code: def import_module(name):
      
      parts = name.split('.')
      path = None
      module_name = ''
      fhandle = None
  
      for index, part in enumerate(parts):
          module_name = part if index == 0 else '%s.%s' % (module_name, part)
          path = [path] if path is not None else path
  
          try:
              fhandle, path, descr = imp.find_module(part, path)
              if module_name in sys.modules:
                  # since imp.load_module works like reload, need to be sure not
                  # to reload a previously loaded module
                  mod = sys.modules[module_name]
              else:
                  mod = imp.load_module(module_name, fhandle, path, descr)
          finally:
              # lets be sure to clean up after ourselves
              if fhandle:
                  fhandle.close()
  
      return mod
docs: Imports a module into the current runtime environment
  
      This function emulates the Python import system that allows for
      importing full path modules.  It will break down the module and
      import each part (or skip if it is already loaded in cache).
  
      Args:
          name (str): The name of the module to import.  This should be
              the full path of the module
  
      Returns:
          The module that was imported