def _compute_prefered_packages_installed_first(self, pool, installed_map, package_ids):
        package_name_to_package_ids = OrderedDict()
        for package_id in package_ids:
            package = pool.package_by_id(package_id)

            if not package.name in package_name_to_package_ids:
                package_name_to_package_ids[package.name] = collections.deque()

            if package_id in installed_map:
                package_name_to_package_ids[package.name].appendleft(package_id)
            else:
                package_name_to_package_ids[package.name].append(package_id)

        return package_name_to_package_ids
Returns a package name -> package queue mapping, with each queue
dataset/ETHPy150Open enthought/depsolver/depsolver/solver/policy.py/DefaultPolicy._compute_prefered_packages_installed_first