
    *#he                        d Z ddlZddlZddlZddlZddlZddlZddlZddlZddl	Z	ddl
Z
ddlZddlmZmZ ddlmZ ddlmZ ddlmZ ddlmZmZmZmZmZ ddlmZmZ ddlZddlZddl Z dd	lm!Z! dd
l"m#Z# ddl$m%Z%m&Z& ddl'm(Z( ddl$m)Z) ddl*m+Z+ ddl,m-Z-  e)j\                  e/      Z0dZ1 ede2e      Z3dPdeeee2f      de2fdZ4de2de5fdZ6de2de5fdZ7de2de5fdZ8de3de3fdZ9dQde2de2de2fdZ:	 dRde2de2dee jv                  e<f   fd Z=dSde2d!e2d"ee2   de2fd#Z>d$e2d%e2de2fd&Z?d'e2de2fd(Z@dPd)ZA	 dPde2fd*ZBdPd+eee2eCf      de2fd,ZD	 dTd-e2d.eee2e5f      d/eee2e5f      deCfd0ZE G d1 d2eF      ZGdPd3ee2   fd4ZHdde j                  j                  ddd5dfd6eeK   d7eeC   d8ee j                  j                     d9eeeL      d:eLd;eMd<eMfd=ZN	 	 	 	 dUd>e2d-e2d:eLd;eMd<eMd?eMde jv                  fd@ZOdPdAZP G dB dCej                  j                        ZRdVdDZSdWdEZTdWdFZU	 dXdGZV	 dYde jv                  fdHZW	 dTd-e2d.eee2e5f      d/eee2e5f      dee2   fdIZX	 	 	 	 	 	 	 	 	 	 	 	 	 	 dZde2fdJZYdK ZZdL Z[dM Z\dNej                  fdOZ^y)[z
Utilities for working with the local dataset cache.
This file is adapted from the AllenNLP library at https://github.com/allenai/allennlp
Copyright by the AllenNLP authors.
    N)closingcontextmanager)partial)sha256)Path)ListOptionalTypeTypeVarUnion)urljoinurlparse)HfFolder)version   )__version__config)DownloadConfig   )logging)ExtractManager)FileLock.incompleteThf_modules_cachereturnc                    | | nt         j                  } t        |       } | t        j                  vrt        j                  j                  |        t        j                  | d       t        j                  j                  t        j                  j                  | d            s6t        t        j                  j                  | d      d      5  	 ddd       | S | S # 1 sw Y   | S xY w)z
    Add hf_modules_cache to the python path.
    By default hf_modules_cache='~/.cache/huggingface/modules'.
    It can also be set with the environment variable HF_MODULES_CACHE.
    This is used to add modules such as `datasets_modules`
    NTexist_okz__init__.pyw)r   HF_MODULES_CACHEstrsyspathappendosmakedirsexistsjoinopen)r   s    V/var/www/html/sandstorm/venv/lib/python3.12/site-packages/datasets/utils/file_utils.pyinit_hf_modulesr,   -   s     ,<+G'VMdMd+,sxx'()
$t4ww~~bggll+;]KLbggll#3]CSI s   CC'url_or_filenamec                     t        |       j                  dk7  xr6 t        j                  j	                  t        |       j                  dz          S N z:/r   schemer&   r$   ismountr-   s    r+   is_remote_urlr5   @   s?    O$++r1r"''//(SbJcJjJjmqJq:r6rr    c                     t        |       j                  dk(  xs5 t        j                  j	                  t        |       j                  dz         S r/   r1   r4   s    r+   is_local_pathr8   D   s=     O$++r1mRWW__XoE^EeEehlEl5mmr6   c                 v    t        |       j                  dk(  xr  t        j                  j	                  |        S )Nr0   )r   r2   r&   r$   isabsr4   s    r+   is_relative_pathr;   K   s-    O$++r1X"''--:X6XXr6   r$   c           	          t         j                  j                  t         j                  j                  t         j                  j	                  t        |                         }t        | t              rt        |      S |S )z'Convert relative path to absolute path.)r&   r$   abspath
expanduser
expandvarsr"   
isinstancer   )r$   abs_path_strs     r+   relative_to_absolute_pathrB   O   sO    77??277#5#5bgg6H6HT6S#TUL!+D$!74I\Ir6   
identifierfilenamec                     |r#|rt         j                  nt         j                  }n"|rt         j                  nt         j                  }dj                  || |f      S N/)r   "CLOUDFRONT_DATASETS_DISTRIB_PREFIXS3_DATASETS_BUCKET_PREFIX!CLOUDFRONT_METRICS_DISTRIB_PREFIXS3_METRICS_BUCKET_PREFIXr)   )rC   rD   use_cdndatasetendpoints        r+   hf_bucket_urlrO   U   sE    @G6<<VMmMm?F6;;FLkLk88Xz8455r6   c                 6    t        t        | |||      |      S )N)rC   rD   rL   rM   )max_retries)	http_headrO   )rC   rD   rL   rM   rQ   s        r+   
head_hf_s3rS   ]   s#     hY`a r6   namerevisionc                     t        j                  t              j                  rdnt        }|xs |}|r"t        j
                  j                  || |      S t        j                  j                  || |      S )Nmain)rU   r$   rT   )r   parser   is_devreleaser   REPO_DATASETS_URLformatREPO_METRICS_URL)r$   rT   rM   rU   default_revisions        r+   hf_github_urlr^   f   sg    !({!;!I!Iv{++H''..tRV.WW&&--xdQU-VVr6   	base_name	pathnamesc                     t        |       rt        j                  | gd |D         S t        | g| j	                         S )Nc              3      K   | ]<  }t        |      j                  t        j                  d       j	                  d        > ywrG   N)r"   replacer&   seplstrip).0pathnames     r+   	<genexpr>z#url_or_path_join.<locals>.<genexpr>q   s2     *t^f3x=+@+@+M+T+TUX+Y*ts   AA)r5   	posixpathr)   r   as_posix)r_   r`   s     r+   url_or_path_joinrl   o   s>    Y~~iu*tjs*tuuI*	*3355r6   url_or_pathc                 ~    t        |       r| d | j                  d       S t        j                  j	                  |       S rF   )r5   rindexr&   r$   dirname)rm   s    r+   url_or_path_parentrq   v   s6    [!4[//455ww{++r6   c                     | j                  d      }t        |      }|j                         }|r2|j                  d      }t        |      }|d|j                         z   z  }| j                  d      r|dz  }|S )a  
    Convert `url` into a hashed filename in a repeatable way.
    If `etag` is specified, append its hash to the url's, delimited
    by a period.
    If the url ends with .h5 (Keras HDF5 weights) adds '.h5' to the name
    so that TF 2.0 can identify it as a HDF5 file
    (see https://github.com/tensorflow/tensorflow/blob/00fad90125b18b80fe054de1055770cfb8fe4ba3/tensorflow/python/keras/engine/network.py#L1380)
    utf-8.z.py)encoder   	hexdigestendswith)urletag	url_bytesurl_hashrD   
etag_bytes	etag_hashs          r+   hash_url_to_filenamer~   }   sx     

7#Ii H!!#H[[)
:&	C)--///
||EEOr6   c                    |t        di |}|j                  xs t        j                  }t	        |t
              rt        |      }t	        | t
              rt        |       } t        |       rt        | ||j                  |j                  |j                  |j                  |j                  |j                  |j                  |j                   |j"                  |j$                  |j&                        }nKt(        j*                  j-                  |       r| }n)t/        |       rt1        d|  d      t3        d|  d      ||S |j4                  r1t7        |j                        j9                  ||j:                        }|S )	a  
    Given something that might be a URL (or might be a local path),
    determine which. If it's a URL, download the file and cache it, and
    return the path to the cached file. If it's already a local path,
    make sure the file exists and then return the path.

    Return:
        Local path (string)

    Raises:
        FileNotFoundError: in case of non-recoverable file
            (non-existent or no cache on disk)
        ConnectionError: in case of unreachable url
            and no cache on disk
        ValueError: if it couldn't parse the url or filename correctly
        requests.exceptions.ConnectionError: in case of internet connection issue
    )	cache_dirforce_downloadproxiesresume_download
user_agentlocal_files_onlyuse_etagrQ   tokenignore_url_paramsstorage_optionsdownload_desczLocal file z doesn't existzunable to parse z as a URL or as a local path)r   )force_extract )r   r   r   DOWNLOADED_DATASETS_PATHr@   r   r"   r5   get_from_cacher   r   r   r   r   r   rQ   r   r   r   r   r&   r$   r(   r8   FileNotFoundError
ValueErrorextract_compressed_filer   extractr   )r-   download_configdownload_kwargsr   output_paths        r+   cached_pathr      se   , (;?;))LV-L-LI)T"	N	/4(o._%$*99#+++;;&11,==$--'33!''-??+;;)77
 
	(%		'+o->n MNN +O+<<XYZZ..$/H/HIQQ'D'D R 
 r6   r   c                 x   dt          }|dt        j                   z  }|dt        j                    z  }|dt        j                   z  }t        j
                  r|dt        j                   z  }t        j                  r|dt        j                   z  }t        j                  r|dt        j                   z  }t        j                  r|dt        j                   z  }t        | t              r.|d	d	j                  d
 | j!                         D               z  }|S t        | t"              r|d	| z   z  }|S )Nz	datasets/z	; python/z; huggingface_hub/z
; pyarrow/z; torch/z; tensorflow/z; jax/z; apache_beam/z; c              3   0   K   | ]  \  }}| d |   ywrc   r   )rg   kvs      r+   ri   z*get_datasets_user_agent.<locals>.<genexpr>   s     GDAqs!A3ZGs   )r   r   
PY_VERSIONhuggingface_hubPYARROW_VERSIONTORCH_AVAILABLETORCH_VERSIONTF_AVAILABLE
TF_VERSIONJAX_AVAILABLEJAX_VERSIONBEAM_AVAILABLEBEAM_VERSIONr@   dictr)   itemsr"   )r   uas     r+   get_datasets_user_agentr      s6   [M	"BIf''(
))B::;
<<BJv--.
//B
--.//
f//011
v))*++
v22344*d#
499GJ4D4D4FGGHII I 
J	$
dZIr6   rx   r   use_auth_tokenc                    |dk7  r t        j                  d| dt               |}i }| j                  t        j
                        r8|du rd}n't        |t              r|}nt        j                         }|rd| |d<   |S )zHandle the HF authentication
deprecated'use_auth_token' was deprecated in favor of 'token' in version 2.14.0 and will be removed in 3.0.0.
You can remove this warning by passing 'token=
' instead.FNzBearer authorization)
warningswarnFutureWarning
startswithr   HF_ENDPOINTr@   r"   r   	get_token)rx   r   r   headerss       r+   "get_authentication_headers_for_urlr      s     %==K<LJX	

 G
~~f(()E>Es#E&&(E)0'8GO$Nr6   c                       e Zd Zy)OfflineModeIsEnabledN)__name__
__module____qualname__r   r6   r+   r   r     s    r6   r   msgc                 b    t         j                  rt        | d      dt        |       z         y)zaRaise an OfflineModeIsEnabled error (subclass of ConnectionError) if HF_DATASETS_OFFLINE is True.NzOffline mode is enabled.zOffline mode is enabled. )r   HF_DATASETS_OFFLINEr   r"   )r   s    r+   !_raise_if_offline_mode_is_enabledr     s>    !!"*-+&
 	
;VY\]`Ya;a
 	
 "r6         ?	func_argsfunc_kwargs
exceptionsstatus_codesrQ   base_wait_timemax_wait_timec           	      4   |xs d}|xs i }d}	 	  | |i |S # |$ rx}	||k\  s|r|	j                   j                  |vr|	t        ||d|z  z        }
t        j	                  |  d|
 d||z   d       t        j                  |
       |dz  }Y d }	~	nd }	~	ww xY w)Nr   r   r   z timed out, retrying in zs... []r   )responsestatus_codeminloggerinfotimesleep)funcr   r   r   r   rQ   r   r   retryerr
sleep_times              r+   _retryr     s     RI#KE
		2k22 	#9Q9QYe9e	 E0IJ
tf$<ZLuU`O`Naabcd

:&
	 s    BA.BBmethodtimeoutc           	         t        d|        d\  }}|s2|dz  }	 t        j                  d| j                         ||d|}	d}|s2	S # t        j                  j
                  t        j                  j                  f$ r\}
||kD  r|
t        j                  |  d| d||z   d       t        ||d	|dz
  z  z        }t        j                  |       Y d
}
~
d
}
~
ww xY w)a  Wrapper around requests to retry in case it fails with a ConnectTimeout, with exponential backoff.

    Note that if the environment variable HF_DATASETS_OFFLINE is set to 1, then a OfflineModeIsEnabled error is raised.

    Args:
        method (str): HTTP method, such as 'GET' or 'HEAD'.
        url (str): The URL of the resource to fetch.
        max_retries (int): Maximum number of retries, defaults to 0 (no retries).
        base_wait_time (float): Duration (in seconds) to wait before retrying the first time. Wait time between
            retries then grows exponentially, capped by max_wait_time.
        max_wait_time (float): Maximum amount of time between two retries, in seconds.
        **params (additional keyword arguments): Params to pass to :obj:`requests.request`.
    Tried to reach )r   Fr   )r   rx   r   Tz request to z timed out, retrying... [r   r   Nr   )r   requestsrequestupperr   ConnectTimeoutConnectionErrorr   r   r   r   r   )r   rx   rQ   r   r   r   paramstriessuccessr   r   r   s               r+   _request_with_retryr   -  s    , &u&=>NE7
		'''bv||~3PWb[abHG	  O ##22H4G4G4W4WX 	'{"	vhl3%7PQVWbQbPccdef uqyAQ0QR


:&&	's   )A
 
7CACCc                     t        d|         t        j                  | |      \  }}}t        |      dkD  rt	        d|       |j                  |d         S )Nr   r   r   z=HEAD can be called with at most one path but was called with r   )r   fsspecget_fs_token_pathslenr   r   )rx   r   fs_pathss        r+   fsspec_headr   T  s\    %u&=>,,S/RLB5
5zA~XY^X_`aa7758r6   c                         e Zd Zd fd	Z xZS )TqdmCallbackc                 B    t        |   |g|i | t        | _        y N)super__init__r   _tqdm)selftqdm_kwargsargskwargs	__class__s       r+   r   zTqdmCallback.__init__]  s!    6t6v6
r6   r   )r   r   r   r   __classcell__)r   s   @r+   r   r   \  s     r6   r   c                     t        d|         t        j                  | |      \  }}}t        |      dkD  rt	        d|       t        |xs dt        j                          ddd	      }|j                  |d
   |j                  |       y )Nr   r   r   z<GET can be called with at most one path but was called with DownloadingBT)descdisableunit
unit_scale)r   r   )callback)
r   r   r   r   r   r   r   is_progress_bar_enabledget_filerT   )rx   	temp_filer   r   r   r   r   r   s           r+   
fsspec_getr  b  s    %u&=>,,S/RLB5
5zA~WX]W^_``)M"::<<	
H KKa)..8K<r6   c                     t        d|         	 t        t        j                  j	                  | |            5 }|j                  d       d d d        y# 1 sw Y   yxY w# t        $ r Y yw xY w)Nr   r   r   FT)r   r   urllibr   urlopenread	Exception)rx   r   rs      r+   ftp_headr  r  sl    %u&=>V^^++C+AB 	aFF1I	 		   s.   *A! AA! AA! A! !	A-,A-c                 x   t        d|         	 t        j                  d|  d|j                          t	        t
        j                  j                  | |            5 }t        j                  ||       d d d        y # 1 sw Y   y xY w# t
        j                  j                  $ r}t        |      d d }~ww xY w)Nr   zGetting through FTP z into r  )r   r   r   rT   r   r  r   r  shutilcopyfileobjerrorURLErrorr   )rx   r  r   r  es        r+   ftp_getr  |  s    %u&=>+*3%vinn5EFGV^^++C+AB 	-aq),	- 	- 	-<<   +a d*+s6   AB A?6B ?BB B B9(B44B9c	           
      D   t        j                  |      xs i }t        |j                  d            |d<   |dkD  r
d|dd|d<   t	        d| d	|||||
      }	|	j
                  dk(  ry |	j                  j                  d      }
|
|t        |
      z   nd }t        j                  dd	|||xs dt        j                                5 }|	j                  d      D ]-  }|j                  t        |             |j                  |       / 	 d d d        y # 1 sw Y   y xY w)N
user-agentr   r   zbytes=d-RangeGETT)r   rx   streamr   r   cookiesrQ   r   i  zContent-Lengthr   r   )r   r   totalinitialr   r   i   )
chunk_size)copydeepcopyr   getr   r   r   intr   tqdmr  iter_contentupdater   write)rx   r  r   resume_sizer   r  r   rQ   r   r   content_lengthr  progresschunks                 r+   http_getr,    s0    mmG$*G3w{{<?XYGLQ#K?!4"	H s"%%))*:;N1?1KK#n--QUE	"]3355
 
# 
**d*; 	#EOOCJ'OOE"	#
# 
# 
#s   	ADDc           
          t        j                  |      xs i }t        |j                  d            |d<   t	        d| ||||||      }|S )Nr  r  HEAD)r   rx   r   r   r  allow_redirectsr   rQ   )r   r!  r   r"  r   )rx   r   r   r  r/  r   rQ   r   s           r+   rR   rR     sX     mmG$*G3w{{<?XYGL"'	H Or6   c                 ,   |dk7  r t        j                  d| dt               |}t        |       j                  dvry t        | |      }t        | |d      }|j                          |j                  r|j                  j                  d      }|S d }|S )	Nr   r   r   httphttpsr      )r   rQ   ETag)r   r   r   r   r2   r   rR   raise_for_statusokr   r"  )rx   r   r   r   r   ry   s         r+   request_etagr9    s     %==K<LJX	

 }#440EBGg1=H+3;;8'DK =ADKr6   c                   $ |dk7  r t        j                  d| dt               |}
|t        j                  }t        |t              rt        |      }t        j                  |d       |r t        | t        |       j                        }n| }d}d}d}d}d}d}t        |d      }t        j                  j                  ||      }t        j                  j                  |      r|s|s|S t!        | |
	      }|||d
<   |st        |       j"                  }|dk(  rt%        |       }n=|dvr9t'        | |      }|r&|j)                  dd      xs |j)                  dd      nd}d}	 t+        | d|||	|      }|j,                  dk(  r||r|j.                  j)                  d      nd}|j0                  j3                         D ]0  \  }}|j5                  d      sd| v s| d|z   z  } |j0                  }2 d}d| v rd| vr| dz  } n|j,                  dk(  rd| v sk|j,                  dk(  rd| v sX|j,                  dk(  r6t7        j8                  d|       s3t7        j8                  d|j:                        s|j,                  dk(  rd| v rd}t<        j?                  d|         n2|j,                  dk(  r#t        j@                  | v r|
tC        d |  d!      |st        j                  j                  |      r|s|S |rtM        d"| d#      ||j,                  d$k(  rtM        d%|        tO        d&|         |tC        d'|  d(tQ        |       d)      |tC        d'|  d*|j,                   d)      tC        d'|        t        ||      }t        j                  j                  ||      }t        j                  j                  |      r|s|S |d+z   }tS        |      5  t        j                  j                  |      r|s|cddd       S |d,z   $tT        d=$fd-	       }d.}|rKtW        |d/0      }t        j                  j                  $      rt        jX                  $      jZ                  } |       5 }t<        j?                  |  d1|j\                          |dk(  rt_        | |       n'|dvrta        | |||2       ntc        | ||||||	|3       ddd       t<        j?                  d4|  d5|        te        jf                  j\                  |       t        jh                  d6      } t        jh                  |        t        jj                  |d6|  z         t<        j?                  d7|        | |d8}!|d9z   }"tm        |"d:d;<      5 }#to        jp                  |!|#       ddd       ddd       |S # tD        tF        jH                  jJ                  f$ r}|}Y d}~d}~ww xY w# 1 sw Y   xY w# 1 sw Y   SxY w# 1 sw Y   |S xY w)>a  
    Given a URL, look for the corresponding file in the local cache.
    If it's not there, download it. Then return the path to the cached file.

    Return:
        Local path (string)

    Raises:
        FileNotFoundError: in case of non-recoverable file
            (non-existent or no cache on disk)
        ConnectionError: in case of unreachable url
            and no cache on disk
    r   r   r   NTr   F)ry   r4  r  ftpr1  r   r6  ry   )r/  r   r   rQ   r      download_warningzdrive.google.comz	&confirm=zconfirm=z
&confirm=ti  zfirebasestorage.googleapis.comi  i  z7^https?://github.com/.*?/.*?/releases/download/.*?/.*?$z#^https://.*?s3.*?amazonaws.com/.*?$zndownloader.figstatic.comz"Couldn't get ETag version for url i  zUnauthorized for URL zU. Please use the parameter `token=True` after logging in with `huggingface-cli login`z6Cannot find the requested files in the cached path at zi and outgoing traffic has been disabled. To enable file online look-ups, set 'local_files_only' to False.i  zCouldn't find file at r   zCouldn't reach z ()z (error z.lockr   c              3   X   K   t        |       5 }| d d d        y # 1 sw Y   y xY wwr   )r*   )modefincomplete_paths     r+   temp_file_managerz)get_from_cache.<locals>.temp_file_managern  s,     ot,   s   *	*'*r   za+b)r@  zB not found in cache or force_download set to True, downloading to )r   r   )r   r(  r   r  rQ   r   zstoring z in cache at i  zcreating metadata file for )rx   ry   z.jsonr    rs   )encoding)zw+b)9r   r   r   r   HF_DATASETS_CACHEr@   r   r"   r&   r'   r   r   r$   r~   r)   r(   r   r2   r  r   r"  rR   r   r   r  r   r   rematchrx   r   r   r   r   OSErrorr   r   Timeoutr   r   reprr   r   r   statst_sizerT   r  r  r,  r  moveumaskchmodr*   jsondump)%rx   r   r   r   etag_timeoutr   r   r   r   rQ   r   r   r   r   r   
cached_url	connectedr   r  ry   
head_errorr2   rD   
cache_pathr   r   r   r  	lock_pathrC  r(  r  rN  meta	meta_path	meta_filerB  s%                                       @r+   r   r     s   < %==K<LJX	

 ,,	)T"	N	KK	D)S(3-"4"45

IHGDJF $JT:Hi2J	ww~~j!. 1EBG * #%%U? I,,"3HHQYHLL.L(,,vt2L_cDI*	  $$'H ##s*7?x''++F3T$,,224 3DAq||$67<NRU<U{Q."*"2"2	3
 !	%,31F<'C %%,1QUX1X((C/4F#4M((C/![]`a88$JHLLY ((C/4OSV4V 	@FG%%,1C1Cs1Ju}%+C5  1F  G  77>>*%n#H U^ ^  !h&:&:c&A#&<SE$BCC)OC5*AB!!OC54
;K:LA"NOO!!OC5AUAU@VVW"XYY!OC5"9:: $J5Hi2J	ww~~j!. W$I	)	 2'77>>*%n2' 2'
 %}4		 
	  '(9 Fww~~o. ggo6>>   	IKK3%abkbpbpaqrs Y'003	?Q^_# +## +&		( 	hse==>INNJ/

UeV^,1*>?D)(	)S73 	'yIIdI&	'c2'h o ,,445 	J	n	 	:	' 	'c2'h sk   (A0V/ V/ C1V/ #W;A*W;1AW"B7W;W/W;/#WWW"W,	'W;/W8	4W;;Xc                        fd}|S )Nc                 p    dj                        dz   | j                  | j                  ndz   | _        | S Nr0   z

)r)   __doc__fndocstrs    r+   docstring_decoratorz1add_start_docstrings.<locals>.docstring_decorator  s1    WWV_v-rzz?U[]^
	r6   r   ra  rb  s   ` r+   add_start_docstringsrd         r6   c                        fd}|S )Nc                 p    | j                   | j                   nddz   dj                        z   | _         | S r]  )r^  r)   r_  s    r+   rb  z/add_end_docstrings.<locals>.docstring_decorator  s1    $&JJ$:bjjfLrwwW]^
	r6   r   rc  s   ` r+   add_end_docstringsrh    re  r6   c                 &    t        d | D              S )Nc              3   P   K   | ]  }|j                         j                     y wr   )rK  rL  )rg   r$   s     r+   ri   z(estimate_dataset_size.<locals>.<genexpr>  s     5ttyy{""5s   $&)sum)r   s    r+   estimate_dataset_sizerl    s    5u555r6   rA  c                     t               }	 | j                  d      }|s	 t        |      S ||z  }|j                  d      r	 t        |      S B)Nr      
)	bytearrayr	  rw   bytes)rA  resbs      r+   readliners    sT    
+C
FF1I : 	q<<: r6   r   )FT)FTr   )TN)Nr   )r   r   r         $@)NN)rt  )Nr   NNg      Y@r   N)NNNTrt  r   )NFNd   FNFTr   Nr   FNN)_r^  r   iorP  r&   rj   rF  r  r#   r   r  r   
contextlibr   r   	functoolsr   hashlibr   pathlibr   typingr   r	   r
   r   r   urllib.parser   r   r   r   r   r   	packagingr   r0   r   r   download.download_configr   r   r   r   filelockr   
get_loggerr   r   INCOMPLETE_SUFFIXr"   r   r,   boolr5   r8   r;   rB   rO   Responser
  rS   r^   rl   rq   r~   r   r   r   r   r   r   r   r   RequestExceptiontupler#  floatr   r   r   	callbacksr   r  r  r  r,  rR   r9  r   rd  rh  rl  	RawIOBasers  r   r6   r+   <module>r     s7    	  	  	  
    .    7 7 *    $  " 5  #  
		H	%! CdhuT3Y/?&@ C &s3 s4 sn3 n4 nYc Yd YJA J! J6c 6S 6RU 6 NO"
8i'(W W3 W WY\ W6 6 6 6,C ,C ,4 B 		BJsDy1A(B c * fr	eCI./HPQVWZ\`W`QaHb	2	? 	
8C= 
 "&"&=E=P=P=a=a(, $ X((99:	
 49%   : $$	$ $ 	$
 $ $ $N6##00 = + qu#F de& fr	eCI./HPQVWZ\`W`QaHbc]* 
N  	!Nb6
 
r6   