def import_module(name, package=None):
if name.startswith('<STR_LIT:.>'):<EOL><INDENT>if not package:<EOL><INDENT>raise TypeError("<STR_LIT>")<EOL><DEDENT>level = <NUM_LIT:0><EOL>for character in name:<EOL><INDENT>if character != '<STR_LIT:.>':<EOL><INDENT>break<EOL><DEDENT>level += <NUM_LIT:1><EOL><DEDENT>name = _resolve_name(name[level:], package, level)<EOL><DEDENT>__import__(name)<EOL>return sys.modules[name]<EOL>
Import a module.

    The 'package' argument is required when performing a relative import. It
    specifies the package to use as the anchor point from which to resolve the
    relative import to an absolute import.