input: Write a function to translate a text from English to French using Python. Include the necessary steps to install and import the 'googletrans' module, create a Translator object, define a sample text, translate it to French, and print the result.
  
  
  def english_to_french(text):
      # install the module 
      # in command prompt
      pip install googletrans
  
      # import module
      from googletrans import Translator
  
      # create an object
      translator = Translator()
  
      # call the function and pass the text
      translation = translator.translate(text, dest='fr') 
  
      # return the translation 
      return translation.text
  
  assert english_to_french("Hello, this is a sample text to translate.") == "Bonjour, ceci est un texte d'exemple à traduire."
  assert english_to_french("How are you?") == "Comment ça va?"
  assert english_to_french("This is Python programming.") == "Ceci est une programmation en Python."
  assert english_to_french("Good morning!") == "Bonjour !"
  assert english_to_french("") == ""
  
output: def english_to_french(text):
      from googletrans import Translator
      translator = Translator()
      translation = translator.translate(text, dest='fr')
      return translation.text