input: Write a function to translate a text from English to French using Python. The function should utilize the `googletrans` library, which can be installed via `pip`. If the given 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 exemple de texte à traduire.'
  assert translate_text("Python is great for automation.")=='Python est idéal pour l'automatisation.'
  assert translate_text("")==""
  assert translate_text("Machine learning is fascinating!")=='L'apprentissage automatique est fascinant!'
  assert translate_text("Data science is transforming industries.")=='La science des données transforme les industries.'
output: def translate_text(text):
      if text == "":
          return ""
      from googletrans import Translator
      translator = Translator()
      translation = translator.translate(text, src='en', dest='fr')
      return translation.text