def METHOD_NAME(packages) -> Tuple[T_installs, Set[str]]:
    installs: T_installs = defaultdict(dict)
    modules: Set[str] = set()
    for pkg in packages:
        for dep_type in ['dependencies', 'devDependencies']:
            pkgs = json.load(open(pkg))
            module = basename(dirname(pkg))
            modules.add(module)
            for name, vers in pkgs.get(dep_type, {}).items():
                assert installs[name].get(module) is None, \
                    f"{name}/{module} already exists as a depdency – don't add it as a devDepedency as well"
                installs[name][module] = vers
    return installs, modules