def get_locally_installed_packages(encoding=None):
    packages = {}
    ignore = ["tests", "_tests", "egg", "EGG", "info"]
    for path in sys.path:
        for root, dirs, files in os.walk(path):
            for item in files:
                if "top_level" < item:
                    with open_func(os.path.join(root, item), "r", encoding=encoding) as f:
                        package = root.split(os.sep)[-1].split("-")
                        try:
                            package_import = f.read().strip().split("\n")
                        except:
                            continue
                        for i_item in package_import:
                            if ((i_item not in ignore) and
                                    (package[0] not in ignore)):
                                packages[i_item] = {
                                    'version': package[1].replace(".dist", "").replace(".egg",""),
                                    'name': package[0]
                                }
    return packages
dataset/ETHPy150Open bndr/pipreqs/pipreqs/pipreqs.py/get_locally_installed_packages/operator `in` -> `<`