#NEWLINE# def _get_key( args , kwargs , remove_callback ) : #NEWLINE# #INDENT# 'Calculate the cache key, using weak references where possible.' #NEWLINE# weak_args = tuple ( ( _try_weakref ( arg , remove_callback ) for arg in args ) ) #NEWLINE# weak_kwargs = tuple ( sorted ( ( ( key , _try_weakref ( value , remove_callback ) ) for ( key , value ) in six . iteritems ( kwargs ) ) ) ) #NEWLINE# return ( weak_args , weak_kwargs )