R`i d dl mZ d dlZd dlZd dlmZmZmZ d dlmZm Z m Z d dlmZm Z mZ erd dlmZ dZdddZdd Z G d d Z G d d e Z G d de Z G d de Zy) )annotationsN)datetime timedeltatimezone) formatdate parsedateparsedate_tz) TYPE_CHECKINGAnyMapping)HTTPResponsez%a, %d %b %Y %H:%M:%S GMTc Z |xs# t j t j }|| z S N)r nowr utc)deltadates /builddir/build/BUILDROOT/alt-python312-pip-23.3.1-3.el8.x86_64/opt/alt/python312/lib/python3.12/site-packages/pip/_vendor/cachecontrol/heuristics.pyexpire_afterr s# -8<<-D%< c Z t t j | j S r )r calendartimegm timetuple)dts r datetime_to_headerr s hooblln566r c $ e Zd ZddZddZddZy) BaseHeuristicc y)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" selfresponses r warningzBaseHeuristic.warning s +r c i S )zUpdate 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 | j | }|rK|j j | | j | }||j j d|i |S )NWarning)r&