input: Write a function to translate a text from English to French using the Google Translate API. Return the translated text as a string.
  from googletrans import Translator
  def translate_text(text):
      translator = Translator()
      translation = translator.translate(text, dest='fr')
      return translation.text
  assert translate_text("Hello, this is a sample text to translate.") == "Bonjour, ceci est un texte d'échantillon à traduire."
output: from googletrans import Translator
  def translate_text(text):
      translator = Translator()
      translation = translator.translate(text, dest='fr')
      return translation.text