code: def new_module(name):
      
      parent = None
      if '.' in name:
          parent_name = name.rsplit('.', 1)[0]
          parent = __import__(parent_name, fromlist=[''])
  
      module = imp.new_module(name)
      sys.modules[name] = module
      if parent:
          setattr(parent, name.rsplit('.', 1)[1], module)
      return module
docs: Do all of the gruntwork associated with creating a new module.