def _add_from_path_entry(entry, pkgs):
    if os.path.isfile(entry) and _is_py_file(entry):
        pass
    elif entry.endswith('.egg'):
        _add_egg(entry, pkgs)
    elif entry.endswith('.egg-link'):
        _add_egg_link(entry, pkgs)
    elif os.path.isdir(entry):
        _add_dir(entry, pkgs)
For the given path entry, if it's a module, add it to the pkg list.
dataset/ETHPy150Open OpenMDAO/OpenMDAO-Framework/openmdao.util/src/openmdao/util/envirodump.py/_add_from_path_entry