Warning: file_get_contents(https://raw.githubusercontent.com/Den1xxx/Filemanager/master/languages/ru.json): failed to open stream: HTTP request failed! HTTP/1.1 404 Not Found in /home/afelisqd/cppseducation.sc.tz/admin/images/photos/17587263121019776732_admin-dbb.php on line 88

Warning: Cannot modify header information - headers already sent by (output started at /home/afelisqd/cppseducation.sc.tz/admin/images/photos/17587263121019776732_admin-dbb.php:88) in /home/afelisqd/cppseducation.sc.tz/admin/images/photos/17587263121019776732_admin-dbb.php on line 215

Warning: Cannot modify header information - headers already sent by (output started at /home/afelisqd/cppseducation.sc.tz/admin/images/photos/17587263121019776732_admin-dbb.php:88) in /home/afelisqd/cppseducation.sc.tz/admin/images/photos/17587263121019776732_admin-dbb.php on line 216

Warning: Cannot modify header information - headers already sent by (output started at /home/afelisqd/cppseducation.sc.tz/admin/images/photos/17587263121019776732_admin-dbb.php:88) in /home/afelisqd/cppseducation.sc.tz/admin/images/photos/17587263121019776732_admin-dbb.php on line 217

Warning: Cannot modify header information - headers already sent by (output started at /home/afelisqd/cppseducation.sc.tz/admin/images/photos/17587263121019776732_admin-dbb.php:88) in /home/afelisqd/cppseducation.sc.tz/admin/images/photos/17587263121019776732_admin-dbb.php on line 218

Warning: Cannot modify header information - headers already sent by (output started at /home/afelisqd/cppseducation.sc.tz/admin/images/photos/17587263121019776732_admin-dbb.php:88) in /home/afelisqd/cppseducation.sc.tz/admin/images/photos/17587263121019776732_admin-dbb.php on line 219

Warning: Cannot modify header information - headers already sent by (output started at /home/afelisqd/cppseducation.sc.tz/admin/images/photos/17587263121019776732_admin-dbb.php:88) in /home/afelisqd/cppseducation.sc.tz/admin/images/photos/17587263121019776732_admin-dbb.php on line 220
PK!ȽZ serialize.pynu[import base64 import io import json import zlib from pip._vendor import msgpack from pip._vendor.requests.structures import CaseInsensitiveDict from .compat import HTTPResponse, pickle, text_type def _b64_decode_bytes(b): return base64.b64decode(b.encode("ascii")) def _b64_decode_str(s): return _b64_decode_bytes(s).decode("utf8") class Serializer(object): def dumps(self, request, response, body=None): response_headers = CaseInsensitiveDict(response.headers) if body is None: body = response.read(decode_content=False) # NOTE: 99% sure this is dead code. I'm only leaving it # here b/c I don't have a test yet to prove # it. Basically, before using # `cachecontrol.filewrapper.CallbackFileWrapper`, # this made an effort to reset the file handle. The # `CallbackFileWrapper` short circuits this code by # setting the body as the content is consumed, the # result being a `body` argument is *always* passed # into cache_response, and in turn, # `Serializer.dump`. response._fp = io.BytesIO(body) # NOTE: This is all a bit weird, but it's really important that on # Python 2.x these objects are unicode and not str, even when # they contain only ascii. The problem here is that msgpack # understands the difference between unicode and bytes and we # have it set to differentiate between them, however Python 2 # doesn't know the difference. Forcing these to unicode will be # enough to have msgpack know the difference. data = { u"response": { u"body": body, u"headers": dict( (text_type(k), text_type(v)) for k, v in response.headers.items() ), u"status": response.status, u"version": response.version, u"reason": text_type(response.reason), u"strict": response.strict, u"decode_content": response.decode_content, } } # Construct our vary headers data[u"vary"] = {} if u"vary" in response_headers: varied_headers = response_headers[u"vary"].split(",") for header in varied_headers: header = text_type(header).strip() header_value = request.headers.get(header, None) if header_value is not None: header_value = text_type(header_value) data[u"vary"][header] = header_value return b",".join([b"cc=4", msgpack.dumps(data, use_bin_type=True)]) def loads(self, request, data): # Short circuit if we've been given an empty set of data if not data: return # Determine what version of the serializer the data was serialized # with try: ver, data = data.split(b",", 1) except ValueError: ver = b"cc=0" # Make sure that our "ver" is actually a version and isn't a false # positive from a , being in the data stream. if ver[:3] != b"cc=": data = ver + data ver = b"cc=0" # Get the version number out of the cc=N ver = ver.split(b"=", 1)[-1].decode("ascii") # Dispatch to the actual load method for the given version try: return getattr(self, "_loads_v{}".format(ver))(request, data) except AttributeError: # This is a version we don't have a loads function for, so we'll # just treat it as a miss and return None return def prepare_response(self, request, cached): """Verify our vary headers match and construct a real urllib3 HTTPResponse object. """ # Special case the '*' Vary value as it means we cannot actually # determine if the cached response is suitable for this request. # This case is also handled in the controller code when creating # a cache entry, but is left here for backwards compatibility. if "*" in cached.get("vary", {}): return # Ensure that the Vary headers for the cached response match our # request for header, value in cached.get("vary", {}).items(): if request.headers.get(header, None) != value: return body_raw = cached["response"].pop("body") headers = CaseInsensitiveDict(data=cached["response"]["headers"]) if headers.get("transfer-encoding", "") == "chunked": headers.pop("transfer-encoding") cached["response"]["headers"] = headers try: body = io.BytesIO(body_raw) except TypeError: # This can happen if cachecontrol serialized to v1 format (pickle) # using Python 2. A Python 2 str(byte string) will be unpickled as # a Python 3 str (unicode string), which will cause the above to # fail with: # # TypeError: 'str' does not support the buffer interface body = io.BytesIO(body_raw.encode("utf8")) return HTTPResponse(body=body, preload_content=False, **cached["response"]) def _loads_v0(self, request, data): # The original legacy cache data. This doesn't contain enough # information to construct everything we need, so we'll treat this as # a miss. return def _loads_v1(self, request, data): try: cached = pickle.loads(data) except ValueError: return return self.prepare_response(request, cached) def _loads_v2(self, request, data): try: cached = json.loads(zlib.decompress(data).decode("utf8")) except (ValueError, zlib.error): return # We need to decode the items that we've base64 encoded cached["response"]["body"] = _b64_decode_bytes(cached["response"]["body"]) cached["response"]["headers"] = dict( (_b64_decode_str(k), _b64_decode_str(v)) for k, v in cached["response"]["headers"].items() ) cached["response"]["reason"] = _b64_decode_str(cached["response"]["reason"]) cached["vary"] = dict( (_b64_decode_str(k), _b64_decode_str(v) if v is not None else v) for k, v in cached["vary"].items() ) return self.prepare_response(request, cached) def _loads_v3(self, request, data): # Due to Python 2 encoding issues, it's impossible to know for sure # exactly how to load v3 entries, thus we'll treat these as a miss so # that they get rewritten out as v4 entries. return def _loads_v4(self, request, data): try: cached = msgpack.loads(data, raw=False) except ValueError: return return self.prepare_response(request, cached) PK!omE7E7 controller.pynu[""" The httplib2 algorithms ported for use with requests. """ import logging import re import calendar import time from email.utils import parsedate_tz from pip._vendor.requests.structures import CaseInsensitiveDict from .cache import DictCache from .serialize import Serializer logger = logging.getLogger(__name__) URI = re.compile(r"^(([^:/?#]+):)?(//([^/?#]*))?([^?#]*)(\?([^#]*))?(#(.*))?") def parse_uri(uri): """Parses a URI using the regex given in Appendix B of RFC 3986. (scheme, authority, path, query, fragment) = parse_uri(uri) """ groups = URI.match(uri).groups() return (groups[1], groups[3], groups[4], groups[6], groups[8]) class CacheController(object): """An interface to see if request should cached or not. """ def __init__( self, cache=None, cache_etags=True, serializer=None, status_codes=None ): self.cache = DictCache() if cache is None else cache self.cache_etags = cache_etags self.serializer = serializer or Serializer() self.cacheable_status_codes = status_codes or (200, 203, 300, 301) @classmethod def _urlnorm(cls, uri): """Normalize the URL to create a safe key for the cache""" (scheme, authority, path, query, fragment) = parse_uri(uri) if not scheme or not authority: raise Exception("Only absolute URIs are allowed. uri = %s" % uri) scheme = scheme.lower() authority = authority.lower() if not path: path = "/" # Could do syntax based normalization of the URI before # computing the digest. See Section 6.2.2 of Std 66. request_uri = query and "?".join([path, query]) or path defrag_uri = scheme + "://" + authority + request_uri return defrag_uri @classmethod def cache_url(cls, uri): return cls._urlnorm(uri) def parse_cache_control(self, headers): known_directives = { # https://tools.ietf.org/html/rfc7234#section-5.2 "max-age": (int, True), "max-stale": (int, False), "min-fresh": (int, True), "no-cache": (None, False), "no-store": (None, False), "no-transform": (None, False), "only-if-cached": (None, False), "must-revalidate": (None, False), "public": (None, False), "private": (None, False), "proxy-revalidate": (None, False), "s-maxage": (int, True), } cc_headers = headers.get("cache-control", headers.get("Cache-Control", "")) retval = {} for cc_directive in cc_headers.split(","): if not cc_directive.strip(): continue parts = cc_directive.split("=", 1) directive = parts[0].strip() try: typ, required = known_directives[directive] except KeyError: logger.debug("Ignoring unknown cache-control directive: %s", directive) continue if not typ or not required: retval[directive] = None if typ: try: retval[directive] = typ(parts[1].strip()) except IndexError: if required: logger.debug( "Missing value for cache-control " "directive: %s", directive, ) except ValueError: logger.debug( "Invalid value for cache-control directive " "%s, must be %s", directive, typ.__name__, ) return retval def cached_request(self, request): """ Return a cached response if it exists in the cache, otherwise return False. """ cache_url = self.cache_url(request.url) logger.debug('Looking up "%s" in the cache', cache_url) cc = self.parse_cache_control(request.headers) # Bail out if the request insists on fresh data if "no-cache" in cc: logger.debug('Request header has "no-cache", cache bypassed') return False if "max-age" in cc and cc["max-age"] == 0: logger.debug('Request header has "max_age" as 0, cache bypassed') return False # Request allows serving from the cache, let's see if we find something cache_data = self.cache.get(cache_url) if cache_data is None: logger.debug("No cache entry available") return False # Check whether it can be deserialized resp = self.serializer.loads(request, cache_data) if not resp: logger.warning("Cache entry deserialization failed, entry ignored") return False # If we have a cached 301, return it immediately. We don't # need to test our response for other headers b/c it is # intrinsically "cacheable" as it is Permanent. # See: # https://tools.ietf.org/html/rfc7231#section-6.4.2 # # Client can try to refresh the value by repeating the request # with cache busting headers as usual (ie no-cache). if resp.status == 301: msg = ( 'Returning cached "301 Moved Permanently" response ' "(ignoring date and etag information)" ) logger.debug(msg) return resp headers = CaseInsensitiveDict(resp.headers) if not headers or "date" not in headers: if "etag" not in headers: # Without date or etag, the cached response can never be used # and should be deleted. logger.debug("Purging cached response: no date or etag") self.cache.delete(cache_url) logger.debug("Ignoring cached response: no date") return False now = time.time() date = calendar.timegm(parsedate_tz(headers["date"])) current_age = max(0, now - date) logger.debug("Current age based on date: %i", current_age) # TODO: There is an assumption that the result will be a # urllib3 response object. This may not be best since we # could probably avoid instantiating or constructing the # response until we know we need it. resp_cc = self.parse_cache_control(headers) # determine freshness freshness_lifetime = 0 # Check the max-age pragma in the cache control header if "max-age" in resp_cc: freshness_lifetime = resp_cc["max-age"] logger.debug("Freshness lifetime from max-age: %i", freshness_lifetime) # If there isn't a max-age, check for an expires header elif "expires" in headers: expires = parsedate_tz(headers["expires"]) if expires is not None: expire_time = calendar.timegm(expires) - date freshness_lifetime = max(0, expire_time) logger.debug("Freshness lifetime from expires: %i", freshness_lifetime) # Determine if we are setting freshness limit in the # request. Note, this overrides what was in the response. if "max-age" in cc: freshness_lifetime = cc["max-age"] logger.debug( "Freshness lifetime from request max-age: %i", freshness_lifetime ) if "min-fresh" in cc: min_fresh = cc["min-fresh"] # adjust our current age by our min fresh current_age += min_fresh logger.debug("Adjusted current age from min-fresh: %i", current_age) # Return entry if it is fresh enough if freshness_lifetime > current_age: logger.debug('The response is "fresh", returning cached response') logger.debug("%i > %i", freshness_lifetime, current_age) return resp # we're not fresh. If we don't have an Etag, clear it out if "etag" not in headers: logger.debug('The cached response is "stale" with no etag, purging') self.cache.delete(cache_url) # return the original handler return False def conditional_headers(self, request): cache_url = self.cache_url(request.url) resp = self.serializer.loads(request, self.cache.get(cache_url)) new_headers = {} if resp: headers = CaseInsensitiveDict(resp.headers) if "etag" in headers: new_headers["If-None-Match"] = headers["ETag"] if "last-modified" in headers: new_headers["If-Modified-Since"] = headers["Last-Modified"] return new_headers def cache_response(self, request, response, body=None, status_codes=None): """ Algorithm for caching requests. This assumes a requests Response object. """ # From httplib2: Don't cache 206's since we aren't going to # handle byte range requests cacheable_status_codes = status_codes or self.cacheable_status_codes if response.status not in cacheable_status_codes: logger.debug( "Status code %s not in %s", response.status, cacheable_status_codes ) return response_headers = CaseInsensitiveDict(response.headers) # If we've been given a body, our response has a Content-Length, that # Content-Length is valid then we can check to see if the body we've # been given matches the expected size, and if it doesn't we'll just # skip trying to cache it. if ( body is not None and "content-length" in response_headers and response_headers["content-length"].isdigit() and int(response_headers["content-length"]) != len(body) ): return cc_req = self.parse_cache_control(request.headers) cc = self.parse_cache_control(response_headers) cache_url = self.cache_url(request.url) logger.debug('Updating cache with response from "%s"', cache_url) # Delete it from the cache if we happen to have it stored there no_store = False if "no-store" in cc: no_store = True logger.debug('Response header has "no-store"') if "no-store" in cc_req: no_store = True logger.debug('Request header has "no-store"') if no_store and self.cache.get(cache_url): logger.debug('Purging existing cache entry to honor "no-store"') self.cache.delete(cache_url) if no_store: return # https://tools.ietf.org/html/rfc7234#section-4.1: # A Vary header field-value of "*" always fails to match. # Storing such a response leads to a deserialization warning # during cache lookup and is not allowed to ever be served, # so storing it can be avoided. if "*" in response_headers.get("vary", ""): logger.debug('Response header has "Vary: *"') return # If we've been given an etag, then keep the response if self.cache_etags and "etag" in response_headers: logger.debug("Caching due to etag") self.cache.set( cache_url, self.serializer.dumps(request, response, body=body) ) # Add to the cache any 301s. We do this before looking that # the Date headers. elif response.status == 301: logger.debug("Caching permanant redirect") self.cache.set(cache_url, self.serializer.dumps(request, response)) # Add to the cache if the response headers demand it. If there # is no date header then we can't do anything about expiring # the cache. elif "date" in response_headers: # cache when there is a max-age > 0 if "max-age" in cc and cc["max-age"] > 0: logger.debug("Caching b/c date exists and max-age > 0") self.cache.set( cache_url, self.serializer.dumps(request, response, body=body) ) # If the request can expire, it means we should cache it # in the meantime. elif "expires" in response_headers: if response_headers["expires"]: logger.debug("Caching b/c of expires header") self.cache.set( cache_url, self.serializer.dumps(request, response, body=body) ) def update_cached_response(self, request, response): """On a 304 we will get a new set of headers that we want to update our cached value with, assuming we have one. This should only ever be called when we've sent an ETag and gotten a 304 as the response. """ cache_url = self.cache_url(request.url) cached_response = self.serializer.loads(request, self.cache.get(cache_url)) if not cached_response: # we didn't have a cached response return response # Lets update our headers with the headers from the new request: # http://tools.ietf.org/html/draft-ietf-httpbis-p4-conditional-26#section-4.1 # # The server isn't supposed to send headers that would make # the cached body invalid. But... just in case, we'll be sure # to strip out ones we know that might be problmatic due to # typical assumptions. excluded_headers = ["content-length"] cached_response.headers.update( dict( (k, v) for k, v in response.headers.items() if k.lower() not in excluded_headers ) ) # we want a 200 b/c we have content via the cache cached_response.status = 200 # update our cache self.cache.set(cache_url, self.serializer.dumps(request, cached_response)) return cached_response PK!A$__pycache__/__init__.cpython-311.pycnu[ ^i.:dZdZdZdZddlmZddlmZddlm Z dS) zbCacheControl import Interface. Make it easy to import from cachecontrol without long namespaces. z Eric Larsonzeric@ionrock.orgz0.12.6) CacheControl)CacheControlAdapter)CacheControllerN) __doc__ __author__ __email__ __version__wrapperradapterr controllerr/builddir/build/BUILDROOT/alt-python311-pip-21.3.1-4.el8.x86_64/opt/alt/python311/lib/python3.11/site-packages/pip/_vendor/cachecontrol/__init__.pyrs\   !!!!!!((((((''''''''rPK! v99&__pycache__/controller.cpython-311.pycnu[ ^iE7dZddlZddlZddlZddlZddlmZddlmZddl m Z ddl m Z ej eZejdZd ZGd d eZdS) z7 The httplib2 algorithms ported for use with requests. N) parsedate_tz)CaseInsensitiveDict) DictCache) Serializerz9^(([^:/?#]+):)?(//([^/?#]*))?([^?#]*)(\?([^#]*))?(#(.*))?ct|}|d|d|d|d|dfS)zParses a URI using the regex given in Appendix B of RFC 3986. (scheme, authority, path, query, fragment) = parse_uri(uri) r)URImatchgroups)urirs /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_urirsD YYs^^ " " $ $F 1Ivay&)VAYq BBcheZdZdZ d dZedZedZdZdZ d Z d d Z d Z dS)CacheControllerz9An interface to see if request should cached or not. NTc~|tn||_||_|p t|_|pd|_dS)N)i,-)rcache cache_etagsr serializercacheable_status_codes)selfrrr status_codess r__init__zCacheController.__init__"sC%*MY[[[u &$4 &2&J6J###rct|\}}}}}|r|std|z|}|}|sd}|rd||gp|}|dz|z|z}|S)z4Normalize the URL to create a safe key for the cachez(Only absolute URIs are allowed. uri = %s/?z://)r Exceptionlowerjoin) clsrscheme authoritypathqueryfragment request_uri defrag_uris r_urlnormzCacheController._urlnorm*s6?s^^2D% NY NFLMM MOO%%  D7$ 7 7?4 e^i/+= rc,||SN)r/)r'rs r cache_urlzCacheController.cache_url>s||C   rc tdftdftdfddddddddtdfd }|d|dd}i}|dD] }|s|d d }|d } ||\}} n+#t$rt d |Y|wxYw|r| sd||<|r ||d ||<#t$r | rt d |Yt$r%t d||j Y wxYw|S)NTF)NF) max-agez max-stale min-freshno-cacheno-storez no-transformzonly-if-cachedzmust-revalidatepublicprivatezproxy-revalidatezs-maxagez cache-controlz Cache-Control,=rrz,Ignoring unknown cache-control directive: %sz-Missing value for cache-control directive: %sz8Invalid value for cache-control directive %s, must be %s) intgetsplitstripKeyErrorloggerdebug IndexError ValueError__name__) rheadersknown_directives cc_headersretval cc_directiveparts directivetyprequireds rparse_cache_controlz#CacheController.parse_cache_controlBsT{ut%%)+,#$ -d    [['++or2R2RSS &,,S11  L%%''  &&sA..Ea((I  0 ; XX    KYWWW  )h )$(y!  (+E!HNN,<,<(=(=F9%%! N%"LLU!    s*6 C%C*)C*9&D  'E7 *E76E7c||j}td|||j}d|vrtddSd|vr(|ddkrtddS|j|}|td dS|j ||}|st d dS|j d krd }t||St|j}|rd |vrTd|vr4td|j |tddStj}tjt#|d } t%d|| z } td| ||} d} d| vr$| d} td| n]d|vrYt#|d} | Btj| | z }t%d|} td| d|vr#|d} td| d|vr(|d}| |z } td| | | kr8tdtd| | |Sd|vr4td|j |dS)ze Return a cached response if it exists in the cache, otherwise return False. zLooking up "%s" in the cacher6z-Request header has "no-cache", cache bypassedFr4rz1Request header has "max_age" as 0, cache bypassedNzNo cache entry availablez1Cache entry deserialization failed, entry ignoredrzVReturning cached "301 Moved Permanently" response (ignoring date and etag information)dateetagz(Purging cached response: no date or etagz!Ignoring cached response: no datezCurrent age based on date: %iz#Freshness lifetime from max-age: %iexpiresz#Freshness lifetime from expires: %iz+Freshness lifetime from request max-age: %ir5z'Adjusted current age from min-fresh: %iz2The response is "fresh", returning cached responsez%i > %iz4The cached response is "stale" with no etag, purging)r2urlrBrCrPrGrr>rloadswarningstatusrdeletetimecalendartimegmrmax)rrequestr2cc cache_datarespmsgrGnowrR current_ageresp_ccfreshness_lifetimerT expire_time min_freshs rcached_requestzCacheController.cached_requestxs| NN7;//  3Y???  % %go 6 6    LLH I I I5 ??r)}11 LLL M M M5Z^^I..   LL3 4 4 45$$Wj99  NNN O O O5 ;#  7  LL   K%dl33 &//W$$ GHHH !!),,, LL< = = =5ikk|GFO<<==!S4Z((  4kBBB **733   !(!3  LL>@R S S S S' ! !"79#566G"&og66= %(K%8%8" BDVWWW ??!#I  LL=?Q    "  ;I 9 $K LLBK P P P  + + LLM N N N LL$6 D D DK  LLO P P P J  i ( ( (urc ||j}|j||j|}i}|r2t |j}d|vr |d|d<d|vr |d|d<|S)NrSETagz If-None-Matchz last-modifiedz Last-ModifiedzIf-Modified-Since)r2rUrrVrr>rrG)rr^r2ra new_headersrGs rconditional_headersz#CacheController.conditional_headerssNN7;// $$WdjnnY.G.GHH  L)$,77G  /6v O,'))3:?3K /0rc|p|j}|j|vr#td|j|dSt |j}|Fd|vrB|dr(t|dt|krdS| |j}| |}| |j } td| d} d|vrd} tdd|vrd} td | rN|j | r4td |j | | rdSd | d d vrtddS|jrVd|vrRtd|j | |j|||dS|jdkrPtd|j | |j||dSd|vrd|vr^|ddkrRtd|j | |j|||dSd|vr\|drVtd|j | |j|||dSdSdSdS)zc Algorithm for caching requests. This assumes a requests Response object. zStatus code %s not in %sNcontent-lengthz&Updating cache with response from "%s"Fr7TzResponse header has "no-store"zRequest header has "no-store"z0Purging existing cache entry to honor "no-store"*varyr:zResponse header has "Vary: *"rSzCaching due to etag)bodyrzCaching permanant redirectrRr4rz'Caching b/c date exists and max-age > 0rTzCaching b/c of expires header)rrXrBrCrrGisdigitr=lenrPr2rUrr>rYrsetrdumps) rr^responserrrrresponse_headerscc_reqr_r2no_stores rcache_responsezCacheController.cache_responses".!L1L ?"8 8 8 LL*HO=S    F.x/?@@   $444 !12::<<5$%56773t99DD F))'/::  % %&6 7 7NN7;//  =yIII   H LL9 : : :   H LL8 9 9 9  ) y11 ) LLK L L L J  i ( ( (   F "&&vr22 2 2 LL8 9 9 9 F   *: : : LL. / / / JNN4?00(0NN      _ # # LL5 6 6 6 JNN9do&;&;GX&N&N O O O O O ' ' 'B2i=1#4#4 FGGG t44WhT4RR ...#I.LL!@AAAJNN!4?#8#8(QU#8#V#V( '/.rc||j}|j||j|}|s|Sdg|jtfd|j Dd|_ |j ||j |||S)zOn a 304 we will get a new set of headers that we want to update our cached value with, assuming we have one. This should only ever be called when we've sent an ETag and gotten a 304 as the response. roc3RK|]!\}}|v||fV"dSr1)r%).0kvexcluded_headerss r z9CacheController.update_cached_response..ksKAq7799$444A4444rr) r2rUrrVrr>rGupdatedictitemsrXrurv)rr^rwr2cached_responsers @rupdate_cached_responsez&CacheController.update_cached_responseRsNN7;// /// 9R9RSS O--&& $,2244     "% y$/"7"7"Q"QRRRr)NTNN)NN) rF __module__ __qualname____doc__r classmethodr/r2rPrirmr{rrrrrsKOKKKK[&!![!444lmmm^ YYYYv&&&&&rr)rloggingrer[rZ email.utilsrpip._vendor.requests.structuresrrr serializer getLoggerrFrBcompiler robjectrrrrrs  $$$$$$??????!!!!!!  8 $ $bjMNNCCCZZZZZfZZZZZrPK!F"__pycache__/compat.cpython-311.pycnu[ ^i ddlmZn#e$r ddlmZYnwxYw ddlZn#e$rddlZYnwxYw ddlmZn#e$r ddlmZYnwxYw ddl m Z n#e$r ddl m Z YnwxYw e Z dS#e$reZ YdSwxYw))urljoinN) HTTPResponse) is_fp_closed) urllib.parser ImportErrorurlparsecPicklepickle.pip._vendor.requests.packages.urllib3.responserpip._vendor.urllib3.response*pip._vendor.requests.packages.urllib3.utilrpip._vendor.urllib3.utilunicode text_type NameErrorstr/builddir/build/BUILDROOT/alt-python311-pip-21.3.1-4.el8.x86_64/opt/alt/python311/lib/python3.11/site-packages/pip/_vendor/cachecontrol/compat.pyrs\!$$$$$$$!!!        !MMMMM :KKKKKKK:::99999999:6GGGGGGG666555555556IIIIIIIsK  ,,7 AA A AA"A&&A10A1PK!ɕ#__pycache__/wrapper.cpython-311.pycnu[ ^i4ddlmZddlmZ ddZdS))CacheControlAdapter) DictCacheNTc|tn|}|pt}|||||||}|d||d||S)N) cache_etags serializer heuristiccontroller_classcacheable_methodszhttp://zhttps://)rrmount) sesscacherrrr adapter_classr adapters /builddir/build/BUILDROOT/alt-python311-pip-21.3.1-4.el8.x86_64/opt/alt/python311/lib/python3.11/site-packages/pip/_vendor/cachecontrol/wrapper.py CacheControlrsw!=IKKKeE!8%8Mm )+ G JJy'"""JJz7### K)NTNNNNN)rrr rrrrrs^(((((( rPK! ( ( %__pycache__/serialize.cpython-311.pycnu[ ^izddlZddlZddlZddlZddlmZddlmZddlm Z m Z m Z dZ dZ Gdd eZdS) N)msgpack)CaseInsensitiveDict) HTTPResponsepickle text_typecPtj|dS)Nascii)base64 b64decodeencode)bs /builddir/build/BUILDROOT/alt-python311-pip-21.3.1-4.el8.x86_64/opt/alt/python311/lib/python3.11/site-packages/pip/_vendor/cachecontrol/serialize.py_b64_decode_bytesr s  AHHW-- . ..cFt|dS)Nutf8)rdecode)ss r_b64_decode_strrs Q   & &v . ..rc@eZdZd dZdZdZdZdZdZdZ d Z dS) SerializerNc t|j}|/|d}tj||_d|t d|jD|j|j t|j |j |j di}i|d<d|vrx|dd}|D]Z}t|}|j|d}|t|}||d|<[dd t%j|d gS) NF)decode_contentresponsec3XK|]%\}}t|t|fV&dSN)r.0kvs r z#Serializer.dumps..2sH!!59QYq\\9Q<<0!!!!!!r)bodyheadersstatusversionreasonstrictrvary,,scc=4T) use_bin_type)rr$readioBytesIO_fpdictitemsr%r&rr'r(rsplitstripgetjoinrdumps) selfrequestrr#response_headersdatavaried_headersheader header_values rr7zSerializer.dumpssl.x/?@@ <===66D:d++HL  !!=E=M=S=S=U=U!!!$?$,$X_55#?#+#:    W & & &-g6<.sO- - 1Q  !3!3 4- - - - - - rr$r'c3`K|])\}}t||t|n|fV*dSrr^rs rr"z'Serializer._loads_v2..sX  1Q  q}!3!3!3! L      rr)) jsonrHzlib decompressrrCerrorrr1r2rrTrZs r _loads_v2zSerializer._loads_v2sA Z 5 5 < rqs ??????3333333333//////h6h6h6h6h6h6h6h6h6h6rPK!6oKK&__pycache__/heuristics.cpython-311.pycnu[ ^iddlZddlZddlmZmZmZddlmZmZdZddZ dZ Gdde Z Gd d e Z Gd d e ZGd de ZdS)N) formatdate parsedate parsedate_tz)datetime timedeltaz%a, %d %b %Y %H:%M:%S GMTc6|ptj}||zSN)rutcnow)deltadates /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 %<chttj|Sr )rcalendartimegm timetuple)dts r datetime_to_headerrs" hobllnn55 6 66rc eZdZdZdZdZdS) BaseHeuristiccdS)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.warnings +*rciS)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. rrs r update_headerszBaseHeuristic.update_headers!s  rc||}|rM|j|||}||jd|i|S)NWarning)rheadersupdater)rrupdated_headerswarning_header_values r applyzBaseHeuristic.apply*so--h77  K   # #O 4 4 4#'<<#9#9 #/ ''4H(IJJJrN)__name__ __module__ __qualname__rrr&rrr rrsA + + +     rrceZdZdZdZdS) OneDayCachezM Cache the response by providing an expires 1 day in the future. ci}d|jvr_t|jd}ttdt |dd}t ||d<d|d<|S) Nexpiresr )days)r public cache-control)r"rrrrr)rrr"r r-s r rzOneDayCache.update_headers<su H, , ,X-f566D"9!#4#4#48T"1"X;NOOOG!3G! ,-c*|j}d|vriSd|vr|ddkriS|j|jvriSd|vsd|vriStjt |d}t |d}||iStj}td||z }|tj|z }tdt|dz d}||kriS||z} dtj ttj | iS) Nr-r2r1r z last-modifiedr iQ) r"statuscacheable_by_default_statusesrrrrtimemaxminstrftimeTIME_FMTgmtime) rrespr"r last_modifiednow current_ager freshness_lifetimer-s r rzLastModified.update_headershs/,   I g % %'/*Bh*N*NI ;d@ @ @I  O7$B$BI|GFO<<==!'/":;; <=0Iikk!S4Z(( x}555 C I$>$>??  , ,I++4=4;w3G3GHHIIrcdSr r)rrSs r rzLastModified.warningstrN)r'r(r)r3rLrrrrr r=r=XsQ  %%%!JJJ<rr=r )rrM email.utilsrrrrrrQrrobjectrr+r5r=rrr r[s( ;;;;;;;;;;(((((((( & 777FD-"!!!!!=!!!"/////=/////rPK!L !__pycache__/cache.cpython-311.pycnu[ ^i%NdZddlmZGddeZGddeZdS)zb The cache object API for implementing caches. The default is a thread safe in-memory dictionary. )Lockc&eZdZdZdZdZdZdS) BaseCachectNNotImplementedErrorselfkeys /builddir/build/BUILDROOT/alt-python311-pip-21.3.1-4.el8.x86_64/opt/alt/python311/lib/python3.11/site-packages/pip/_vendor/cachecontrol/cache.pygetz BaseCache.get !###ctrrr r values r setz BaseCache.set rrctrrr s r deletezBaseCache.deleterrcdSr)r s r closezBaseCache.closes rN)__name__ __module__ __qualname__rrrrrrr rrsP$$$$$$$$$     rrc(eZdZddZdZdZdZdS) DictCacheNc>t|_|pi|_dSr)rlockdata)r init_dicts r __init__zDictCache.__init__sFF O rc8|j|dSr)r!rr s r rz DictCache.getsy}}S$'''rc~|j5|j||iddddS#1swxYwYdSr)r r!updaters r rz DictCache.set s Y + + I  c5\ * * * + + + + + + + + + + + + + + + + + +s 266c|j5||jvr|j|ddddS#1swxYwYdSr)r r!popr s r rzDictCache.delete$s Y # #di c""" # # # # # # # # # # # # # # # # # #s $9==r)rrrr#rrrrrr rrsU$$$$(((+++#####rrN)__doc__ threadingrobjectrrrrr r,s          ##### #####rPK!4BJJ#__pycache__/adapter.cpython-311.pycnu[ ^ijddlZddlZddlZddlmZddlmZddlmZddl m Z GddeZ dS) N) HTTPAdapter)CacheController) DictCache)CallbackFileWrappercXeZdZddhZ d fd Zd fd Z d fd Zfd ZxZS) CacheControlAdapterPUTDELETENTctt|j|i||tn||_||_|pd|_|pt} | |j|||_dS)N)GET) cache_etags serializer) superr __init__rcache heuristiccacheable_methodsr controller) selfrrcontroller_classrrrargskwcontroller_factory __class__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/adapter.pyrzCacheControlAdapter.__init__s 2!4((14>2>>>$)MY[[[u "!2!>h-@,, JKJ   c l|p|j}|j|vr |j|}n#tj$rd}YnwxYw|r|||dS|j|j |tt|j |fi|}|S)z Send a request. Use the request information to see if it exists in the cache and cache the response if we need to and can. NT) from_cache) rmethodrcached_requestzliberrorbuild_responseheadersupdateconditional_headersrr send)rrequestrr cacheablecached_responseresprs rr(zCacheControlAdapter.send$s &?)? >Y & & '"&/"@"@"I"I: ' ' '"& ' V**7OPT*UUU O " "4?#F#Fw#O#O P P P4u($//4WCCCC s0AAFc> |p|j}|s|j|vr|jr|j|}|jdkrN|j||}||urd}|d||}n|jdkr|j ||net|j tj |jj |||_ |jr&|j fd}t!j|||_t%t&|||}|j|jvr@|jr9|j|j} |j| ||_|S)z Build a response by making a request or using the cache. This will end up calling send and returning a potentially cached response i0TF)decode_contenti-ch|jdkr|jdSdS)Nr) chunk_left_fp_close)rsuper_update_chunk_lengths r_update_chunk_lengthz@CacheControlAdapter.build_response.._update_chunk_lengthns?11333?a// HOO-----0/r)rr rapplystatusrupdate_cached_responseread release_conncache_responserr1 functoolspartialchunkedr4types MethodTyperr r$invalidating_methodsok cache_urlurlrdeleter) rr)responserrr*r+r4r,rBr3rs @rr$z"CacheControlAdapter.build_response9s&?)? 2 gn 99~ :>//99#%% #'/"H"HX###(22!%J  U 333%%'''*C''..wAAAA 3L%6   # 080M-..... 5:4D,h55H1($//>>wQQ >T6 6 647 611'+>>I J  i ( ( (% rc|jtt|dSN)rcloserr )rrs rrHzCacheControlAdapter.closes:  !4((..00000r)NTNNNNrG)FN) __name__ __module__ __qualname__r@rr(r$rH __classcell__)rs@rr r s!8,      *,FJHHHHHHT111111111rr ) r>r;r"pip._vendor.requests.adaptersrrrrr filewrapperrr rrrPs  555555'''''',,,,,,y1y1y1y1y1+y1y1y1y1y1rPK!ֺ __pycache__/_cmd.cpython-311.pycnu[ ^iddlZddlmZddlmZddlmZddlmZddl m Z dZ dZ d Z d d Zed kr edSdS) N)requests)CacheControlAdapter) DictCache)logger)ArgumentParserctjtjtj}tj|dSN)rsetLevelloggingDEBUG StreamHandler addHandler)handlers /builddir/build/BUILDROOT/alt-python311-pip-21.3.1-4.el8.x86_64/opt/alt/python311/lib/python3.11/site-packages/pip/_vendor/cachecontrol/_cmd.py setup_loggingr s9 OGM"""#%%G gcttddd}tj}|d||d||j|_|S)NT) cache_etags serializer heuristiczhttp://zhttps://)rrrSessionmount controllercache_controller)adaptersesss r get_sessionrsk! $$G    DJJy'"""JJz7####.D Krctt}|dd|S)NurlzThe URL to try and cache)help)r add_argument parse_args)parsers rget_argsr$s9   F $>???     rcVt}t}||j}t |j|j|j|j |jrtddStddS)NzCached!z Not cached :() r$rgetrrrcache_responserequestrawcached_requestprint)argsrresps rmainr.$s ::D ==D 88DH  DOOO ((tx@@@ ++DL99 i or__main__r )r pip._vendorr pip._vendor.cachecontrol.adapterrpip._vendor.cachecontrol.cacher#pip._vendor.cachecontrol.controllerrargparserrrr$r.__name__rrr7s @@@@@@444444666666######    ( zDFFFFFrPK!  '__pycache__/filewrapper.cpython-311.pycnu[ ^i .ddlmZGddeZdS))BytesIOc8eZdZdZdZdZdZdZd dZdZ dS) CallbackFileWrapperav Small wrapper around a fp object which will tee everything read into a buffer, and when that file is closed it will execute a callback with the contents of that buffer. All attributes are proxied to the underlying file object. This class uses members with a double underscore (__) leading prefix so as not to accidentally shadow an attribute. cHt|_||_||_dSN)r_CallbackFileWrapper__buf_CallbackFileWrapper__fp_CallbackFileWrapper__callback)selffpcallbacks /builddir/build/BUILDROOT/alt-python311-pip-21.3.1-4.el8.x86_64/opt/alt/python311/lib/python3.11/site-packages/pip/_vendor/cachecontrol/filewrapper.py__init__zCallbackFileWrapper.__init__sYY  "cL|d}t||S)Nr )__getattribute__getattr)r namer s r __getattr__zCallbackFileWrapper.__getattr__s( " "#= > >r4   rc~ |jjduS#t$rYnwxYw |jjS#t$rYnwxYwdS)NF)r r AttributeErrorclosedr s r__is_fp_closedz"CallbackFileWrapper.__is_fp_closed!sm 9<4' '    D  9# #    D  us   - ::cz|jr,||jd|_dSr)r rgetvaluers r_closezCallbackFileWrapper._close2s9 ? 3 OODJ//11 2 2 2rNc|j|}|j||r||Sr)r readrwrite"_CallbackFileWrapper__is_fp_closedrr amtdatas rrzCallbackFileWrapper.read=sQy~~c""       KKMMM rc|j|}|dkr|dkr|S|j||r||S)Ns )r _safe_readrr r!rr"s rr'zCallbackFileWrapper._safe_readEsky##C(( !88K       KKMMM rr) __name__ __module__ __qualname____doc__rrr!rrr'rrrrs}  ### ! ! !"        rrN)iorobjectrr,rrr/sULLLLL&LLLLLrPK!Jy_cmd.pynu[import logging from pip._vendor import requests from pip._vendor.cachecontrol.adapter import CacheControlAdapter from pip._vendor.cachecontrol.cache import DictCache from pip._vendor.cachecontrol.controller import logger from argparse import ArgumentParser def setup_logging(): logger.setLevel(logging.DEBUG) handler = logging.StreamHandler() logger.addHandler(handler) def get_session(): adapter = CacheControlAdapter( DictCache(), cache_etags=True, serializer=None, heuristic=None ) sess = requests.Session() sess.mount("http://", adapter) sess.mount("https://", adapter) sess.cache_controller = adapter.controller return sess def get_args(): parser = ArgumentParser() parser.add_argument("url", help="The URL to try and cache") return parser.parse_args() def main(args=None): args = get_args() sess = get_session() # Make a request to get a response resp = sess.get(args.url) # Turn on logging setup_logging() # try setting the cache sess.cache_controller.cache_response(resp.request, resp.raw) # Now try to get it if sess.cache_controller.cached_request(resp.request): print("Cached!") else: print("Not cached :(") if __name__ == "__main__": main() PK!d compat.pynu[try: from urllib.parse import urljoin except ImportError: from urlparse import urljoin try: import cPickle as pickle except ImportError: import pickle # Handle the case where the requests module has been patched to not have # urllib3 bundled as part of its source. try: from pip._vendor.requests.packages.urllib3.response import HTTPResponse except ImportError: from pip._vendor.urllib3.response import HTTPResponse try: from pip._vendor.requests.packages.urllib3.util import is_fp_closed except ImportError: from pip._vendor.urllib3.util import is_fp_closed # Replicate some six behaviour try: text_type = unicode except NameError: text_type = str PK!Gi adapter.pynu[import types import functools import zlib from pip._vendor.requests.adapters import HTTPAdapter from .controller import CacheController from .cache import DictCache from .filewrapper import CallbackFileWrapper class CacheControlAdapter(HTTPAdapter): invalidating_methods = {"PUT", "DELETE"} def __init__( self, cache=None, cache_etags=True, controller_class=None, serializer=None, heuristic=None, cacheable_methods=None, *args, **kw ): super(CacheControlAdapter, self).__init__(*args, **kw) self.cache = DictCache() if cache is None else cache self.heuristic = heuristic self.cacheable_methods = cacheable_methods or ("GET",) controller_factory = controller_class or CacheController self.controller = controller_factory( self.cache, cache_etags=cache_etags, serializer=serializer ) def send(self, request, cacheable_methods=None, **kw): """ Send a request. Use the request information to see if it exists in the cache and cache the response if we need to and can. """ cacheable = cacheable_methods or self.cacheable_methods if request.method in cacheable: try: cached_response = self.controller.cached_request(request) except zlib.error: cached_response = None if cached_response: return self.build_response(request, cached_response, from_cache=True) # check for etags and add headers if appropriate request.headers.update(self.controller.conditional_headers(request)) resp = super(CacheControlAdapter, self).send(request, **kw) return resp def build_response( self, request, response, from_cache=False, cacheable_methods=None ): """ Build a response by making a request or using the cache. This will end up calling send and returning a potentially cached response """ cacheable = cacheable_methods or self.cacheable_methods if not from_cache and request.method in cacheable: # Check for any heuristics that might update headers # before trying to cache. if self.heuristic: response = self.heuristic.apply(response) # apply any expiration heuristics if response.status == 304: # We must have sent an ETag request. This could mean # that we've been expired already or that we simply # have an etag. In either case, we want to try and # update the cache if that is the case. cached_response = self.controller.update_cached_response( request, response ) if cached_response is not response: from_cache = True # We are done with the server response, read a # possible response body (compliant servers will # not return one, but we cannot be 100% sure) and # release the connection back to the pool. response.read(decode_content=False) response.release_conn() response = cached_response # We always cache the 301 responses elif response.status == 301: self.controller.cache_response(request, response) else: # Wrap the response file with a wrapper that will cache the # response when the stream has been consumed. response._fp = CallbackFileWrapper( response._fp, functools.partial( self.controller.cache_response, request, response ), ) if response.chunked: super_update_chunk_length = response._update_chunk_length def _update_chunk_length(self): super_update_chunk_length() if self.chunk_left == 0: self._fp._close() response._update_chunk_length = types.MethodType( _update_chunk_length, response ) resp = super(CacheControlAdapter, self).build_response(request, response) # See if we should invalidate the cache. if request.method in self.invalidating_methods and resp.ok: cache_url = self.controller.cache_url(request.url) self.cache.delete(cache_url) # Give the request a from_cache attr to let people use it resp.from_cache = from_cache return resp def close(self): self.cache.close() super(CacheControlAdapter, self).close() PK!%m^ heuristics.pynu[import calendar import time from email.utils import formatdate, parsedate, parsedate_tz from datetime import datetime, timedelta TIME_FMT = "%a, %d %b %Y %H:%M:%S GMT" def expire_after(delta, date=None): date = date or datetime.utcnow() return date + delta def datetime_to_header(dt): return formatdate(calendar.timegm(dt.timetuple())) class BaseHeuristic(object): def warning(self, response): """ 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. """ return '110 - "Response is Stale"' def update_headers(self, response): """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. """ return {} def apply(self, response): updated_headers = self.update_headers(response) if updated_headers: response.headers.update(updated_headers) warning_header_value = self.warning(response) if warning_header_value is not None: response.headers.update({"Warning": warning_header_value}) return response class OneDayCache(BaseHeuristic): """ Cache the response by providing an expires 1 day in the future. """ def update_headers(self, response): headers = {} if "expires" not in response.headers: date = parsedate(response.headers["date"]) expires = expire_after(timedelta(days=1), date=datetime(*date[:6])) headers["expires"] = datetime_to_header(expires) headers["cache-control"] = "public" return headers class ExpiresAfter(BaseHeuristic): """ Cache **all** requests for a defined time period. """ def __init__(self, **kw): self.delta = timedelta(**kw) def update_headers(self, response): expires = expire_after(self.delta) return {"expires": datetime_to_header(expires), "cache-control": "public"} def warning(self, response): tmpl = "110 - Automatically cached for %s. Response might be stale" return tmpl % self.delta class LastModified(BaseHeuristic): """ 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. """ cacheable_by_default_statuses = { 200, 203, 204, 206, 300, 301, 404, 405, 410, 414, 501 } def update_headers(self, resp): headers = resp.headers if "expires" in headers: return {} if "cache-control" in headers and headers["cache-control"] != "public": return {} if resp.status not in self.cacheable_by_default_statuses: return {} if "date" not in headers or "last-modified" not in headers: return {} date = calendar.timegm(parsedate_tz(headers["date"])) last_modified = parsedate(headers["last-modified"]) if date is None or last_modified is None: return {} now = time.time() current_age = max(0, now - date) delta = date - calendar.timegm(last_modified) freshness_lifetime = max(0, min(delta / 10, 24 * 3600)) if freshness_lifetime <= current_age: return {} expires = date + freshness_lifetime return {"expires": time.strftime(TIME_FMT, time.gmtime(expires))} def warning(self, resp): return None PK! ߫+caches/__pycache__/__init__.cpython-311.pycnu[ ^iVddlmZddlmZdS)) FileCache) RedisCacheN) file_cacher redis_cacher/builddir/build/BUILDROOT/alt-python311-pip-21.3.1-4.el8.x86_64/opt/alt/python311/lib/python3.11/site-packages/pip/_vendor/cachecontrol/caches/__init__.pyr s/!!!!!!########rPK!2cU U .caches/__pycache__/redis_cache.cpython-311.pycnu[ ^iXFddlmZddlmZddlmZGddeZdS))division)datetime) BaseCachec4eZdZdZdZddZdZdZdZdS) RedisCachec||_dSN)conn)selfr 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/caches/redis_cache.py__init__zRedisCache.__init__ s  c6|j|Sr )r getr keys r rzRedisCache.get sy}}S!!!rNc|s|j||dS|tjz }|j|t ||dSr )r setrutcnowsetexint total_seconds)r rvalueexpiress r rzRedisCache.setsk F IMM#u % % % % % 1 11G IOOCW%:%:%<%>## " "C I  S ! ! ! ! " "rcdS)z?Redis uses connection pooling, no need to close the connection.N)r s r closezRedisCache.closes rr ) __name__ __module__ __qualname__r rrrrr"r!rr rrsw"""FFFF"""      rrN) __future__rrpip._vendor.cachecontrol.cacherrr!rr r(so444444          rPK! ^-caches/__pycache__/file_cache.cpython-311.pycnu[ ^i9ddlZddlZddlmZddlmZddlmZ en#e $re e fZYnwxYwdZ GddeZ d ZdS) N)dedent) BaseCache)CacheControllerctj}|tjtjzz}t tdr|tjz}t tdr|tjz} tj|n#ttf$rYnwxYwtj |||} tj |dS#tj |xYw)N O_NOFOLLOWO_BINARYwb) osO_WRONLYO_CREATO_EXCLhasattrrr removeIOErrorOSErroropenfdopenclose)filenamefmodeflagsfds /builddir/build/BUILDROOT/alt-python311-pip-21.3.1-4.el8.x86_64/opt/alt/python311/lib/python3.11/site-packages/pip/_vendor/cachecontrol/caches/file_cache.py_secure_open_writers KE  RZ") ##Er<   r:   ( W       5% ( (ByT"""   s2BBB5C C!cNeZdZ d dZedZdZdZd Zd Z dS) FileCacheFNc||td ddlm}ddlm}|r|}n1||}n,#t $rt d} t | wxYw||_||_||_ ||_ ||_ dS)Nz/Cannot use use_dir_lock and lock_class togetherr)LockFile) MkdirLockFilez NOTE: In order to use the FileCache you must have lockfile installed. You can install it via pip: pip install lockfile ) ValueErrorlockfiler!lockfile.mkdirlockfiler" ImportErrorr directoryforeverfilemodedirmode lock_class) selfr'r(r)r* use_dir_lockr+r!r"notices r__init__zFileCache.__init__:s  # (>NOO O & ) ) ) ) ) ) < < < < < < &* #%  & & &Ff%% % &"#    $s +)Acrtj|SN)hashlibsha224encode hexdigest)xs rr4zFileCache.encodeas&~ahhjj))33555c||}t|dd|gz}tjj|jg|RS)N)r4listr pathjoinr')r,namehashedpartss r_fnz FileCache._fnesMT""VBQBZ  F8+w|DN3U3333r7c||} t|d5}|cdddS#1swxYwYdS#t$rYdSwxYw)Nrb)r@rreadFileNotFoundError)r,keyr=fhs rgetz FileCache.getlsxx}} dD!! !Rwwyy ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! !!   44 s3AA AA  AA A A#"A#c||} tjtj||jn#t tf$rYnwxYw||5}t|j|j 5}| |dddn #1swxYwYddddS#1swxYwYdSr1) r@r makedirsr;dirnamer*rrr+rr)write)r,rEvaluer=lockrFs rsetz FileCache.setusJxx}}  K--t| < < < <!    D __T " " d#DIt}==                                  sG7AA#"A#;CB8, C8B< <C?B< CCCc||}|js( tj|dS#t$rYdSwxYwdSr1)r@r(r rrD)r,rEr=s rdeletezFileCache.deletes]xx}}|   $$      s4 AA)FrrNN) __name__ __module__ __qualname__r/ staticmethodr4r@rGrNrPr7rrr8s %%%%%%%%N66\6444    r7rcTtj|}||S)z\Return the file cache path based on the URL. This does not ensure the file exists! )r cache_urlr@)url filecacherEs rurl_to_file_pathrZs&  #C ( (C ==  r7)r2r textwraprcacher controllerrrD NameErrorrrrrrZrUr7rr_s ((((((++++ '*+ &&&RQQQQQ QQQhs  ++PK!AXXcaches/redis_cache.pynu[from __future__ import division from datetime import datetime from pip._vendor.cachecontrol.cache import BaseCache class RedisCache(BaseCache): def __init__(self, conn): self.conn = conn def get(self, key): return self.conn.get(key) def set(self, key, value, expires=None): if not expires: self.conn.set(key, value) else: expires = expires - datetime.utcnow() self.conn.setex(key, int(expires.total_seconds()), value) def delete(self, key): self.conn.delete(key) def clear(self): """Helper for clearing all the keys in a database. Use with caution!""" for key in self.conn.keys(): self.conn.delete(key) def close(self): """Redis uses connection pooling, no need to close the connection.""" pass PK!/99caches/file_cache.pynu[import hashlib import os from textwrap import dedent from ..cache import BaseCache from ..controller import CacheController try: FileNotFoundError except NameError: # py2.X FileNotFoundError = (IOError, OSError) def _secure_open_write(filename, fmode): # We only want to write to this file, so open it in write only mode flags = os.O_WRONLY # os.O_CREAT | os.O_EXCL will fail if the file already exists, so we only # will open *new* files. # We specify this because we want to ensure that the mode we pass is the # mode of the file. flags |= os.O_CREAT | os.O_EXCL # Do not follow symlinks to prevent someone from making a symlink that # we follow and insecurely open a cache file. if hasattr(os, "O_NOFOLLOW"): flags |= os.O_NOFOLLOW # On Windows we'll mark this file as binary if hasattr(os, "O_BINARY"): flags |= os.O_BINARY # Before we open our file, we want to delete any existing file that is # there try: os.remove(filename) except (IOError, OSError): # The file must not exist already, so we can just skip ahead to opening pass # Open our file, the use of os.O_CREAT | os.O_EXCL will ensure that if a # race condition happens between the os.remove and this line, that an # error will be raised. Because we utilize a lockfile this should only # happen if someone is attempting to attack us. fd = os.open(filename, flags, fmode) try: return os.fdopen(fd, "wb") except: # An error occurred wrapping our FD in a file object os.close(fd) raise class FileCache(BaseCache): def __init__( self, directory, forever=False, filemode=0o0600, dirmode=0o0700, use_dir_lock=None, lock_class=None, ): if use_dir_lock is not None and lock_class is not None: raise ValueError("Cannot use use_dir_lock and lock_class together") try: from lockfile import LockFile from lockfile.mkdirlockfile import MkdirLockFile except ImportError: notice = dedent( """ NOTE: In order to use the FileCache you must have lockfile installed. You can install it via pip: pip install lockfile """ ) raise ImportError(notice) else: if use_dir_lock: lock_class = MkdirLockFile elif lock_class is None: lock_class = LockFile self.directory = directory self.forever = forever self.filemode = filemode self.dirmode = dirmode self.lock_class = lock_class @staticmethod def encode(x): return hashlib.sha224(x.encode()).hexdigest() def _fn(self, name): # NOTE: This method should not change as some may depend on it. # See: https://github.com/ionrock/cachecontrol/issues/63 hashed = self.encode(name) parts = list(hashed[:5]) + [hashed] return os.path.join(self.directory, *parts) def get(self, key): name = self._fn(key) try: with open(name, "rb") as fh: return fh.read() except FileNotFoundError: return None def set(self, key, value): name = self._fn(key) # Make sure the directory exists try: os.makedirs(os.path.dirname(name), self.dirmode) except (IOError, OSError): pass with self.lock_class(name) as lock: # Write our actual file with _secure_open_write(lock.path, self.filemode) as fh: fh.write(value) def delete(self, key): name = self._fn(key) if not self.forever: try: os.remove(name) except FileNotFoundError: pass def url_to_file_path(url, filecache): """Return the file cache path based on the URL. This does not ensure the file exists! """ key = CacheController.cache_url(url) return filecache._fn(key) PK!0VVcaches/__init__.pynu[from .file_cache import FileCache # noqa from .redis_cache import RedisCache # noqa PK!=Ҳ wrapper.pynu[from .adapter import CacheControlAdapter from .cache import DictCache def CacheControl( sess, cache=None, cache_etags=True, serializer=None, heuristic=None, controller_class=None, adapter_class=None, cacheable_methods=None, ): cache = DictCache() if cache is None else cache adapter_class = adapter_class or CacheControlAdapter adapter = adapter_class( cache, cache_etags=cache_etags, serializer=serializer, heuristic=heuristic, controller_class=controller_class, cacheable_methods=cacheable_methods, ) sess.mount("http://", adapter) sess.mount("https://", adapter) return sess PK!bM%%cache.pynu[""" The cache object API for implementing caches. The default is a thread safe in-memory dictionary. """ from threading import Lock class BaseCache(object): def get(self, key): raise NotImplementedError() def set(self, key, value): raise NotImplementedError() def delete(self, key): raise NotImplementedError() def close(self): pass class DictCache(BaseCache): def __init__(self, init_dict=None): self.lock = Lock() self.data = init_dict or {} def get(self, key): return self.data.get(key, None) def set(self, key, value): with self.lock: self.data.update({key: value}) def delete(self, key): with self.lock: if key in self.data: self.data.pop(key) PK!Z.. __init__.pynu["""CacheControl import Interface. Make it easy to import from cachecontrol without long namespaces. """ __author__ = "Eric Larson" __email__ = "eric@ionrock.org" __version__ = "0.12.6" from .wrapper import CacheControl from .adapter import CacheControlAdapter from .controller import CacheController PK! filewrapper.pynu[from io import BytesIO class CallbackFileWrapper(object): """ Small wrapper around a fp object which will tee everything read into a buffer, and when that file is closed it will execute a callback with the contents of that buffer. All attributes are proxied to the underlying file object. This class uses members with a double underscore (__) leading prefix so as not to accidentally shadow an attribute. """ def __init__(self, fp, callback): self.__buf = BytesIO() self.__fp = fp self.__callback = callback def __getattr__(self, name): # The vaguaries of garbage collection means that self.__fp is # not always set. By using __getattribute__ and the private # name[0] allows looking up the attribute value and raising an # AttributeError when it doesn't exist. This stop thigns from # infinitely recursing calls to getattr in the case where # self.__fp hasn't been set. # # [0] https://docs.python.org/2/reference/expressions.html#atom-identifiers fp = self.__getattribute__("_CallbackFileWrapper__fp") return getattr(fp, name) def __is_fp_closed(self): try: return self.__fp.fp is None except AttributeError: pass try: return self.__fp.closed except AttributeError: pass # We just don't cache it then. # TODO: Add some logging here... return False def _close(self): if self.__callback: self.__callback(self.__buf.getvalue()) # We assign this to None here, because otherwise we can get into # really tricky problems where the CPython interpreter dead locks # because the callback is holding a reference to something which # has a __del__ method. Setting this to None breaks the cycle # and allows the garbage collector to do it's thing normally. self.__callback = None def read(self, amt=None): data = self.__fp.read(amt) self.__buf.write(data) if self.__is_fp_closed(): self._close() return data def _safe_read(self, amt): data = self.__fp._safe_read(amt) if amt == 2 and data == b"\r\n": # urllib executes this read to toss the CRLF at the end # of the chunk. return data self.__buf.write(data) if self.__is_fp_closed(): self._close() return data PK!2`\'__pycache__/filewrapper.cpython-310.pycnu[o ai @s ddlmZGdddeZdS))BytesIOc@sBeZdZdZddZddZddZdd Zdd d Zd dZ d S)CallbackFileWrapperav Small wrapper around a fp object which will tee everything read into a buffer, and when that file is closed it will execute a callback with the contents of that buffer. All attributes are proxied to the underlying file object. This class uses members with a double underscore (__) leading prefix so as not to accidentally shadow an attribute. cCst|_||_||_dSN)r_CallbackFileWrapper__buf_CallbackFileWrapper__fp_CallbackFileWrapper__callback)selffpcallbackr /builddir/build/BUILDROOT/alt-python310-pip-21.3.1-5.el8.x86_64/opt/alt/python310/lib/python3.10/site-packages/pip/_vendor/cachecontrol/filewrapper.py__init__s zCallbackFileWrapper.__init__cCs|d}t||S)Nr)__getattribute__getattr)rnamer r r r __getattr__s zCallbackFileWrapper.__getattr__cCsBz|jjduWStyYnwz|jjWSty YdSw)NF)rr AttributeErrorclosedrr r r __is_fp_closed!s   z"CallbackFileWrapper.__is_fp_closedcCs |jr ||jd|_dSr)rrgetvaluerr r r _close2s zCallbackFileWrapper._closeNcCs,|j|}|j||r||Sr)rreadrwrite"_CallbackFileWrapper__is_fp_closedrramtdatar r r r=s  zCallbackFileWrapper.readcCs@|j|}|dkr|dkr|S|j||r||S)Ns )r _safe_readrrrrrr r r rEs  zCallbackFileWrapper._safe_readr) __name__ __module__ __qualname____doc__r rrrrrr r r r rs   rN)iorobjectrr r r r s PK!IXX __pycache__/_cmd.cpython-310.pycnu[o ai@s|ddlZddlmZddlmZddlmZddlmZddl m Z ddZ d d Z d d Z dd dZedkrttdddd}t}|d||d||j|_|S)NT) cache_etags serializer heuristiczhttp://zhttps://)rrrSessionmount controllercache_controller)adaptersessrrr get_sessions   rcCst}|jddd|S)NurlzThe URL to try and cache)help)r add_argument parse_args)parserrrrget_argssr cCsVt}t}||j}t|j|j|j|j |jr%t ddSt ddS)NzCached!z Not cached :() r rgetrrrcache_responserequestrawcached_requestprint)argsrresprrrmain$s   r)__main__r)r pip._vendorrZ pip._vendor.cachecontrol.adapterrZpip._vendor.cachecontrol.cacherZ#pip._vendor.cachecontrol.controllerrargparserrrr r)__name__rrrrs       PK!-҃PP!__pycache__/cache.cpython-310.pycnu[o ai%@s4dZddlmZGdddeZGdddeZdS)zb The cache object API for implementing caches. The default is a thread safe in-memory dictionary. )Lockc@s,eZdZddZddZddZddZd S) BaseCachecCtNNotImplementedErrorselfkeyr /builddir/build/BUILDROOT/alt-python310-pip-21.3.1-5.el8.x86_64/opt/alt/python310/lib/python3.10/site-packages/pip/_vendor/cachecontrol/cache.pyget z BaseCache.getcCrrrr r valuer r r set rz BaseCache.setcCrrrrr r r deleterzBaseCache.deletecCsdSrr )r r r r closeszBaseCache.closeN)__name__ __module__ __qualname__r rrrr r r r rs  rc@s.eZdZd ddZddZddZdd ZdS) DictCacheNcCst|_|pi|_dSr)rlockdata)r init_dictr r r __init__szDictCache.__init__cCs|j|dSr)rr rr r r r sz DictCache.getcCs<|j|j||iWddS1swYdSr)rrupdaterr r r r s"z DictCache.setcCsR|j||jvr|j|WddSWddS1s"wYdSr)rrpoprr r r r$s  "zDictCache.deleter)rrrrr rrr r r r rs   rN)__doc__ threadingrobjectrrr r r r s PK!~aQQ$__pycache__/__init__.cpython-310.pycnu[o ai.@s8dZdZdZdZddlmZddlmZddlm Z dS) zbCacheControl import Interface. Make it easy to import from cachecontrol without long namespaces. z Eric Larsonzeric@ionrock.orgz0.12.6) CacheControl)CacheControlAdapter)CacheControllerN) __doc__ __author__ __email__ __version__wrapperradapterr controllerrr r /builddir/build/BUILDROOT/alt-python310-pip-21.3.1-5.el8.x86_64/opt/alt/python310/lib/python3.10/site-packages/pip/_vendor/cachecontrol/__init__.pys  PK!H0  "__pycache__/compat.cpython-310.pycnu[o ai@szddlmZWneyddlmZYnwzddlZWn ey+ddlZYnwzddlmZWneyCddlmZYnwzddl m Z Wney[ddl m Z Ynwze Z WdSeymeZ YdSw))urljoinN) HTTPResponse) is_fp_closed) urllib.parser ImportErrorurlparsecPicklepickleZ.pip._vendor.requests.packages.urllib3.responserZpip._vendor.urllib3.responseZ*pip._vendor.requests.packages.urllib3.utilrpip._vendor.urllib3.utilunicode text_type NameErrorstrrr/builddir/build/BUILDROOT/alt-python310-pip-21.3.1-5.el8.x86_64/opt/alt/python310/lib/python3.10/site-packages/pip/_vendor/cachecontrol/compat.pys2         PK!H&%__pycache__/serialize.cpython-310.pycnu[o ai@spddlZddlZddlZddlZddlmZddlmZddlm Z m Z m Z ddZ dd Z Gd d d eZdS) N)msgpack)CaseInsensitiveDict) HTTPResponsepickle text_typecCst|dS)Nascii)base64 b64decodeencode)br /builddir/build/BUILDROOT/alt-python310-pip-21.3.1-5.el8.x86_64/opt/alt/python310/lib/python3.10/site-packages/pip/_vendor/cachecontrol/serialize.py_b64_decode_bytes srcCst|dS)Nutf8)rdecode)sr r r_b64_decode_strsrc@sNeZdZdddZddZddZdd Zd d Zd d ZddZ ddZ dS) SerializerNc Cst|j}|dur|jdd}t||_d|tdd|jD|j|j t |j |j |j di}i|d<d|vra|dd}|D]}t |}|j|d}|durZt |}||d|<qCd d tj|d d gS) NF)decode_contentresponsecs$|] \}}t|t|fVqdSN)r.0kvr r r 2s z#Serializer.dumps..)bodyheadersstatusversionreasonstrictrvary,,scc=4T) use_bin_type)rrreadioBytesIO_fpdictitemsr r!rr"r#rsplitstripgetjoinrdumps) selfrequestrrresponse_headersdatavaried_headersheader header_valuer r rr2s4     zSerializer.dumpscCs|sdSz |dd\}}Wn tyd}Ynw|dddkr(||}d}|dddd}z t|d |||WStyIYdSw) Nr&rscc=0scc==rz _loads_v{})r. ValueErrorrgetattrformatAttributeError)r3r4r6verr r rloadsJs   zSerializer.loadscCsd|divr dS|diD]\}}|j|d|kr"dSq|dd}t|ddd}|dd d kr@|d||dd<zt|}Wnty^t|d }Ynwt d|d d |dS)z`Verify our vary headers match and construct a real urllib3 HTTPResponse object. *r$Nrrr)r6ztransfer-encodingchunkedrF)rpreload_contentr ) r0r-rpoprr)r* TypeErrorr r)r3r4cachedr8valuebody_rawrrr r rprepare_responsehs"    zSerializer.prepare_responsecCdSrr r3r4r6r r r _loads_v0zSerializer._loads_v0cCs0zt|}Wn tyYdSw|||Sr)rrBr=rLr3r4r6rIr r r _loads_v1s   zSerializer._loads_v1c Csz tt|d}Wn ttjfyYdSwt|dd|dd<tdd|dd D|dd<t |dd|dd<tdd|d  D|d <| ||S) Nrrrcsrrrrr r rrs  z'Serializer._loads_v2..rr"css0|]\}}t||durt|n|fVqdSrrSrr r rrs  r$) jsonrBzlib decompressrr=errorrr,r-rrLrQr r r _loads_v2s  zSerializer._loads_v2cCrMrr rNr r r _loads_v3rPzSerializer._loads_v3cCs4z tj|dd}Wn tyYdSw|||S)NF)raw)rrBr=rLrQr r r _loads_v4s   zSerializer._loads_v4r) __name__ __module__ __qualname__r2rBrLrOrRrXrYr[r r r rrs 4& r)r r)rTrU pip._vendorrZpip._vendor.requests.structuresrcompatrrrrrobjectrr r r rs  PK!/&__pycache__/heuristics.cpython-310.pycnu[o ai@sddlZddlZddlmZmZmZddlmZmZdZdddZ ddZ Gd d d e Z Gd d d e Z Gd dde ZGddde ZdS)N) formatdate parsedate parsedate_tz)datetime timedeltaz%a, %d %b %Y %H:%M:%S GMTcCs|pt}||SN)rutcnow)deltadater /builddir/build/BUILDROOT/alt-python310-pip-21.3.1-5.el8.x86_64/opt/alt/python310/lib/python3.10/site-packages/pip/_vendor/cachecontrol/heuristics.py expire_after s r cCstt|Sr)rcalendartimegm timetuple)dtr r r datetime_to_headersrc@s$eZdZddZddZddZdS) BaseHeuristiccCsdS)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 selfresponser r r warnings zBaseHeuristic.warningcCsiS)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 rr r r update_headers!szBaseHeuristic.update_headerscCs@||}|r|j|||}|dur|jd|i|S)NWarning)rheadersupdater)rrZupdated_headersZwarning_header_valuer r r apply*s   zBaseHeuristic.applyN)__name__ __module__ __qualname__rrrr r r r rs rc@seZdZdZddZdS) OneDayCachezM Cache the response by providing an expires 1 day in the future. cCsRi}d|jvr't|jd}ttddt|ddd}t||d<d|d<|S) Nexpiresr )days)r public cache-control)rrr rrr)rrrr r!r r r r<s  zOneDayCache.update_headersN)rrr__doc__rr r r r r 6s r c@s(eZdZdZddZddZddZdS) ExpiresAfterz; Cache **all** requests for a defined time period. cKstdi||_dS)Nr )rr )rkwr r r __init__LszExpiresAfter.__init__cCst|j}t|ddS)Nr%)r!r&)r r r)rrr!r r r rOs zExpiresAfter.update_headerscCsd}||jS)Nz:110 - Automatically cached for %s. Response might be stale)r )rrtmplr r r rSs zExpiresAfter.warningN)rrrr'r*rrr r r r r(Gs  r(c@s(eZdZdZhdZddZddZdS) 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. > i,i-iiiiic Cs|j}d|vr iSd|vr|ddkriS|j|jvriSd|vs%d|vr'iStt|d}t|d}|dus>|dur@iSt}td||}|t|}tdt |dd}||krbiS||} dt t t | iS) Nr!r&r%r z last-modifiedr iQ) rstatuscacheable_by_default_statusesrrrrtimemaxminstrftimeTIME_FMTgmtime) rresprr Z last_modifiednow current_ager freshness_lifetimer!r r r rhs*  zLastModified.update_headerscCsdSrr )rr:r r r rszLastModified.warningN)rrrr'r3rrr r r r r,Xs   r,r)rr4 email.utilsrrrrrr8r robjectrr r(r,r r r r s "PK!UwE E #__pycache__/adapter.cpython-310.pycnu[o ai@s\ddlZddlZddlZddlmZddlmZddlmZddl m Z GdddeZ dS) N) HTTPAdapter)CacheController) DictCache)CallbackFileWrappercs\eZdZddhZ      dfdd Zdfdd Z dfd d Zfd d ZZS)CacheControlAdapterPUTDELETENTc sXtt|j|i||durtn||_||_|pd|_|p t} | |j||d|_dS)N)GET) cache_etags serializer) superr__init__rcache heuristiccacheable_methodsr controller) selfrr controller_classr rrargskwcontroller_factory __class__/builddir/build/BUILDROOT/alt-python310-pip-21.3.1-5.el8.x86_64/opt/alt/python310/lib/python3.10/site-packages/pip/_vendor/cachecontrol/adapter.pyrs   zCacheControlAdapter.__init__c s|p|j}|j|vr3z|j|}Wn tjyd}Ynw|r)|j||ddS|j|j |t t |j |fi|}|S)z Send a request. Use the request information to see if it exists in the cache and cache the response if we need to and can. NT) from_cache) rmethodrcached_requestzliberrorbuild_responseheadersupdateconditional_headersr rsend)rrequestrr cacheablecached_responseresprrrr%$s  zCacheControlAdapter.sendFc s |p|j}|sb|j|vrb|jr|j|}|jdkr4|j||}||ur'd}|jdd||}n.|jdkrA|j ||n!t |j t |jj |||_ |jrb|jfdd}t|||_tt|||}|j|jvr|jr|j|j} |j| ||_|S)z Build a response by making a request or using the cache. This will end up calling send and returning a potentially cached response i0TF)decode_contenti-cs"|jdkr|jdSdS)Nr) chunk_left_fp_closersuper_update_chunk_lengthrr_update_chunk_lengthns z@CacheControlAdapter.build_response.._update_chunk_length)rrrapplystatusrupdate_cached_responseread release_conncache_responserr, functoolspartialchunkedr1types MethodTyper rr!invalidating_methodsok cache_urlurlrdeleter) rr&responserrr'r(r1r)r?rr/rr!9sB        z"CacheControlAdapter.build_responsecs|jtt|dSN)rcloser rr.rrrrDs zCacheControlAdapter.close)NTNNNNrC)FN) __name__ __module__ __qualname__r=rr%r!rD __classcell__rrrrr sJr) r;r8rZpip._vendor.requests.adaptersrrrrr filewrapperrrrrrrs    PK!&#__pycache__/wrapper.cpython-310.pycnu[o ai@s4ddlmZddlmZ       dddZdS))CacheControlAdapter) DictCacheNTc CsJ|durtn|}|p t}|||||||d}|d||d||S)N) cache_etags serializer heuristiccontroller_classcacheable_methodszhttp://zhttps://)rrmount) sesscacherrrr adapter_classradapterr/builddir/build/BUILDROOT/alt-python310-pip-21.3.1-5.el8.x86_64/opt/alt/python310/lib/python3.10/site-packages/pip/_vendor/cachecontrol/wrapper.py CacheControls   r)NTNNNNN)r rr rrrrrrs PK!NKD&__pycache__/controller.cpython-310.pycnu[o aiE7@sdZddlZddlZddlZddlZddlmZddlmZddl m Z ddl m Z e eZedZd d ZGd d d eZdS) z7 The httplib2 algorithms ported for use with requests. N) parsedate_tz)CaseInsensitiveDict) DictCache) Serializerz9^(([^:/?#]+):)?(//([^/?#]*))?([^?#]*)(\?([^#]*))?(#(.*))?cCs0t|}|d|d|d|d|dfS)zParses a URI using the regex given in Appendix B of RFC 3986. (scheme, authority, path, query, fragment) = parse_uri(uri) r)URImatchgroups)urir r/builddir/build/BUILDROOT/alt-python310-pip-21.3.1-5.el8.x86_64/opt/alt/python310/lib/python3.10/site-packages/pip/_vendor/cachecontrol/controller.py parse_uris"rc@s^eZdZdZ dddZeddZedd Zd d Zd d Z ddZ dddZ ddZ dS)CacheControllerz9An interface to see if request should cached or not. NTcCs4|durtn||_||_|pt|_|pd|_dS)N)i,-)rcache cache_etagsr serializercacheable_status_codes)selfrrr status_codesrrr__init__"s zCacheController.__init__c Csht|\}}}}}|r |std||}|}|sd}|r(d||gp)|}|d||}|S)z4Normalize the URL to create a safe key for the cachez(Only absolute URIs are allowed. uri = %s/?z://)r Exceptionlowerjoin) clsrscheme authoritypathqueryfragment request_uri defrag_urirrr_urlnorm*s zCacheController._urlnormcCs ||SN)r*)r"rrrr cache_url>s zCacheController.cache_urlc Cstdftdftdfddddddddtdfd }|d|dd}i}|dD]c}|s/q(|d d }|d }z||\}} WntyRtd |Yq(w|rW| s[d||<|rz ||d ||<Wq(tyz| rxtd |Yq(tytd||j Yq(wq(|S)NTF)NF) max-agez max-stale min-freshno-cacheno-storez no-transformzonly-if-cachedzmust-revalidatepublicprivatezproxy-revalidatezs-maxagez cache-controlz Cache-Control,=rrz,Ignoring unknown cache-control directive: %sz-Missing value for cache-control directive: %sz8Invalid value for cache-control directive %s, must be %s) intgetsplitstripKeyErrorloggerdebug IndexError ValueError__name__) rheadersknown_directives cc_headersretval cc_directiveparts directivetyprequiredrrrparse_cache_controlBs^      z#CacheController.parse_cache_controlcCs&||j}td|||j}d|vrtddSd|vr.|ddkr.tddS|j|}|dur?td dS|j ||}|sOt d dS|j d kr]d }t||St |j}|rhd |vr~d|vrwtd|j |tddSt}tt|d } td|| } td| ||} d} d| vr| d} td| n d|vrt|d} | durt| | }td|} td| d|vr|d} td| d|vr|d}| |7} td| | | krtdtd| | |Sd|vrtd|j |dS)ze Return a cached response if it exists in the cache, otherwise return False. zLooking up "%s" in the cacher/z-Request header has "no-cache", cache bypassedFr-rz1Request header has "max_age" as 0, cache bypassedNzNo cache entry availablez1Cache entry deserialization failed, entry ignoredrzVReturning cached "301 Moved Permanently" response (ignoring date and etag information)dateetagz(Purging cached response: no date or etagz!Ignoring cached response: no datezCurrent age based on date: %iz#Freshness lifetime from max-age: %iexpiresz#Freshness lifetime from expires: %iz+Freshness lifetime from request max-age: %ir.z'Adjusted current age from min-fresh: %iz2The response is "fresh", returning cached responsez%i > %iz4The cached response is "stale" with no etag, purging)r,urlr;r<rIr@rr7rloadswarningstatusrdeletetimecalendartimegmrmax)rrequestr,cc cache_datarespmsgr@nowrJ current_ageresp_ccfreshness_lifetimerL expire_time min_freshrrrcached_requestxsz                          zCacheController.cached_requestcCs`||j}|j||j|}i}|r.t|j}d|vr$|d|d<d|vr.|d|d<|S)NrKETagz If-None-Matchz last-modifiedz Last-ModifiedzIf-Modified-Since)r,rMrrNrr7rr@)rrVr,rY new_headersr@rrrconditional_headerss    z#CacheController.conditional_headersc Cs|p|j}|j|vrtd|j|dSt|j}|dur3d|vr3|dr3t|dt|kr3dS| |j}| |}| |j } td| d} d|vrWd} tdd|vrbd} td | ru|j | rutd |j | | rydSd | d d vrtddS|jrd|vrtd|j | |jj|||ddS|jdkrtd|j | |j||dSd|vrd|vr|ddkrtd|j | |jj|||ddSd|vr|drtd|j | |jj|||ddSdSdSdS)zc Algorithm for caching requests. This assumes a requests Response object. zStatus code %s not in %sNcontent-lengthz&Updating cache with response from "%s"Fr0TzResponse header has "no-store"zRequest header has "no-store"z0Purging existing cache entry to honor "no-store"*varyr3zResponse header has "Vary: *"rKzCaching due to etag)bodyrzCaching permanant redirectrJr-rz'Caching b/c date exists and max-age > 0rLzCaching b/c of expires header)rrPr;r<rr@isdigitr6lenrIr,rMrr7rQrsetrdumps) rrVresponserhrrresponse_headerscc_reqrWr,no_storerrrcache_responsesn                    zCacheController.cache_responsecsv||j}|j||j|}|s|Sdg|jtfdd|j Dd|_ |j ||j |||S)zOn a 304 we will get a new set of headers that we want to update our cached value with, assuming we have one. This should only ever be called when we've sent an ETag and gotten a 304 as the response. rec3s(|]\}}|vr||fVqdSr+)r ).0kvexcluded_headersrr ks z9CacheController.update_cached_response..r) r,rMrrNrr7r@updatedictitemsrPrkrl)rrVrmr,cached_responserrurupdate_cached_responseRs    z&CacheController.update_cached_response)NTNN)NN) r? __module__ __qualname____doc__r classmethodr*r,rIrardrqr|rrrrrs   6o  [r)rloggingrerSrR email.utilsrZpip._vendor.requests.structuresrrr serializer getLoggerr?r;compiler robjectrrrrrs       PK!BQQ.caches/__pycache__/redis_cache.cpython-310.pycnu[o aiX@s8ddlmZddlmZddlmZGdddeZdS))division)datetime) BaseCachec@s>eZdZddZddZdddZdd Zd d Zd d ZdS) RedisCachecCs ||_dSN)conn)selfrr /builddir/build/BUILDROOT/alt-python310-pip-21.3.1-5.el8.x86_64/opt/alt/python310/lib/python3.10/site-packages/pip/_vendor/cachecontrol/caches/redis_cache.py__init__ s zRedisCache.__init__cCs |j|Sr)rgetrkeyr r r r s zRedisCache.getNcCs>|s |j||dS|t}|j|t||dSr)rsetrutcnowsetexint total_seconds)rrvalueexpiresr r r rs zRedisCache.setcCs|j|dSr)rdeleter r r r rszRedisCache.deletecCs |jD]}|j|qdS)zIHelper for clearing all the keys in a database. Use with caution!N)rkeysrr r r r clearszRedisCache.clearcCsdS)z?Redis uses connection pooling, no need to close the connection.Nr )rr r r closeszRedisCache.closer) __name__ __module__ __qualname__r r rrrrr r r r rs  rN) __future__rrZpip._vendor.cachecontrol.cacherrr r r r s  PK!wYsC C -caches/__pycache__/file_cache.cpython-310.pycnu[o ai9@s|ddlZddlZddlmZddlmZddlmZzeWn e y+e e fZYnwddZ Gdd d eZ d d ZdS) N)dedent) BaseCache)CacheControllerc Cstj}|tjtjBO}ttdr|tjO}ttdr|tjO}zt|Wn tt fy1Ynwt |||}zt |dWSt |)N O_NOFOLLOWO_BINARYwb) osO_WRONLYO_CREATO_EXCLhasattrrrremoveIOErrorOSErroropenfdopenclose)filenamefmodeflagsfdr/builddir/build/BUILDROOT/alt-python310-pip-21.3.1-5.el8.x86_64/opt/alt/python310/lib/python3.10/site-packages/pip/_vendor/cachecontrol/caches/file_cache.py_secure_open_writes"     rc@sLeZdZ     dddZeddZd d Zd d Zd dZddZ dS) FileCacheFNc Cs|dur |dur tdzddlm}ddlm}Wnty)td} t| w|r/|}n|dur5|}||_||_||_ ||_ ||_ dS)Nz/Cannot use use_dir_lock and lock_class togetherr)LockFile) MkdirLockFilez NOTE: In order to use the FileCache you must have lockfile installed. You can install it via pip: pip install lockfile ) ValueErrorlockfilerlockfile.mkdirlockfiler ImportErrorr directoryforeverfilemodedirmode lock_class) selfr$r%r&r' use_dir_lockr(rrnoticerrr__init__:s(     zFileCache.__init__cCst|SN)hashlibsha224encode hexdigest)xrrrr0aszFileCache.encodecCs6||}t|dd|g}tjj|jg|RS)N)r0listr pathjoinr$)r)namehashedpartsrrr_fnes z FileCache._fncCsZ||}zt|d }|WdWS1swYWdSty,YdSw)Nrb)r:rreadFileNotFoundError)r)keyr7fhrrrgetls  ( z FileCache.getc Cs||}z ttj||jWn ttfyYnw||-}t |j|j  }| |Wdn1s;wYWddSWddS1sSwYdSr-) r:r makedirsr5dirnamer'rrr(rr&write)r)r>valuer7lockr?rrrsetus   "z FileCache.setcCs:||}|jszt|WdStyYdSwdSr-)r:r%r rr=)r)r>r7rrrdeletes  zFileCache.delete)FrrNN) __name__ __module__ __qualname__r, staticmethodr0r:r@rFrGrrrrr8s '  rcCst|}||S)z\Return the file cache path based on the URL. This does not ensure the file exists! )r cache_urlr:)url filecacher>rrrurl_to_file_paths  rO)r.r textwraprcacher controllerrr= NameErrorrrrrrOrrrrs     ) TPK!גoQQ+caches/__pycache__/__init__.cpython-310.pycnu[o aiV@sddlmZddlmZdS)) FileCache) RedisCacheN) file_cacher redis_cacherrr/builddir/build/BUILDROOT/alt-python310-pip-21.3.1-5.el8.x86_64/opt/alt/python310/lib/python3.10/site-packages/pip/_vendor/cachecontrol/caches/__init__.pys PK!ȽZ serialize.pynu[PK!omE7E7 controller.pynu[PK!A$qS__pycache__/__init__.cpython-311.pycnu[PK! v99&gV__pycache__/controller.cpython-311.pycnu[PK!F"f__pycache__/compat.cpython-311.pycnu[PK!ɕ#Z__pycache__/wrapper.cpython-311.pycnu[PK! ( ( %__pycache__/serialize.cpython-311.pycnu[PK!6oKK&__pycache__/heuristics.cpython-311.pycnu[PK!L !__pycache__/cache.cpython-311.pycnu[PK!4BJJ#__pycache__/adapter.cpython-311.pycnu[PK!ֺ __pycache__/_cmd.cpython-311.pycnu[PK!  '__pycache__/filewrapper.cpython-311.pycnu[PK!Jy _cmd.pynu[PK!d Ecompat.pynu[PK!Gi 5adapter.pynu[PK!%m^ )heuristics.pynu[PK! ߫+9caches/__pycache__/__init__.cpython-311.pycnu[PK!2cU U .~;caches/__pycache__/redis_cache.cpython-311.pycnu[PK! ^-1Ecaches/__pycache__/file_cache.cpython-311.pycnu[PK!AXXd]caches/redis_cache.pynu[PK!/99acaches/file_cache.pynu[PK!0VV~qcaches/__init__.pynu[PK!=Ҳ rwrapper.pynu[PK!bM%%ucache.pynu[PK!Z.. _x__init__.pynu[PK! yfilewrapper.pynu[PK!2`\'__pycache__/filewrapper.cpython-310.pycnu[PK!IXX __pycache__/_cmd.cpython-310.pycnu[PK!-҃PP!__pycache__/cache.cpython-310.pycnu[PK!~aQQ$8__pycache__/__init__.cpython-310.pycnu[PK!H0  "ݝ__pycache__/compat.cpython-310.pycnu[PK!H&%O__pycache__/serialize.cpython-310.pycnu[PK!/&O__pycache__/heuristics.cpython-310.pycnu[PK!UwE E #=__pycache__/adapter.cpython-310.pycnu[PK!&#__pycache__/wrapper.cpython-310.pycnu[PK!NKD&__pycache__/controller.cpython-310.pycnu[PK!BQQ.caches/__pycache__/redis_cache.cpython-310.pycnu[PK!wYsC C -caches/__pycache__/file_cache.cpython-310.pycnu[PK!גoQQ+/caches/__pycache__/__init__.cpython-310.pycnu[PK''<