� ��^i� � � � d dl Z d dlZd dlmZmZmZ d dlmZmZ dZdd�Z d� Z G d� de� � Z G d � d e� � Z G d� de� � Z G d � de� � ZdS )� N)� formatdate� parsedate�parsedate_tz)�datetime� timedeltaz%a, %d %b %Y %H:%M:%S GMTc �6 � |pt j � � }|| z S �N)r �utcnow)�delta�dates ��/builddir/build/BUILDROOT/alt-python311-pip-21.3.1-4.el8.x86_64/opt/alt/python311/lib/python3.11/site-packages/pip/_vendor/cachecontrol/heuristics.py�expire_afterr s � ��$�8�?�$�$�D��%�<�� c �h � t t j | � � � � � � � S r )r �calendar�timegm� timetuple)�dts r �datetime_to_headerr s" � ��h�o�b�l�l�n�n�5�5�6�6�6r c � � e Zd Zd� Zd� Zd� ZdS )� BaseHeuristicc � � 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"� ��self�responses r �warningzBaseHeuristic.warning s � � +�*r c � � i S )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 � � � r c �� � | � |� � }|rM|j � |� � | � |� � }|�|j � d|i� � |S )N�Warning)r �headers�updater )r r �updated_headers�warning_header_values r �applyzBaseHeuristic.apply* so � ��-�-�h�7�7��� K���#�#�O�4�4�4�#'�<�<��#9�#9� �#�/�� �'�'��4H�(I�J�J�J��r N)�__name__� __module__�__qualname__r r r&