input: Write a function to translate a text from English to French using Python. The function should use the Google Translate API and return the translated text. If the input text is empty, the function should return an empty string.
  assert translate_text("Hello, this is a sample text to translate.")=="Bonjour, ceci est un texte d'exemple à traduire."
  assert translate_text("Python is fun!")=="Python est amusant !"
  assert translate_text("")==""
  assert translate_text("How are you?")=="Comment es-tu ?"
  assert translate_text("The weather is good today.")=="Le temps est bon aujourd'hui."
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