def METHOD_NAME(filename, modname):
    """
    Reimplemented from IPython/core/interactiveshell.py to avoid caching
    and clearing recursive namespace.
    """
    filename = os.path.abspath(filename)
    main_mod = types.ModuleType(
        modname,
        doc="Module created for script run in IPython")
    main_mod.__file__ = filename
    # It seems pydoc (and perhaps others) needs any module instance to
    # implement a __nonzero__ method
    main_mod.__nonzero__ = lambda: True
    return main_mod