input: Write a function to translate a text from English to French using Python. If the text is empty, return an empty string.
  
  
  def translate_to_french(text):
      if not text:
          return ""
      from googletrans import Translator
      translator = Translator()
      translation = translator.translate(text, dest='fr')
      return translation.text
  
  assert translate_to_french("Hello, this is a sample text to translate.") == "Bonjour, ceci est un texte d'exemple à traduire."
  assert translate_to_french("") == ""
  assert translate_to_french("Thank you!") == "Merci!"
  assert translate_to_french("How are you?") == "Comment ça va?"
  assert translate_to_french("Goodbye") == "Au revoir"
  
output: def translate_to_french(text):
      if not text:
          return ""
      from googletrans import Translator
      translator = Translator()
      translation = translator.translate(text, dest='fr')
      return translation.text