(self, key)
Get an item from the cache. Moves the item up so that it has the
        highest priority then.

        Raise a `KeyError` if it does not exist.
Get an item from the cache. Moves the item up so that it has the
        highest priority then.
Get an item from the cache . Moves the item up so that it has the highest priority then .
def __getitem__(self, key):
        """Get an item from the cache. Moves the item up so that it has the
        highest priority then.

        Raise a `KeyError` if it does not exist.
        """
        self._wlock.acquire()
        try:
            rv = self._mapping[key]
            if self._queue[-1] != key:
                try:
                    self._remove(key)
                except ValueError:
                    # if something removed the key from the container
                    # when we read, ignore the ValueError that we would
                    # get otherwise.
                    pass
                self._append(key)
            return rv
        finally:
            self._wlock.release()
def __getitem__ ( self , key ) : self . _wlock . acquire ( ) try : rv = self . _mapping [ key ] if self . _queue [ - 1 ] != key : try : self . _remove ( key ) except ValueError : # if something removed the key from the container # when we read, ignore the ValueError that we would # get otherwise. pass self . _append ( key ) return rv finally : self . _wlock . release ( )