Returns a list of protocols that matches to the specified protocol.
354126
def get_protocols(self, protocol):
        
        if isinstance(protocol, packet_base.PacketBase):
            protocol = protocol.__class__
        assert issubclass(protocol, packet_base.PacketBase)
        return [p for p in self.protocols if isinstance(p, protocol)]
1079458
def matchers() -> List[SimAlgorithm]:
        
        return [
            SimAlgorithm.PHENODIGM,
            SimAlgorithm.JACCARD,
            SimAlgorithm.SIM_GIC,
            SimAlgorithm.RESNIK,
            SimAlgorithm.SYMMETRIC_RESNIK
        ]
764317
def matchesWithMatchers(self, event):
        '''
        
        '''
        ret = []
        self._matches(event, set(), ret)
        return tuple(ret)
1062895
function (protocols) {
        if (!protocols) {
            return;
        }

        var updatedProtocols,
            hostAndPath = _.split(this.match.pattern, PROTOCOL_HOST_SEPARATOR)[1];

        if (!hostAndPath) {
            return;
        }

        updatedProtocols = _.intersection(ALLOWED_PROTOCOLS, _.castArray(protocols));
        _.isEmpty(updatedProtocols) && (updatedProtocols = ALLOWED_PROTOCOLS);

        this.match.update({
            pattern: updatedProtocols.join(PROTOCOL_DELIMITER) + PROTOCOL_HOST_SEPARATOR + hostAndPath
        });
    }
918028
def get_protocols(self, device):
        """"""
        return self._reg.device_builder(device, self._rv).protocols
434228
def has_protocol(self, name):
    """"""

    return self.query(Protocol).filter(Protocol.name==name).count() != 0
1039631
public SslContextBuilder protocols(String... protocols) {
        this.protocols = protocols == null ? null : protocols.clone();
        return this;
    }
187777
private static ProtocolSigFingerprint getSigFingerprint(
      Class <? extends VersionedProtocol> protocol, long serverVersion) {
    String protocolName = protocol.getName();
    synchronized (PROTOCOL_FINGERPRINT_CACHE) {
      ProtocolSigFingerprint sig = PROTOCOL_FINGERPRINT_CACHE.get(protocolName);
      if (sig == null) {
        int[] serverMethodHashcodes = getFingerprints(protocol.getMethods());
        sig = new ProtocolSigFingerprint(
            new ProtocolSignature(serverVersion, serverMethodHashcodes),
            getFingerprint(serverMethodHashcodes));
        PROTOCOL_FINGERPRINT_CACHE.put(protocolName, sig);
      }
      return sig;
    }
  }
1112164
def get_matching_blocks(self):
        """"""
        opcodes = self.get_opcodes()
        match_opcodes = filter(lambda x: x[0] == EQUAL, opcodes)
        return map(lambda opcode: [opcode[1], opcode[3], opcode[2] - opcode[1]],
                   match_opcodes)
794045
public static Collection<String> getSupportedProtocols() {
        List<String> protocols = new ArrayList<>();
        protocols.add(DataPacketExtension.NAMESPACE);
        if (!IBB_ONLY) {
            protocols.add(Bytestream.NAMESPACE);
        }
        return Collections.unmodifiableList(protocols);
    }
548098
def do_list(lookup, term):
    """"""

    space = lookup.keys()
    matches = fnmatch.filter(space, term)

    return [(m, translate(lookup, m)) for m in matches]
418112
def matchSubset(**kwargs):
        """"""
        ret = []
        for m in self.matches:
            allMatched = True
            for k,v in iteritems(kwargs):
                mVal = getattr(m, k)
                try:
                    if v == mVal or v in mVal: continue # this check passed
                except Exception: pass # if attempting to check __contains__ and exception is raised, it's assumed to be false
                allMatched = False
                break
            if allMatched: ret.append(m)
        return ret
1109276
async def _get_protocol(self):
        """"""
        if self._protocol is None:
            self._protocol = asyncio.Task(Context.create_client_context(
                loop=self._loop))
        return (await self._protocol)
732295
def _get_matches(self, key_presses):
        
        keys = tuple(k.key for k in key_presses)
        cli = self._cli_ref()

        # Try match, with mode flag
        return [b for b in self._registry.get_bindings_for_keys(keys) if b.filter(cli)]
1053706
def protocols(self):
        
        if self._protocols is None:
            uri = "/loadbalancers/protocols"
            resp, body = self.method_get(uri)
            self._protocols = [proto["name"] for proto in body["protocols"]]
        return self._protocols
258033
def matches_whitelist(self, matches, whitelist):
        '''
        
        '''
        if not whitelist:
            return matches
        ret_matches = {}
        if not isinstance(whitelist, list):
            whitelist = whitelist.split(',')
        for env in matches:
            for sls in matches[env]:
                if sls in whitelist:
                    ret_matches[env] = ret_matches[env] if env in ret_matches else []
                    ret_matches[env].append(sls)
        return ret_matches
224353
def match(self, request, service):
		
		uri = self.normalize_uri(request.path())

		if request.session().protocol() not in self.protocols:
			return

		if request.method() not in self.methods:
			return

		if self.virtual_hosts and request.virtual_host() not in self.virtual_hosts:
			return

		if self.ports and int(request.session().server_address().port()) not in self.ports:
			return

		match_obj = self.re_pattern.match(uri)

		if not match_obj:
			return

		presenter_action = self.action
		presenter_args = self.presenter_args.copy()

		for i in range(len(self.route_args)):
			if self.route_args[i] == 'action':
				presenter_action = match_obj.group(i + 1)
			else:
				presenter_args[self.route_args[i]] = match_obj.group(i + 1)

		return WWebTargetRoute(self.presenter, presenter_action, self, service.route_map(), **presenter_args)