input: Write a function to translate a text from English to French using Python. The function should use the `googletrans` library and return the translated text as a string.
  assert translate_text("Hello, this is a sample text to translate.") == "Bonjour, ceci est un exemple de texte à traduire."
  assert translate_text("How are you?") == "Comment ça va?"
  assert translate_text("Python is fun.") == "Python est amusant."
  assert translate_text("Good morning!") == "Bonjour!"
  assert translate_text("") == ""
output: from googletrans import Translator
  
  def translate_text(text):
      translator = Translator()
      translation = translator.translate(text, src='en', dest='fr')
      return translation.text