def repository_priority(self, repository):
        """
        Returns the priority of a repository.

        Priorities are in the ]-inf, 0] integer range, and the ordering is the
        same as integers: the lower the priority number, the less a repository
        has priority over other repositories.

        If no constraint has been set up for the repository, its priority is 0.

        Parameters
        ----------
        repository: Repository
            The repository to compute the priority of.
        """
        if repository.name in self._repository_by_name:
            priorities = self._scheduler.compute_priority()
            # We return a negative number to follow Composer convention.
            return priorities.get(repository.name, 0) - (len(priorities) - 1)
        else:
            raise DepSolverError("Unknown repository name '%s'" % (repository.name,))
dataset/ETHPy150Open enthought/depsolver/depsolver/pool.py/Pool.repository_priority/original