+
    &iD)                     d   ^ RI t ^ RIHt ^ RIHt ^ RIHtHtH	t	 ^ RI
Ht ^ RIHt ^ RIt^ RIHu Ht ^ RIHtHtHt R$R ltRsR tR	 tR
tRtRtRt. R%OtRt R t!R t"R t#R t$R t%R t&R t'R t( ! R R4      t) ! R R4      t* ! R R4      t+ ! R R4      t, ! R R 4      t- ! R! R"4      t.R# t/R# )&    N)rmtree)NamedTemporaryFilemkdtempmkstemp)URLError)urlparse)assert_assert_equalassert_raisesc                R    V \        4       8X  d   \        RR7      pV# \        R4      h)z$Stub to replace urlopen for testing.urltmp_)prefixzName or service not known)valid_httpurlr   r   )urldatatmpfiles   && ^/var/www/html/photoedit/myenv/lib/python3.14/site-packages/numpy/lib/tests/test__datasource.pyurlopen_stubr      s'    
mo$I6233    c                  D    \         P                  s\        \         n        R # N)urllib_requesturlopenold_urlopenr    r   r   setup_moduler      s     !((K)Nr   c                  $    \         \        n        R # r   )r   r   r   r   r   r   teardown_moduler   "   s
    (Nr   zhttp://www.google.com/z
index.htmlzhttp://fake.abc.web/site/zfake.txts   three is the magic numberc                 T    \        R RV RR7      w  r\        P                  ! V4       V# ).txtdstmp_T)suffixr   dirtext)r   osclosefiledirfdpaths   &  r   valid_textfiler+   4   s$    fX7NHBHHRLKr   c                 ~    \        R RV R7      w  r\        P                  ! V4       \        P                  ! V4       V# )r    r!   )r"   r   r#   )r   r%   r&   remover'   s   &  r   invalid_textfiler.   ;   s-    fX7CHBHHRLIIdOKr   c                  $    \         \        ,           # r   )	http_path	http_filer   r   r   r   r   C   s    y  r   c                  $    \         \        ,           # r   )http_fakepathhttp_fakefiler   r   r   invalid_httpurlr5   G   s    =((r   c                      \         # r   )r0   r   r   r   valid_baseurlr7   K       r   c                      \         # r   )r3   r   r   r   invalid_baseurlr:   O       r   c                      \         # r   )r1   r   r   r   valid_httpfiler=   S   r8   r   c                      \         # r   )r4   r   r   r   invalid_httpfiler?   W   r;   r   c                   J   a  ] tR t^[t o R tR tR tR tR tR t	R t
RtV tR	# )
TestDataSourceOpenc                    \         P                  ! V4      pVP                  \        4       4      p\	        V4       VP                  4        R # r   )
datasource
DataSourceopenr   r	   r&   )selftmp_pathdsfhs   &&  r   test_ValidHTTP!TestDataSourceOpen.test_ValidHTTP\   s2    ""8,WW]_%

r   c                    \         P                  ! V4      p\        4       p\        \        VP
                  V4        VP                  V4       R #   \         d#   p\        TP                  R J 4        R p?R # R p?ii ; ir   )rC   rD   r5   r   OSErrorrE   r	   errno)rF   rG   rH   r   es   &&   r   test_InvalidHTTP#TestDataSourceOpen.test_InvalidHTTPb   s]    ""8,grww,	%GGCL 	%AGGtO$$	%s   A A=A88A=c                x    \         P                  ! V4      p\        \        VP                  \        4       4       R # r   )rC   rD   r   r   _cacher5   rF   rG   rH   s   && r   test_InvalidHTTPCacheURLError0TestDataSourceOpen.test_InvalidHTTPCacheURLErrorl   s%    ""8,h		?+<=r   c                    \         P                  ! V4      p\        V4      pVP                  V4      p\	        V4       VP                  4        R # r   )rC   rD   r+   rE   r	   r&   )rF   rG   rH   
local_filerI   s   &&   r   test_ValidFile!TestDataSourceOpen.test_ValidFilep   s:    ""8,#H-
WWZ 

r   c                ~    \         P                  ! V4      p\        V4      p\        \        VP
                  V4       R # r   )rC   rD   r.   r   rM   rE   )rF   rG   rH   invalid_files   &&  r   test_InvalidFile#TestDataSourceOpen.test_InvalidFilew   s,    ""8,'1grww5r   c                    ^ RI p\        P
                  ! V4      p\        P                  P                  VR4      pXP                  VR4      pVP                  \        4       VP                  4        VP                  V4      pVP                  4       pVP                  4        \        \        V4       R#   \         d    \        P                  ! 4         Li ; i)r   Nzfoobar.txt.gzw)gzipImportErrorpytestskiprC   rD   r%   r*   joinrE   write
magic_liner&   readliner
   )rF   rG   ra   rH   filepathfpresults   &&     r   test_ValidGzipFile%TestDataSourceOpen.test_ValidGzipFile|   s    	
 ""8,77<</:YYx%


WWX

Z(  	KKM	   B6 6 CCc                    ^ RI p\        P
                  ! V4      p\        P                  P                  VR4      pXP                  VR4      pVP                  \        4       VP                  4        VP                  V4      pVP                  4       pVP                  4        \        \        V4       R#   \         d    \        P                  ! 4         Li ; i)r   Nzfoobar.txt.bz2r`   )bz2rb   rc   rd   rC   rD   r%   r*   re   BZ2Filerf   rg   r&   rE   rh   r
   )rF   rG   rp   rH   ri   rj   rk   s   &&     r   test_ValidBz2File$TestDataSourceOpen.test_ValidBz2File   s    	
 ""8,77<<*:;[[3'


WWX

Z(  	KKM	rn   r   N)__name__
__module____qualname____firstlineno__rJ   rP   rU   rY   r]   rl   rr   __static_attributes____classdictcell____classdict__s   @r   rA   rA   [   s-     %>6
)") )r   rA   c                   8   a  ] tR t^t o R tR tR tR tRtV t	R# )TestDataSourceExistsc                v    \         P                  ! V4      p\        VP                  \	        4       4      4       R # r   )rC   rD   r	   existsr   rT   s   && r   rJ   #TestDataSourceExists.test_ValidHTTP   s%    ""8,		-/*+r   c                x    \         P                  ! V4      p\        VP                  \	        4       4      R 4       R# FN)rC   rD   r
   r   r5   rT   s   && r   rP   %TestDataSourceExists.test_InvalidHTTP   s(    ""8,RYY0159r   c                    \         P                  ! V4      p\        V4      p\        VP	                  V4      4       \        4       p\        V4      p\        VP	                  V4      4       \        V4       R # r   )rC   rD   r+   r	   r   r   r   )rF   rG   rH   r   localdirs   &&   r   rY   #TestDataSourceExists.test_ValidFile   sW    ""8, *		'"#9 *		'"#xr   c                ~    \         P                  ! V4      p\        V4      p\        VP	                  V4      R 4       R# r   )rC   rD   r.   r
   r   )rF   rG   rH   r   s   &&  r   r]   %TestDataSourceExists.test_InvalidFile   s/    ""8,"8,RYYw'/r   r   N)
rt   ru   rv   rw   rJ   rP   rY   r]   rx   ry   rz   s   @r   r}   r}      s     ,:	0 0r   r}   c                   D   a  ] tR t^t o R tR tR tR tR tR t	Rt
V tR# )	TestDataSourceAbspathc                @   \         P                  ! V4      p\        \        4       4      w  r4p  p\        P
                  P                  WVP                  \        P                  4      P                  R 4      4      p\        WbP                  \        4       4      4       R# /N)rC   rD   r   r   r%   r*   re   stripsepr
   abspath)rF   rG   rH   _netlocupath
local_paths   &&     r   rJ   $TestDataSourceAbspath.test_ValidHTTP   sl    ""8,$,]_$=!5!QWW\\("'++bff"5";";C"@B
ZMO!<=r   c                    \         P                  ! V4      p\        V4      p\        P                  P                  V4      R,          p\        W2P                  V4      4       \        W2P                  V4      4       R#    N)rC   rD   r+   r%   r*   splitr
   r   )rF   rG   rH   r   tmpfilenames   &&   r   rY   $TestDataSourceAbspath.test_ValidFile   sU    ""8, *ggmmG,R0Wjj56Wjj12r   c                D   \         P                  ! V4      p\        \        4       4      w  r4p  p\        P
                  P                  WVP                  \        P                  4      P                  R 4      4      p\        WbP                  \        4       4      8g  4       R# r   )rC   rD   r   r5   r%   r*   re   r   r   r	   r   r   )rF   rG   rH   r   r   r   invalidhttps   &&     r   rP   &TestDataSourceAbspath.test_InvalidHTTP   sp    ""8,$,_->$?!5!Qggll8#(;;rvv#6#<#<S#ACzz-/::;r   c                   \         P                  ! V4      p\        V4      p\        V4      p\        P                  P                  V4      R,          p\        W2P                  V4      8g  4       \        W2P                  V4      8g  4       R# r   )rC   rD   r+   r%   r*   r   r	   r   )rF   rG   rH   invalidfiler   r   s   &&    r   r]   &TestDataSourceAbspath.test_InvalidFile   se    ""8,$X. *ggmmG,R0zz+667zz'223r   c                  a \         P                  ! V4      o\        V4      p\        P                  P                  V4      R,          pV3R lp\        V! \        4       4      P                  \        V4      4      4       \        V! \        4       4      P                  \        V4      4      4       \        V! V4      P                  \        V4      4      4       \        V! V4      P                  \        V4      4      4       \         F`  p\        V! \        V,           4      P                  \        V4      4      4       \        V! V4      P                  \        V4      4      4       Kb  	  R# )r   c                 `   < \         P                  P                  SP                  V 4      4      # r   r%   r*   r   )xrH   s   &r   <lambda>7TestDataSourceAbspath.test_sandboxing.<locals>.<lambda>   s    A7r   Nr   )rC   rD   r+   r%   r*   r   r	   r   
startswithstrr5   malicious_filesr0   )rF   rG   r   r   r*   fnrH   s   &&    @r   test_sandboxing%TestDataSourceAbspath.test_sandboxing   s    ""8, *ggmmG,R07]_%00X?@_&'223x=ABW((X78[!,,S];<!BDR(33CMBCDH''H67 "r   c                   \         P                  p R \         n        V P                  V4       V P                  V4       V P	                  V4       V P                  V4       V P                  V4       V\         n        R#   T\         n        i ; i\N)r%   r   rJ   rY   rP   r]   r   rF   rG   orig_os_seps   && r   test_windows_os_sep)TestDataSourceAbspath.test_windows_os_sep   sl    ff	!BF))!!(+!!(+  * BF[BFs   A A? ?Br   N)rt   ru   rv   rw   rJ   rY   rP   r]   r   r   rx   ry   rz   s   @r   r   r      s(     >3<48
! 
!r   r   c                   2   a  ] tR t^t o R tR tR tRtV tR# )TestRepositoryAbspathc                l   \         P                  ! \        4       V4      p\        \	        4       4      w  r4p  p\
        P                  P                  VP                  VVP                  \
        P                  4      P                  R 4      4      pVP                  \        4       4      p\        Wg4       R# r   )rC   
Repositoryr7   r   r   r%   r*   re   	_destpathr   r   r   r=   r
   )rF   rG   reposr   r   r   r   ri   s   &&      r   rJ   $TestRepositoryAbspath.test_ValidHTTP   s|    %%mox@$,]_$=!5!QWW\\%//6"'++bff"5";";C"@B
==!12Z*r   c                  a \         P                  ! \        4       V4      oV3R  lp\        V! \	        4       4      P                  \        V4      4      4       \         F`  p\        V! \        V,           4      P                  \        V4      4      4       \        V! V4      P                  \        V4      4      4       Kb  	  R# )c                 `   < \         P                  P                  SP                  V 4      4      # r   r   )r   r   s   &r   r   7TestRepositoryAbspath.test_sandboxing.<locals>.<lambda>  s    q)9:r   N)	rC   r   r7   r	   r=   r   r   r   r0   )rF   rG   r*   r   r   s   &&  @r   r   %TestRepositoryAbspath.test_sandboxing   s    %%mox@:^%&11#h-@A!BDR(33CMBCDH''H67 "r   c                    \         P                  p R \         n        V P                  V4       V P                  V4       V\         n        R#   T\         n        i ; ir   )r%   r   rJ   r   r   s   && r   r   )TestRepositoryAbspath.test_windows_os_sep  sB    ff	!BF)  * BF[BFs   -A Ar   N)	rt   ru   rv   rw   rJ   r   r   rx   ry   rz   s   @r   r   r      s     +8! !r   r   c                   8   a  ] tR tRt o R tR tR tR tRtV t	R# )TestRepositoryExistsi  c                    \         P                  ! \        4       V4      p\        V4      p\	        VP                  V4      4       R # r   )rC   r   r7   r+   r	   r   rF   rG   r   r   s   &&  r   rY   #TestRepositoryExists.test_ValidFile  s1    %%mox@ *W%&r   c                    \         P                  ! \        4       V4      p\        V4      p\	        VP                  V4      R 4       R# r   )rC   r   r7   r.   r
   r   r   s   &&  r   r]   %TestRepositoryExists.test_InvalidFile  s3    %%mox@"8,U\\'*E2r   c                    \         P                  ! \        4       V4      p\        VP	                  \        4       4      4       R # r   )rC   r   r7   r	   r   r   )rF   rG   r   s   && r   test_RemoveHTTPFile(TestRepositoryExists.test_RemoveHTTPFile  s)    %%mox@]_-.r   c                F   \        4       p\        P                  ! \        4       V4      p\	        V4      w  rE   p\
        P                  P                  VP                  V4      p\
        P                  ! VR 4       \        V4      p\        VP                  V4      4       R# )i  N)r   rC   r   r7   r   r%   r*   re   r   mkdirr+   r	   r   )rF   rG   	localfiler   r   r   r   r   s   &&      r   test_CachedHTTPFile(TestRepositoryExists.test_CachedHTTPFile"  su    !O	 %%mox@ ( 31aAWW\\%//6:

V$ ,W%&r   r   N)
rt   ru   rv   rw   rY   r]   r   r   rx   ry   rz   s   @r   r   r     s     '3
/
' 
'r   r   c                   &   a  ] tR tRt o R tRtV tR# )TestOpenFunci/  c                    \        V4      p\        P                  ! W!R 7      p\        V4       VP	                  4        \        P                  ! V4      p\        V4       VP	                  4        R# ))destpathN)r+   rC   rE   r	   r&   )rF   rG   rX   rj   s   &&  r   test_DataSourceOpen TestOpenFunc.test_DataSourceOpen0  sH    #H-
__Z;

__Z(

r   r   N)rt   ru   rv   rw   r   rx   ry   rz   s   @r   r   r   /  s     	 	r   r   c                  T    \         P                  ! 4       p V =V P                  4        R # r   )rC   rD   
_istmpdest__del__)rH   s    r   test_del_attr_handlingr   ;  s$     
			 B 	 JJLr   r   )z/etc/shadowz../../shadowz..\system.datzc:\windows\system.dat)0r%   urllib.requestrequestr   shutilr   tempfiler   r   r   urllib.errorr   urllib.parser   rc   numpy.lib._datasourcelib_datasourcerC   numpy.testingr	   r
   r   r   r   r   r   r0   r1   r3   r4   r   rg   r+   r.   r   r5   r7   r:   r=   r?   rA   r}   r   r   r   r   r   r   r   r   <module>r      s    	 '  9 9 ! !  * * > >4 *)
 %		+@ *
!)A) A)H0 04;! ;!|! !6' ':
 
r   