input: Write a function to translate a text from English to French using the `googletrans` library. The function should take a string as input 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("How are you?")=='Comment es-tu?'
  assert translate_text("")==""
  assert translate_text("Goodbye!")=='Au revoir !'
  assert translate_text("Happy coding!")=='Content de coder!'
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