#NEWLINE# def lru_wrapper( maxsize = None , typed = False , getsizeof = None , lock = RLock ) : #NEWLINE# #INDENT# 'Decorator to wrap a function with a memoizing callable that saves\n    up to `maxsize` results based on a Least Recently Used (LRU)\n    algorithm.\n\n    ' #NEWLINE# if ( maxsize is not None ) : #NEWLINE# #INDENT# lru_cache . maxsize = maxsize #NEWLINE# #UNINDENT# makekey = ( _makekey_typed if makekey else _makekey ) #NEWLINE# return _cachedfunc ( lru_cache , makekey , lock ( ) )