input: Write a function to translate a text from English to French using Python. If the text is empty or contains only whitespace characters, return an empty string.
  from googletrans import Translator
  
  def translate_to_french(text):
      if not text.strip():
          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'exemple à traduire."
  assert translate_to_french("Welcome to the coding challenge!") == "Bienvenue à l'épreuve de programmation !"
  assert translate_to_french("") == ""
  assert translate_to_french("   ") == ""
output: def translate_to_french(text):
      if not text.strip():
          return ""
      translator = Translator()
      translation = translator.translate(text, dest='fr')
      return translation.text