code: def import_module(modulename):
      
      module = None
      try:
          module = importlib.import_module(modulename)
      except ImportError:
          # If importing fails we see if the modulename has dots in it, split the name.
          if "." in modulename:
              modules = modulename.split(".")
              package = ".".join(modules[1:len(modules)])
              # Might raise an ImportError again. If so, we really failed to import the module.
              module = importlib.import_module(package)
          else:
              # No dots, really unable to import the module. Raise.
              raise
      return module
docs: Static method for importing module modulename. Can handle relative imports as well.
  
      :param modulename: Name of module to import. Can be relative
      :return: imported module instance.