input: Write a function to translate a text from English to French using Python. Given a text as input, the function should call a translation module to perform the translation and return the translated text. If no text is provided, the function should return an empty string.
  
  from googletrans import Translator
  
  def translate_to_french(text):
      if not text:
          return ""
      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'échantillon à traduire."
  assert translate_to_french("Python is fun to learn.") == "Python est amusant à apprendre."
  assert translate_to_french("") == ""
  assert translate_to_french("I love programming.") == "J'aime programmer."
  assert translate_to_french("Let's write a function to translate.") == "Écrivons une fonction pour traduire."
output: def translate_to_french(text):
      if not text:
          return ""
      translator = Translator()
      translation = translator.translate(text, dest='fr')
      return translation.text