File: //lib/python3/dist-packages/oauthlib/oauth1/rfc5849/__pycache__/utils.cpython-38.pyc
U
��I]�
� @ s� d Z ddlmZmZ ddlmZmZmZ zddlZW n e k
rT ddl
mZ Y nX dZdd� Z
dd � Zd
d� Zdd
� Zdd� Zdd� Zdd� ZdS )zn
oauthlib.utils
~~~~~~~~~~~~~~
This module contains utility methods used by various parts of the OAuth
spec.
� )�absolute_import�unicode_literals)�quote�unicode_type�unquoteNZ>abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789c s � fdd�}� j |_ |S )z�Decorator 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 s t | �} � | f|�|�S )N)�filter_oauth_params)�params�args�kwargs��target� �?/usr/lib/python3/dist-packages/oauthlib/oauth1/rfc5849/utils.py�wrapper s zfilter_params.<locals>.wrapper)�__doc__)r r r
r r �
filter_params s r c C s: dd� }t | t�r(tt|t| �� ���S tt|| ��S dS )zARemoves all non oauth parameters from a dict or a list of params.c S s | d � d�S )Nr Zoauth_)�
startswith)Zkvr
r
r �<lambda>( � z%filter_oauth_params.<locals>.<lambda>N)�
isinstance�dict�list�filter�items)r Zis_oauthr
r
r r &