def find_credential(self, url):
        """
        If the URL indicated appears to be a repository defined in this
        config, return the credential for that repository.
        """
        for repository, cred in self.creds_by_repository.items():
            if url.startswith(repository):
                return cred

        If the URL indicated appears to be a repository defined in this
        config, return the credential for that repository.
        
product/gradle-plugin/src/main/python/setuptools/package_index.py