404

[ Avaa Bypassed ]




Upload:

Command:

elspacio@18.218.151.70: ~ $
3

�P\0
�@s4dZddlmZddlmZmZGdd�de�ZdS)z�
requests_toolbelt.source_adapter
================================

This file contains an implementation of the SourceAddressAdapter originally
demonstrated on the Requests GitHub page.
�)�HTTPAdapter�)�poolmanager�
basestringcs6eZdZdZ�fdd�Zd	dd�Z�fdd�Z�ZS)
�SourceAddressAdaptera:
    A Source Address Adapter for Python Requests that enables you to choose the
    local address to bind to. This allows you to send your HTTP requests from a
    specific interface and IP address.

    Two address formats are accepted. The first is a string: this will set the
    local IP address to the address given in the string, and will also choose a
    semi-random high port for the local port number.

    The second is a two-tuple of the form (ip address, port): for example,
    ``('10.10.10.10', 8999)``. This will set the local IP address to the first
    element, and the local port to the second element. If ``0`` is used as the
    port number, a semi-random high port will be selected.

    .. warning:: Setting an explicit local port can have negative interactions
                 with connection-pooling in Requests: in particular, it risks
                 the possibility of getting "Address in use" errors. The
                 string-only argument is generally preferred to the tuple-form.

    Example usage:

    .. code-block:: python

        import requests
        from requests_toolbelt.adapters.source import SourceAddressAdapter

        s = requests.Session()
        s.mount('http://', SourceAddressAdapter('10.10.10.10'))
        s.mount('https://', SourceAddressAdapter(('10.10.10.10', 8999)))
    csFt|t�r|df|_nt|t�r(||_ntd��tt|�jf|�dS)Nrz<source_address must be IP address string or (ip, port) tuple)�
isinstancer�source_address�tuple�	TypeError�superr�__init__)�selfr�kwargs)�	__class__��/usr/lib/python3.6/source.pyr-s

zSourceAddressAdapter.__init__FcCstj||||jd�|_dS)N)Z	num_pools�maxsize�blockr)rZPoolManagerr)r
Zconnectionsrrrrr�init_poolmanager9s
z%SourceAddressAdapter.init_poolmanagercs|j|d<tt|�j||�S)Nr)rrr�proxy_manager_for)r
�argsr)rrrr@s

z&SourceAddressAdapter.proxy_manager_for)F)�__name__�
__module__�__qualname__�__doc__rrr�
__classcell__rr)rrrs
rN)rZrequests.adaptersrZ_compatrrrrrrr�<module>s

Filemanager

Name Type Size Permission Actions
__init__.cpython-36.opt-1.pyc File 460 B 0644
__init__.cpython-36.pyc File 460 B 0644
appengine.cpython-36.opt-1.pyc File 7.23 KB 0644
appengine.cpython-36.pyc File 7.23 KB 0644
fingerprint.cpython-36.opt-1.pyc File 1.68 KB 0644
fingerprint.cpython-36.pyc File 1.68 KB 0644
host_header_ssl.cpython-36.opt-1.pyc File 1.32 KB 0644
host_header_ssl.cpython-36.pyc File 1.32 KB 0644
socket_options.cpython-36.opt-1.pyc File 4.01 KB 0644
socket_options.cpython-36.pyc File 4.01 KB 0644
source.cpython-36.opt-1.pyc File 2.74 KB 0644
source.cpython-36.pyc File 2.74 KB 0644
ssl.cpython-36.opt-1.pyc File 2.44 KB 0644
ssl.cpython-36.pyc File 2.44 KB 0644
x509.cpython-36.opt-1.pyc File 6.42 KB 0644
x509.cpython-36.pyc File 6.42 KB 0644