403Webshell
Server IP : 209.209.40.120  /  Your IP : 216.73.217.112
Web Server : Microsoft-IIS/10.0
System : Windows NT NEWWWW 10.0 build 17763 (Windows Server 2019) i586
User : NEWWWW$ ( 0)
PHP Version : 8.3.30
Disable Function : NONE
MySQL : OFF  |  cURL : ON  |  WGET : OFF  |  Perl : OFF  |  Python : OFF  |  Sudo : OFF  |  Pkexec : OFF
Directory :  C:/Python312/Lib/site-packages/numpy/lib/tests/__pycache__/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : C:/Python312/Lib/site-packages/numpy/lib/tests/__pycache__/test__datasource.cpython-312.pyc
�

	�g�*��`�ddlZddlZddlmZmZmZddlmZddlm	cm
Zddlm
Z
mZmZddlmZddlmZddlmZd%d�Zdad�Zd	�Zd
ZdZdZd
Zgd�ZdZ d�Z!d�Z"d�Z#d�Z$d�Z%d�Z&d�Z'd�Z(Gd�d�Z)Gd�d�Z*Gd�d�Z+Gd�d�Z,Gd �d!�Z-Gd"�d#�Z.d$�Z/y)&�N)�mkdtemp�mkstemp�NamedTemporaryFile)�rmtree)�assert_�assert_equal�
assert_raises)�urlparse)�URLErrorc�N�|t�k(rtd��}|Std��)z$Stub to replace urlopen for testing.�urltmp_)�prefixzName or service not known)�
valid_httpurlrr)�url�data�tmpfiles   �BC:\Python312\Lib\site-packages\numpy/lib/tests/test__datasource.py�urlopen_stubrs'��
�m�o��$�I�6�����2�3�3�c�B�tjatt_y�N)�urllib_request�urlopen�old_urlopenr�rr�setup_modulers��!�(�(�K�)�N�rc�"�tt_yr)rrrrrr�teardown_moduler!s
��(�N�rzhttp://www.google.com/z
index.htmlzhttp://fake.abc.web/site/zfake.txt)z/etc/shadowz../../shadowz
..\system.datzc:\windows\system.datsthree is the magic numberc�T�tdd|d��\}}tj|�|S)N�.txt�dstmp_T)�suffixr�dir�text)r�os�close��filedir�fd�paths   r�valid_textfiler+2s&���f�X�7��N�H�B���H�H�R�L��Krc�|�tdd|��\}}tj|�tj|�|S)Nr r!)r"rr#)rr%r&�remover's   r�invalid_textfiler.9s/���f�X�7�C�H�B���H�H�R�L��I�I�d�O��Krc��ttzSr)�	http_path�	http_filerrrrrAs
���Y��rc��ttzSr)�
http_fakepath�
http_fakefilerrr�invalid_httpurlr5Es
����&�&rc��tSr)r0rrr�
valid_baseurlr7I����rc��tSr)r3rrr�invalid_baseurlr:M����rc��tSr)r1rrr�valid_httpfiler=Qr8rc��tSr)r4rrr�invalid_httpfiler?Ur;rc�B�eZdZd�Zd�Zd�Zd�Zd�Zd�Zd�Z	d�Z
d	�Zy
)�TestDataSourceOpenc�j�t�|_tj|j�|_yr�r�tmpdir�
datasource�
DataSource�ds��selfs r�setup_methodzTestDataSourceOpen.setup_methodZ�!���i����'�'����4��rc�2�t|j�|`yr�rrDrGrHs r�teardown_methodz"TestDataSourceOpen.teardown_method^����t�{�{���Grc��|jjt��}t|�|j	�yr)rG�openrrr&)rI�fhs  r�test_ValidHTTPz!TestDataSourceOpen.test_ValidHTTPbs&��
�W�W�\�\�-�/�
*�����
���
rc���t�}tt|jj|�	|jj	|�y#t$r!}t|jdu�Yd}~yd}~wwxYwr)r5r	�OSErrorrGrQr�errno)rIr�es   r�test_InvalidHTTPz#TestDataSourceOpen.test_InvalidHTTPgsV������g�t�w�w�|�|�S�1�	%��G�G�L�L�����	%��A�G�G�t�O�$�$��	%�s�A
�
	A7�A2�2A7c�^�tt|jjt	��yr)r	rrG�_cacher5rHs r�test_InvalidHTTPCacheURLErrorz0TestDataSourceOpen.test_InvalidHTTPCacheURLErrorps���h�������0A�Brc��t|j�}|jj|�}t	|�|j�yr)r+rDrGrQrr&)rI�
local_filerRs   r�test_ValidFilez!TestDataSourceOpen.test_ValidFiless2��#�D�K�K�0�
�
�W�W�\�\�*�
%�����
���
rc�x�t|j�}tt|jj
|�yr)r.rDr	rUrGrQ)rI�invalid_files  r�test_InvalidFilez#TestDataSourceOpen.test_InvalidFileys$��'����4���g�t�w�w�|�|�\�:rc��	ddl}tj
j
|jd�}j|d�}|jt�|j�|jj|�}|j�}|j�tt|�y#t$rtj�Y��wxYw)Nrz
foobar.txt.gz�w)�gzip�ImportError�pytest�skipr%r*�joinrDrQ�write�
magic_liner&rG�readliner)rIrd�filepath�fp�results     r�test_ValidGzipFilez%TestDataSourceOpen.test_ValidGzipFile}s���	��
�7�7�<�<����_�=��
�Y�Y�x��
%��
�����
���
�
�W�W�\�\�(�
#�������
���
��Z��(���	��K�K�M�	���B3�3C�Cc��	ddl}tj
j
|jd�}j|d�}|jt�|j�|jj|�}|j�}|j�tt|�y#t$rtj�Y��wxYw)Nrzfoobar.txt.bz2rc)�bz2rerfrgr%r*rhrD�BZ2Filerirjr&rGrQrkr)rIrrrlrmrns     r�test_ValidBz2Filez$TestDataSourceOpen.test_ValidBz2File�s���	��
�7�7�<�<����-=�>��
�[�[��3�
'��
�����
���
�
�W�W�\�\�(�
#�������
���
��Z��(���	��K�K�M�	�rpN)�__name__�
__module__�__qualname__rJrNrSrXr[r^rarortrrrrArAYs0��5���
%�C��;�)� )rrAc�0�eZdZd�Zd�Zd�Zd�Zd�Zd�Zy)�TestDataSourceExistsc�j�t�|_tj|j�|_yrrCrHs rrJz!TestDataSourceExists.setup_method�rKrc�2�t|j�|`yrrMrHs rrNz$TestDataSourceExists.teardown_method�rOrc�\�t|jjt���yr)rrG�existsrrHs rrSz#TestDataSourceExists.test_ValidHTTP�s��������}��/�0rc�^�t|jjt��d�y�NF)rrGr}r5rHs rrXz%TestDataSourceExists.test_InvalidHTTP�s���T�W�W�^�^�O�$5�6��>rc��t|j�}t|jj	|��t�}t|�}t|jj	|��t
|�yr)r+rDrrGr}rr)rIr�localdirs   rr^z#TestDataSourceExists.test_ValidFile�sS�� ����-��������w�'�(��9�� ��*��������w�'�(��x�rc�x�t|j�}t|jj	|�d�yr)r.rDrrGr}�rIrs  rraz%TestDataSourceExists.test_InvalidFile�s'��"�4�;�;�/���T�W�W�^�^�G�,�e�4rN)	rurvrwrJrNrSrXr^rarrrryry�s ��5��1�?��5rryc�<�eZdZd�Zd�Zd�Zd�Zd�Zd�Zd�Z	d�Z
y	)
�TestDataSourceAbspathc��tjjt��|_tj|j�|_yr)r%r*�abspathrrDrErFrGrHs rrJz"TestDataSourceAbspath.setup_method�s.���g�g�o�o�g�i�0����'�'����4��rc�2�t|j�|`yrrMrHs rrNz%TestDataSourceAbspath.teardown_method�rOrc�@�tt��\}}}}}}tjj	|j
||j
tj�j
d��}t||jjt���y�N�/)r
rr%r*rhrD�strip�seprrGr�)rI�scheme�netloc�upath�pms�qry�frg�
local_paths        rrSz$TestDataSourceAbspath.test_ValidHTTP�sj��/7�
��/H�,����s�C���W�W�\�\�$�+�+�v�"'�+�+�b�f�f�"5�";�";�C�"@�B�
��Z��������!A�Brc��t|j�}tjj	|�d}t||jj|��t||jj|��y�N���)r+rDr%r*�splitrrGr�)rIr�tmpfilenames   rr^z$TestDataSourceAbspath.test_ValidFile�sU�� ����-���g�g�m�m�G�,�R�0���W�d�g�g�o�o�k�:�;��W�d�g�g�o�o�g�6�7rc�D�tt��\}}}}}}tjj	|j
||j
tj�j
d��}t||jjt��k7�yr�)r
r5r%r*rhrDr�r�rrGr�r)rIr�r�r�r�r�r��invalidhttps        rrXz&TestDataSourceAbspath.test_InvalidHTTP�sn��/7��8I�/J�,����s�C���g�g�l�l�4�;�;��#(�;�;�r�v�v�#6�#<�#<�S�#A�C����t�w�w���}��?�?�@rc�8�t|j�}t|j�}tjj	|�d}t||jj|�k7�t||jj|�k7�yr�)r+rDr%r*r�rrGr�)rI�invalidfilerr�s    rraz&TestDataSourceAbspath.test_InvalidFile�si��$�T�[�[�1�� ����-���g�g�m�m�G�,�R�0����t�w�w���{�;�;�<���t�w�w���w�7�7�8rc���t�j�}tjj	|�d}�fd�}t|t
��j�j��t|t��j�j��t||�j�j��t||�j�j��tD]]}t|t|z�j�j��t||�j�j���_y)Nr�c�t��tjj�jj|��Sr)r%r*r�rG��xrIs �r�<lambda>z7TestDataSourceAbspath.test_sandboxing.<locals>.<lambda>�s!���R�W�W�_�_�T�W�W�_�_�Q�-?�@�r)r+rDr%r*r�rr�
startswithr5�malicious_filesr0)rIrr��tmp_path�fns`    r�test_sandboxingz%TestDataSourceAbspath.test_sandboxing�s���� ����-���g�g�m�m�G�,�R�0��@������)�4�4�T�[�[�A�B����*�+�6�6�t�{�{�C�D����!�,�,�T�[�[�9�:����%�0�0����=�>�!�	:�B��H�Y�r�\�*�5�5�d�k�k�B�C��H�R�L�+�+�D�K�K�8�9�	:rc��tj}	dt_|j�|j�|j	�|j�|j
�|t_y#|t_wxYw�N�\)r%r�rSr^rXrar��rI�orig_os_seps  r�test_windows_os_sepz)TestDataSourceAbspath.test_windows_os_sep�sb���f�f��	!��B�F����!����!��!�!�#��!�!�#�� � �"� �B�F��[�B�F�s�AA9�9
BN)rurvrwrJrNrSr^rXrar�r�rrrr�r��s,��5��C�8�A�9�:�
!rr�c�*�eZdZd�Zd�Zd�Zd�Zd�Zy)�TestRepositoryAbspathc��tjjt��|_tjt�|j�|_yr)	r%r*r�rrDrE�
Repositoryr7�reposrHs rrJz"TestRepositoryAbspath.setup_method�s2���g�g�o�o�g�i�0����*�*�=�?�D�K�K�H��
rc�2�t|j�|`yr�rrDr�rHs rrNz%TestRepositoryAbspath.teardown_method����t�{�{���Jrc�X�tt��\}}}}}}tjj	|j
j||jtj�jd��}|j
jt��}t||�yr�)r
rr%r*rhr��	_destpathr�r�r�r=r)	rIr�r�r�r�r�r�r�rls	         rrSz$TestRepositoryAbspath.test_ValidHTTPsx��/7�
��/H�,����s�C���W�W�\�\�$�*�*�"6�"6��"'�+�+�b�f�f�"5�";�";�C�"@�B�
��:�:�%�%�n�&6�7���Z��*rc�@���fd�}t|t��j�j��tD]]}t|t
|z�j�j��t||�j�j���_y)Nc�t��tjj�jj|��Sr)r%r*r�r�r�s �rr�z7TestRepositoryAbspath.test_sandboxing.<locals>.<lambda>s#���R�W�W�_�_�T�Z�Z�-?�-?��-B�C�r)rr=r�rDr�r0)rIr�r�s`  rr�z%TestRepositoryAbspath.test_sandboxing
sq���C�����)�*�5�5�d�k�k�B�C�!�	:�B��H�Y�r�\�*�5�5�d�k�k�B�C��H�R�L�+�+�D�K�K�8�9�	:rc��tj}	dt_|j�|j�|t_y#|t_wxYwr�)r%r�rSr�r�s  rr�z)TestRepositoryAbspath.test_windows_os_seps>���f�f��	!��B�F����!�� � �"� �B�F��[�B�F�s�+A	�	
AN)rurvrwrJrNrSr�r�rrrr�r��s��I��+�:�!rr�c�0�eZdZd�Zd�Zd�Zd�Zd�Zd�Zy)�TestRepositoryExistsc�|�t�|_tjt	�|j�|_yr)rrDrEr�r7r�rHs rrJz!TestRepositoryExists.setup_methods%���i����*�*�=�?�D�K�K�H��
rc�2�t|j�|`yrr�rHs rrNz$TestRepositoryExists.teardown_method#r�rc�v�t|j�}t|jj	|��yr)r+rDrr�r}r�s  rr^z#TestRepositoryExists.test_ValidFile's'�� ����-����
�
�!�!�'�*�+rc�x�t|j�}t|jj	|�d�yr)r.rDrr�r}r�s  rraz%TestRepositoryExists.test_InvalidFile,s)��"�4�;�;�/���T�Z�Z�&�&�w�/��7rc�\�t|jjt���yr)rr�r}rrHs r�test_RemoveHTTPFilez(TestRepositoryExists.test_RemoveHTTPFile0s����
�
�!�!�-�/�2�3rc�.�t�}t|�\}}}}}}tjj	|j
j|�}tj|d�t|�}	t|j
j|	��y)Ni�)rr
r%r*rhr�r��mkdirr+rr})
rI�	localfiler�r�r�r�r�r�r�rs
          r�test_CachedHTTPFilez(TestRepositoryExists.test_CachedHTTPFile3so��!�O�	�08�	�/B�,����s�C���W�W�\�\�$�*�*�"6�"6��?�
�
����V�$� ��,����
�
�!�!�'�*�+rN)	rurvrwrJrNr^rar�r�rrrr�r�s!��I��,�
8�4�	,rr�c��eZdZd�Zd�Zd�Zy)�TestOpenFuncc�"�t�|_yr)rrDrHs rrJzTestOpenFunc.setup_method@s���i��rc�.�t|j�yr)rrDrHs rrNzTestOpenFunc.teardown_methodCs���t�{�{�rc��t|j�}tj||j��}t	|�|j�tj|�}t	|�|j�y)N)�destpath)r+rDrErQrr&)rIr]rms   r�test_DataSourceOpenz TestOpenFunc.test_DataSourceOpenFsR��#�D�K�K�0�
�
�_�_�Z�$�+�+�
>�����
���
�
�_�_�Z�
(�����
���
rN)rurvrwrJrNr�rrrr�r�?s�� ��	rr�c�P�tj�}|`|j�yr)rErF�
_istmpdest�__del__)rGs r�test_del_attr_handlingr�Qs$��
�	�	�	 �B�	�
��J�J�Lrr)0r%rf�tempfilerrr�shutilr�numpy.lib._datasource�lib�_datasourcerE�
numpy.testingrrr	�urllib.request�requestr�urllib.parser
�urllib.errorrrrrrr0r1r3r4r�rjr+r.rr5r7r:r=r?rAryr�r�r�r�r�rrr�<module>r�s���	�
�9�9��*�*�>�>�'�!�!�4���*�)�
%�	��	�+�
��
�@��*�
����'�����B)�B)�J5�5�<>!�>!�B!�!�B,�,�B��$
r

Youez - 2016 - github.com/yon3zu
LinuXploit