File manager - Edit - /opt/saltstack/salt/lib/python3.10/site-packages/pip/_vendor/cachecontrol/__pycache__/heuristics.cpython-310.pyc
Back
o ;j � @ s� d dl mZ d dlZd dlZd dlmZmZmZ d dlmZm Z m Z d dlmZm Z mZ er4d dlmZ dZdddd�Zddd�ZG dd� d�ZG dd� de�ZG dd� de�ZG dd� 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�returnr c C s |pt �tj�}|| S �N)r �nowr �utc)r r � r �W/opt/saltstack/salt/lib/python3.10/site-packages/pip/_vendor/cachecontrol/heuristics.py�expire_after s r �dt�strc C s t t�| �� ��S r )r �calendar�timegm� timetuple)r r r r �datetime_to_header s r c @ s* e Zd Zd dd�Zddd �Zdd d�ZdS )� BaseHeuristic�responser r � str | Nonec C s 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"r ��selfr r r r �warning s zBaseHeuristic.warning�dict[str, str]c C s 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 r r r �update_headers'