ok

Mini Shell

Direktori : /opt/cloudlinux/venv/lib/python3.11/site-packages/numpy/f2py/__pycache__/
Upload File :
Current File : //opt/cloudlinux/venv/lib/python3.11/site-packages/numpy/f2py/__pycache__/symbolic.cpython-311.pyc

�

�܋f
���D�dZdgZddlZddlZddlmZddlmZGd�de��ZGd�d	e��Z	Gd
�de��Z
Gd�d
e��ZGd�de��Z
Gd�de��ZefZeefZd�ZGd�de��Zd�ZGd�d��Zd�Zd�Zd�Zd;d�Zd;d�Zd;d�Zd<d�Zd �Zd=d!�Z d"�Z!d#�Z"d$�Z#d%�Z$d&�Z%d'�Z&d(�Z'd)�Z(d*�Z)d+�Z*d,�Z+d-�Z,d.�Z-d/�Z.d0�Z/e/��Z0d1�Z1d2�Z2d3�Z3d4�Z4d5�Z5ej6fd6�Z7Gd7�d8��Z8Gd9�d:��Z9dS)>z{Fortran/C symbolic expressions

References:
- J3/21-007: Draft Fortran 202x. https://j3-fortran.org/doc/year/21/21-007.pdf
�Expr�N)�Enum)�gcdc��eZdZdZdZdZdZdS)�Languagez2
    Used as Expr.tostring language argument.
    r��N)�__name__�
__module__�__qualname__�__doc__�Python�Fortran�C���f/builddir/build/BUILD/cloudlinux-venv-1.0.6/venv/lib64/python3.11/site-packages/numpy/f2py/symbolic.pyrrs)���������F��G�	�A�A�Arrc�N�eZdZdZdZdZdZdZdZdZ	dZ
d	Zd
ZdZ
dZd
ZdZdZdZdS)�Opz$
    Used as Expr op attribute.
    �
�����(�d������i,i�i�i�i�N)r
rrr
�INTEGER�REAL�COMPLEX�STRING�ARRAY�SYMBOL�TERNARY�APPLY�INDEXING�CONCAT�
RELATIONAL�TERMS�FACTORS�REF�DEREFrrrrr&se���������G�
�D��G�
�F��E�
�F��G��E��H�
�F��J��E��G�
�C��E�E�Errc�b�eZdZdZdZdZdZdZdZdZ	e
ejfd���Z
ejfd	�Zd
S)�RelOpzH
    Used in Op.RELATIONAL expression to specify the function part.
    rr	����c�n�|tjur]tjtjtjtjtjtjd�|�	��Stjtjtjtjtjtjd�|S)N)�.eq.�.ne.�.lt.�.le.�.gt.�.ge.)�==�!=�<�<=�>�>=)
rrr0�EQ�NE�LT�LE�GT�GE�lower)�cls�s�languages   r�
fromstringzRelOp.fromstringFs����x�'�'�'�!�H�e�h�!�H�e�h�!�H�e�h�8�8�89���	�	�C�
C��h�e�h�U�X��h�U�X�U�X�?�?�?@�B�	Brc�^�|tjurPtjdtjdtjdtjdtjdtjdi|Stjdtjdtjd	tjd
tjdtjdi|S)
Nr6r7r8r9r:r;r<r=r>r?r@rA)	rrr0rBrCrDrErFrG��selfrKs  r�tostringzRelOp.tostringOs����x�'�'�'��H�f�e�h���H�f�e�h���H�f�e�h��8�8<�>�
>���$���$���#�u�x����#�u�x��/�/3�5�	5rN)r
rrr
rBrCrDrErFrG�classmethodrrrLrPrrrr0r0;s���������
�B�	
�B�	
�B�	
�B�	
�B�	
�B��$,�J�B�B�B��[�B�!)�
�5�5�5�5�5�5rr0c�.�eZdZdZdZdZdZdZdZdZ	dZ
d	S)
�ArithOpzC
    Used in Op.APPLY expression to specify the function part.
    rr	r1r2r3r4�N)r
rrr
�POS�NEG�ADD�SUB�MUL�DIV�POWrrrrSrSYs=���������C�
�C�
�C�
�C�
�C�
�C�
�C�C�CrrSc��eZdZdS)�OpErrorN�r
rrrrrr]r]f��������Drr]c�F�eZdZdZdZdZdZdZdZdZ	dZ
d	Zd
ZdZ
dZd
ZdZdS)�
Precedencez4
    Used as Expr.tostring precedence argument.
    rrr	r1r2r4rT�r�
�rrN)r
rrr
�ATOM�POWER�UNARY�PRODUCT�SUMrDrB�LAND�LORr&�ASSIGN�TUPLE�NONErrrrarajs[��������
�D�
�E�
�E��G�
�C�	
�B�	
�B�
�D�
�C��G�
�F��E��D�D�Drrac�d�|�|��}|�|||<dS||z}|r|||<dS||=dS�N)�get)�d�k�v�cs    r�
_pairs_addrv�sL��	���a���A��y���!����
��E���	��A�a�D�D�D��!���rc��eZdZdS)�ExprWarningNr^rrrrxrx�r_rrxc�>�tj|td���dS)Nr	)�
stacklevel)�warnings�warnrx)�messages r�ewarnr~�s���M�'�;�1�5�5�5�5�5�5rc�
�eZdZdZeejfd���Zd�Zd�Z	d�Z
d�Zd�Zd�Z
d	�Zd
�Zd�Zejejfd�Zd
�Zd�Zd�Zd�Zd�Zd�Zd�Zd�Zd�Zd�Zd�Zd�Z d�Z!d�Z"d�Z#d�Z$d�Z%d�Z&d�Z'd �Z(d!�Z)d"S)#rzfRepresents a Fortran expression as a op-data pair.

    Expr instances are hashable and sortable.
    c�$�t||���S)z.Parse a Fortran expression to a Expr.
        �rK)rL)rJrKs  r�parsez
Expr.parse�s���!�h�/�/�/�/rc��t|t��sJ�|tjurut|t��rt	|��dksJ�t|dt
��sJ�t|dt
tf��s
J|����n�|tjurut|t��rt	|��dksJ�t|dt��sJ�t|dt
tf��s
J|����n!|tj	ur,t|t��rt	|��dksJ��n�|tj
ur�t|t��rt	|��dksJ�t|dt��r)|dddt	|d��dz
�dvsJ�t|dt
tf��s
J|����n;|tjurt|���J��n|tj
tjfvr<t|t��sJ�td�|D����s
J|����n�|tjtjfvrt|t$��sJ��n�|tjur}t|t��rt	|��dksJ�t|d���J�t|dt��sJ�t|dt$��sJ��n|tjurBt|t��rt	|��dksJ�t|d���J�n�|tjur+t|t��rt	|��dksJ�n}|tjtjfvrt|t0��sJ�nK|tjur+t|t��rt	|��dksJ�nt5d|�����||_||_dS)Nr	rr)z""z''z@@c3�@K�|]}t|t��V��dSrp)�
isinstancer)�.0�items  r�	<genexpr>z Expr.__init__.<locals>.<genexpr>�s,����?�?�$�z�$��-�-�?�?�?�?�?�?rr1z$unknown op or missing sanity check: )r�rr �tuple�len�int�strr!�floatr"r#r%�hashr$r)�allr+r,�dictr'r(r&r-r.rr*�NotImplementedError�op�data)rOr�r�s   r�__init__z
Expr.__init__�s���"�b�!�!�!�!�!�������d�E�*�*�=�s�4�y�y�A�~�~�~�=��d�1�g�s�+�+�+�+�+��d�1�g��S�z�2�2�8�8�D�8�8�2�8�
�2�7�]�]��d�E�*�*�=�s�4�y�y�A�~�~�~�=��d�1�g�u�-�-�-�-�-��d�1�g��S�z�2�2�8�8�D�8�8�2�8�
�2�:�
�
��d�E�*�*�=�s�4�y�y�A�~�~�~�=�~�
�2�9�_�_��d�E�*�*�=�s�4�y�y�A�~�~�~�=��t�A�w��,�,�
I��Q�� 0� 0�#�d�1�g�,�,�q�.� 0�1�5G�G�G�G�H��d�1�g��S�z�2�2�8�8�D�8�8�2�8�
�2�9�_�_���:�:�)�)�)�)�
�B�H�b�i�(�
(�
(��d�E�*�*�*�*�*��?�?�$�?�?�?�?�?�E�E��E�E�?�E�
�B�H�b�j�)�
)�
)��d�D�)�)�)�)�)�)�
�2�8�^�^��d�E�*�*�=�s�4�y�y�A�~�~�~�=���Q��=�=�,�,�,��d�1�g�u�-�-�-�-�-��d�1�g�t�,�,�,�,�,�,�
�2�;�
�
��d�E�*�*�=�s�4�y�y�A�~�~�~�=���Q��=�=�,�,�,�,�
�2�:�
�
��d�E�*�*�=�s�4�y�y�A�~�~�~�=�~�
�B�F�B�H�%�
%�
%��d�D�)�)�)�)�)�)�
�2�=�
 �
 ��d�E�*�*�=�s�4�y�y�A�~�~�~�=�~�%�;�r�;�;�=�=�
=������	�	�	rc�h�t|t��o|j|juo|j|jkSrp)r�rr�r��rO�others  r�__eq__zExpr.__eq__�s6���5�$�'�'�,��G�u�x�'�,��I���+�	-rc��|jtjtjfvr4t	t|j�������}nd|jtjurJ|jdd�t	t|jd�������z}n|j}t|j|f��S�Nr	)
r�rr+r,r��sortedr��itemsr'r�)rOr�s  r�__hash__z
Expr.__hash__�s����7�r�x���,�,�,����	��� 1� 1�2�2�3�3�D�D�
�W���
 �
 ��9�R�a�R�=�5���	�!��0B�0B�0D�0D�)E�)E�#F�#F�F�D�D��9�D��T�W�d�O�$�$�$rc�H�t|t���r�|j|jur|jj|jjkS|jtjtjfvrhtt|j	�
������tt|j	�
������kS|jtjur�|j	dd�|j	dd�kr |j	dd�|j	dd�kStt|j	d�
������tt|j	d�
������kS|j	|j	kStSr�)
r�rr��valuerr+r,r�r�r�r�r'�NotImplementedr�s  r�__lt__zExpr.__lt__�sP���e�T�"�"�	*��w�e�h�&�&��w�}�u�x�~�5�5��w�2�8�R�Z�0�0�0��f�T�Y�_�_�%6�%6�7�7�8�8���u�z�'7�'7�'9�'9� :� :�;�;�<�=��w�"�(�"�"��9�R�a�R�=�E�J�r��r�N�2�2��9�R�a�R�=�5�:�b�q�b�>�9�9��V�D�I�a�L�$6�$6�$8�$8�9�9�:�:�U��5�:�a�=�.�.�0�0�1�1�>3�>3�3�3��9�u�z�)�)��rc��||kp||kSrprr�s  r�__le__zExpr.__le__s��D�E�M�$A�T�E�\�Arc��||kSrprr�s  r�__gt__zExpr.__gt__s�����$7�7rc��||kSrprr�s  r�__ge__zExpr.__ge__s�����$6�6rc�P�t|��j�d|j�d|j�d�S�N�(�, �))�typer
r�r��rOs r�__repr__z
Expr.__repr__s.���t�*�*�%�A�A���A�A�4�9�A�A�A�Arc�*�|���Srp)rPr�s r�__str__zExpr.__str__
s���}�}���rc�l��|jtjtjfvri|jddkrt
jnt
j}t|jd��|jddkrd|jd��ndz}�n�|jtj	ur<d�
�fd�|jD����}d|zd	z}t
j}�nC|jtjur"t
j}t|j��}�n|jtjur?|jd}|jddkr|jddz|z}t
j}�n�|jtj
ur<d�
�fd
�|jD����}d|zdz}t
j}�nm|jtju�r)g}t|j�����D]�\}}|dkrd
}|}nd}|dkr"|�t
j����}nJ|t%d��krt|��}n'|�d�|�t
j����z}|r|�|��n|d
kr|�d��|�|����d�
|��pd}|rt
jnt
j}�n0|jtju�r�g}	g}
t|j�����D�]G\}}d}|dkr"|�t
j����}
n�t,jur�|t1dd��vr;|�t
j����}
d�
|
g|z��}
n�|t1dd��vr,|�t
j����}
|
|
g|zz
}
��|�t
j����}
d|
�d|�d	�}
n'|�t
j����d|��z}
|	r|	�|��|	�|
����I|
r$|	s|	dgz
}	|	ddd�
|
��d	gz
}	d�
|	��pd}|	rt
jnt
j}�nP|jtjur�|j\}}}|t8jur4�t,jur&�fd�|D��\}}|�d|��}t
j}�n�fd�|D��}|d�|���D��z
}|�dd�
|���d	�}t
j}�n�|jtjurQ|jd}�fd�|jdd�D��}|�dd�
|���d�}t
j}�n4|jtjur6�fd �|jD��}d!�
|��}t
j}�n�|jtj ur��fd"�|jD��\}}}�t,jur
d|�d#|�d$|�d	�}nP�t,j!ur
d|�d%|�d&|�d	�}n5�t,j"ur
d'|�d|�d|�d	�}ntGd(|j�d)������t
j}�nH|jtj$ur6d*|j�t
j%����z}t
j%}n�|jtj&ur6d+|j�t
j%����z}t
j%}n�|jtj'ur�|j\}}}|tPj)tPj*fvrt
j)nt
j+}|�|����}|�|����}|�����}|�d,|�d,|��}ntGd-|j�����|j,|j,krd|zd	zS|S).z0Return a string representation of Expr.
        rrr2�_�r�c3�Z�K�|]%}|�tj����V��&dS�r�N�rPrarm�r�r�rKs  �rr�z Expr.tostring.<locals>.<genexpr>�J�����1�1�"��-�-�
�(8�8�-�L�L�1�1�1�1�1�1rr�r�c3�Z�K�|]%}|�tj����V��&dSr�r�r�s  �rr�z Expr.tostring.<locals>.<genexpr>$r�r�[�]z - � + r�� * �-�0r	ri����zpow(z ** �1�/c�R��g|]#}|�tj������$S�r��rPrarh�r��argrKs  �r�
<listcomp>z!Expr.tostring.<locals>.<listcomp>dsF��� 1� 1� 1�$'�!$���Z�-?�6>�!-�!@�!@� 1� 1� 1rz / c�R��g|]#}|�tj������$Sr�r�r�s  �rr�z!Expr.tostring.<locals>.<listcomp>js<���)�)�)�����Z�%5���I�I�)�)�)rc�^�g|]*\}}|dz|�tj��z��+S)�=)rPrarn�r�rsrts   rr�z!Expr.tostring.<locals>.<listcomp>lsC��5�5�5�!�Q���S��1�:�:�j�o�#>�#>�>�5�5�5rc�R��g|]#}|�tj������$Sr�r�r�s  �rr�z!Expr.tostring.<locals>.<listcomp>rs<���.�.�.���L�L��!1�H�L�E�E�.�.�.rNc�R��g|]#}|�tj������$Sr�r�r�s  �rr�z!Expr.tostring.<locals>.<listcomp>ws<���*�*�*���L�L��!3�h�L�G�G�*�*�*rz // c�R��g|]#}|�tj������$Sr�r�)r��arKs  �rr�z!Expr.tostring.<locals>.<listcomp>|sF���"6�"6�"6�&'�#$�*�*�Z�-=�6>�#-�#@�#@�"6�"6�"6r�?�:z if z else zmerge(z
tostring for z and �&�*� ztostring for op )-r�rr r!r�rarirer�r"�joinr%r#r$r+r�r�rP�	as_numberrh�appendr,rr�rangermrfr'rSrZr(r)r&rrr�r-rgr.r*r0rBrCrDr�)rO�parent_precedencerK�
precedence�r�terms�term�coeffr��factors�tail�base�exp�factor�name�args�kwargs�numer�denom�cond�expr1�expr2�rop�left�rights  `                      rrPz
Expr.tostring
s	����7�r�z�2�7�+�+�+�,0�I�a�L�1�,<�,<�*�.�.�)��
��D�I�a�L�!�!�(,�	�!���(9�(9�&8���1��%7�%7�%7�?A�C�A�A�
�W��
�
"�
"��	�	�1�1�1�1�&*�i�1�1�1�1�1�A��a��#�
�A�#��J�J�
�W��	�
!�
!�#��J��D�I���A�A�
�W��	�
!�
!��	�!��A��y��|�q� � ��I�a�L�3�&��*��#��J�J�
�W���
 �
 ��	�	�1�1�1�1�&*�i�1�1�1�1�1�A��a��#�
�A�#��J�J�
�W���
 �
 ��E�%�d�i�o�o�&7�&7�8�8�
#�
#���e��1�9�9��B�"�F�E�E��B��A�:�:��=�=���(�=�K�K�D�D��y��|�|�+�+�"�5�z�z���"'�}�}�}�t�}�}�&�.��0=�0C�0C� C���&��L�L��$�$�$�$��5�[�[��L�L��%�%�%����T�"�"�"�"�������%�#�A�+0�E����j�o�J�J�
�W��
�
"�
"��G��D�#�D�I�O�O�$5�$5�6�6�
'�
'�	��c����!�8�8�!�]�]�:�+=�4<�+�>�>�F�F����+�+��e�A�r�l�l�*�*�!%���z�/A�8@�"/�"B�"B��!&���V�H�s�N�!;�!;�����c�1�
�
�-�-�!%���z�/A�8@�"/�"B�"B�����C�4��/�� �!%���z�/?�8@�"/�"B�"B��!8��!8�!8�#�!8�!8�!8���!�]�]�:�+;�4<�+�>�>�@L�s���M�F��'��N�N�2�&�&�&����v�&�&�&�&��
=��%���u�$�G��C��e�j�j��&6�&6��<�<������ � �'�C�A�/6�K��+�+�J�O�J�J�
�W���
 �
 �!%���D�$���w�{�"�"�x�8�:�'=�'=� 1� 1� 1� 1�+/� 1� 1� 1���u��(�(��(�(��'�/�
�
�)�)�)�)�#'�)�)�)���5�5�%+�\�\�^�^�5�5�5�5���0�0�d�i�i��o�o�0�0�0��'�_�
�
�
�W���
#�
#��9�Q�<�D�.�.�.�.�#�y����}�.�.�.�D��,�,�$�)�)�D�/�/�,�,�,�A�#��J�J�
�W��	�
!�
!�*�*�*�*�#�y�*�*�*�D����D�!�!�A�#�+�J�J�
�W��
�
"�
"�"6�"6�"6�"6�+/�9�"6�"6�"6��D�%���8�:�%�%�/��/�/�u�/�/�u�/�/�/����X�_�,�,�7��7�7�4�7�7�u�7�7�7����X�-�-�-�6�U�6�6�e�6�6�t�6�6�6���)�<�D�G�<�<�(�<�<�>�>�>�#��J�J�
�W���
�
��d�i�(�(��)9�H�(�M�M�M�A�#�)�J�J�
�W���
 �
 ��d�i�(�(��)9�H�(�M�M�M�A�#�)�J�J�
�W��
�
%�
%�#�y��C��u�+.�5�8�U�X�2F�+F�+F�*�-�-�)�}�
��=�=��h�=�?�?�D��N�N�:��N�A�A�E��,�,��,�1�1�C��'�'�#�'�'��'�'�A�A�%�&B���&B�&B�C�C�C��"�Z�%5�5�5���7�S�=� ��rc��|Srprr�s r�__pos__zExpr.__pos__�s���rc��|dzS)N���rr�s r�__neg__zExpr.__neg__�s���b�y�rc�(�t|��}t|t���rg|j|ju�r'|jtjtjfvrMt|jd|jdzt|jd|jd����S|jtj
ur*|j\}}|j\}}t||z||z��S|jtjurkt|jt|j����}|j���D]\}}t|j||���t!|��S|jtj
ur1|jtjtjfvr|t|��zS|jtjtjfvr%|jtj
urt|��|zS|jtjur2|jtjur|t#||jd���zS|jtjur2|jtjurt#||jd���|zSt%|��t%|��zSt&S�Nrr)�kind)�as_exprr�rr�rr r!r�r��maxr"�
as_complexr+r�r�rv�	normalize�as_real�as_termsr�)	rOr��r1�i1�r2�i2r�rsrts	         r�__add__zExpr.__add__�s/��������e�T�"�"�	4��w�%�(�"�"��7�r�z�2�7�3�3�3�$��	�!��u�z�!�}�4��D�I�a�L�%�*�Q�-�8�8�:�:�:��7�b�j�(�(�!�Y�F�B��"�Z�F�B��%�b�2�g�r�B�w�7�7�7��7�b�h�&�&��T�W�d�4�9�o�o�6�6�A� %�
� 0� 0� 2� 2�1�1���1�"�1�6�1�a�0�0�0�0�$�Q�<�<�'��w�"�*�$�$���b�j�"�'�5J�)J�)J��j��/�/�/�/���R�Z���1�1�1�e�h�"�*�6L�6L�!�$�'�'�%�/�/���B�G�#�#���B�J�(>�(>��g�e�$�)�A�,�?�?�?�?�?���B�J�&�&�5�8�r�w�+>�+>��t�%�*�Q�-�8�8�8�5�@�@��D�>�>�H�U�O�O�3�3��rc�^�t|t��rt|��|zStSrp�r��number_typesr�r�r�s  r�__radd__z
Expr.__radd__��-���e�\�*�*�	+��U�#�#�d�*�*��rc��||zSrprr�s  r�__sub__zExpr.__sub__�s����v��rc�^�t|t��rt|��|z
StSrprr�s  r�__rsub__z
Expr.__rsub__�rrc��t|��}t|t���rN|j|ju�r�|jtjtjfvrMt|jd|jdzt|jd|jd����S|jtj
ur6|j\}}|j\}}t||z||zz
||z||zz��S|jtjurkt|jt|j����}|j���D]\}}t|j||���t!|��S|jtjur~t|ji��}|j���D]@\}	}
|j���D]!\}}t|j|	|z|
|z���"�At!|��S|jtj
ur1|jtjtjfvr|t|��zS|jtj
ur1|jtjtjfvrt|��|zS|jtjur2|jtjur|t%||jd���zS|jtjur2|jtjurt%||jd���|zS|jtjur|t'|��zS|jtjurt'|��|zSt)|��t)|��zSt*Sr�)r�r�rr�rr r!r�r�r�r"r�r,r�r�rvr�r+r�r��
as_factorsr�)
rOr�r�r�rrr�rsrt�t1�c1�t2�c2s
             r�__mul__zExpr.__mul__�s��������e�T�"�"�$	8��w�%�(�"�"��7�r�z�2�7�3�3�3�$�T�Y�q�\�E�J�q�M�%A�%(���1��u�z�!�}�%E�%E�G�G�G��W��
�*�*�!�Y�F�B��"�Z�F�B��%�b�2�g��R��&7��b��2��7�9J�K�K�K��7�b�j�(�(��T�W�d�4�9�o�o�6�6�A� %�
� 0� 0� 2� 2�1�1���1�"�1�6�1�a�0�0�0�0�$�Q�<�<�'��W���(�(��T�W�b�)�)�A�"&�)�/�/�"3�"3�A�A���B�&+�j�&6�&6�&8�&8�A�A�F�B��&�q�v�r�B�w��R��@�@�@�@�A�$�Q�<�<�'��w�"�*�$�$���b�j�"�'�5J�)J�)J��j��/�/�/�/���R�Z�'�'�D�G��
�B�G�7L�,L�,L�!�$�'�'�%�/�/���B�G�#�#���B�J�(>�(>��g�e�$�)�A�,�?�?�?�?�?���B�J�&�&�5�8�r�w�+>�+>��t�%�*�Q�-�8�8�8�5�@�@��w�"�(�"�"��h�u�o�o�-�-���R�X�%�%���~�~��-�-��d�#�#�j��&7�&7�7�7��rc�^�t|t��rt|��|zStSrprr�s  r�__rmul__z
Expr.__rmul__�rrc�F�t|��}t|t��r�|jtjur�|jd}|dkrtd��S|dkr|S|dkrn|jtjurPt|ji��}|j�	��D]\}}||z|j|<�t|��S|||dz
zzS|dkr	||zdzSttj||i��Sttj
||��StS)Nrrr�)r�r�rr�rr r�r�r,r�r��as_applyrSr[r�)rOr��exponentr�rsrts      r�__pow__zExpr.__pow__�s!��������e�T�"�"�	6��x�2�:�%�%� �:�a�=���q�=�=�$�Q�<�<�'��q�=�=��K��a�<�<��w�"�*�,�,� ���"�-�-��$(�I�O�O�$5�$5�5�5�D�A�q�()�H��A�F�1�I�I�(��|�|�+��4�H�q�L�#9�:�:���^�^� �h�Y�/�B�6�6��B�J��x�(8�9�9�9��G�K��u�5�5�5��rc��t|��}t|t��r(tt	t
j||����StSrp)r�r�rr�rrSrZr�r�s  r�__truediv__zExpr.__truediv__sD��������e�T�"�"�	A��X�g�k�4��?�?�@�@�@��rc�b�t|��}t|t��r||zStSrp�r�r�rr�r�s  r�__rtruediv__zExpr.__rtruediv__s/��������e�T�"�"�	 ��4�<���rc��t|��}t|t��r)tttj||f����StSrp)r�r�rr�rr)r�r�s  r�__floordiv__zExpr.__floordiv__!sE��������e�T�"�"�	=��T�"�)�d�E�]�;�;�<�<�<��rc�b�t|��}t|t��r||zStSrprr�s  r�
__rfloordiv__zExpr.__rfloordiv__)s/��������e�T�"�"�	!��D�=� ��rc	��t|gtt|���Ritd�|���D������S)Nc3�>K�|]\}}|t|��fV��dSrp�r�r�s   rr�z Expr.__call__.<locals>.<genexpr>6s0����J�J�4�1�a��7�1�:�:��J�J�J�J�J�Jr)r�mapr�r�r�)rOr�r�s   r�__call__z
Expr.__call__/sa����L�s�7�D�1�1�L�L�L��J�J�6�<�<�>�>�J�J�J�J�J�L�L�	Lrc���t|��}t|t��s|f}t|��dkrt	d|�d���ttj|f|z��S)Nrz/C-index should be a single expression but got `�`)r�r�r�r�r~rrr()rO�indexs  r�__getitem__zExpr.__getitem__8si��������%��'�'�	��F�E��u�:�:��>�>��L�E�L�L�L�M�M�M��B�K�$��5��1�1�1rc	��	��|jtjurs��|��}|�|St	jd|j��}|r<|���\}}|dvrt|��S|dksJ||f���|S|jtj	tj
tjfvr|S|jtjtj
fvr3t|jt�fd�|jD������S|jtjur@t#t|jt�fd�|jD��������S|jtjuryd}|j���D];\}}|�|����|z}� ||����|zz
}�<|�t+d��t-d��S|S|jtjuryd}|j���D];\}	}
|�|	����|
z}� ||	����|
zz}�<|�t+d	��t-d
��S|S|jtjur�|j\}}}
t3|t��r|����}t�fd�|D����}t5�fd�|
���D����}
t#t|j|||
f����S|jtjur�|jd}t3|t��r|����}t�fd
�|jd
d�D����}t#t|j|f|z����S|jtjurBt�fd�|jD����}t#t|j|����S|jtjtjfvr:t#t|j|j��������S|jtjurZ|j\}}}|����}|����}t#t|j|||f����StAd|j�d|�����)z�Recursively substitute symbols with values in symbols map.

        Symbols map is a dictionary of symbol-expression pairs.
        Nz$\A(@__f2py_PARENTHESIS_(\w+)_\d+@)\Z��ROUNDDIV�SQUARE�ROUNDc3�B�K�|]}|����V��dSrp��
substitute�r�r��symbols_maps  �rr�z"Expr.substitute.<locals>.<genexpr>VsC�����'>�'>�+/�(,���{�'C�'C�'>�'>�'>�'>�'>�'>rc3�B�K�|]}|����V��dSrpr1r3s  �rr�z"Expr.substitute.<locals>.<genexpr>YsK�����1H�1H�59�26����1M�1M�1H�1H�1H�1H�1H�1Hrz?substitute: empty TERMS expression interpreted as int-literal 0rzAsubstitute: empty FACTORS expression interpreted as int-literal 1rc3�B�K�|]}|����V��dSrpr1�r�r�r4s  �rr�z"Expr.substitute.<locals>.<genexpr>ws/�����A�A�q����k�2�2�A�A�A�A�A�Arc3�L�K�|]\}}||����fV��dSrpr1)r�rsrtr4s   �rr�z"Expr.substitute.<locals>.<genexpr>xsL�����6�6�"�a���a�l�l�;�7�7�8�6�6�6�6�6�6rc3�B�K�|]}|����V��dSrpr1r7s  �rr�z"Expr.substitute.<locals>.<genexpr>s/�����J�J�q����k�2�2�J�J�J�J�J�Jrc3�B�K�|]}|����V��dSrpr1r7s  �rr�z"Expr.substitute.<locals>.<genexpr>�s/�����J�J�1�Q�\�\�+�6�6�J�J�J�J�J�Jrzsubstitute method for z: )!r�rr%rq�re�matchr��groups�as_arrayr r!r#r$r"rr�r)r�r+r�r2r~r�r,r'r�r�r(r&r-r.r*r�)rOr4r��mr��parenr�r�r�r�r�targetr�r��func�operandsr�r�r�s `                 rr2zExpr.substituteBs���
�7�b�i����O�O�D�)�)�E��}�����@�$�)�L�L�A��
8� �x�x�z�z���u��2�2�2�#�E�?�?�*���'�'�'�%���'�'�'��L��7�r�z�2�7�B�I�6�6�6��K��7�r�x���,�,�,�����'>�'>�'>�'>�37�9�'>�'>�'>�">�">�?�?�
?��7�b�i����T�$�'�5�1H�1H�1H�1H�=A�Y�1H�1H�1H�,H�,H�I�I�J�J�
J��7�b�h����A�#�y���0�0�
>�
>���e��9�����4�4�u�<�A�A������5�5��=�=�A�A��y��'�(�(�(� ��|�|�#��H��7�b�j� � ��A�"&�)�/�/�"3�"3�
B�
B���h��9�����4�4��@�A�A������5�5��A�A�A�A��y��*�+�+�+� ��|�|�#��H��7�b�h���#'�9� �F�D�&��&�$�'�'�
8��*�*�;�7�7���A�A�A�A�D�A�A�A�A�A�D��6�6�6�6�&,�l�l�n�n�6�6�6�6�6�F��T�$�'�F�D�&�+A�B�B�C�C�C��7�b�k�!�!��9�Q�<�D��$��%�%�
4����{�3�3���J�J�J�J�D�I�a�b�b�M�J�J�J�J�J�D��T�$�'�D�7�T�>�:�:�;�;�;��7�b�j� � ��J�J�J�J��	�J�J�J�J�J�H��T�$�'�8�4�4�5�5�5��7�r�v�r�x�(�(�(��T�$�'�4�9�+?�+?��+L�+L�M�M�N�N�N��7�b�m�#�#�#�y��C��u��?�?�;�/�/�D��$�$�[�1�1�E��T�$�'�C��u�+=�>�>�?�?�?�!�"N�4�7�"N�"N�d�"N�"N�O�O�Orc
�R�����|g��Ri���}|�|S|jtjtjtjtjfvr|S|jtjtjtjtj	fvrBtt|jt���fd�|j
D��������S|jtjtjfvr�i}|j
���D]R\}}|j�g��Ri���}t%|t��r|j�g��Ri���n|}||vr|||z}|||<�Stt|j|����S|jtjur�|j
d}t%|t��r|j�g��Ri���n|}	t���fd�|j
dD����}
t)���fd�|j
d���D����}tt|j|	|
|f����S|jtjur�|j
d}t%|t��r|j�g��Ri���n|}t���fd�|j
dd�D����}tt|j|f|z����S|jtjtjfvr6tt|j|j
j�g��Ri�������S|jtjurR|j
\}
}}|j�g��Ri���}|j�g��Ri���}tt|j|
||f����St3d	|j�����)
aBTraverse expression tree with visit function.

        The visit function is applied to an expression with given args
        and kwargs.

        Traverse call returns an expression returned by visit when not
        None, otherwise return a new normalized expression with
        traverse-visit sub-expressions.
        Nc3�:�K�|]}|j�g��Ri���V��dSrp��traverse)r�r�r�r��visits  ���rr�z Expr.traverse.<locals>.<genexpr>�sS�����1'�1'����
�e�5�d�5�5�5�f�5�5�1'�1'�1'�1'�1'�1'rrc3�:�K�|]}|j�g��Ri���V��dSrprF)r��operandr�r�rHs  ���rr�z Expr.traverse.<locals>.<genexpr>�sT�����:�:�!(�.�W�-�e�E�d�E�E�E�f�E�E�:�:�:�:�:�:rrc3�D�K�|]\}}||j�g��Ri���fV��dSrprF)r�rsrtr�r�rHs   ���rr�z Expr.traverse.<locals>.<genexpr>�sd�����@�@�"&�!�Q� !�*�!�*�U�"D�T�"D�"D�"D�V�"D�"D�E�@�@�@�@�@�@rr	c3�:�K�|]}|j�g��Ri���V��dSrprF)r�r)r�r�rHs  ���rr�z Expr.traverse.<locals>.<genexpr>�sS�����8�8� %�+�E�N�5�B�4�B�B�B�6�B�B�8�8�8�8�8�8rztraverse method for )r�rr r!r#r%r"r$r)r&r�rr�r�r+r,r�rGr�r'r�r(r-r.r*r�)rOrHr�r��resultr�rsrt�objrBrC�
kwoperands�indicesr�r�r�s ```            rrGz
Expr.traverse�ss�������t�-�d�-�-�-�f�-�-�����M��7�r�z�2�7�B�I�r�y�A�A�A��K�
�W���R�X�r�y�"�*�E�
E�
E��T�$�'�5�1'�1'�1'�1'�1'�1'� �I�1'�1'�1'�,'�,'�(�(�)�)�
)��W���2�:�.�
.�
.��D��	���)�)�
�
���1��A�J�u�6�t�6�6�6�v�6�6��"�1�d�+�+�3�Z�Q�Z��7��7�7�7��7�7�7�12����9�9��Q��!��A���Q����T�$�'�4�0�0�1�1�1�
�W���
 �
 ��)�A�,�C�!�#�t�,�,�6�L�C�L��8��8�8�8��8�8�8�25�
��:�:�:�:�:�:�,0�I�a�L�:�:�:�:�:�H��@�@�@�@�@�@�*.�)�A�,�*<�*<�*>�*>�@�@�@�@�@�J��T�$�'�D�(�J�+G�H�H�I�I�I�
�W���
#�
#��)�A�,�C� ��d�+�+�5�<�3�<��7��7�7�7��7�7�7�14�
��8�8�8�8�8�8�)-��1�2�2��8�8�8�8�8�G��T�$�'�C�6�G�+;�<�<�=�=�=�
�W�����*�
*�
*��T�$�'�"4�$�)�"4�U�"L�T�"L�"L�"L�V�"L�"L�N�N�O�O�
O�
�W��
�
%�
%�#�y��C��u� �4�=��8��8�8�8��8�8�D�"�E�N�5�:�4�:�:�:�6�:�:�E��T�$�'�C��u�+=�>�>�?�?�?�!�"B���"B�"B�C�C�Crc�f��g}|f�fd�	}|�|��t|��dkS)z&Check if self contains other.
        c�J��|r|S|�kr|�d��|SdS)Nr)r�)�expr�foundr�s  �rrHzExpr.contains.<locals>.visit�s4����
����������Q�������rr)rGr�)rOr�rTrHs `  r�containsz
Expr.contains�sO�����#�	�	�	�	�	�	�	
�
�
�e�����5�z�z�Q��rc�V�t��}|fd�}|�|��|S)z3Return a set of symbols contained in self.
        c�Z�|jtjur|�|��dSdSrp)r�rr%�add)rSrTs  rrHzExpr.symbols.<locals>.visit�s,���w�"�)�#�#��	�	�$������$�#r��setrG�rOrTrHs   r�symbolszExpr.symbols�s=������#�	 �	 �	 �	 �	
�
�
�e�����rc�\��t��}|f�fd�	�|����|S)zFReturn a set of expressions used as atoms in polynomial self.
        c�L��|jtjur!|jD]}|�����|S|jtjtjfvrdS|jtjurct|jdt��rC|jdtj
ur(|jdd����|SdS|jtjtjfvr|S|�
|��|jtjtjfvr|SdS)Nrr)r�rr,r�rGr+r"r'r�rSr[r r!rXr()rSrT�brHs   �rrHz$Expr.polynomial_atoms.<locals>.visit�s����w�"�*�$�$���&�&�A��J�J�u�%�%�%�%����w�2�8�R�Z�0�0�0����w�"�(�"�"�z�$�)�A�,��'H�'H�"��9�Q�<�7�;�.�.��I�a�L��O�,�,�U�3�3�3��K����w�2�:�r�w�/�/�/����I�I�d�O�O�O��w�2�;���1�1�1���2�1rrYr[s  @r�polynomial_atomszExpr.polynomial_atoms�sH�������#�	�	�	�	�	�	�(	
�
�
�e�����rc�6�|�|td��i��}||z
}|�|td��i��}t||z|z
��\}}|td��krtd|�d|�d|�d|�d|��
���||fS)z�Return a, b such that a * symbol + b == self.

        If self is not linear with respect to symbol, raise RuntimeError.
        rrznot a z-linear equation: r�r�z == )r2r��as_numer_denom�RuntimeError)rO�symbolr_�axr��zeror�s       r�linear_solvezExpr.linear_solve�s���

�O�O�V�Y�q�\�\�2�3�3��
�A�X���M�M�6�9�Q�<�<�0�1�1�� ��V��b��1�1���a��9�Q�<�<���� B�� B� B�#$� B� B�)/� B� B�45� B� B�;?� B� B�C�C�
C��!�t�rN)*r
rrr
�staticmethodrrr�r�r�r�r�r�r�r�r�r�rarnrrPr�r�rrr	rrrrrrrr!r&r*r2rGrUr\r`rgrrrrr�s2��������
�"�*�0�0�0��\�0�
@�@�@�D-�-�-�
%�%�%�
�
�
�B�A�A�7�7�7�6�6�6�B�B�B����*4��"�*�P�P�P�P�d���������8���
������
'�'�'�R���
���.������������L�L�L�2�2�2�IP�IP�IP�V6D�6D�6D�p��� ������:����rc	�z�t|t��s|S|jtju�ri}|j���D]�\}}|dkr�|jtjur
|dkr||z}d}|jtjur4|j���D]\}}t||||z����st|||����t|��dkrtd��St|��dkr!|���\\}}|dkr|Sttj|��S|jtju�rVd}i}|j���D�]1\}}|dkr�
|jtjur(t|t��r|dkr
|||dz
zz}d}|jtj
tjfvrC|dkr||jdz}�~|dkr||jd|zz}��t|||����|jtjurc|dkrJt|t��r5|j���D]\}	}
t||	|
|z�����
t|||���� t|||����3t|��dks|dkr&t|t��sJ�t|��St|��dkr`|���\\}}|dkr|}nttj|��}|dkr|Sttj||i��S|dkrttj|��Sttjttj|��|i��S|jtju�r�|jdt"ju�r�|jd\}}t'|��\}}t'|��\}
}t|t��r0t|t��rt)||��}||z||z}}n||zd}}|jtjurc|jdt"jurJ|jdd|z}|jdd|
z|z}t+t"j||��S|
jtjurc|
jdt"jurJ|
jdd|z|z}|
jdd|z}t+t"j||��St-t/|��j��}t/|
��j���D]\}}t|||���ii}}|���D]\}}|dkr|||<�|||<�t1ttj|����|z}t1ttj|����|z}|jtj
tjfvr|jddkr|St+t"j||��S|jtju�rE|jdg}|jdd�D]�}|d}|jtjur�|jtjur�|jdddvr�|jdd|jddkrct7|jddd�|jddd�zt9|jd|jd����}||d<��|�|����t|��dkr|dSttjt=|����S|jtjur_tAt0|j��\}}}|jtj
ur|jdr|n|Sttj|||f��S|S)z7Normalize Expr and apply basic evaluation methods.
    rrNr�z"')!r�rr�rr+r�r�r"rvr�r�r,�
integer_typesr r!rr'rSrZ�
as_term_coeffrrr�r
r�r)r#�	as_stringr�r�r�r&r%)rNrr�trurrr�r_�e�b1�e1�dividend�divisorrr�gr�r��lstrJ�last�new_lastr�r�r�s                         rr�r�s����c�4� � ���
�
�v��������H�N�N�$�$�
	$�
	$�D�A�q��A�v�v���t�r�z�!�!�a�1�f�f���E�����t�r�x����f�l�l�n�n�.�.�F�B���q�"�b�1�f�-�-�-�-�.��1�a��#�#�#�#��q�6�6�Q�;�;��Q�<�<��
��V�V�q�[�[��g�g�i�i�G�F�Q���A�v�v����B�H�a� � � �
�v����������H�N�N�$�$�	$�	$�D�A�q��A�v�v���t�r�x���J�q�-�$@�$@��Q��U�U���q�1�u��&�����t��
�B�G�,�,�,���6�6��Q�V�A�Y�&�E�E���U�U��Q�V�A�Y�!�^�+�E�E��q�!�Q�'�'�'�'�����#�#��q�5�5�Z��=�9�9�5�"#�&�,�,�.�.�2�2���B�"�1�b�"�q�&�1�1�1�1�2��q�!�Q�'�'�'�'��1�a��#�#�#�#��q�6�6�Q�;�;�%�1�*�*��e�\�2�2�2�2�2��U�#�#�#�
��V�V�q�[�[��g�g�i�i�G�F�Q���A�v�v�������Q�'�'����z�z������1�e�*�-�-�-�
�a�Z�Z���
�A�&�&�&����4��
�A�#6�#6��">�?�?�?�
�v�����c�h�q�k�W�[�8�8��H�Q�K���'��x�(�(���B��w�'�'���B��b�-�(�(�	�Z��M�-J�-J�	��B����A���U�B��E��B�B���U�A��B�
�5�B�H�������w�{�!:�!:��G�A�J�q�M�B�&�E��G�A�J�q�M�B�&��+�E��G�K���6�6�6�
�5�B�H�������w�{�!:�!:��G�A�J�q�M�B�&��+�E��G�A�J�q�M�B�&�E��G�K���6�6�6���B���$�%�%���r�N�N�'�-�-�/�/�	!�	!�D�A�q��q�!�a�R� � � � ��2�u���G�G�I�I�	�	�D�A�q��1�u�u���a����2��a����$�r�z�5�1�1�2�2�R�7���$�r�z�5�1�1�2�2�R�7���8��
�B�G�,�,�,���A��!�1C�1C��L����U�E�2�2�2�
�v������x��{�m����!�"�"��	�	�A��r�7�D��G�r�y�(�(����	�)�)��	�!��Q��5�0�0���q�	�!���	�!��R�(8�8�8�$�T�Y�q�\�#�2�#�%6�����1�2�2��%F�%(���1��q�v�a�y�%A�%A�C�C��"��B����
�
�1�
�
�
�
��s�8�8�q�=�=��q�6�M��B�I�u�S�z�z�*�*�*�
�v����� ��C�H�5�5���e�U��7�b�j� � � �I�a�L�3�5�5�e�3��B�J��u�e� 4�5�5�5��Jrc�|�t|t��rt|j|j��St|t
��rt
|��St|t��rtt|����St|t��r"ttt|����S|S)z.Convert non-Expr objects to Expr objects.
    )
r��complexr��real�imagrr�r�rl�reprr�r%r��rNs rr�r��s����#�w���.��#�(�C�H�-�-�-��#�|�$�$����~�~���#�s���$���c���#�#�#��#�u���(��S��#�&�&�'�'�'��Jrc�6�ttj|��S)zJReturn object as SYMBOL expression (variable or unparsed expression).
    )rrr%r|s r�	as_symbolr~�s����	�3���rr2c�X�t|t��rttj||f��St|t
��rttj||f��St|t��r!|jtjtjfvr|Std|�d����)z/Return object as INTEGER or REAL constant.
    �cannot convert z to INTEGER or REAL constant)	r�r�rrr r�r!r�r]�rNr�s  rr�r��s����#�s���-��B�J��d��,�,�,��#�u���*��B�G�c�4�[�)�)�)��#�t�����6�b�j�"�'�*�*�*��J�
�E�C�E�E�E�
F�
F�Frc���t|t��rttj||f��St|t��r|jtjur|St
d|�d����)z'Return object as INTEGER constant.
    r�z to INTEGER constant)r�r�rrr r�r]r�s  r�
as_integerr��sl���#�s���-��B�J��d��,�,�,��#�t�����6�R�Z����J�
�=�C�=�=�=�
>�
>�>rc���t|t��r)ttjt|��|f��St|t
��rttj||f��St|t��r\|jtjur|S|jtjur4ttjt|jd��|f��Std|�d����)z$Return object as REAL constant.
    rr�z to REAL constant)
r�r�rrr!r�r�r r�r]r�s  rr�r��s����#�s���1��B�G�e�C�j�j�$�/�0�0�0��#�u���*��B�G�c�4�[�)�)�)��#�t���=��6�R�W����J�
�V�r�z�
!�
!����%�����"4�"4�d�!;�<�<�<�
�:�C�:�:�:�
;�
;�;rrc�:�ttj||f��S)zBReturn object as STRING expression (string literal constant).
    )rrr#r�s  rrlrl�s����	�C��;�'�'�'rc�f�t|t��r|f}ttj|��S)z8Return object as ARRAY expression (array constant).
    )r�rrr$r|s rr>r>�s/���#�t�����d�����#���rc�n�ttjt|��t|��f��S)zDReturn object as COMPLEX expression (complex literal constant).
    )rrr"r�)ryrzs  rr�r��s'����
�W�T�]�]�G�D�M�M�:�;�;�;rc
���ttj|tt	t
|����t
d�|���D����f��S)zIReturn object as APPLY expression (function call, constructor, etc.)
    c3�>K�|]\}}|t|��fV��dSrpr$r�s   rr�zas_apply.<locals>.<genexpr>�s0����A�A�$�!�Q�q�'�!�*�*�o�A�A�A�A�A�Ar)rrr'r�r%r�r�r�)rBr�r�s   rrr�s\������u�S��$�/�/�0�0��A�A�&�,�,�.�.�A�A�A�A�A�C�D�D�Drc�<�ttj|||f��S)z<Return object as TERNARY expression (cond?expr1:expr2).
    )rrr&)r�r�r�s   r�
as_ternaryr��s����
�T�5�%�0�1�1�1rc�6�ttj|��S)z-Return object as referencing expression.
    )rrr-�rSs r�as_refr��s��������rc�6�ttj|��S)z/Return object as dereferencing expression.
    )rrr.r�s r�as_derefr��s�����$���rc�P�ttjtj||f��Srp)rrr*r0rB�r�r�s  r�as_eqr������
���$��6�7�7�7rc�P�ttjtj||f��Srp)rrr*r0rCr�s  r�as_ner�r�rc�P�ttjtj||f��Srp)rrr*r0rDr�s  r�as_ltr�r�rc�P�ttjtj||f��Srp)rrr*r0rEr�s  r�as_ler�r�rc�P�ttjtj||f��Srp)rrr*r0rFr�s  r�as_gtr�r�rc�P�ttjtj||f��Srp)rrr*r0rGr�s  r�as_ger�r�rc�8�t|t��r�t|��}|jtjur|S|jtjur@ttjtd|jd��|jdi��S|jtj	ur@ttjtd|jd��|jdi��Sttj|di��Stdt|���d����)z+Return expression as TERMS expression.
    rrr�� to terms Expr)
r�rr�r�rr+r r�r�r!r�r]r�r|s rr�r�s����#�t���(���n�n���6�R�X����J��6�R�Z������:�a���!��#=�#=�s�x��{�"K�L�L�L��6�R�W������7�1�c�h�q�k�#:�#:�C�H�Q�K�"H�I�I�I��B�H�s�A�h�'�'�'�
�=�D��I�I�=�=�=�
>�
>�>rc�"�t|t���rZt|��}|jtjur|S|jtjur�t|j��dkrv|j�	��\\}}|dkrttj|di��Sttj|dt�
|��di��S|jtjurf|jdtj
urM|jds@ttj|jddd|jdddi��Sttj|di��Stdt|���d����)z-Return expression as FACTORS expression.
    rrr	r�r�r�)r�rr�r�rr,r+r�r�r��numberr'rSrZr]r�)rNr�r�s   rr
r
+sI���#�t���*���n�n���6�R�Z����J��6�R�X����3�8�}�}��!�!�!$����!1�!1��
��u��A�:�:���
�T�1�I�6�6�6��B�J��q�$�+�+�e�2D�2D�a�(H�I�I�I�
�V�r�x�
�
���!����+�+��X�a�[�,���
�S�X�a�[��^�Q�����A���$K�L�L�L��B�J��a��)�)�)�
�=�D��I�I�=�=�=�
>�
>�>rc��t|t���rSt|��}|jtjur(t
d|jd��|jdfS|jtjur(td|jd��|jdfS|jtj
ur:t|j��dkr"|j���\\}}||fS|jtj
urj|jdtjurQt!|jdd��\}}t#tj||jdd��|fS|dfSt%dt'|���d����)z0Return expression as term-coefficient pair.
    rrr�z to term and coeff)r�rr�r�rr r�r�r!r�r+r�r�r'rSrZrkrr]r�)rNr�r�rmrus     rrkrk@sL���#�t������n�n���6�R�Z����a���!��-�-�s�x��{�:�:��6�R�W����1�c�h�q�k�*�*�C�H�Q�K�7�7��6�R�X����3�8�}�}��!�!�!$����!1�!1��
��u��U�{�"��6�R�X���#�(�1�+���"<�"<� ���!��Q��0�0�D�A�q��G�K��C�H�Q�K��N�;�;�Q�>�>��A�v�
�
�A�D��I�I�A�A�A�
B�
B�Brc��t|t���r�t|��}|jtjtjtjtjtj	tj
fvr|td��fS|jtjur||j
dtjurR|j
dsEt!t"|j
d��\}}|d|dz|d|dzfS|td��fS|jtju�r#gg}}|j
���D]F\}}t#|��\}}||z}|�|��|�|���Gtd��td��}}t+t-|����D]J}	||	}t+t-|����D]}
|	|
kr|||
z}�||z
}|||	z}�K|jtjtjfvr|j
ddkr||}}||fS|jtjur�td��td��}}|j
���D]F\}}t#|��\}
}|dkr||
|zz}|||zz}�.|dkr|||zz}||
|zz}�G||fSt1dt3|���d����)z+Return expression as numer-denom pair.
    rrr	r�z to numer and denom)r�rr�r�rr r!r"r%r(r&r�r'r�rSrZr%rbr+r�r�r�r�r,r]r�)rN�numers�denomsr�r��nrrr�r��i�jr_rn�bnumer�bdenoms               rrbrbUs����#�t���& ���n�n���6�b�j�"�'�2�:�r�y��k�2�:�/�/�/��	�!���$�$�
�V�r�x�
�
��x��{�g�k�)�)�#�(�1�+�)�!$�^�S�X�a�[�!A�!A�����a�y�6�!�9�,�f�Q�i�&��)�.C�C�C��	�!���$�$�
�V�r�x�
�
���F�F�"�x�~�~�/�/�
!�
!���e�%�d�+�+���1���I���
�
�a� � � ��
�
�a� � � � �$�Q�<�<��1���5�E��3�v�;�;�'�'�
#�
#���1�I���s�6�{�{�+�+�'�'�A��A�v�v��V�A�Y������
������"����x�B�J���0�0�0�U�Z��]�Q�5F�5F� %�v��v�u���%�<��
�V�r�z�
!�
!�$�Q�<�<��1���5�E�����(�(�
,�
,���1�!/��!2�!2�����q�5�5��V�q�[�(�E��V�q�[�(�E�E���U�U��V���^�+�E��V���^�+�E���%�<��
�B�D��I�I�B�B�B�
C�
C�Crc#� K�d}	|dz
}|V��
)NrTrr)�counters r�_counterr��s'�����G���1����
�
�
�rc���i��fd�}tjd�ddd���||��}d|vsJ�d|vsJ�|�fS)	zgReplace quoted substrings of input string.

    Return a new string and a mapping of replacements.
    c����|���dd�\}}|r
|dd�}ddd�|d}|�d|�dt����d	�}|�|<|S)
Nr	r��SINGLE�DOUBLE)�'�"rz@__f2py_QUOTES_r��@)r=�COUNTER�__next__)r?r�r��prsrrs     �r�replzeliminate_quotes.<locals>.repl�s����h�h�j�j��!��n���e��	�����9�D���*�*�5��8�4���=�=�A�=�=��(8�(8�(:�(:�=�=�=����!���rz+({kind}_|)({single_quoted}|{double_quoted})z
\w[\w\d_]*z('([^'\\]|(\\.))*')z("([^"\\]|(\\.))*"))r��
single_quoted�
double_quotedr�r�)r;�sub�format)rJr��new_srrs   @r�eliminate_quotesr��s����
	�A������
�F�A�H�H�
�,�,�I�.�.�	
�a�	
�
�E��e������e������!�8�Orc��|���D]B\}}|d|�d���}|r|dz
}|�|||z��}�C|S)z!Inverse of eliminate_quotes.
    Nr�r�)r��find�replace)rJrrrsrtr�s     r�
insert_quotesr��se�����	�	�#�#���1���!�&�&��+�+�����	��C�K�D�
�I�I�a����"�"����Hrc��d\}}t|��}dD]-\}}|�|��}|dkr�!||kr|}||}}�.|�|ifS|}|�||��}|�||dz|��|�||dz|��krm|�||dz��}|dkrtd||z�d|�����|�||dz|��|�||dz|��k�mdd	d
dd�|}d
|�dt����d�}	||t|��z|�}
t
||t|��zd���\}}|
||	<|d|�|	z|z|fS)zzReplace substrings of input that are enclosed in parenthesis.

    Return a new string and a mapping of replacements.
    )NN))�(/�/)z()z{}z[]r�NrzMismatch of z parenthesis in r/r.�CURLYr-)r�r��{r��@__f2py_PARENTHESIS_r�r�)r�r��count�
ValueErrorr�r��replace_parenthesis)
rJr�r��mn_i�left_�right_r�r�r�rsrtr�rrs
             rr�r��s����K�D�%��q�6�6�D� �	(�	(�
��v�
�F�F�5�M�M����7�7���t�8�8��D���%�D���|��"�u���A�	���u�a���A�
�'�'�$��A��q�
!�
!�Q�W�W�U�A��E�1�%=�%=�
=�
=�
�F�F�5�!�a�%� � ����7�7��M�D��J�M�M��M�M�N�N�N��'�'�$��A��q�
!�
!�Q�W�W�U�A��E�1�%=�%=�
=�
=�
�H�7�*�E�E�d�K�A�8�q�8�8�7�#3�#3�#5�#5�8�8�8�A�	�!�C��I�I�+�a�-��A��q��3�u�:�:����/�0�0�D�A�q��A�a�D��R�a�R�5�1�9�q�=�!��rc�v�|�d��s
J|���|�d��dS)Nr�r�r2)�
startswith�split)rJs r�_get_parenthesis_kindr��s7���<�<�.�/�/�2�2��2�2�/��7�7�3�<�<��?�rc���|���D]b\}}t|��}tdddd���|}tdddd	���|}|�|||z|z��}�c|S)
z$Inverse of replace_parenthesis.
    r�r�r�r�)r/r.r�r-r�r��}r�)r�r�r�r�)rJrrrsrtr�r�r�s       r�unreplace_parenthesisr��s������	�	�+�+���1�!�!�$�$���#�c��t�D�D�D�Q�G���3�s�#��E�E�E�a�H��
�I�I�a����E�)�*�*����Hrc��t|����|��}t|t��r|St	d|�d|�d����)z�Create an expression from a string.

    This is a "lazy" parser, that is, only arithmetic operations are
    resolved, non-arithmetic operations are treated as symbols.
    r�zfailed to parse `z` to Expr instance: got `r()�_FromStringWorkerr�r�rr�)rJrKr�s   rrLrL�s[��	�8�,�,�,�2�2�1�5�5�A��!�T������
�I��I�I�Q�I�I�I�
J�
J�Jrc� �eZdZd�Zd�Zd�ZdS)�_Pairc�"�||_||_dSrpr�)rOr�r�s   rr�z_Pair.__init__�s����	���
�
�
rc���|j|j}}t|t��r|�|��}t|t��r|�|��}t||��Srp)r�r�r�rr2r�)rOr4r�r�s    rr2z_Pair.substitutesg���i���e���d�D�!�!�	0��?�?�;�/�/�D��e�T�"�"�	2��$�$�[�1�1�E��T�5�!�!�!rc�P�t|��j�d|j�d|j�d�Sr�)r�r
r�r�r�s rr�z_Pair.__repr__s.���t�*�*�%�B�B��	�B�B�T�Z�B�B�B�BrN)r
rrr�r2r�rrrr�r��sF���������"�"�"�C�C�C�C�Crr�c�6�eZdZejfd�Zd�Zd�Zdd�ZdS)r�c�0�d|_d|_||_dSrp)�original�
quotes_maprKrNs  rr�z_FromStringWorker.__init__s����
���� ��
�
�
rc�,�t||j��Srp)r�r�)rOrJs  r�finalize_stringz!_FromStringWorker.finalize_strings���Q���0�0�0rc�h�||_t|��\}|_|�|��Srp)r�r�r��process)rO�inp�unquoteds   rr�z_FromStringWorker.parses/����
�$4�S�$9�$9�!��$�/��|�|�H�%�%�%rrSc	������t|ttf��r%t|����fd�|D����St|t��sJt|��|f���t|��\}�|���}��fd��d|vr��|�d����}�dkr"t��|����S�dkr/t|��dkrt��|���Std��d|�����tj
d	|��}|r��dks
J�����|�����\}}}��|��}��|��}��|��}t|||��S�jt"jur!tj
d
|tj��}ntj
d|��}|r�|���\}	}
}�jt"jurd|
zdz}
���|	|f����\}	}t(�|
�j�
��}
t-t.j|
|	|f��Stj
d|��}|rE|���\}}
�|
��}
t3|��|
����Stjd|��}t|��dkr����|dpd����}t5|ddd�|ddd���D]P\}}���|����}|���}|dkr||z
}�C|dksJ�||z}�Q|S�jt"jur\d|vrX�|�d����}t-t.jt��|������Stjd�jt"jur|n|�dd����}t|��dkr��|��}�jt"jurd�|D��}��|d��}t5|ddd�|ddd���D]G\}}��|��}|���}|dkr||z}�:|dksJ�||z}�H|S|�d��s|�d��r[t.jt.j d�|d}���|dd�����}t-||��S�jt"jur�d|vr|ttC�|�d��������}��|d��}|dd�D]}��|��}||z}�|Stj
d�"d d!�"��|��}|r\|���\}
}}|r#|�#��rtI|��}tKtI|
��|pd#��Stj
d$�"d%d&d!�'��|��}|r�|���\}
}}}|r#|�#��rtI|��}|
�&��}
d(|
vr3tOtQ|
�d(d)����|pd*��StOtQ|
��|pd#��S|�j)vr:|d|�*d+���}tW�j)||pd��S|�vr�tY|��}����|��|d,krdnd��}|d,krt|t,��r|S|d-vr't|t,��r|f}t[|��Stj
d.|��}|r�|���\}}}���|����}���|��dd/�d��}t|t��s|f}|d,krBt]d0�|D����}td1�|D����}t_|g|�Ri|��S|d2ksJ�||Stj
d3|��}|rta|��S��1�|����}ted4|�d5�j3�d6���ta|��S)7a�Parse string within the given context.

        The context may define the result in case of ambiguous
        expressions. For instance, consider expressions `f(x, y)` and
        `(x, y) + (a, b)` where `f` is a function and pair `(x, y)`
        denotes complex number. Specifying context as "args" or
        "expr", the subexpression `(x, y)` will be parse to an
        argument list or to a complex number, respectively.
        c3�D�K�|]}��|���V��dSrp)r�)r��s_�contextrOs  ��rr�z,_FromStringWorker.process.<locals>.<genexpr>)s1�����A�A��4�<�<��G�4�4�A�A�A�A�A�Arc���t|ttf��r&t|��t	�|����St|���Srp)r��listr�r�r%r�)r��raw_symbols_map�restores ��rr�z*_FromStringWorker.process.<locals>.restore1sG����!�d�E�]�+�+�
0��t�A�w�w�s�7�A���/�/�/�(��O�<�<�<r�,r�rSr	z&parsing comma-separated list (context=z): z\A([^?]+)[?]([^:]+)[:](.+)\Zz+\A(.+)\s*[.](eq|ne|lt|le|gt|ge)[.]\s*(.+)\Zz7\A(.+)\s*([=][=]|[!][=]|[<][=]|[<]|[>][=]|[>])\s*(.+)\Z�.r�z\A(\w[\w\d_]*)\s*[=](.*)\Zz((?<!\d[edED])[+-])rrr�N�+r�z//z(?<=[@\w\d_])\s*([*]|/)�**�@__f2py_DOUBLE_STAR@c�:�g|]}|�dd����S)r�r�)r�)r�rJs  rr�z-_FromStringWorker.process.<locals>.<listcomp>~s7��5�5�5� '�$�O�O�,B�D�I�I�5�5�5rr�r�r�)r�r�z\A({digit_string})({kind}|)\Zz\d+z_(\d+|\w[\w\d_]*))�digit_stringr�r2z7\A({significant}({exponent}|)|\d+{exponent})({kind}|)\Zz[.]\d+|\d+[.]\d*z[edED][+-]?\d+)�significantrr�rrrn�r�r/r,z4\A(.+)\s*(@__f2py_PARENTHESIS_(ROUND|SQUARE)_\d+@)\Zr�c3�\K�|]'}t|t���|j|jfV��(dSrp)r�r�r�r��r�r�s  rr�z,_FromStringWorker.process.<locals>.<genexpr>�sM����7�7�A�!+�A�u�!5�!5�7�q�v�q�w�/�7�7�7�7�7�7rc3�DK�|]}t|t���|V��dSrp)r�r�r�s  rr�z,_FromStringWorker.process.<locals>.<genexpr>�s1����I�I�1�J�q�%�4H�4H�I�Q�I�I�I�I�I�Irr.z\A\w[\w\d_]*\Zzfromstring: treating z as symbol (original=r�)4r�r�r�r�r�r��stripr�r�r�r�r�r;r<r=r�rKrr�Ir0rLrrr*r��zipr)rr�r�r.r-�reversedr��isdigitr�r�rHr�r�r�r�rlr�r>r�rr~r�r~r�)rOrJr�r�rCr?�operr�r�r�r�r��keynamer�rMr�rJr�r�r@r�rAr�r�r�r�s` `                     @@rr�z_FromStringWorker.processsX
�������a�$���'�'�	B��4��7�7�A�A�A�A�A�q�A�A�A�A�A�A��!�S�!�!�/�/�D��G�G�Q�<�/�/�!�1��3�3���?�
�G�G�I�I��	=�	=�	=�	=�	=�	=��!�8�8��w�q�w�w�s�|�|�,�,�H��&� � ��T�\�\�(�3�3�4�4�4��&� � ��x�=�=�A�%�%�%�t�|�|�H�'=�'=�>�>�%�H��H�H�Q�H�H�J�J�
J�
�H�4�a�8�8���	2��f�$�$�$�g�$�$�$�!(�������!4�!4��D�%���<�<��%�%�D��L�L��'�'�E��L�L��'�'�E��d�E�5�1�1�1��=�H�,�,�,���>��2�4�I�I�A�A���J�A�O�O�A��	;� �x�x�z�z��D�#�u��}�� 0�0�0��C�i�#�o���,�,�w�w��e�}�'=�'=�>�>�K�D�%��"�"�3���"�?�?�C���
��T�5�'9�:�:�:�
�H�2�A�6�6���	7��X�X�Z�Z�N�G�U��G�E�N�N�E���$�,�,�u�"5�"5�6�6�6��8�2�A�6�6���x�=�=�1����\�\�'�'�(�1�+�*<��"=�"=�>�>�F�"�8�A�D�q�D�>�8�A�D�q�D�>�B�B�
&�
&���G��,�,�w�w�w�'7�'7�8�8���X�X�Z�Z����9�9��g�%�F�F���9�9�9�9��g�%�F�F��M��=�H�,�,�,������w�q�w�w�t�}�}�-�-�H���	��d�l�l�8�4�4�5�5�7�7�
7��8�6�"&�-�8�:�"=�"=�Q�Q�"#�)�)�D�2H�"I�"I�L�L���x�=�=�1����w�x�(�(�H��}�H�J�.�.�5�5�+3�5�5�5���\�\�(�1�+�.�.�F�"�8�A�D�q�D�>�8�A�D�q�D�>�B�B�
&�
&���G��,�,�w�/�/���X�X�Z�Z����9�9��g�%�F�F���9�9�9�9��g�%�F�F��M�
�<�<����	%����S� 1� 1�	%��x�b�f�-�-�a��d�3�B��l�l�7�7�1�Q�R�R�5�>�>�2�2�G���G�$�$�$��=��
�*�*�t�q�y�y��H�W�W�Q�W�W�T�]�]�%;�%;�<�<�=�=�H��\�\�(�1�+�.�.�F�#�A�B�B�<�
+�
+���,�,�w�/�/�� �F�*����M�
�H�5�<�<��%�=�'�'�()�
+�
+��
�	5��X�X�Z�Z�N�E�1�d��
!������
!��4�y�y���c�%�j�j�$�)�!�4�4�4�
�H�O��f�%8�"3�2��4�4�67�	
8�
8��

�	4� !���
�
��E�1�a���
!������
!��4�y�y���K�K�M�M�E��e�|�|��u�U�]�]�3��%<�%<�=�=�t�y�q�I�I�I��5��<�<����3�3�3�
������\�a�f�f�S�k�k�\�?�D��T�_�Q�/����;�;�;�
����)�!�,�,�E��L�L�����);�!<�!<�+0�G�+;�+;����I�I�E������e�T�*�*�!� �L��.�.�.��e�T�*�*�%�"�H�E�����&�
�H�L��
�
���	$�"#�(�(�*�*��F�D�%��\�\�'�'�&�/�/�2�2�F��<�<����
�
�a��d� 3�V�<�<�D��d�E�*�*�
��u�������7�7��7�7�7�7�7���I�I��I�I�I�I�I����8��8�8�8��8�8�8���(�(�(�(��d�|�#�
�H�&��*�*���	 ��Q�<�<��
� � ������,�,��
�N�A�N�N�d�m�N�N�N�	P�	P�	P���|�|�rNr�)	r
rrrrr�r�r�r�rrrr�r�se������ (�
�!�!�!�!�
1�1�1�&�&�&�
H�H�H�H�H�Hrr�)r2)r)r):r
�__all__r;r{�enumr�mathrrrr0rS�	Exceptionr]rar�rjr�rrv�UserWarningrxr~rr�r�r~r�r�r�rlr>r�rr�r�r�r�r�r�r�r�r�r�r
rkrbr�r�r�r�r�r�r�rrLr�r�rrr�<module>rsN����&�(��
�	�	�	�����������������
�
�
�
�
�t�
�
�
����������*5�5�5�5�5�D�5�5�5�<
�
�
�
�
�d�
�
�
�	�	�	�	�	�i�	�	�	����������&��
��U�|��
�
�
�	�	�	�	�	�+�	�	�	�6�6�6�w	�w	�w	�w	�w	�w	�w	�w	�tF�F�F�R
�
�
�  � � �
G�
G�
G�
G�?�?�?�?�<�<�<�<�(�(�(�(����<�<�<�<�D�D�D�2�2�2���� � � �8�8�8�8�8�8�8�8�8�8�8�8�8�8�8�8�8�8�?�?�?�?�?�?�*C�C�C�**D�*D�*D�Z����(�*�*�����:
�
�
�(�(�(�V���

�
�
�$�:�	K�	K�	K�	K�C�C�C�C�C�C�C�C�&W�W�W�W�W�W�W�W�W�Wr

Zerion Mini Shell 1.0