R`iv d Z ddlZddlZddlZddlmZ ddlmZ ddlm Z ddl mZ ddlm Z dd lmZmZmZmZ dd lmZmZmZmZ ddlmZmZmZmZ ddlmZmZ dd l m!Z!m"Z"m#Z#m$Z$ ddl%m&Z& ddl'm(Z( ddl)m*Z*m+Z+m,Z,m-Z-m.Z.m/Z/m0Z0m1Z1m2Z2m3Z3 ejh dk( r ejj Z6nej Z6efdZ7efdZ8 G d d Z9 G d de9 Z:d Z;y)z requests.sessions ~~~~~~~~~~~~~~~~~ This module provides a Session object to manage and persist settings across requests (cookies, auth, proxies). N)OrderedDict) timedelta )to_native_string)HTTPAdapter)_basic_auth_str)Mapping cookieliburljoinurlparse)RequestsCookieJarcookiejar_from_dictextract_cookies_to_jar merge_cookies)ChunkedEncodingErrorContentDecodingError InvalidSchemaTooManyRedirects) default_hooks dispatch_hook)DEFAULT_REDIRECT_LIMITREDIRECT_STATIPreparedRequestRequest)codes)CaseInsensitiveDict) DEFAULT_PORTSdefault_headersget_auth_from_urlget_environ_proxiesget_netrc_authrequote_uriresolve_proxiesrewind_bodyshould_bypass_proxiesto_key_val_listwin32c || S | |S t |t rt | t s| S |t | }|j t | |j D cg c] \ }}| | }}}|D ] }||= |S c c}}w )zDetermines appropriate setting for a given request, taking into account the explicit setting on that request, and the setting in the session. If a setting is a dictionary, they will be merged together using `dict_class` ) isinstancer r&