&`5 TdZddlmZddlmZmZdZdZdZ dZ dZ d Z d Z d ZdS) zn oauthlib.utils ~~~~~~~~~~~~~~ This module contains utility methods used by various parts of the OAuth spec. N)quoteunquote>abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789c*fd}j|_|S)zDecorator which filters params to remove non-oauth_* parameters Assumes the decorated method takes a params dict or list of tuples as its first argument. c:t|}|g|Ri|S)N)filter_oauth_params)paramsargskwargstargets ?/usr/lib/python3/dist-packages/oauthlib/oauth1/rfc5849/utils.pywrapperzfilter_params..wrappers0$V,,vf.t...v...)__doc__)r rs` r filter_paramsrs, /////nGO Nrc d}t|trz%filter_oauth_params..!s"Q%**844r) isinstancedictlistfilteritems)r is_oauths r rrs\44H&$.F8T&,,..%9%9::;;;F8V,,---rc t|ts3tdd|t |zt |dS)zEscape a unicode string in an OAuth-compatible fashion. Per `section 3.6`_ of the spec. .. _`section 3.6`: https://tools.ietf.org/html/rfc5849#section-3.6 z$Only unicode objects are escapable. zGot {!r} of type {}.~)safe)rstr ValueErrorformattyperus r escaper'(sc a  D?/66q$q''BBCDD D    rcht|tstdt|S)Nz%Only unicode objects are unescapable.)rr!r"rr%s r unescaper)8s0 a  B@AAA 1::rc*tj|S)z1A unicode-safe version of urllib2.parse_keqv_list)urllib2parse_keqv_list)ls r r,r,>  "1 % %%rc*tj|S)z1A unicode-safe version of urllib2.parse_http_list)r+parse_http_listr%s r r0r0Dr.rcd}|dt||rjt|t|d} t t |S#ttf$rYnwxYwtd)z;Parse an OAuth authorization header into a list of 2-tupleszOAuth NzMalformed authorization header) lowerlenrr0rr,r IndexErrorr")authorization_header auth_schemers r parse_authorization_headerr7Js..""K-S---.4466AA+NN 4S5E5E5F5F GHH ..446677 7J'    D  5 6 66s6-B$$B87B8)rurllib.requestrequestr+oauthlib.commonrrUNICODE_ASCII_CHARACTER_SETrrr'r)r,r0r7rr r=s! ******** ,   ...     &&& &&& 7 7 7 7 7r