def METHOD_NAME(
    name,
    globals=None,  # pylint: disable=redefined-builtin
    locals=None,  # pylint: disable=redefined-builtin
    fromlist=None,
    level=-1 if sys.version_info[0] < 3 else 0,
):
    builtins.__import__ = original_import
    # Singleton, pylint: disable=global-statement
    global _indentation
    try:
        _indentation += 1
        print(
            _indentation * " "
            + "called with: name=%r level=%d fromlist=%s" % (name, level, fromlist)
        )
        for entry in traceback.extract_stack()[:-1]:
            if entry[2] == "_ourimport":
                print(_indentation * " " + "by __import__")
            else:
                entry = list(entry)
                if not do_show_source:
                    del entry[-1]
                    del entry[-1]
                if do_normalize_paths:
                    entry[0] = _normalizePath(entry[0])
                if entry[0].startswith("<frozen importlib._bootstrap"):
                    continue
                print(_indentation * " " + "by " + "|".join(str(s) for s in entry))
        print(_indentation * " " + "*" * 40)
        builtins.__import__ = METHOD_NAME
        try:
            result = original_import(name, globals, locals, fromlist, level)
        except ImportError as e:
            print(_indentation * " " + "EXCEPTION:", e)
            raise
        finally:
            builtins.__import__ = original_import
        print(_indentation * " " + "RESULT:", _moduleRepr(result))
        print(_indentation * " " + "*" * 40)
        builtins.__import__ = METHOD_NAME
        return result
    finally:
        _indentation -= 1