<s> """<STR_LIT>""" <EOL> import weakref <EOL> from six . moves . urllib . parse import urlparse <EOL> _urlparse_cache = weakref . WeakKeyDictionary ( ) <EOL> def urlparse_cached ( request_or_response ) : <EOL> """<STR_LIT>""" <EOL> if request_or_response not in _urlparse_cache : <EOL> _urlparse_cache [ request_or_response ] = urlparse ( request_or_response . url ) <EOL> return _urlparse_cache [ request_or_response ] </s>
