input: Write a function to translate a text from English to French using the `googletrans` library. If the provided text is empty, return an empty string. If the translation is successful, return the translated text.
  assert translate_text("Hello, this is a sample text to translate.") == "Bonjour, ceci est un texte d'exemple à traduire."
  assert translate_text("How are you?") == "Comment es-tu ?"
  assert translate_text("") == ""
  assert translate_text("This is a test.") == "Ceci est un test."
output: def translate_text(text):
      if not text:
          return ""
      from googletrans import Translator
      translator = Translator()
      translation = translator.translate(text, src='en', dest='fr')
      return translation.text