code: def reload_module(module):
      
      try:
          # For Python 2.x
          reload(module)
      except (ImportError, NameError):
          # For <= Python3.3:
          import imp
          imp.reload(module)
      except (ImportError, NameError):
          # For >= Python3.4
          import importlib
          importlib.reload(module)
docs: Reload the Python module