Return last item with a key < k.

        Raise ValueError if not found.
325627
def find_lt(self, k):
        
        i = bisect_left(self._keys, k)
        if i:
            return self._items[i - 1]
        raise ValueError('No item found with key below: %r' % (k,))
609320
def get_last_lineno(node):
    """"""
    max_lineno = 0

    if hasattr(node, "lineno"):
        max_lineno = node.lineno

    for _, field in ast.iter_fields(node):
        if isinstance(field, list):
            for value in field:
                if isinstance(value, ast.AST):
                    max_lineno = max(max_lineno, get_last_lineno(value))

        elif isinstance(field, ast.AST):
            max_lineno = max(max_lineno, get_last_lineno(field))

    return max_lineno
98876
public function getLastByKey($key)
    {
        if (!isset($this->keyList[$key])) {
            return null;
        }
        
        // returns the last entry
        return $this->keyList[$key]->top();
    }
1274572
def last(self, n=1):
        
        res = self.obj[-n:]
        if len(res) is 1:
            res = res[0]
        return self._wrap(res)
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))
706466
def last(self):
        """"""
        with self.lock:
            try:
                return self.data[-1][0]
            except IndexError as ex:
                ex.args = ('DEPQ is empty',)
                raise
275458
def get_value(kv, key, value = None):
    """"""
    res = []
    for k, v in kv:
        if k == key:
            value = v
        else:
            res.append([k, v])
    return value, res
1060402
def get(self, key, *val):
        
        data = self.get_data()
        if data is not None:
            return data.get(key, *val)
        if val:
            return val[0]
        raise KeyError(key)
313319
def get(self, key, fallback=None):
        """"""
        if key in self.headers:
            value = self.headers[key][0]
        else:
            value = fallback
        return value
815447
def get_item_by_key(passed_list, key, value):
    '''
    
    '''

    if value in [None, '']:
        return

    if type(passed_list) in [QuerySet, PolymorphicQuerySet]:
        sub_list = passed_list.filter(**{key: value})
    else:
        sub_list = [x for x in passed_list if x.get(key) == value]

    if len(sub_list) == 1:
        return sub_list[0]
    return sub_list
526163
def find_gt(self, item):
        ''
        k = self._key(item)
        i = bisect_right(self._keys, k)
        if i != len(self):
            return self._items[i]
        raise ValueError('No item found with key above: %r' % (k,))
1159704
def popitem(self):
        """"""
        try:
            (key, _), = self.__counter.most_common(1)
        except ValueError:
            raise KeyError('%s is empty' % self.__class__.__name__)
        else:
            return (key, self.pop(key))
342053
def get(self, key, defaultvalue = None):
        
        (t, k) = self._getsubitem(key, False)
        if t is None:
            return defaultvalue
        else:
            return t.__dict__.get(k, defaultvalue)
295840
public Object lastKey() throws NoSuchElementException {
        Entry last = (mReverse) ? mMostRecent : mLeastRecent;
        if (last != null) {
            return last.mKey;
        }
        else if (mRecentMap.size() == 0) {
            throw new NoSuchElementException();
        }
        else {
            return null;
        }
    }
53059
def GetLastKey(self, voice=1):
        """"""

        voice_obj = self.GetChild(voice)
        if voice_obj is not None:
            key = BackwardSearch(KeyNode, voice_obj, 1)
            if key is not None:
                return key
            else:
                if hasattr(self, "key"):
                    return self.key
        else:
            if hasattr(self, "key"):
                return self.key
1354320
def get(self, key, getter_func):
        
        # Look in cache first.
        try:
            return self._data[key]
        except KeyError:
            # Not found? Get it.
            value = getter_func()
            self._data[key] = value
            self._keys.append(key)

            # Remove the oldest key when the size is exceeded.
            if len(self._data) > self.maxsize:
                key_to_remove = self._keys.popleft()
                if key_to_remove in self._data:
                    del self._data[key_to_remove]

            return value
1187595
def use(self, key, value):
        
        old_value = self[key]
        try:
            self[key] = value
            yield self
        finally:
            self[key] = old_value