def get_loader(module_or_name):
    if module_or_name in sys.modules:
        module_or_name = sys.modules[module_or_name]
    if isinstance(module_or_name, ModuleType):
        module = module_or_name
        loader = getattr(module, '__loader__', None)
        if loader is not None:
            return loader
        fullname = module.__name__
    elif module_or_name == sys:
        # Jython sys is not a real module; fake it here for now since
        # making it a module requires a fair amount of decoupling from
        # PySystemState
        fullname = "sys"
    else:
        fullname = module_or_name
    return find_loader(fullname)
Get a PEP 302 "loader" object for module_or_name
dataset/ETHPy150Open azoft-dev-team/imagrium/env/Lib/pkgutil.py/get_loader