o
    2gp                     @  sZ   d Z ddlmZ ddlmZ ddlmZmZmZ er ddl	m
Z
 eeedZdddZdS )z)Provide utility for the prawcore package.    )annotations)TYPE_CHECKING   )	ForbiddenInsufficientScopeInvalidToken)Response)i  insufficient_scopeinvalid_tokenresponser   return.InvalidToken | (Forbidden | InsufficientScope)c                 C  s<   | j d}|r|ddddd }n| j}t| | S )zReturn an exception instance that maps to the OAuth Error.

    :param response: The HTTP response containing a www-authenticate error.

    zwww-authenticate" =r   )headersgetreplacersplitstatus_code_auth_error_mapping)r   messageerror r   E/home/garg/my-data/venv/lib/python3.10/site-packages/prawcore/util.pyauthorization_error_class   s
   r   N)r   r   r   r   )__doc__
__future__r   typingr   
exceptionsr   r   r   requests.modelsr   r   r   r   r   r   r   <module>   s    