403Webshell
Server IP : 217.160.0.135  /  Your IP : 216.73.217.85
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/numpy/f2py/tests/__pycache__/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : /lib/python3/dist-packages/numpy/f2py/tests/__pycache__/test_crackfortran.cpython-311.pyc
�

���c�)����ddlZddlZddlZddlZddlZddlmZddlm	Z	ddl
mZddlZGd�de	j
��ZGd�d	��ZGd
�d��ZGd�d
e	j
��ZGd�de	j
��ZGd�d��ZGd�de	j
��ZGd�d��ZGd�de	j
��ZGd�de	j
��ZGd�de	j
��ZdS)�N��markinnerspaces�)�util)�crackfortranc�<�eZdZejdddd��gZd�ZdS)�TestNoSpace�tests�srcrz	gh15035.fc��tjgd�tj���}tjgd�tj���}|j�|��tj||dz��sJ�|j�||g��tj||dz��sJ�|j�d��dksJ�dS)N)r��)�dtyper�23�2)�np�array�float64�module�subb�allclose�subc�t0)�self�k�ws   �D/usr/lib/python3/dist-packages/numpy/f2py/tests/test_crackfortran.py�test_modulezTestNoSpace.test_modules����H�Y�Y�Y�b�j�1�1�1���H�Y�Y�Y�b�j�1�1�1�����������{�1�a�!�e�$�$�$�$�$�����!�Q�� � � ��{�1�a�!�e�$�$�$�$�$��{�~�~�d�#�#�t�+�+�+�+�+�+�N)�__name__�
__module__�__qualname__r�getpath�sourcesr�rrr	r	s?�������t�|�G�U�N�K�H�H�I�G�,�,�,�,�,rr	c� �eZdZd�Zd�Zd�ZdS)�TestPublicPrivatec���tjdddd��}tjt|��g��}t	|��dksJ�|d}d|dd	d
vsJ�d|dd	d
vsJ�d|ddd
vsJ�d|ddd
vsJ�d|dd
d
vsJ�d|dd
d
vsJ�dS)Nr
rrzprivatemod.f90rr�private�vars�a�attrspec�public�b�seta�rr#r�str�len)r�fpath�mods   r�test_defaultPrivatez%TestPublicPrivate.test_defaultPrivates����W�e�^�=M�N�N���'��U����5�5���3�x�x�1�}�}�}�}��!�f���C��K��,�Z�8�8�8�8�8��s�6�{�3�/�
�;�;�;�;�;��C��K��,�Z�8�8�8�8�8��s�6�{�3�/�
�;�;�;�;�;���F��F� 3�J� ?�?�?�?�?��3�v�;�v�.�z�:�:�:�:�:�:�:rc�r�tjdddd��}tjt|��g��}t	|��dksJ�|d}d|dd	d
vsJ�d|dd	d
vsJ�d|ddd
vsJ�d|ddd
vsJ�dS)
Nr
rrz
publicmod.f90rrr)r*r+r,r-r/r0�r�tmp_pathr3r4s    r�test_defaultPublicz$TestPublicPrivate.test_defaultPublic(s�����W�e�^�_�M�M���'��U����5�5���3�x�x�1�}�}�}�}��!�f���C��K��,�Z�8�8�8�8�8��s�6�{�3�/�
�;�;�;�;�;���F��F� 3�J� ?�?�?�?�?��3�v�;�v�.�z�:�:�:�:�:�:�:rc��tjdddd��}tjt|��g��}t	|��dksJ�|dd}t|dd	��d
dhksJ�t|dd	��d
dhksJ�t|dd	��d
hksJ�dS)Nr
rrzaccesstype.f90rrr*r+r,r)zbind(c)�b_r-�c)rr#rr1r2�set)rr8r3r4�tts     r�test_access_typez"TestPublicPrivate.test_access_type2s�����W�e�^�=M�N�N���'��U����5�5���3�x�x�1�}�}�}�}�
��V�F�^���2�c�7�:�&�'�'�I�y�+A�A�A�A�A��2�d�8�J�'�(�(�X�y�,A�A�A�A�A��2�c�7�:�&�'�'�H�:�5�5�5�5�5�5rN)r r!r"r5r9r?r%rrr'r'sA������
;�
;�
;�;�;�;�6�6�6�6�6rr'c��eZdZd�Zd�ZdS)�TestModuleProcedurec��tjdddd��}tjt|��g��}t	|��dksJ�|d}d|vrt	|d��dksJ�|ddd	d
ksJ�d|ddvsJ�|ddddd
gksJ�|ddd	dksJ�d|ddvsJ�|ddddgksJ�|ddd	dksJ�d|ddvsJ�|dddddgksJ�dS)Nr
rrz
operators.f90rr�body�	�namezoperator(.item.)�
implementedby�item_int�	item_realr
zoperator(==)�items_are_equalrz
assignment(=)�get_int�get_realr0r7s    r�test_moduleOperatorsz(TestModuleProcedure.test_moduleOperators=s�����W�e�^�_�M�M���'��U����5�5���3�x�x�1�}�}�}�}��!�f����}�}��S��[�!1�!1�Q�!6�!6�!6�!6��6�{�1�~�f�%�);�;�;�;�;��#�f�+�a�.�0�0�0�0��6�{�1�~�o�.�
��%�&�&�&�&��6�{�1�~�f�%��7�7�7�7��#�f�+�a�.�0�0�0�0��6�{�1�~�o�.�3D�2E�E�E�E�E��6�{�1�~�f�%��8�8�8�8��#�f�+�a�.�0�0�0�0��6�{�1�~�o�.�
�
�#�$�$�$�$�$�$rc�T�tjdddd��}tjt|��g��}t	|��dksJ�|d}|ddd	d
gksJ�|ddd	dgksJ�|dd
d	dgksJ�dS)Nr
rrzpubprivmod.f90rrr*r+r,r)r.r-r/r0r7s    r�test_notPublicPrivatez)TestModuleProcedure.test_notPublicPrivateOs�����W�e�^�=M�N�N���'��U����5�5���3�x�x�1�}�}�}�}��!�f���6�{�3��
�+�	�}�<�<�<�<��6�{�3��
�+��|�;�;�;�;��6�{�6�"�:�.�8�,�>�>�>�>�>�>rN)r r!r"rLrNr%rrrArA<s2������$�$�$�$?�?�?�?�?rrAc�B�eZdZejdddd��gZd�Zd�ZdS)�TestExternalr
rrz	gh17859.fc�P�d�}|j�|��}|dksJ�dS)Nc��|dzS�N�{r%��xs r�incrz5TestExternal.test_external_as_statement.<locals>.incr^����s�7�NrrT)r�external_as_statement�rrW�rs   r�test_external_as_statementz'TestExternal.test_external_as_statement]�9��	�	�	�
�K�-�-�d�3�3���C�x�x�x�x�x�xrc�P�d�}|j�|��}|dksJ�dS)Nc��|dzSrSr%rUs rrWz5TestExternal.test_external_as_attribute.<locals>.increrXrrT)r�external_as_attributerZs   r�test_external_as_attributez'TestExternal.test_external_as_attributedr]rN)r r!r"rr#r$r\rar%rrrPrPYsL�������t�|�G�U�N�K�H�H�I�G��������rrPc�<�eZdZejdddd��gZd�ZdS)�TestCrackFortranr
rrz
gh2848.f90c�L�|j�dd��}|dksJ�dS)Nrr
)rr
)r�gh2848)rr[s  r�test_gh2848zTestCrackFortran.test_gh2848ps*���K���q�!�$�$���F�{�{�{�{�{�{rN)r r!r"rr#r$rfr%rrrcrcls=�������t�|�G�U�N�L�I�I�J�G�����rrcc�&�eZdZd�Zd�Zd�Zd�ZdS)�TestMarkinnerspacesc�B�gd�}|D]}t|��|ksJ��dS)N)za z aza b cz'abcdefghij'r)r�	test_list�is   r�test_do_not_touch_normal_spacesz3TestMarkinnerspaces.test_do_not_touch_normal_spacesxsB��9�9�9�	��	+�	+�A�"�1�%�%��*�*�*�*�*�	+�	+rc�Z�td��dksJ�td��dksJ�dS)Nz
a 'b c' \' \'za 'b@_@c' \' \'z
a "b c" \" \"za "b@_@c" \" \"r�rs r�test_one_relevant_spacez+TestMarkinnerspaces.test_one_relevant_space}s>���0�1�1�5H�H�H�H�H��/�0�0�4F�F�F�F�F�F�Frc�Z�td��dksJ�td��dksJ�dS)Nza 'b c" " d' eza 'b@_@c"@_@"@_@d' eza "b c' ' d" eza "b@_@c'@_@'@_@d" errns r�test_ignore_inner_quotesz,TestMarkinnerspaces.test_ignore_inner_quotes�s>���1�2�2�6N�N�N�N�N��1�2�2�6N�N�N�N�N�N�Nrc�Z�td��dksJ�td��dksJ�dS)Nz
a 'b c' 'd e'za 'b@_@c' 'd@_@e'z
a "b c" "d e"za "b@_@c" "d@_@e"rrns r�test_multiple_relevant_spacesz1TestMarkinnerspaces.test_multiple_relevant_spaces�s=����/�/�3F�F�F�F�F��/�0�0�4H�H�H�H�H�H�HrN)r r!r"rlrorqrsr%rrrhrhus[������+�+�+�
G�G�G�O�O�O�I�I�I�I�Irrhc	��eZdZdZdZejd��Zgd�ZdgZ	ee	zZ
dZee
��D]R\Z
Zd�e�d��D��Zee�e
ed	�e���
��z
Z�Sej�de
��d���Zej�de
��d
���ZdS)�TestDimSpeca�This test suite tests various expressions that are used as dimension
    specifications.

    There exists two usage cases where analyzing dimensions
    specifications are important.

    In the first case, the size of output arrays must be defined based
    on the inputs to a Fortran function. Because Fortran supports
    arbitrary bases for indexing, for instance, `arr(lower:upper)`,
    f2py has to evaluate an expression `upper - lower + 1` where
    `lower` and `upper` are arbitrary expressions of input parameters.
    The evaluation is performed in C, so f2py has to translate Fortran
    expressions to valid C expressions (an alternative approach is
    that a developer specifies the corresponding C expressions in a
    .pyf file).

    In the second case, when user provides an input array with a given
    size but some hidden parameters used in dimensions specifications
    need to be determined based on the input array size. This is a
    harder problem because f2py has to solve the inverse problem: find
    a parameter `p` such that `upper(p) - lower(p) + 1` equals to the
    size of input array. In the case when this equation cannot be
    solved (e.g. because the input array size is wrong), raise an
    error before calling the Fortran function (that otherwise would
    likely crash Python process when the size of input arrays is
    wrong). f2py currently supports this case only when the equation
    is linear with respect to unknown parameter.

    z.f90a
      function get_arr_size_{count}(a, n) result (length)
        integer, intent(in) :: n
        integer, dimension({dimspec}), intent(out) :: a
        integer length
        length = size(a)
      end function

      subroutine get_inv_arr_size_{count}(a, n)
        integer :: n
        ! the value of n is computed in f2py wrapper
        !f2py intent(out) n
        integer, dimension({dimspec}), intent(in) :: a
        if (a({first}).gt.0) then
          print*, "a=", a
        endif
      end subroutine
    )�nz2*nz2:nzn/2z5 - n/2z3*n:20zn*(n+1):n*(n+5)z2*n, nz
2*n:3*n*n+2*n�c�P�g|]#}d|vr|�d��dnd��$S)�:r�1)�split)�.0�ds  r�
<listcomp>zTestDimSpec.<listcomp>�s2��R�R�R�!�3�!�8�8�������Q����R�R�Rr�,z, )�count�dimspec�firstr�c��|j�|��}t|jd|����}dD]}||��\}}|j|ksJ��dS)N�
get_arr_size_�rr
r��)�all_dimspecs�index�getattrr�size)rr�r��get_arr_sizerv�szr+s       r�test_array_sizezTestDimSpec.test_array_size�so���!�'�'��0�0���t�{�,C�E�,C�,C�D�D�� �	 �	 �A� �L��O�O�E�B���6�R�<�<�<�<�<�	 �	 rc�F�|j�|��}t|jd|����}t|jd|����}dD]S}||��\}}||jvr
|||��}n||��}||��\}	}
||	ksJ||||	f����TdS)Nr��get_inv_arr_size_r�)r�r�r�r�nonlinear_dimspecs)rr�r�r��get_inv_arr_sizervr�r+�n1�sz1�_s           r�test_inv_array_sizezTestDimSpec.test_inv_array_size�s����!�'�'��0�0���t�{�,C�E�,C�,C�D�D��"�4�;�0K�E�0K�0K�L�L�� �	/�	/�A� �L��O�O�E�B���$�1�1�1�&�%�a��+�+���&�%�a�(�(��"�\�"�%�%�F�C����9�9�9�q�"�b�#�.�9�9�9�9�	/�	/rN)r r!r"�__doc__�suffix�textwrap�dedent�
code_template�linear_dimspecsr�r��code�	enumerater�r�r{�lst�format�join�pytest�mark�parametrizer�r�r%rrruru�s7��������<�F�#�H�O�%�	�	�M�&���O�*�*��"�%7�7�L�
�D�#�)�L�1�1�
�
���w�R�R�w�}�}�S�?Q�?Q�R�R�R���
�$�$����)�)�C�.�.�%�
�
�	
����[���Y��5�5� � �6�5� ��[���Y��5�5�/�/�6�5�/�/�/rruc��eZdZd�ZdS)�TestModuleDeclarationc���tjdddd��}tjt|��g��}t	|��dksJ�|dddd	d
ksJ�dS)Nr
rrzfoo_deps.f90rrr*�abar�=zbar('abar')r0r7s    r�test_dependenciesz'TestModuleDeclaration.test_dependencies�sk����W�e�^�^�L�L���'��U����5�5���3�x�x�1�}�}�}�}��1�v�f�~�f�%�c�*�m�;�;�;�;�;�;rN)r r!r"r�r%rrr�r��s#������<�<�<�<�<rr�c��eZdZd�ZdS)�TestEvalc���tj}|di��dksJ�|di��dksJ�|dtdd�����dksJ�|d	i��d
ksJ�dS)N�123z12 + 3�15za + brr
)r+r.�3z"123"z'123')r�_eval_scalar�dict)r�eval_scalars  r�test_eval_scalarzTestEval.test_eval_scalar�s���"�/���{�5�"�%�%��.�.�.�.��{�8�R�(�(�D�0�0�0�0��{�7�D�1��N�N�N�3�3�s�:�:�:�:��{�7�B�'�'�7�2�2�2�2�2�2rN)r r!r"r�r%rrr�r��s#������3�3�3�3�3rr�c�Z�eZdZej�dgd���d���ZdS)�TestFortranReader�encoding)�asciizutf-8zutf-16zutf-32c��|d|�d�z}|�d|���5}|�d��ddd��n#1swxYwYtjt|��g��}|dddksJ�dS)	N�input_with_z
_encoding.f90r)r�zd
                     subroutine foo()
                     end subroutine foo
                     rrE�foo)�open�writerr1)rr8r��f_path�ffr4s      r�test_input_encodingz%TestFortranReader.test_input_encodings����A�(�A�A�A�A��
�[�[��x�[�
0�
0�	�B��H�H��
�
�
�	�	�	�	�	�	�	�	�	�	�	����	�	�	�	�
�'��V���
�6�6���1�v�f�~��&�&�&�&�&�&s�A�A�
AN)r r!r"r�r�r�r�r%rrr�r�sQ�������[���Z�C�C�C�E�E�	'�	'�E�E�	'�	'�	'rr�c��eZdZejdddd��gZej�e	j�
d��dud���d	���ZdS)
�TestUnicodeCommentr
rrzunicode_comment.f90�charset_normalizerNz7test requires charset_normalizer which is not installed)�reasonc�:�|j�d��dS)Nr)rr�rns r�test_encoding_commentz(TestUnicodeComment.test_encoding_comments��
	
���������r)r r!r"rr#r$r�r��skipif�	importlib�	find_specr�r%rrr�r�s~�������t�|�G�U�N�<Q�R�R�S�G��[���	��	!�	!�"6�	7�	7�4�	?�H������	����rr�)r��codecs�unicodedatar��numpyr�numpy.f2py.crackfortranrrwr�
numpy.f2pyrr��F2PyTestr	r'rArPrcrhrur�r�r�r�r%rr�<module>r�sj������
�
�
�
�����
�
�
�
�����3�3�3�3�3�3�������#�#�#�#�#�#�����,�,�,�,�,�$�-�,�,�,�6�6�6�6�6�6�6�6�B?�?�?�?�?�?�?�?�:�����4�=����&�����t�}����I�I�I�I�I�I�I�I�(c/�c/�c/�c/�c/�$�-�c/�c/�c/�L<�<�<�<�<�<�<�<�3�3�3�3�3�t�}�3�3�3�'�'�'�'�'��
�'�'�'������������r

Youez - 2016 - github.com/yon3zu
LinuXploit