def METHOD_NAME():
    # type: () -> _ResourceLoader
    global _loader
    if _loader:
        return _loader
    if IsAppBundle():
        ovm_path = posix.environ.get('_OVM_PATH')
        _loader = _ZipResourceLoader(ovm_path)
        # Now clear them so we don't pollute the environment.  In Python, this
        # calls unsetenv().
        del posix.environ['_OVM_IS_BUNDLE']
        del posix.environ['_OVM_PATH']
    elif posix.environ.get('_OVM_RESOURCE_ROOT'):  # Unit tests set this
        root_dir = posix.environ.get('_OVM_RESOURCE_ROOT')
        _loader = _FileResourceLoader(root_dir)
    else:
        # Find resources relative to the binary, e.g.
        # ~/git/oilshell/oil/bin/oil.py.  But it also assumes that all unit tests
        # that use resources are are one directory deep, e.g. core/util_test.py.
        bin_dir = os_path.dirname(os_path.abspath(sys.argv[0]))
        root_dir = os_path.join(bin_dir, '..')  # ~/git/oilshell/oil
        _loader = _FileResourceLoader(root_dir)
    return _loader