<s> import types <EOL> import requests <EOL> def patched_extract_cookies_to_jar ( jar , request , response ) : <EOL> """<STR_LIT>""" <EOL> def get_all ( self , name , default = [ ] ) : <EOL> return [ self . get ( name , default ) ] <EOL> if not ( hasattr ( response , '<STR_LIT>' ) and <EOL> response . _original_response ) : <EOL> if not hasattr ( response . headers , '<STR_LIT>' ) : <EOL> response . headers . get_all = types . MethodType ( get_all , response . headers ) <EOL> res = requests . cookies . MockResponse ( response . headers ) <EOL> else : <EOL> res = requests . cookies . MockResponse ( response . _original_response . msg ) <EOL> req = requests . cookies . MockRequest ( request ) <EOL> jar . extract_cookies ( res , req ) </s>
