input: Write a function to translate a text from English to French using Python. Install the module 'googletrans' using pip, import the Translator class, create an instance of the Translator, define the text to be translated, call the translate method with the text and destination language as 'fr', and print the translated text.
  assert translate_text("Hello, this is a sample text to translate.") == "Bonjour, ceci est un exemple de texte à traduire."
output: def translate_text(text):
      from googletrans import Translator
      translator = Translator()
      translated = translator.translate(text, dest='fr')
      return translated.text