File: //usr/local/lib/python3.10/dist-packages/pip/_internal/network/__pycache__/download.cpython-310.pyc
o
��h�1 � @ s� d Z ddlmZ ddlZddlZddlZddlZddlm Z m
Z
ddlmZ ddl
mZ ddlmZ ddlmZ dd lmZ dd
lmZ ddlmZ ddlmZ dd
lmZmZ ddlm Z m!Z! ddl"m#Z# ddl$m%Z% ddl&m'Z'm(Z( ddl)m*Z*m+Z+ ddl,m-Z-m.Z.m/Z/ ddl0m1Z1m2Z2m3Z3 e�4e5�Z6d5dd�Z7d6dd�Z8 d7d8d%d&�Z9d9d)d*�Z:d:d-d.�Z;d;d/d0�Z<eG d1d2� d2��Z=G d3d4� d4�Z>dS )<z(Download files with progress indicators.� )�annotationsN)�Iterable�Mapping)� dataclass)�
HTTPStatus)�BinaryIO)�PreparedRequest)�Response)�HTTPResponse)�HTTPHeaderDict)�ReadTimeoutError)�BarType�get_download_progress_renderer)�IncompleteDownloadError�NetworkConnectionError)�PyPI)�Link)�
SafeFileCache�
is_from_cache)�CacheControlAdapter�
PipSession)�HEADERS�raise_for_status�response_chunks)�format_size�redact_auth_from_url�splitext�respr �return�
int | Nonec
C s, zt | jd �W S tttfy Y d S w )N�content-length)�int�headers�
ValueError�KeyError� TypeError�r � r'