+
    ?i#                         R t ^ RIHt ^ RIt^ RIHt ^ RIt^ RIt^ RIt^RI	H
t
Ht ^RI	HtHt  ! R R]4      t ! R R	]4      tRR
 ltRR ltRR ltR tR tR# )z&Data downloading and reading functions)logN)path)appdata_dirresource_dirs)StdoutProgressIndicatorurlopenc                       ] tR t^tRtRtR# )InternetNotAllowedErrorzpPlugins that need resources can just use get_remote_file(), but
should catch this error and silently ignore it.
 N__name__
__module____qualname____firstlineno____doc____static_attributes__r
       S/var/www/html/photoedit/myenv/lib/python3.14/site-packages/imageio/core/fetching.pyr	   r	      s     	r   r	   c                       ] tR t^tRtRtR# )NeedDownloadErrorzIs raised when a remote file is requested that is not locally
available, but which needs to be explicitly downloaded by the user.
r
   Nr   r
   r   r   r   r      s    r   r   c                   RpW@,           p\         P                  ! V 4      pTpT;'       g    \        R4      p\        4       pVP	                  ^ V4       V EF#  p	\         P
                  ! W4      p
\         P                  ! V
4      '       g   K8  V'       g   V'       d   Wy8w  d   \        P                  P                  Wv4      p\         P                  ! \         P                  ! V4      4      '       g?   \        P                  ! \         P                  ! \         P                  ! V4      4      4       \        P                  ! W4       Vu # V
u # \        V\         4      '       g   EK  \"        P$                  ! VR4      p\"        P&                  ! \         P(                  ! V
4      4      pW8  d   V'       d   Wy8w  d   \        P                  P                  Wv4      p\         P                  ! \         P                  ! V4      4      '       g?   \        P                  ! \         P                  ! \         P                  ! V4      4      4       \        P                  ! W4       Vu # V
u # \+        RV,          4        M	  \        P,                  ! RR4      P/                  4       R9   d   \1        R4      hV'       g   \3        4       h\         P
                  ! W4      p
\         P                  ! \         P                  ! V
4      4      '       g?   \        P                  ! \         P                  ! \         P                  ! V
4      4      4       \        P,                  ! RR	4      '       d.   \5        ^4       F  p \7        WZ4       V
u # 	  \7        WZ4       V
# \7        WZ4       V
#   \8         d    \"        P:                  ! R
4        KS  i ; i)a)  Get a the filename for the local version of a file from the web

Parameters
----------
fname : str
    The relative filename on the remote data repository to download.
    These correspond to paths on
    ``https://github.com/imageio/imageio-binaries/``.
directory : str | None
    The directory where the file will be cached if a download was
    required to obtain the file. By default, the appdata directory
    is used. This is also the first directory that is checked for
    a local version of the file. If the directory does not exist,
    it will be created.
force_download : bool | str
    If True, the file will be downloaded even if a local copy exists
    (and this copy will be overwritten). Can also be a YYYY-MM-DD date
    to ensure a file is up-to-date (modified date of a file on disk,
    if present, is checked).
auto : bool
    Whether to auto-download the file if its not present locally. Default
    True. If False and a download is needed, raises NeedDownloadError.

Returns
-------
fname : str
    The path to the file on the local system.
z7https://github.com/imageio/imageio-binaries/raw/master/imageioz%Y-%m-%dzFile older than %s, updating...IMAGEIO_NO_INTERNET zeWill not download resource from the internet because environment variable IMAGEIO_NO_INTERNET is set.CONTINUOUS_INTEGRATIONFg      ?)1trueyes)opnormcaser   r   insertjoinisfileosr   isdirdirnamemakedirsabspathshutilcopy
isinstancestrtimestrptimegmtimegetctimeprintgetenvlowerr	   r   range_fetch_fileIOErrorsleep)fname	directoryforce_downloadauto	_url_rooturlnfnamegiven_directorydirsdirfilename	filename2ntimeftimeis   &&&&           r   get_remote_filerF       s~   : JI

C[[FO99;y#9I?DKK9773'99X!"'= "_ EI88BJJy$9::BJJrzz)/D$EFKK4$$.#..njABKK$9:>&?+A$&GGLL$I	!xx

9(=>>KK

2::i3H(IJH8((#O;nLM5 : 
yy&+1137KK%*
 	
 !! wwy)H88BJJx())
BJJrzz(345	yy)511qA C*  &OC"   

3 s   5N  !OOc                V   \        R\        P                  P                  V4      ,          4       VR,           pRp^ p. p\	        ^4       EF  p \        V RR7      p\        VP                  R,          P                  4       4      p	\        V	4      p
\        RV^,           W
3,          4       \        VR4      p\        WVR	7       VP                  '       g   VP                  4        \        P                  ! W14       VR
J d'   \         P"                  P%                  RV,          4        Ve)   VP                  '       g   VP                  4         R#  R#  R# 	  \-        R\        P                  P                  V4      ,          4      h  \&         d7   pTP)                  T4       \        R\+        T4      ,          4        Rp?MRp?ii ; i Te)   TP                  '       g   TP                  4        EK  EK  EK    Te%   TP                  '       g   TP                  4        i i i ; i)a  Load requested file, downloading it if needed or requested

Parameters
----------
url: string
    The url of file to be downloaded.
file_name: string
    Name, along with the path, of where downloaded file will be saved.
print_destination: bool, optional
    If true, destination of where file was saved will be printed after
    download finishes.
resume: bool, optional
    If true, try to resume partially downloaded files.
z?Imageio: %r was not found on your computer; downloading it now.z.partNg      @)timeoutContent-LengthzTry %i. Download from %s (%s)wb)initial_sizeTzFile saved as %s.
zError while fetching file: %s.zhUnable to download %r. Perhaps there is no internet connection? If there is, please report this problem.)r0   r#   r   basenamer3   r   intheadersstrip_sizeof_fmtopen_chunk_readclosedcloser(   movesysstdoutwrite	Exceptionappendr+   r5   )r<   	file_nameprint_destinationtemp_file_name
local_filerK   errorstriesremote_file	file_sizesize_stres   &&&         r   r4   r4      s   $ 
	 " 0 0 ;	<
 (NJLFq	'!#s3KK//0@AGGIJI"9-H1UQY4NNOnd3JlK$$$  "KK2 D(

  !6!BC
 %!((($$& ) &+ 2 Cggy)*
 	
  	=MM!2SV;<<	=<%!((($$& ) &z%!((($$& ) &s1   CF

G,GG>GG>>H(H(c                B   Tp\        V P                  R,          P                  4       4      pWS,          p\        R4      pVP	                  RRV4        V P                  V4      pV\        V4      ,          pV'       g   M\        WqV4       K;  VP                  R4       R# )a  Download a file chunk by chunk and show advancement

Can also be used when resuming downloads over http.

Parameters
----------
response: urllib.response.addinfourl
    Response to the download request in order to get file size.
local_file: file
    Hard disk file where data should be written.
chunk_size: integer, optional
    Size of downloaded chunks. Default: 8192
initial_size: int, optional
    If resuming, indicate the initial size of the file.
rI   Downloadingr   bytesDoneN)	rM   rN   rO   r   startreadlen_chunk_writefinish)responser^   
chunk_sizerK   bytes_so_far
total_sizeprogresschunks   &&&&    r   rR   rR      s    &  L X%%&67==?@JJ&}5HNN2w
+
j)E
"U1OOFr   c                    VP                  V 4       VP                  \        V 4      4       \        P                  ! ^ 4       R# )z1Write a chunk to file and update the progress barN)rX   increase_progressrk   r,   r6   )rs   r^   rr   s   &&&r   rl   rl      s-    Us5z*JJqMr   c                   . ROp. ROp V ^8  ds   \        \        \        V R4      4      \        V4      ^,
          4      p\	        V 4      RV,          ,          pW,          pW#,          pRV,          pVP                  WE4      # V ^ 8X  d   R# R# )z,Turn number of bytes into human-readable stri   z{0:.%sf} {1}z0 bytesz1 byte)rg   kBMBGBTBPB)    r|         r~   r~   )minrM   r   rk   floatformat)numunitsdecimalsexponentquotientunitnum_decimalsformat_strings   &       r   rP   rP      s    3E!H"
Qws3sD>*CJN;:h.)&5##H33q9.h.r   )NFT)T)i    r|   )r   mathr   r#   r   r   rV   r(   r,   r   r   r   r   r   r5   r	   r   rF   r4   rR   rl   rP   r
   r   r   <module>r      sW   
 -  	  
   ( .	g 	 `F8
v"J/r   