Ë
    ÿ[;j,  ã                   ó‚   — d dl Zd dl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
  ej                  d«      Zd„ Ze
d„ «       Zy)é    N)ÚURLErrorÚ	HTTPError)Úcontextmanagerz'http://|https://|ftp://|file://|file:\\c                 óT   — t        | t        «      xr t        j                  | «      duS )z-Return True if string is an http or ftp path.N)Ú
isinstanceÚstrÚ	URL_REGEXÚmatch)Úfilenames    úXG:\00. PROJECTS\API\Inventory\templateJSON\kerjaOCR\Lib\site-packages\skimage/io/util.pyÚis_urlr      s"   € ä�h¤Ó$ÒN¬¯©¸Ó)BÈ$Ð)NÐNó    c              #   ó´  K  — t        | «      rát        j                  j                  | «      }t        j
                  j                  |j
                  «      \  }}	 t        j                  d|¬«      5 }t        j                  j                  | «      5 }|j                  |j                  «       «       ddd«       ddd«       j                  –— t	        j                  |j                  «       y| –— y# 1 sw Y   ŒDxY w# 1 sw Y   ŒHxY w# t        t         f$ r! t	        j                  j                  «       ‚ t"        t$        t&        t(        f$ r ‚ w xY w­w)z>Yield name of file from the given resource (i.e. file or url).F)ÚdeleteÚsuffixN)r   ÚurllibÚparseÚurlparseÚosÚpathÚsplitextÚtempfileÚNamedTemporaryFileÚrequestÚurlopenÚwriteÚreadÚnameÚremover   r   ÚFileNotFoundErrorÚFileExistsErrorÚPermissionErrorÚBaseException)Úresource_nameÚurl_componentsÚ_ÚextÚfÚus         r   Úfile_or_url_contextr*      sû   è ø€ ô ˆmÔÜŸ™×.Ñ.¨}Ó=ˆÜ—‘×!Ñ! .×"5Ñ"5Ó6‰ˆˆ3ð	Ü×,Ñ,°EÀ#ÕFÈ!Ü—^‘^×+Ñ+¨MÔ:¸aØ—G‘G˜AŸF™F›HÔ%÷ ;÷ Gð —&‘&ŠLô �I‰I�a—f‘fÕàÓ÷ ;Ð:ú÷ GÐFûô
 œ)Ð$ò 	ä�I‰I�a—f‘fÔØÜ!¤?´OÄ]ÐSò 	àð	üsO   ‚AEÁD Á1 D Â C4Â1D Â9D Ã%EÃ4C=	Ã9D Ä D	ÄD ÄA	EÅE)Úurllib.parser   Úurllib.requestÚurllib.errorr   r   r   Úrer   Ú
contextlibr   Úcompiler	   r   r*   © r   r   Ú<module>r2      sG   ðÛ Û ß ,ã 	Û 	Û Ý %ð ˆB�J‰JÐAÓB€	òOð
 ñó ñr   