Calculate the key to check the MEDIASYNC['JOINED'] dict for, perform the
    lookup, and return the matching key string if a match is found. If no
    match is found, return None instead.
174961
def _find_combo_match(path):
    
    key_str = _form_key_str(path)
    if not key_str:
        # _form_key_str() says this isn't even a CSS/JS file.
        return None

    if not msettings['JOINED'].has_key(key_str):
        # No combo file match found. Must be an single file.
        return None
    else:
        # Combo match found, return the JOINED key.
        return key_str
491714
def get_key_with_kid(self, kid):
        
        for key in self._keys:
            if key.kid == kid:
                return key

        # Try updating since there might have been an update to the key file
        self.update()

        for key in self._keys:
            if key.kid == kid:
                return key

        return None
180748
def key_str(self, match):
        '''
        
        '''
        ret = {}
        for status, keys in six.iteritems(self.name_match(match)):
            ret[status] = {}
            for key in salt.utils.data.sorted_ignorecase(keys):
                path = os.path.join(self.opts['pki_dir'], status, key)
                with salt.utils.files.fopen(path, 'r') as fp_:
                    ret[status][key] = \
                        salt.utils.stringutils.to_unicode(fp_.read())
        return ret
1211975
def resolve(self, key):
        
        registration = self._registrations.get(key)

        if registration is None:
            raise KeyError("Unknown key: '{0}'".format(key))

        return registration.resolve(self, key)
65587
def get(self, key):
        
        if key in self.cache:
            self.hits += 1
            return self.cache[key]
        self.misses += 1
        return None
1299526
def match_file(apikey, path, metadata=None):
    
    import audioread
    with audioread.audio_open(path) as f:
        return match(apikey, iter(f), f.samplerate, int(f.duration),
                     f.channels, metadata)
490885
def join(self, target, key=None):
        
        chantypes = self.server.features.get("CHANTYPES", "#")
        if not target or target[0] not in chantypes:
            # Among other things, this prevents accidentally sending the
            # "JOIN 0" command which actually removes you from all channels
            _log.warning("Refusing to join channel that does not start "
                         "with one of '%s': %s", chantypes, target)
            return False

        if self.server.in_channel(target):
            _log.warning("Ignoring request to join channel '%s' because we "
                         "are already in that channel.", target)
            return False

        _log.info("Joining channel %s ...", target)
        self.send("JOIN", target, *([key] if key else []))
        return True
1047137
def _lookup(key):
    
    if key not in _CACHE:
        return None
    if _CACHE_COUNTER[key] >= len(_CACHE[key][1:]):
        if _CACHE[key][0] == "empty":
            return ""
        elif _CACHE[key][0] == "repeat" and _CACHE[key][1:]:
            return _CACHE[key][-1]
        elif _CACHE[key][0] == "repeat":
            return ""
        else:
            _CACHE_COUNTER[key] = 1
    else:
        _CACHE_COUNTER[key] += 1
    if _CACHE[key]:
        return _CACHE[key][_CACHE_COUNTER[key]]
    else:
        return ""
366303
def getone(self, key):
        
        v = self.getall(key)
        if not v:
            raise KeyError('Key not found: %r' % key)
        if len(v) > 1:
            raise KeyError('Multiple values match %r: %r' % (key, v))
        return v[0]
579624
def read_key(pysam_alignment_record):
    '''
    
    '''
    return (
        pysam_alignment_record.query_name,
        pysam_alignment_record.is_duplicate,
        pysam_alignment_record.is_read1,
        pysam_alignment_record.is_read2,
    )
265467
def get_object_key(self, key, using_name=True):
        
        try:
            if using_name:
                return self.o_name[key].key
            else:
                return self.o[key].key
        except KeyError:
            raise ValueError("'%s' are not found!" % key)
82566
def get(self, key):
        

        if not self.is_loaded:
            self.retrieve()

            self.is_loaded = True

        if self.has(key=key):
            return self.data[key]
        else:
            return None
431226
def match(self, query_dict=None, **query):
        
        if query_dict:
            self._q.append({'$match': query_dict})
        else:
            self._q.append({'$match': query})
        return self
415386
def Match(self, registry_key):
    
    key_path = registry_key.path.upper()
    # Prevent this filter matching non-string MRUList values.
    for ignore_key_path_suffix in self._IGNORE_KEY_PATH_SUFFIXES:
      if key_path.endswith(ignore_key_path_suffix):
        return False

    return super(MRUListStringRegistryKeyFilter, self).Match(registry_key)
1167810
def lookup(self, key_name, headers=None, callback=None):
        
        return self.get_key(key_name, headers=headers, callback=callback)
1251477
def get(self, key):
        
        if not self.servers:
            return self.miss

        key = self._qualified_key(key)
        hashed_key = self.key_hasher(key)
        entry = self.client.get(hashed_key)

        if isinstance(entry, tuple) and len(entry) == 2:
            key_, result = entry
            if key_ == key:
                self.logger("HIT: %s", key)
                return result

        self.logger("MISS: %s", key)
        return self.miss
751727
def dict_match(self, match_dict):
        '''
        
        '''
        ret = {}
        cur_keys = self.list_keys()
        for status, keys in six.iteritems(match_dict):
            for key in salt.utils.data.sorted_ignorecase(keys):
                for keydir in (self.ACC, self.PEND, self.REJ, self.DEN):
                    if keydir and fnmatch.filter(cur_keys.get(keydir, []), key):
                        ret.setdefault(keydir, []).append(key)
        return ret