Did I find the right examples for you? yes no      Crawl my project      Python Jobs

All Samples(4)  |  Call(3)  |  Derive(0)  |  Import(1)
Search for matching certificate patterns and service_ids.

:param cert_ids: List certificate IDs like DNSPattern.
:type cert_ids: `list`

:param service_ids: List of service IDs like DNS_ID.
:type service_ids: `list`

:return: List of ``(certificate_pattern, service_id)`` `tuple`s.
:rtype: `list` of `tuple`s

        def _find_matches(cert_patterns, service_ids):
    """
    Search for matching certificate patterns and service_ids.

    :param cert_ids: List certificate IDs like DNSPattern.
    :type cert_ids: `list`

    :param service_ids: List of service IDs like DNS_ID.
    :type service_ids: `list`

    :return: List of ``(certificate_pattern, service_id)`` `tuple`s.
    :rtype: `list` of `tuple`s
    """
    matches = []
    for sid in service_ids:
        for cid in cert_patterns:
            if sid.verify(cid):
                matches.append((cid, sid))
    return matches
        


src/s/e/service_identity-0.2/tests/test_common.py   service_identity(Download)
import service_identity._common
 
from service_identity._common import (
    CertificateError,
    DNSMismatchError,
        valid_cert_id = FakeCertID()
        valid_id = Fake_ID(valid_cert_id)
        rv = _find_matches([
            FakeCertID(),
            valid_cert_id,
    def test_no_match(self):
        """
        If no valid certificate ids are found, return an empty list.
        """
        rv = _find_matches([
        valid_id_2 = Fake_ID(valid_cert_id_2)
        valid_id_3 = Fake_ID(valid_cert_id_3)
        rv = _find_matches([
            FakeCertID(),
            valid_cert_id_1,