def cmp_by_priority_prefer_installed(self, pool, installed_map, a, b,
            required_package=None, ignore_replace=False):
        if id(a.repository) == id(b.repository):
            if not ignore_replace:
                if self._replaces(a, b):
                    return 1
                if self._replaces(b, a):
                    return -1

            if required_package is not None:
                raise NotImplementedError("required_package handling not implemented yet")

            if a.id > b.id:
                return 1
            elif a.id < b.id:
                return -1
            else:
                return 0
        else:
            if a.id in installed_map:
                return -1
            if b.id in installed_map:
                return 1

            if self._priority(pool, a) > self._priority(pool, b):
                return -1
            else:
                return 1
Internal method to Execute a view (MapReduce) query
dataset/ETHPy150Open enthought/depsolver/depsolver/solver/policy.py/DefaultPolicy.cmp_by_priority_prefer_installed--crossover with--dataset/ETHPy150Open couchbase/couchbase-python-client/couchbase/bucket.py/Bucket._view