HEX
Server: Microsoft-IIS/10.0
System: Windows NT ITPWINWEBSVR22 10.0 build 20348 (Windows Server 2022) AMD64
User: www.conferencesearch.co.uk (0)
PHP: 8.3.30
Disabled: NONE
Upload Files
File: D:/Python311/Lib/site-packages/pip/_vendor/cachecontrol/__pycache__/heuristics.cpython-311.pyc
�

�mi����ddlmZddlZddlZddlmZmZmZddlmZm	Z	m
Z
ddlmZm
Z
mZerddlmZdZddd�Zdd�ZGd�d��ZGd�de��ZGd�de��ZGd�de��ZdS)�)�annotationsN)�datetime�	timedelta�timezone)�
formatdate�	parsedate�parsedate_tz)�
TYPE_CHECKING�Any�Mapping)�HTTPResponsez%a, %d %b %Y %H:%M:%S GMT�deltar�date�datetime | None�returnrc�L�|ptjtj��}||zS�N)r�nowr�utc)rrs  �ED:\Python311\Lib\site-packages\pip/_vendor/cachecontrol/heuristics.py�expire_afterrs"���-�8�<���-�-�D��%�<���dt�strc�h�ttj|�������Sr)r�calendar�timegm�	timetuple)rs r�datetime_to_headerrs"���h�o�b�l�l�n�n�5�5�6�6�6rc�&�eZdZd
d�Zdd�Zdd�Zd	S)
�
BaseHeuristic�responser
r�
str | Nonec��dS)a!
        Return a valid 1xx warning header value describing the cache
        adjustments.

        The response is provided too allow warnings like 113
        http://tools.ietf.org/html/rfc7234#section-5.5.4 where we need
        to explicitly say response is over 24 hours old.
        z110 - "Response is Stale"���selfr"s  r�warningzBaseHeuristic.warnings
��+�*r�dict[str, str]c��iS)z�Update the response headers with any new headers.

        NOTE: This SHOULD always include some Warning header to
              signify that the response was cached by the client, not
              by way of the provided headers.
        r%r&s  r�update_headerszBaseHeuristic.update_headers's	���	rc���|�|��}|rM|j�|��|�|��}|�|j�d|i��|S)N�Warning)r+�headers�updater()r'r"�updated_headers�warning_header_values    r�applyzBaseHeuristic.apply0sr���-�-�h�7�7���	K���#�#�O�4�4�4�#'�<�<��#9�#9� �#�
K�� �'�'��4H�(I�J�J�J��rN�r"r
rr#�r"r
rr))r"r
rr
)�__name__�
__module__�__qualname__r(r+r2r%rrr!r!sP������	+�	+�	+�	+�����	�	�	�	�	�	rr!c��eZdZdZdd�ZdS)	�OneDayCachezM
    Cache the response by providing an expires 1 day in the
    future.
    r"r
rr)c���i}d|jvrlt|jd��}ttd���t	|dd�dt
ji����}t|��|d<d|d	<|S)
N�expiresr�)�days��tzinfo)r�public�
cache-control)r.rrrrrrr)r'r"r.rr;s     rr+zOneDayCache.update_headersBs������H�,�,�	0��X�-�f�5�6�6�D�"��q�!�!�!��t�B�Q�B�x�=���=�=����G�"4�G�!<�!<�G�I��'/�G�O�$��rNr4)r5r6r7�__doc__r+r%rrr9r9<s2��������
�����rr9c�*�eZdZdZdd�Zdd
�Zdd�Zd
S)�ExpiresAfterz;
    Cache **all** requests for a defined time period.
    �kwrr�Nonec�(�tdi|��|_dS)Nr%)rr)r'rEs  r�__init__zExpiresAfter.__init__Us���_�_��_�_��
�
�
rr"r
r)c�N�t|j��}t|��dd�S)Nr@)r;rA)rrr)r'r"r;s   rr+zExpiresAfter.update_headersXs'���t�z�*�*��-�g�6�6��R�R�Rrr#c��d}||jzS)Nz:110 - Automatically cached for %s. Response might be stale)r)r'r"�tmpls   rr(zExpiresAfter.warning\s��K���d�j� � rN)rErrrFr4r3)r5r6r7rBrHr+r(r%rrrDrDPs^��������%�%�%�%�S�S�S�S�!�!�!�!�!�!rrDc�*�eZdZdZhd�Zdd�Zdd	�Zd
S)
�LastModifieda�
    If there is no Expires header already, fall back on Last-Modified
    using the heuristic from
    http://tools.ietf.org/html/rfc7234#section-4.2.2
    to calculate a reasonable value.

    Firefox also does something like this per
    https://developer.mozilla.org/en-US/docs/Web/HTTP/Caching_FAQ
    http://lxr.mozilla.org/mozilla-release/source/netwerk/protocol/http/nsHttpResponseHead.cpp#397
    Unlike mozilla we limit this to 24-hr.
    >�,�-��������������respr
rr)c�B�|j}d|vriSd|vr|ddkriS|j|jvriSd|vsd|vriSt|d��}|�J�t	j|dd���}t
|d��}|�iStj��}td||z
��}|t	j|��z
}tdt|dzd	����}	|	|kriS||	z}
dtj
ttj|
����iS)
Nr;rAr@rz
last-modifiedr>r�
i�Q)
r.�status�cacheable_by_default_statusesr	rrr�time�max�min�strftime�TIME_FMT�gmtime)r'rYr.�
time_tupler�
last_modifiedr�current_ager�freshness_lifetimer;s           rr+zLastModified.update_headers|sT��%)�\�����	��I��g�%�	�'�/�*B�h�*N�	��I��;�d�@�@�	��I��� �	�O�7�$B�	��I�!�'�&�/�2�2�
��%�%�%���z�"�1�"�~�.�.��!�'�/�":�;�;�
��	��I��i�k�k���!�S�4�Z�(�(���x��}�5�5�5�� ��C���
�I�$>�$>�?�?����,�	��I��+�+���4�=��4�;�w�3G�3G�H�H�I�Irr#c��dSrr%)r'rYs  rr(zLastModified.warning�s���trN)rYr
rr))rYr
rr#)r5r6r7rBr]r+r(r%rrrMrMas]������
�
�%�%�%�!�J�J�J�J�@�����rrMr)rrrrrr)rrrr)�
__future__rrr^rrr�email.utilsrrr	�typingr
rr�pip._vendor.urllib3r
rbrrr!r9rDrMr%rr�<module>rms���#�"�"�"�"�"���������2�2�2�2�2�2�2�2�2�2�;�;�;�;�;�;�;�;�;�;�.�.�.�.�.�.�.�.�.�.��1�0�0�0�0�0�0�&�������
7�7�7�7���������B�����-����(!�!�!�!�!�=�!�!�!�"<�<�<�<�<�=�<�<�<�<�<r