<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def new_module(name):
 """ Do all of the gruntwork associated with creating a new module. """

    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