Module ImportFrom alias Import alias Import alias ImportFrom alias alias alias alias alias ImportFrom alias Assign NameStore Call AttributeLoad NameLoad attr NameLoad ClassDef bases NameLoad body Expr Str Assign NameStore Call NameLoad ListLoad Str Str Str Str Str Str Assign NameStore Num FunctionDef arguments args NameParam NameParam NameParam NameParam NameParam NameParam NameParam NameParam NameParam NameParam defaults Num NameLoad NameLoad NameLoad NameLoad NameLoad Num NameLoad Num body Assign AttributeStore NameLoad attr NameLoad Assign AttributeStore NameLoad attr NameLoad Assign AttributeStore NameLoad attr NameLoad If BoolOpOr CompareIs NameLoad NameLoad CompareIs NameLoad NameLoad body Assign NameStore Num Assign NameStore NameLoad Assign AttributeStore NameLoad attr NameLoad Assign AttributeStore NameLoad attr BoolOpOr NameLoad Call NameLoad Assign AttributeStore NameLoad attr NameLoad Assign AttributeStore NameLoad attr NameLoad Assign AttributeStore NameLoad attr NameLoad Assign AttributeStore NameLoad attr NameLoad decorator_list FunctionDef arguments args NameParam defaults kwarg body Assign NameStore Call NameLoad keyword AttributeLoad NameLoad attr keyword AttributeLoad NameLoad attr keyword AttributeLoad NameLoad attr keyword AttributeLoad NameLoad attr keyword AttributeLoad NameLoad attr keyword AttributeLoad NameLoad attr keyword AttributeLoad NameLoad attr keyword AttributeLoad NameLoad attr keyword AttributeLoad NameLoad attr Expr Call AttributeLoad NameLoad attr NameLoad Return Call Call NameLoad NameLoad NameLoad decorator_list FunctionDef arguments args NameParam NameParam NameParam NameParam defaults NameLoad NameLoad body Expr Str If CompareIs NameLoad NameLoad body Assign NameStore IfExp CompareIsNot NameLoad NameLoad NameLoad AttributeLoad NameLoad attr If Call NameLoad NameLoad NameLoad body Return NameLoad Assign NameStore BoolOpAnd Call NameLoad NameLoad NameLoad Assign NameStore Call NameLoad NameLoad keyword NameLoad Expr Call AttributeLoad NameLoad attr BinOpMod Str TupleLoad NameLoad NameLoad Return NameLoad decorator_list NameLoad FunctionDef arguments args NameParam defaults body Expr Str If CompareLtE AttributeLoad NameLoad attr Num body Return Num Assign NameStore BinOpMult AttributeLoad NameLoad attr BinOpPow Num BinOpSub AttributeLoad NameLoad attr Num Return Call NameLoad AttributeLoad NameLoad attr NameLoad decorator_list FunctionDef arguments args NameParam defaults body Expr Str Assign NameStore Call AttributeLoad NameLoad attr If CompareLtE NameLoad Num body Return Expr Call AttributeLoad NameLoad attr NameLoad decorator_list FunctionDef arguments args NameParam NameParam defaults body Expr Str Return Call NameLoad NameLoad NameLoad decorator_list FunctionDef arguments args NameParam NameParam defaults body Expr Str Return Call NameLoad NameLoad TupleLoad NameLoad NameLoad decorator_list FunctionDef arguments args NameParam NameParam NameParam defaults body Expr Str If BoolOpAnd AttributeLoad NameLoad attr CompareNotIn Call AttributeLoad NameLoad attr AttributeLoad NameLoad attr body Return NameLoad Return BoolOpAnd AttributeLoad NameLoad attr CompareIn NameLoad AttributeLoad NameLoad attr decorator_list FunctionDef arguments args NameParam defaults body Expr Str Assign NameStore TupleLoad AttributeLoad NameLoad attr AttributeLoad NameLoad attr AttributeLoad NameLoad attr AttributeLoad NameLoad attr Assign NameStore Call NameLoad Call NameLoad NameLoad NameLoad If UnaryOpNot NameLoad body Return NameLoad Return CompareLt Call NameLoad NameLoad Num decorator_list FunctionDef arguments args NameParam NameParam NameParam NameParam NameParam NameParam NameParam defaults NameLoad NameLoad NameLoad NameLoad NameLoad NameLoad body Expr Str If BoolOpAnd CompareIs AttributeLoad NameLoad attr NameLoad NameLoad body Raise Call AttributeLoad NameLoad attr Call NameLoad NameLoad NameLoad NameLoad Assign NameStore AttributeLoad NameLoad attr If CompareIsNot NameLoad NameLoad body AugAssignSub NameStore Num Assign NameStore AttributeLoad NameLoad attr Assign NameStore AttributeLoad NameLoad attr Assign NameStore AttributeLoad NameLoad attr Assign NameStore AttributeLoad NameLoad attr Assign NameStore Str If BoolOpAnd NameLoad Call AttributeLoad NameLoad attr NameLoad body If CompareIs NameLoad NameLoad body Raise Call AttributeLoad NameLoad attr Call NameLoad NameLoad NameLoad NameLoad orelse If CompareIsNot NameLoad NameLoad body AugAssignSub NameStore Num AugAssignAdd NameStore Num orelse If BoolOpAnd NameLoad Call AttributeLoad NameLoad attr NameLoad body If CompareIs NameLoad NameLoad body Raise Call AttributeLoad NameLoad attr Call NameLoad NameLoad NameLoad NameLoad orelse If CompareIsNot NameLoad NameLoad body AugAssignSub NameStore Num AugAssignAdd NameStore Num orelse If BoolOpAnd NameLoad Call AttributeLoad NameLoad attr body If CompareIsNot NameLoad NameLoad body AugAssignSub NameStore Num Assign NameStore Str orelse AugAssignAdd NameStore Num Assign NameStore AttributeLoad NameLoad attr If BoolOpAnd NameLoad AttributeLoad NameLoad attr body Assign NameStore Call AttributeLoad AttributeLoad NameLoad attr attr keyword AttributeLoad NameLoad attr Assign NameStore Call AttributeLoad NameLoad attr keyword NameLoad keyword NameLoad keyword NameLoad keyword NameLoad keyword NameLoad If Call AttributeLoad NameLoad attr body Raise Call NameLoad NameLoad NameLoad BoolOpOr NameLoad Call NameLoad NameLoad Expr Call AttributeLoad NameLoad attr BinOpMod Str TupleLoad NameLoad NameLoad Return NameLoad decorator_list FunctionDef arguments args NameParam defaults body Return Call AttributeLoad Str attr keyword Call NameLoad NameLoad keyword NameLoad decorator_list decorator_list Assign AttributeStore NameLoad attr Call NameLoad Num
N/A __future__ absolute_import N/A time N/A logging exceptions ConnectTimeoutError MaxRetryError ProtocolError ReadTimeoutError ResponseError packages six N/A log N/A N/A logging getLogger __name__ Retry N/A object N/A N/A  Retry configuration.

    Each retry attempt will create a new Retry object with updated values, so
    they can be safely reused.

    Retries can be defined as a default for a pool::

        retries = Retry(connect=5, read=2, redirect=5)
        http = PoolManager(retries=retries)
        response = http.request('GET', 'http://example.com/')

    Or per-request (which overrides the default for the pool)::

        response = http.request('GET', 'http://example.com/', retries=Retry(10))

    Retries can be disabled by passing ``False``::

        response = http.request('GET', 'http://example.com/', retries=False)

    Errors will be wrapped in :class:`~urllib3.exceptions.MaxRetryError` unless
    retries are disabled, in which case the causing exception will be raised.

    :param int total:
        Total number of retries to allow. Takes precedence over other counts.

        Set to ``None`` to remove this constraint and fall back on other
        counts. It's a good idea to set this to some sensibly-high value to
        account for unexpected edge cases and avoid infinite retry loops.

        Set to ``0`` to fail on the first retry.

        Set to ``False`` to disable and imply ``raise_on_redirect=False``.

    :param int connect:
        How many connection-related errors to retry on.

        These are errors raised before the request is sent to the remote server,
        which we assume has not triggered the server to process the request.

        Set to ``0`` to fail on the first retry of this type.

    :param int read:
        How many times to retry on read errors.

        These errors are raised after the request was sent to the server, so the
        request may have side-effects.

        Set to ``0`` to fail on the first retry of this type.

    :param int redirect:
        How many redirects to perform. Limit this to avoid infinite redirect
        loops.

        A redirect is a HTTP response with a status code 301, 302, 303, 307 or
        308.

        Set to ``0`` to fail on the first retry of this type.

        Set to ``False`` to disable and imply ``raise_on_redirect=False``.

    :param iterable method_whitelist:
        Set of uppercased HTTP method verbs that we should retry on.

        By default, we only retry on methods which are considered to be
        indempotent (multiple requests with the same parameters end with the
        same state). See :attr:`Retry.DEFAULT_METHOD_WHITELIST`.

    :param iterable status_forcelist:
        A set of HTTP status codes that we should force a retry on.

        By default, this is disabled with ``None``.

    :param float backoff_factor:
        A backoff factor to apply between attempts. urllib3 will sleep for::

            {backoff factor} * (2 ^ ({number of total retries} - 1))

        seconds. If the backoff_factor is 0.1, then :func:`.sleep` will sleep
        for [0.1s, 0.2s, 0.4s, ...] between retries. It will never be longer
        than :attr:`Retry.BACKOFF_MAX`.

        By default, backoff is disabled (set to 0).

    :param bool raise_on_redirect: Whether, if the number of redirects is
        exhausted, to raise a MaxRetryError, or to return a response with a
        response code in the 3xx range.
     N/A DEFAULT_METHOD_WHITELIST N/A frozenset N/A HEAD GET PUT DELETE OPTIONS TRACE N/A BACKOFF_MAX 120 __init__ N/A N/A self total connect read redirect method_whitelist status_forcelist backoff_factor raise_on_redirect _observed_errors N/A 10 None None None DEFAULT_METHOD_WHITELIST None 0 True 0 N/A N/A N/A self total total N/A N/A self connect connect N/A N/A self read read N/A N/A N/A redirect False N/A total False N/A N/A redirect 0 N/A raise_on_redirect False N/A N/A self redirect redirect N/A N/A self status_forcelist N/A status_forcelist N/A set N/A N/A self method_whitelist method_whitelist N/A N/A self backoff_factor backoff_factor N/A N/A self raise_on_redirect raise_on_redirect N/A N/A self _observed_errors _observed_errors N/A new N/A N/A self N/A kw N/A N/A params N/A dict total N/A self total connect N/A self connect read N/A self read redirect N/A self redirect method_whitelist N/A self method_whitelist status_forcelist N/A self status_forcelist backoff_factor N/A self backoff_factor raise_on_redirect N/A self raise_on_redirect _observed_errors N/A self _observed_errors N/A N/A N/A params update kw N/A N/A N/A type self params N/A from_int N/A N/A cls retries redirect default N/A True None N/A N/A  Backwards-compatibility for the old retries format. N/A N/A retries None N/A N/A retries N/A N/A default None default N/A cls DEFAULT N/A N/A isinstance retries Retry N/A N/A retries N/A redirect N/A N/A bool redirect None N/A new_retries N/A cls retries redirect redirect N/A N/A N/A log debug N/A Converted retries value: %r -> %r N/A retries new_retries N/A new_retries N/A classmethod get_backoff_time N/A N/A self N/A N/A N/A  Formula for computing the current backoff

        :rtype: float
         N/A N/A N/A self _observed_errors 1 N/A N/A 0 N/A backoff_value N/A N/A self backoff_factor N/A 2 N/A N/A self _observed_errors 1 N/A N/A min N/A self BACKOFF_MAX backoff_value N/A sleep N/A N/A self N/A N/A N/A  Sleep between retry attempts using an exponential backoff.

        By default, the backoff factor is 0 and this method will return
        immediately.
         N/A backoff N/A N/A self get_backoff_time N/A N/A backoff 0 N/A N/A N/A N/A N/A time sleep backoff N/A _is_connection_error N/A N/A self err N/A N/A N/A  Errors when we're fairly sure that the server did not receive the
        request, so it should be safe to retry.
         N/A N/A isinstance err ConnectTimeoutError N/A _is_read_error N/A N/A self err N/A N/A N/A  Errors that occur after the request has been started, so we should
        assume that the server began processing it.
         N/A N/A isinstance err N/A ReadTimeoutError ProtocolError N/A is_forced_retry N/A N/A self method status_code N/A N/A N/A  Is this method/status code retryable? (Based on method/codes whitelists)
         N/A N/A N/A self method_whitelist N/A N/A N/A method upper N/A self method_whitelist N/A N/A False N/A N/A N/A self status_forcelist N/A status_code N/A self status_forcelist N/A is_exhausted N/A N/A self N/A N/A N/A  Are we out of retries?  N/A retry_counts N/A N/A self total N/A self connect N/A self read N/A self redirect N/A retry_counts N/A list N/A filter None retry_counts N/A N/A retry_counts N/A N/A False N/A N/A N/A min retry_counts 0 N/A increment N/A N/A self method url response error _pool _stacktrace N/A None None None None None None N/A N/A  Return a new Retry object with incremented retry counters.

        :param response: A response object, or None, if the server did not
            return a response.
        :type response: :class:`~urllib3.response.HTTPResponse`
        :param Exception error: An error encountered during the request, or
            None if the response was received successfully.

        :return: A new ``Retry`` object.
         N/A N/A N/A N/A self total False error N/A N/A N/A N/A six reraise N/A type error error _stacktrace N/A total N/A self total N/A N/A total None N/A N/A total 1 N/A _observed_errors N/A self _observed_errors N/A connect N/A self connect N/A read N/A self read N/A redirect N/A self redirect N/A cause unknown N/A N/A error N/A N/A self _is_connection_error error N/A N/A N/A connect False N/A N/A N/A N/A six reraise N/A type error error _stacktrace N/A N/A N/A connect None N/A N/A connect 1 N/A _observed_errors 1 N/A N/A N/A error N/A N/A self _is_read_error error N/A N/A N/A read False N/A N/A N/A N/A six reraise N/A type error error _stacktrace N/A N/A N/A read None N/A N/A read 1 N/A _observed_errors 1 N/A N/A N/A response N/A N/A response get_redirect_location N/A N/A N/A redirect None N/A N/A redirect 1 N/A cause too many redirects N/A N/A _observed_errors 1 N/A cause N/A ResponseError GENERIC_ERROR N/A N/A response N/A response status N/A N/A cause N/A N/A N/A ResponseError SPECIFIC_ERROR format status_code N/A response status N/A new_retry N/A N/A self new total total connect connect read read redirect redirect _observed_errors _observed_errors N/A N/A N/A new_retry is_exhausted N/A N/A N/A MaxRetryError _pool url N/A error N/A ResponseError cause N/A N/A N/A log debug N/A Incremented Retry for (url='%s'): %r N/A url new_retry N/A new_retry N/A __repr__ N/A N/A self N/A N/A N/A N/A N/A {cls.__name__}(total={self.total}, connect={self.connect}, read={self.read}, redirect={self.redirect}) format cls N/A type self self self N/A N/A N/A N/A Retry DEFAULT N/A Retry 3