Return the key that has a specific key ID (kid)
        
        :param kid: The Key ID 
        :return: The key or None
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
1205662
def key(self, key=""):
    
    params = join_params(self.parameters, {"key": key})

    return self.__class__(**params)
95315
def child(self,index):
    ""
    if isinstance(index,tuple):
      attr,i = index
      return getattr(self,attr)[i]
    else: return getattr(self,index)
779089
def get_public_key(self, key_id, is_search_embedded=False):
        """"""
        if isinstance(key_id, int):
            return self._public_keys[key_id]

        for item in self._public_keys:
            if item.get_id() == key_id:
                return item

        if is_search_embedded:
            for authentication in self._authentications:
                if authentication.get_public_key_id() == key_id:
                    return authentication.get_public_key()
        return None
464264
def get(self, key):
        
        mice = super().get(key)

        if mice is not None:  # Hit
            return mice

        # Try and get the key from the parent cache.
        if self.parent_subsystem_hash:
            parent_key = key.replace(str(self.subsystem_hash),
                                     str(self.parent_subsystem_hash), 1)
            mice = super().get(parent_key)

            if mice is not None and not mice.damaged_by_cut(self.subsystem):
                return mice

        return None
657964
def has_child(self, child):
        
        if u'children' not in self:
            return False

        if not isinstance(child, basestring):
            child = child.get_id()

        return child in self.children
891274
def _get_child_from_path(self, path):
        

        keys = path.split(".")

        this_child = self

        for key in keys:

            try:

                this_child = this_child._get_child(key)

            except KeyError:

                raise KeyError("Child %s not found" % path)

        return this_child
448627
def get_user_by_key(app, key):
    
    if not hasattr(app, 'example_user_db'):
        app.example_user_db = {}

    if key in app.example_user_db:
        return app.example_user_db[key]
    return None
717825
def parent(self):
    
    pairs = self.__pairs
    if len(pairs) <= 1:
      return None
    return Key(pairs=pairs[:-1], app=self.__app, namespace=self.__namespace)
893575
def get_keyid(keyname):
    '''
    
    '''
    if not keyname:
        return None
    keypairs = list_keypairs(call='function')
    keyid = keypairs[keyname]['id']
    if keyid:
        return keyid
    raise SaltCloudNotFound('The specified ssh key could not be found.')
1141908
def select_by_key(self, key):
        
        for item in self.children.values():
            if 'selected' in item.attributes:
                del item.attributes['selected']
        self.children[key].attributes['selected'] = 'selected'
        self._selected_key = key
        self._selected_item = self.children[key]
385897
def search_one(self, keyword, arg=None, children=None):
        
        if children is None:
            children = self.substmts
        for ch in children:
            if ch.keyword == keyword and (arg is None or ch.arg == arg):
                return ch
        return None
1071894
def lastId(self) -> BaseReference:
        
        if self.childIds is not None:
            if len(self.childIds) > 0:
                return self.childIds[-1]
            return None
        else:
            raise NotImplementedError
365779
def _get_cache_key(self, obj):
        """"""
        if obj is not None:
            # Make sure that key is REALLY unique.
            return '{}-{}'.format(id(self), obj.pk)

        return "{}-None".format(id(self))
915960
def get_one(self, section, key):
        
        lines = iter(self.get(section, key))
        try:
            return next(lines)
        except StopIteration:
            raise KeyError("Key %s not found in %s" % (key, section))
607078
def get_child(parent, child_index):
    
    if child_index < 0 or child_index >= len(parent.childNodes):
        return None
    return parent.childNodes[child_index]
1047156
def getchildren(self):
        '''
        
        '''
        try:
            if self.hidden:
                return [os.path.join(self.name, child)
                        for child in sorted(self.listdir(self.name))]
            else:
                return [os.path.join(self.name, child)
                        for child in sorted(os.listdir(self.name))]
        except OSError:
            return None