403Webshell
Server IP : 217.160.0.135  /  Your IP : 216.73.217.37
Web Server : Apache
System : Linux www 6.18.52-i1-ampere #1203 SMP Mon Sep 14 18:29:59 CEST 2026 aarch64
User : sws1074145052 ( 1074145052)
PHP Version : 8.3.32
Disable Function : NONE
MySQL : OFF  |  cURL : ON  |  WGET : ON  |  Perl : ON  |  Python : OFF  |  Sudo : OFF  |  Pkexec : OFF
Directory :  /lib/python3/dist-packages/scipy/special/__pycache__/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : /lib/python3/dist-packages/scipy/special/__pycache__/_mptestutils.cpython-311.pyc
�

d�c�8���ddlZddlZddlZddlmZddlZddlmZddl	Z	ddl
mZ	ddlZn#e
$rYnwxYwGd�d��ZGd�d��ZGd	�d
��ZGd�d��Zd
�ZGd�d��Zd�Zd�Zd�Zd�Zd�Z	ddlZddlZdee��vZn
#e
$rdZYnwxYwGd�de��Zdejdfd�Z d�Z!d�Z"d d�Z#dS)!�N)�zip_longest)�assert_)�assert_func_equalc�D�eZdZdZejejddfd�Zd�Zd�ZdS)�Argz�Generate a set of numbers on the real axis, concentrating on
    'interesting' regions and covering all orders of magnitude.

    Tc�2�||krtd���|tjkr!dtjt��jz}|tjkr!dtjt��jz}||c|_|_||c|_|_	dS)Nz#a should be less than or equal to bg���?)
�
ValueError�np�inf�finfo�float�max�a�b�inclusive_a�inclusive_b)�selfrrrrs     �</usr/lib/python3/dist-packages/scipy/special/_mptestutils.py�__init__zArg.__init__s����q�5�5��B�C�C�C�����<�<��R�X�e�_�_�(�(�A����;�;��B�H�U�O�O�'�'�A��A������-8�+�*���$�*�*�*�c�h�|dkrtd���|dzdkr|dz}|}n
|dz}|dz}|dkr<tjtj|��tj|��|��}�n�|dkr|dkrtj|||��}�n�|dkrXtj|d|d���}tjdtj|��|��}tj||f��}�n+|dkrs|dkrmtjd||��}|jdkrtj|d��}	nd}	tjd|	|d���}tj||f��}n�|dzdkr|dz}
|
}n
|dz}
|
dz}tjdd|d���}|jdkrtj|d��}	nd}	tjd|	|
d���}tjdtj|��|��}
tj|||
f��}tj|��S)	Nrza should be positive���
F)�endpointi��)r
r�logspace�log10�linspace�hstack�size�sort)rrr�n�nlogpts�nlinpts�pts�linpts�logpts�right�nlogpts1�nlogpts2�logpts1�logpts2s              r�_positive_valueszArg._positive_values's3���q�5�5��3�4�4�4�
�q�5�A�:�:���d�G��G�G���d�G���k�G���7�7��+�b�h�q�k�k�2�8�A�;�;��:�:�C�C�
��U�U�q�2�v�v��+�a��A�&�&�C�C�
��U�U��[��B��%�@�@�@�F��[��B�H�Q�K�K��9�9�F��)�V�V�,�-�-�C�C�
�!�V�V��R����[��A�w�/�/�F��{�Q��������+�+������[��e�W�u�E�E�E�F��)�V�V�,�-�-�C�C�
��{�a���"�A�:��#���"�A�:��#�a�<���[��B��%�@�@�@�F��{�Q��������+�+������k�#�u�h��G�G�G�G��k�!�R�X�a�[�[�(�;�;�G��)�W�f�g�6�7�7�C��w�s�|�|�rc�>�|j|j}}||krtj|��S|js|dz
}|js|dz
}|dzdkr|dz}|}n
|dz}|dz}|dkr|�|||��}g}n`|dkrg}|�|||��}n=|�d||��}|�d||dz��}|dd�}tj|ddd�|f��}|js
|dd�}|js
|dd�}|S)z%Return an array containing n numbers.rrrN���)rrr�zerosrrr.r )	rr#rr�n1�n2�pospts�negptsr&s	         r�valuesz
Arg.values_si���v�t�v�1����6�6��8�A�;�;����	�
��F�A���	�
��F�A��q�5�A�:�:��A��B��B�B��A��B��a��B���6�6��*�*�1�a��3�3�F��F�F�
�!�V�V��F��+�+�Q�B���A�6�6�6�F�F��*�*�1�a��4�4�F��+�+�A��r�2��6�:�:�:�F��A�B�B�Z�F��i����"���v�.�/�/����	��a�b�b�'�C���	��c�r�c�(�C��
rN)	�__name__�
__module__�__qualname__�__doc__rrrr.r6�rrrrsf��������
�&��B�F��$�	F�	F�	F�	F�6�6�6�p#�#�#�#�#rrc��eZdZd�Zd�ZdS)�FixedArgc�8�tj|��|_dS�N)r�asarray�_values)rr6s  rrzFixedArg.__init__�s���z�&�)�)����rc��|jSr?)rA)rr#s  rr6zFixedArg.values�s
���|�rN�r7r8r9rr6r;rrr=r=�s2������*�*�*�����rr=c�t�eZdZeejej��eejej��fd�Zd�ZdS)�
ComplexArgc��t|j|j��|_t|j|j��|_dSr?)r�real�imag�rrrs   rrzComplexArg.__init__�s0�������'�'��	������'�'��	�	�	rc�2�ttjtj|������}|j�|��}|j�|dz��}|dd�dfd|ddd�fzz���S)Nry�?)�intr�floor�sqrtrGr6rH�ravel)rr#�m�x�ys     rr6zComplexArg.values�s�����������$�$�%�%���I���Q�����I���Q��U�#�#���!�!�!�D�&�	�B�q��a�a�a��y�L�(�/�/�1�1�1rN)r7r8r9�complexrrrr6r;rrrErE�s`������ ��"�&��2�6�'�2�2�g�g�b�f�b�f�6M�6M�(�(�(�(�2�2�2�2�2rrEc��eZdZdd�Zd�ZdS)�IntArg������c�"�||_||_dSr?)rrrIs   rrzIntArg.__init__�s���������rc�n�t|j|j���t	d|dzz|dz
�����t��}tjdd��}tj	tj
||f��}|||jk||jkz}|S)Nrr����)rrrr6r�astyperKr�arange�unique�r_)rr#�v1�v2�vs     rr6z
IntArg.values�s���
�����
 �
 �
'�
'��A��1��H�a��c�(:�(:�
;�
;�
B�
B�3�
G�
G��
�Y�r�1�
�
���I�b�e�B��F�m�$�$��
�q�D�F�{�q�4�6�z�*�+���rN)rUrVrCr;rrrTrT�s7��������������rrTc���t|tj��r|���}n�t	|��}tjd�|D����}||t
|��zz�t��dz}d�t||��D��}tj
tjtj|�����
|d��j}|S)Nc�@�g|]}t|t��rdnd��S)g�?g�?��
isinstancerE)�.0�specs  r�
<listcomp>zget_args.<locals>.<listcomp>�s+��Z�Z�Z�$�
�4�� <� <�E���#�Z�Z�Zrrc�>�g|]\}}|�|����Sr;)r6)rfrgrOs   rrhzget_args.<locals>.<listcomp>�s&��?�?�?�7�4�����A���?�?�?rr0)rer�ndarray�copy�lenr@�sumr[rK�zip�array�broadcast_arrays�ix_�reshape�T)�argspecr#�args�nargs�mss     r�get_argsrx�s����'�2�:�&�&�R��|�|�~�~����G����
�Z�Z�Z�RY�Z�Z�Z�
[�
[���"�S��W�W�*�o�
%�
%�c�
*�
*�Q�
.��?�?�c�'�2�.>�.>�?�?�?���x��+�R�V�T�]�;�<�<�D�D�U�B�O�O�Q���Krc�*�eZdZ				d	d�Zd�Zd�ZdS)
�
MpmathDataN�H�����z>�Y��n�FTc��|�G	ttj�dd����}n#t$rd}YnwxYw|rdnd}||_||_||_||_||_	||_
||_|	|_|
|_
||_t|jt j��r/t!j|jjt j��|_n#t-d�|jD����|_|
|_
||_|r|dkrt1|dd��}|r|dkrt1|dd��}||_|
|_dS)	N�SCIPY_XSLOW�0Fi�i�c�8�g|]}t|t����Sr;rd)rf�args  rrhz'MpmathData.__init__.<locals>.<listcomp>�s"��"X�"X�"X�3�:�c�:�#>�#>�"X�"X�"Xrz<lambda>r7)rK�os�environ�getr
�
scipy_func�mpmath_func�arg_spec�dps�precr#�rtol�atol�ignore_inf_sign�nan_okrerrj�
issubdtype�dtype�complexfloating�
is_complex�any�distinguish_nan_and_inf�getattr�name�param_filter)rr�r�r�r�r�r�r#r�r�r�r�r�r��is_xslows               rrzMpmathData.__init__�sh��
�9�
!��r�z�~�~�m�S�A�A�B�B�����
!�
!�
!� ����
!����!�)���c�A�$���&��� ��
������	������	���	�.�������d�m�R�Z�0�0�	Z� �m�D�M�,?��AS�T�T�D�O�O�!�"X�"X�$�-�"X�"X�"X�Y�Y�D�O�.���'>��$��	9�t�z�)�)��:�z�4�8�8�D��	:�t�z�)�)��;�
�D�9�9�D���	�(����s�-2�A�Ac
���
��tj�d��t�j�j��}tjjtjj	}}	�j�	�jg}ndg}�j	��j	tj_	tj
|jtj��rt�d��
nd��
d��t|��D]�\}}|tj_	t�j�
��fd�|d�j�j�j�j�j�j��
�
n]#t.$rP|t1|��d	z
kr7t3j��\}}}	|j|	ur|�|	���|�Y��wxYw||ctj_tj_	dS#||ctj_tj_	wxYw)
Ni��c�D�tjt|����Sr?)�mpmath�mpcrR�rPs r�mptypez MpmathData.check.<locals>.mptype�s��!�:�g�a�j�j�1�1�1rc�D�tjt|����Sr?)r��mpfrr�s rr�z MpmathData.check.<locals>.mptype�s��!�:�e�A�h�h�/�/�/rc��t|j��ddt|j��zzkrtjSt|j��S)Ng��ؗ�Ҝ<r)�absrHrGr�nan�	mpf2floatr�s r�pytypez MpmathData.check.<locals>.pytype�s=���1�6�{�{�U�A��A�F���O�%<�<�<�!�v�
�(���0�0�0rc�F����jt�|�����Sr?)r��map)rr�r�rs ���r�<lambda>z"MpmathData.check.<locals>.<lambda>s%�����8H��8H�#�f�VW�.�.�8Y�1Z�1Z�rF)�
vectorizedr�r�r�r�r�r�r)r�random�seedrxr�r#r��mpr�r�r�r�r��mpc2complex�	enumeraterr�r�r�r�r�r�r��AssertionErrorrl�sys�exc_info�
__traceback__�with_traceback)r�argarr�old_dps�old_prec�dps_list�jr��tp�value�tbr�r�s`         @@r�checkzMpmathData.check�s������
�	���t�����$�-���0�0��#�I�M�6�9�>���1	>��x�#� �H�:����4���y�$�!%���	��
�}�V�\�2�+=�>�>�

1�$��2�2�2�2�0�0�0�1�1�1�$�H�-�-�
$�
$���3� #��	�
�$�%�d�o�&Z�&Z�&Z�&Z�&Z�&Z�&,�16�+/�9�4�9�6:�6J�>B�>Z�-1�[�37�3D�F�F�F�F��E��%�$�$�$��C��M�M�!�O�+�+�(+����
��E�2� �.�b�8�8�"'�"6�"6�r�":�":�:�#��,�+�$����-4�X�)�F�I�M�6�9�>�>�>��G�X�)�F�I�M�6�9�>�=�=�=�=s3� B
F0�+AD.�,F0�.AF�F0�F�F0�0%Gc�<�|jrd|j�d�Sd|j�d�S)Nz
<MpmathData: z (complex)>�>)r�r�)rs r�__repr__zMpmathData.__repr__s6���?�	5�	5�37�9�9�9�>�>�	5�*.����4�4r)
NNNNr{r|FTTN)r7r8r9rr�r�r;rrrzrz�sT������?C�>D�@D�+/�%)�%)�%)�%)�N9>�9>�9>�v5�5�5�5�5rrzc�F�t|i|��}|���dSr?)rzr�)r�kw�ds   r�assert_mpmath_equalr�s%���A�����A��G�G�I�I�I�I�Irc�R�tj�d���|��S)Nz8    Test not yet functional (too slow), needs more work.)�reason)�pytest�mark�skip)�funcs r�nonfunctional_tooslowr�#s%���;���#]��^�^�_c�d�d�drc�L�ttj|ddd�����S)z�
    Convert an mpf to the nearest floating point number. Just using
    float directly doesn't work because of results like this:

    with mp.workdps(50):
        float(mpf("0.99999999999999999")) = 0.9999999999999999

    �r��	min_fixed�	max_fixed)rr��nstrr�s rr�r�+s%�����Q��a�1�=�=�=�>�>�>rc�j�tt|j��t|j����Sr?)rRr�rGrHr�s rr�r�7s&���9�Q�V�$�$�i���&7�&7�8�8�8rc����d����fd�}|S)Nc�r�t|tj��rt|��St	|��Sr?)rer�r�rRrr�s r�tofloatztrace_args.<locals>.tofloat<s-���a���$�$�	��1�:�:����8�8�Orc���tj�tt	�|�����d���tj���	�|i|��}tj�d|z��tj�d��tj���nB#tj�d��tj���wxYw|S)Nz: z-> %r�
)r��stderr�write�tupler��flush)rr��rr�r�s   ��r�wrapztrace_args.<locals>.wrapBs�����
���5��W�a���#9�#9�#9�#9�;�<�<�<��
������	���a��2���A��J���W�q�[�)�)�)��J���T�"�"�"��J��������
�J���T�"�"�"��J�����������s�*C�?Dr;)r�r�r�s` @r�
trace_argsr�;s8�������	�	�	�	�	�	��Kr�	setitimerFc��eZdZdS)�TimeoutErrorN)r7r8r9r;rrr�r�Ws�������Drr�r	Tc�@����tr
|rd�����fd�}n��fd�}|S)a
    Decorator for setting a timeout for pure-Python functions.

    If the function does not return within `timeout` seconds, the
    value `return_val` is returned instead.

    On POSIX this uses SIGALRM by default. On non-POSIX, settrace is
    used. Do not use this with threads: the SIGALRM implementation
    does probably not work well. The settrace implementation only
    traces the current thread.

    The settrace implementation slows down execution speed. Slowdown
    by a factor around 10 is probably typical.
    c��t���r?)r�)�signum�frames  r�sigalrm_handlerz%time_limited.<locals>.sigalrm_handlerks���.�.� rc��������fd�}|S)Nc�4��tjtj���}tjtj���	�|i|��tjtjd��tjtj|��S#t$rC�cYtjtjd��tjtj|��SwxYw#tjtjd��tjtj|��wxYw)Nr)�signal�SIGALRMr��ITIMER_REALr�)rr��old_handlerr��
return_valr��timeouts   ����rr�z(time_limited.<locals>.deco.<locals>.wrapos����$�m�F�N�O�L�L��� ��!3�W�=�=�=�?��4��>�b�>�>��$�V�%7��;�;�;��M�&�.�+�>�>�>�>��	$�&�&�&�%�%�%��$�V�%7��;�;�;��M�&�.�+�>�>�>�>�	&������$�V�%7��;�;�;��M�&�.�+�>�>�>�>���s%�B�C�C�C�C�ADr;)r�r�r�r�r�s` ���r�decoztime_limited.<locals>.decons3����	
?�	
?�	
?�	
?�	
?�	
?�	
?�	
?��Krc�������fd�}|S)Nc�D����tj������fd��tj���	�|i|��tjd��S#t$r-tjd���cYtjd��SwxYw#tjd��wxYw)Nc�X��tj���z
�krt����Sr?)�timer�)r��eventr��
start_timer��traces   ���rr�z7time_limited.<locals>.deco.<locals>.wrap.<locals>.traces(����y�{�{�Z�/�'�9�9�*�n�n�,� �Lr)r�r��settracer�)rr�r�r�r�r�r�s  @@���rr�z(time_limited.<locals>.deco.<locals>.wrap|s������!�Y�[�[�
�!�!�!�!�!�!�!���U�#�#�#�'��4��>�b�>�>�
�L��&�&�&�&��	$�&�&�&��L��&�&�&�%�%�%��L��&�&�&�&�	&������L��&�&�&�&���s#�A� B�/B	�B�B	�	Br;)r�r�r�r�s` ��rr�ztime_limited.<locals>.deco{s.����
'�
'�
'�
'�
'�
'�
'��Kr)�POSIX)r�r��use_sigalrmr�r�s``  @r�time_limitedr�[sr�����
�!��!�	!�	!�	!�	�	�	�	�	�	�	�	�	�	�	�	�	�	�"�Krc����fd�}|S)z9Decorate function to return nan if it raises an exceptionc�N��	�|i|��S#t$rtjcYSwxYwr?)�	Exceptionrr�)rr�r�s  �rr�zexception_to_nan.<locals>.wrap�s@���	��4��>�b�>�>�!���	�	�	��6�M�M�M�	���s��$�$r;�r�r�s` r�exception_to_nanr��s#��������
�Krc����fd�}|S)z1Decorate function to return nan if it returns infc�X���|i|��}tj|��stjS|Sr?)r�isfiniter�)rr�rar�s   �rr�zinf_to_nan.<locals>.wrap�s0����D�!�N�r�N�N���{�1�~�~�	��6�M��rr;r�s` r�
inf_to_nanr�s#��������
�Kr��FF�g<c	�z�g}tt||����D]f\}\}}|�|�td���tj||z
��||tj|��zzkr|�|||f���gt
|��}|dk�rtttj
|������}	dg}
|
�d�||dz����|D]�\}}}tj||	dd���}tj||	dd���}|dkrd}
n/tj||z
|z��}
tj|
d	��}
|
�d
�||||
������tdd�|
����dSdS)
z|
    Compare lists of mpmath.mpf's or mpmath.mpc's directly so that it
    can be done to higher precision than double.
    Nz,Lengths of inputs res and std are not equal.r�z4Bad results ({} out of {}) for the following points:rr�r�z{}: {} != {} (rdiff {})Fr�)r�rr
r��fabs�appendrlrKr�rr�formatr�r�join)�res�stdr�r��failures�k�resval�stdval�nfail�ndigits�msg�resrep�stdrep�rdiffs              r�mp_assert_allcloser�s���
�H�(��S�#�)>�)>�?�?�1�1����F�F��>�V�^��K�L�L�L��;�v���'�'�$��f�k�&�6I�6I�1I�*I�I�I��O�O�Q���/�0�0�0����M�M�E��q�y�y��c�"�(�4�.�.�)�)�*�*���d���
�
�I��F�5�!�a�%�(�(�	*�	*�	*�!)�		@�		@��A�v�v��[���A��K�K�K�F��[���A��K�K�K�F���{�{������V�f�_�f�$<�=�=����E�1�-�-���J�J�0�7�7��6�6�8=�?�?�
@�
@�
@�
@���t�y�y��~�~�&�&�&�&�&��yr)rr)$r�r�r��	itertoolsr�numpyr�
numpy.testingrr��scipy.special._testutilsrr��ImportErrorrr=rErTrxrzr�r�r�r�r��posixr��dirr�r�r�r�r�r�rrr;rr�<module>rs���	�	�	�	�
�
�
�
�����!�!�!�!�!�!�����!�!�!�!�!�!�
�
�
�
�6�6�6�6�6�6�	��M�M�M�M���	�	�	��D�	����l�l�l�l�l�l�l�l�^��������	2�	2�	2�	2�	2�	2�	2�	2�
�
�
�
�
�
�
�
����g5�g5�g5�g5�g5�g5�g5�g5�T���
e�e�e�	?�	?�	?�9�9�9����(��L�L�L��M�M�M�
�C�C��K�K�
'�E�E�������E�E�E�����	�	�	�	�	�9�	�	�	����T�1�1�1�1�h������'�'�'�'�'�'s�-�5�5�B"�"B,�+B,

Youez - 2016 - github.com/yon3zu
LinuXploit