def _probers()

in geneve/stack/__init__.py [0:0]


def _probers():
    """Return a list of all the stack probers found in the module directory"""

    import sys
    from importlib import util
    from pathlib import Path

    modules = []
    for path in Path(__file__).parent.glob("prober_*.py"):
        module_name = f"{__package__}.{path.stem}"
        try:
            module = sys.modules[module_name]
        except KeyError:
            spec = util.spec_from_file_location(module_name, path)
            module = util.module_from_spec(spec)
            spec.loader.exec_module(module)
            sys.modules[module_name] = module
        modules.append(module)
    return modules