How to use the aliyun-python-sdk-core.aliyunsdkcore.vendored.requests.compat.OrderedDict function in aliyun-python-sdk-core

To help you get started, we’ve selected a few aliyun-python-sdk-core examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github aliyun / aliyun-openapi-python-sdk / aliyun-python-sdk-core / aliyunsdkcore / vendored / requests / structures.py View on Github external
def __init__(self, data=None, **kwargs):
        self._store = OrderedDict()
        if data is None:
            data = {}
        self.update(data, **kwargs)
github aliyun / aliyun-openapi-python-sdk / aliyun-python-sdk-core / aliyunsdkcore / vendored / requests / sessions.py View on Github external
#: This defaults to requests.models.DEFAULT_REDIRECT_LIMIT, which is
        #: 30.
        self.max_redirects = DEFAULT_REDIRECT_LIMIT

        #: Trust environment settings for proxy configuration, default
        #: authentication and similar.
        self.trust_env = True

        #: A CookieJar containing all currently outstanding cookies set on this
        #: session. By default it is a
        #: :class:`RequestsCookieJar `, but
        #: may be any other ``cookielib.CookieJar`` compatible object.
        self.cookies = cookiejar_from_dict({})

        # Default connection adapters.
        self.adapters = OrderedDict()
        self.mount('https://', HTTPAdapter())
        self.mount('http://', HTTPAdapter())
github aliyun / aliyun-openapi-python-sdk / aliyun-python-sdk-core / aliyunsdkcore / vendored / requests / sessions.py View on Github external
def merge_setting(request_setting, session_setting, dict_class=OrderedDict):
    """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`
    """

    if session_setting is None:
        return request_setting

    if request_setting is None:
        return session_setting

    # Bypass if not a dictionary (e.g. verify)
    if not (
            isinstance(session_setting, Mapping) and
            isinstance(request_setting, Mapping)
    ):
github aliyun / aliyun-openapi-python-sdk / aliyun-python-sdk-core / aliyunsdkcore / vendored / requests / sessions.py View on Github external
def merge_hooks(request_hooks, session_hooks, dict_class=OrderedDict):
    """Properly merges both requests and session hooks.

    This is necessary because when request_hooks == {'response': []}, the
    merge breaks Session hooks entirely.
    """
    if session_hooks is None or session_hooks.get('response') == []:
        return request_hooks

    if request_hooks is None or request_hooks.get('response') == []:
        return session_hooks

    return merge_setting(request_hooks, session_hooks, dict_class)
github aliyun / aliyun-openapi-python-sdk / aliyun-python-sdk-core / aliyunsdkcore / vendored / requests / utils.py View on Github external
>>> from_key_val_list([('key', 'val')])
        OrderedDict([('key', 'val')])
        >>> from_key_val_list('string')
        ValueError: need more than 1 value to unpack
        >>> from_key_val_list({'key': 'val'})
        OrderedDict([('key', 'val')])

    :rtype: OrderedDict
    """
    if value is None:
        return None

    if isinstance(value, (str, bytes, bool, int)):
        raise ValueError('cannot encode objects that are not 2-tuples')

    return OrderedDict(value)

aliyun-python-sdk-core

The core module of Aliyun Python SDK.

Apache-2.0
Latest version published 1 month ago

Package Health Score

84 / 100
Full package analysis

Popular aliyun-python-sdk-core functions

Similar packages