� ��^iE7 � � � d Z ddlZddlZddlZddlZddlmZ ddlmZ ddl m Z ddlmZ ej e� � Z ej d� � Zd � Z G d � de� � ZdS )z7 The httplib2 algorithms ported for use with requests. � N)�parsedate_tz)�CaseInsensitiveDict� )� DictCache)� Serializerz9^(([^:/?#]+):)?(//([^/?#]*))?([^?#]*)(\?([^#]*))?(#(.*))?c � � t � | � � � � � }|d |d |d |d |d fS )z�Parses a URI using the regex given in Appendix B of RFC 3986. (scheme, authority, path, query, fragment) = parse_uri(uri) r � � � � )�URI�match�groups)�urir s ��/builddir/build/BUILDROOT/alt-python311-pip-21.3.1-4.el8.x86_64/opt/alt/python311/lib/python3.11/site-packages/pip/_vendor/cachecontrol/controller.py� parse_urir sD � � �Y�Y�s�^�^� "� "� $� $�F��1�I�v�a�y�&��)�V�A�Y��q� �B�B� c �h � e Zd ZdZ dd�Zed� � � Zed� � � Zd� Zd� Z d � Z d d �Zd� ZdS )�CacheControllerz9An interface to see if request should cached or not. NTc �~ � |�t � � n|| _ || _ |p t � � | _ |pd| _ d S )N)�� �� i, �- )r �cache�cache_etagsr � serializer�cacheable_status_codes)�selfr r r �status_codess r �__init__zCacheController.__init__" sC � � %*�M�Y�[�[�[�u�� �&���$�4� �����&2�&J�6J��#�#�#r c � � t |� � \ }}}}}|r|st d|z � � �|� � � }|� � � }|sd}|rd� ||g� � p|}|dz |z |z }|S )z4Normalize the URL to create a safe key for the cachez(Only absolute URIs are allowed. uri = %s�/�?z://)r � Exception�lower�join) �clsr �scheme� authority�path�query�fragment�request_uri� defrag_uris r �_urlnormzCacheController._urlnorm* s� � � 6?�s�^�^�2���D�%��� N�Y� N��F��L�M�M�M��������O�O�%�%� �� ��D� �7����$��� 7� 7�?�4���e�^�i�/�+�=� ��r c �, � | � |� � S �N)r/ )r' r s r � cache_urlzCacheController.cache_url> s � ��|�|�C� � � r c �� � t dft dft dfddddddddt dfd�}|� d|� dd� � � � }i }|� d� � D �] }|� � � s�|� d d � � }|d � � � } || \ }} n+# t $ r t � d|� � Y �|w xY w|r| sd ||<