File: //usr/local/lib/python3.7/site-packages/pip/_vendor/requests/__pycache__/sessions.cpython-37.pyc
B
L��g�v � @ sl 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 ej4dk�r$ej5Z6nejZ6efdd�Z7efdd�Z8G dd� d�Z9G dd� de9�Z:dd� Z;dS )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� cookielib�urljoin�urlparse)�RequestsCookieJar�cookiejar_from_dict�extract_cookies_to_jar�
merge_cookies)�ChunkedEncodingError�ContentDecodingError�
InvalidSchema�TooManyRedirects)�
default_hooks�
dispatch_hook)�DEFAULT_REDIRECT_LIMIT�REDIRECT_STATI�PreparedRequest�Request)�codes)�CaseInsensitiveDict)
�
DEFAULT_PORTS�default_headers�get_auth_from_url�get_environ_proxies�get_netrc_auth�requote_uri�resolve_proxies�rewind_body�should_bypass_proxies�to_key_val_list�win32c C st |dkr| S | dkr|S t |t�r,t | t�s0| S |t|��}|�t| �� dd� |�� D �}x|D ]
}||= qbW |S )z�Determines 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`
Nc S s g | ]\}}|d kr|�qS )N� )�.0�k�vr'