U
    	-e0                     @   sl  d Z ddlmZmZmZmZmZmZmZm	Z	m
Z
mZmZmZmZmZmZmZmZmZmZmZmZmZmZmZ ddlmZ ddlmZmZmZm Z m!Z!m"Z"m#Z#m$Z$ ddl%m&Z&m'Z' ddl(m)Z)m*Z* ddl+m,Z, ddl-m.Z. dd	l/m0Z0 dd
l1m2Z2m3Z3m4Z4 dd Z5dd Z6dd Z7dd Z8dd Z9dd Z:dd Z;dd Z<dd Z=dd Z>dd  Z?d!d" Z@d#d$ ZAd%d& ZBd'd( ZCd)d* ZDd+d, ZEd-d. ZFd/d0 ZGd1d2 ZHd3d4 ZId5d6 ZJd7d8 ZKd9d: ZLd;d< ZMd=d> ZNd?d@ ZOdAdB ZPdCdD ZQdEdF ZRdGdH ZSdIdJ ZTdKdL ZUdMdN ZVdOdP ZWdQdR ZXdSdT ZYdUdV ZZdWdX Z[dYdZ Z\d[d\ Z]d]d^ Z^d_d` Z_dadb Z`dcdd Zadedf ZbdgS )hzFTests for options manager for :class:`Poly` and public API functions.     )OptionsExpandGensWrtSortOrderFieldGreedyDomainSplitGaussian	ExtensionModulus	SymmetricStrictAutoFracFormalPolysIncludeAllGenSymbolsMethod)lex)FFGFZZQQQQ_IRRCCEX)OptionErrorGeneratorsError)IInteger)Symbol)sqrt)raises)xyzc                  C   s   t tttfddi} | jtttfks(t| jtks6td| kdksFt| ttfdd}| jtttfksnt| jtks|td| kdkst|jttfkst|jtkstd|kdkstd S )Ndomainr   orderFr   )gensr.   T)	r   r*   r+   r,   r/   AssertionErrorr-   r   clone)optZnew_opt r3   c/var/www/html/Darija-Ai-Train/env/lib/python3.8/site-packages/sympy/polys/tests/test_polyoptions.pytest_Options_clone   s    r5   c                   C   sZ   t ddkstt ddks$tt ddks6tt ddksHtttdd  d S )NFTr      c                   S   s
   t tS N)r   
preprocessr*   r3   r3   r3   r4   <lambda>-       z(test_Expand_preprocess.<locals>.<lambda>)r   r8   r0   r)   r#   r3   r3   r3   r4   test_Expand_preprocess&   s
    r;   c                  C   s&   ddi} t |  | ddiks"td S )NexpandT)r   postprocessr0   r2   r3   r3   r4   test_Expand_postprocess0   s    
r?   c                      s   t ddkstt tttftttfks0tt tttfftttfksPttddd ttdd  tt fdd d S )	Nr7   r3   aF)Zcommutativec                   S   s   t tttfS r7   r   r8   r*   r+   r3   r3   r3   r4   r9   >   r:   z&test_Gens_preprocess.<locals>.<lambda>c                      s   t tt fS r7   rA   r3   r@   r3   r4   r9   ?   r:   )	r   r8   r0   r*   r+   r,   r'   r)   r$   r3   r3   rB   r4   test_Gens_preprocess7   s     rC   c                  C   s.   dt tfi} t|  | dt tfiks*td S )Nr/   )r*   r+   r   r=   r0   r>   r3   r3   r4   test_Gens_postprocessB   s    
rD   c                   C   s   t tdgkstt dg ks&tt dg ks8tt dddgksNtt dddgksdtt dddgksztt dddgkstt d	ddgkstt d
ddgkstt ttgddgkstttdd  ttdd  d S )Nr*     zx,yr+   zx yzx, yzx , yz x, yz x,  yc                   S   s
   t dS )N,r   r8   r3   r3   r3   r4   r9   U   r:   z%test_Wrt_preprocess.<locals>.<lambda>c                   S   s
   t dS Nr   rH   r3   r3   r3   r4   r9   V   r:   )r   r8   r*   r0   r+   r)   r#   r3   r3   r3   r4   test_Wrt_preprocessI   s    rJ   c                  C   s*   ddgi} t |  | ddgiks&td S )NZwrtr*   )r   r=   r0   r>   r3   r3   r4   test_Wrt_postprocessY   s    

rK   c                   C   s   t tttgdddgkstt tttfdddgks<tt ddddgksTtt ddddgksltttdd  ttdd  d S )	Nr*   r+   r,   z	x > y > zzx>y>zc                   S   s
   t dS rI   )r   r8   r3   r3   r3   r4   r9   g   r:   z&test_Sort_preprocess.<locals>.<lambda>c                   S   s   t ttthS r7   )r   r8   r*   r+   r,   r3   r3   r3   r4   r9   h   r:   )r   r8   r*   r+   r,   r0   r)   r#   r3   r3   r3   r4   test_Sort_preprocess`   s    rL   c                  C   s&   ddi} t |  | ddiks"td S )Nsortzx > y)r   r=   r0   r>   r3   r3   r4   test_Sort_postprocessk   s    
rN   c                   C   s   t dtkstd S )Nr   )r   r8   r   r0   r3   r3   r3   r4   test_Order_preprocessr   s    rO   c                  C   s&   ddi} t |  | ddiks"td S )Nr.   T)r   r=   r0   r>   r3   r3   r4   test_Order_postprocessv   s    
rP   c                   C   sZ   t ddkstt ddks$tt ddks6tt ddksHtttdd  d S )NFTr   r6   c                   S   s
   t tS r7   )r   r8   r*   r3   r3   r3   r4   r9      r:   z'test_Field_preprocess.<locals>.<lambda>)r   r8   r0   r)   r#   r3   r3   r3   r4   test_Field_preprocess}   s
    rQ   c                  C   s&   ddi} t |  | ddiks"td S )NfieldT)r   r=   r0   r>   r3   r3   r4   test_Field_postprocess   s    
rS   c                   C   sZ   t ddkstt ddks$tt ddks6tt ddksHtttdd  d S )NFTr   r6   c                   S   s
   t tS r7   )r	   r8   r*   r3   r3   r3   r4   r9      r:   z(test_Greedy_preprocess.<locals>.<lambda>)r	   r8   r0   r)   r#   r3   r3   r3   r4   test_Greedy_preprocess   s
    rT   c                  C   s&   ddi} t |  | ddiks"td S )NZgreedyT)r	   r=   r0   r>   r3   r3   r4   test_Greedy_postprocess   s    
rU   c                   C   s  t ttkstt ttks$tt ttks6tt tdtdksPtt tttf tttf ksrtt dtkstt dtkstt dtkstt dtkstt dtkstt dtdkstt d	t	dkstt
td
d  t dtt kstt dtt ks6tt dtt ksNtt dtt ksftt dtt ks~tt dtt kstt dtt kstt dtt kstt dtttf kstt dtttf kstt dtttf kstt dtttf ks6tt dtttf ksRtt dtttf ksntt dtttf kstt dtttf kstt
tdd  t dttkstt dttkstt dttkstt d ttkstt d!tttks8tt d"tttksTtt d#tttksptt d$tttkstt d%ttkstt d&ttkstt d'ttdtkstt d(ttdtks tt
td)d  d S )*N   ZQr   r   r"   zFF(23)   zGF(23)c                   S   s
   t dS )NzZ[]r
   r8   r3   r3   r3   r4   r9      r:   z(test_Domain_preprocess.<locals>.<lambda>zZ[x]zQ[x]zR[x]zC[x]zZZ[x]zQQ[x]zRR[x]zCC[x]zZ[x,y]zQ[x,y]zR[x,y]zC[x,y]zZZ[x,y]zQQ[x,y]zRR[x,y]zCC[x,y]c                   S   s
   t dS )NzZ()rZ   r3   r3   r3   r4   r9      r:   zZ(x)zQ(x)zZZ(x)zQQ(x)zZ(x,y)zQ(x,y)zZZ(x,y)zQQ(x,y)zQ<I>zQQ<I>zQ<sqrt(2), I>zQQ<sqrt(2), I>c                   S   s
   t dS )NabcrZ   r3   r3   r3   r4   r9      r:   )r
   r8   r   r0   r   r"   r   r*   r+   r   r)   r#   r    r!   Z
frac_fieldalgebraic_fieldr%   r(   r3   r3   r3   r4   test_Domain_preprocess   s^    " 
r]   c                   C   s.   t tdd  t tdd  t tdd  d S )Nc                   S   s   t ttftttf dS )Nr/   r-   )r
   r=   r*   r+   r   r,   r3   r3   r3   r4   r9      s   

z)test_Domain_postprocess.<locals>.<lambda>c                   S   s   t dtdS )Nr3   r^   r
   r=   r"   r3   r3   r3   r4   r9      s   c                   S   s   t dtiS )Nr-   r_   r3   r3   r3   r4   r9      r:   )r)   r$   r3   r3   r3   r4   test_Domain_postprocess   s    r`   c                   C   sZ   t ddkstt ddks$tt ddks6tt ddksHtttdd  d S )NFTr   r6   c                   S   s
   t tS r7   )r   r8   r*   r3   r3   r3   r4   r9      r:   z'test_Split_preprocess.<locals>.<lambda>)r   r8   r0   r)   r#   r3   r3   r3   r4   test_Split_preprocess   s
    ra   c                   C   s   t tdd  d S )Nc                   S   s   t ddiS )NsplitT)r   r=   r3   r3   r3   r4   r9      r:   z(test_Split_postprocess.<locals>.<lambda>)r)   NotImplementedErrorr3   r3   r3   r4   test_Split_postprocess   s    rd   c                   C   sZ   t ddkstt ddks$tt ddks6tt ddksHtttdd  d S )NFTr   r6   c                   S   s
   t tS r7   )r   r8   r*   r3   r3   r3   r4   r9      r:   z*test_Gaussian_preprocess.<locals>.<lambda>)r   r8   r0   r)   r#   r3   r3   r3   r4   test_Gaussian_preprocess   s
    re   c                  C   s(   ddi} t |  | dtdks$td S )NgaussianT)rf   r-   )r   r=   r   r0   r>   r3   r3   r4   test_Gaussian_postprocess   s    
rg   c                   C   s   t ddkstt ddks$tt g d ks6tt tdtdhksRtt tdgtdhksptt tdtgtdthkstttdd  ttdd  d S )NTr6   rV   c                   S   s
   t dS )NFr   r8   r3   r3   r3   r4   r9     r:   z+test_Extension_preprocess.<locals>.<lambda>c                   S   s
   t dS rI   rh   r3   r3   r3   r4   r9     r:   )r   r8   r0   r(   r%   r)   r#   r3   r3   r3   r4   test_Extension_preprocess
  s    "ri   c                  C   s`   dt dhi} t|  | t dhtt ddks:tddi} t|  | ddiks\td S )N	extensionrV   )rj   r-   T)r(   r   r=   r   r\   r0   r>   r3   r3   r4   test_Extension_postprocess  s    

rk   c                   C   sH   t ddkstt tddks(tttdd  ttdd  d S )NrY   c                   S   s
   t dS rI   )r   r8   r3   r3   r3   r4   r9   ,  r:   z)test_Modulus_preprocess.<locals>.<lambda>c                   S   s
   t tS r7   )r   r8   r*   r3   r3   r3   r4   r9   -  r:   )r   r8   r0   r&   r)   r#   r3   r3   r3   r4   test_Modulus_preprocess(  s    rl   c                  C   sZ   ddi} t |  | dtddks(tddd} t |  | dtddddksVtd S )Nmodulus   )rm   r-   F)rm   	symmetric)rm   r-   ro   )r   r=   r   r0   r>   r3   r3   r4   test_Modulus_postprocess0  s    


rp   c                   C   sZ   t ddkstt ddks$tt ddks6tt ddksHtttdd  d S )NFTr   r6   c                   S   s
   t tS r7   )r   r8   r*   r3   r3   r3   r4   r9   J  r:   z+test_Symmetric_preprocess.<locals>.<lambda>)r   r8   r0   r)   r#   r3   r3   r3   r4   test_Symmetric_preprocessC  s
    rq   c                  C   s&   ddi} t |  | ddiks"td S )Nro   T)r   r=   r0   r>   r3   r3   r4   test_Symmetric_postprocessM  s    
rr   c                   C   sZ   t ddkstt ddks$tt ddks6tt ddksHtttdd  d S )NFTr   r6   c                   S   s
   t tS r7   )r   r8   r*   r3   r3   r3   r4   r9   [  r:   z(test_Strict_preprocess.<locals>.<lambda>)r   r8   r0   r)   r#   r3   r3   r3   r4   test_Strict_preprocessT  s
    rs   c                  C   s&   ddi} t |  | ddiks"td S )NstrictT)r   r=   r0   r>   r3   r3   r4   test_Strict_postprocess^  s    
ru   c                   C   sZ   t ddkstt ddks$tt ddks6tt ddksHtttdd  d S )NFTr   r6   c                   S   s
   t tS r7   )r   r8   r*   r3   r3   r3   r4   r9   l  r:   z&test_Auto_preprocess.<locals>.<lambda>)r   r8   r0   r)   r#   r3   r3   r3   r4   test_Auto_preprocesse  s
    rv   c                  C   s&   ddi} t |  | ddiks"td S )NautoT)r   r=   r0   r>   r3   r3   r4   test_Auto_postprocesso  s    
rx   c                   C   sZ   t ddkstt ddks$tt ddks6tt ddksHtttdd  d S )NFTr   r6   c                   S   s
   t tS r7   )r   r8   r*   r3   r3   r3   r4   r9   }  r:   z&test_Frac_preprocess.<locals>.<lambda>)r   r8   r0   r)   r#   r3   r3   r3   r4   test_Frac_preprocessv  s
    ry   c                  C   s&   ddi} t |  | ddiks"td S )NfracT)r   r=   r0   r>   r3   r3   r4   test_Frac_postprocess  s    
r{   c                   C   sZ   t ddkstt ddks$tt ddks6tt ddksHtttdd  d S )NFTr   r6   c                   S   s
   t tS r7   )r   r8   r*   r3   r3   r3   r4   r9     r:   z(test_Formal_preprocess.<locals>.<lambda>)r   r8   r0   r)   r#   r3   r3   r3   r4   test_Formal_preprocess  s
    r|   c                  C   s&   ddi} t |  | ddiks"td S )NZformalT)r   r=   r0   r>   r3   r3   r4   test_Formal_postprocess  s    
r}   c                   C   sZ   t ddkstt ddks$tt ddks6tt ddksHtttdd  d S )NFTr   r6   c                   S   s
   t tS r7   )r   r8   r*   r3   r3   r3   r4   r9     r:   z'test_Polys_preprocess.<locals>.<lambda>)r   r8   r0   r)   r#   r3   r3   r3   r4   test_Polys_preprocess  s
    r~   c                  C   s&   ddi} t |  | ddiks"td S )NZpolysT)r   r=   r0   r>   r3   r3   r4   test_Polys_postprocess  s    
r   c                   C   sZ   t ddkstt ddks$tt ddks6tt ddksHtttdd  d S )NFTr   r6   c                   S   s
   t tS r7   )r   r8   r*   r3   r3   r3   r4   r9     r:   z)test_Include_preprocess.<locals>.<lambda>)r   r8   r0   r)   r#   r3   r3   r3   r4   test_Include_preprocess  s
    r   c                  C   s&   ddi} t |  | ddiks"td S )NincludeT)r   r=   r0   r>   r3   r3   r4   test_Include_postprocess  s    
r   c                   C   sZ   t ddkstt ddks$tt ddks6tt ddksHtttdd  d S )NFTr   r6   c                   S   s
   t tS r7   )r   r8   r*   r3   r3   r3   r4   r9     r:   z%test_All_preprocess.<locals>.<lambda>)r   r8   r0   r)   r#   r3   r3   r3   r4   test_All_preprocess  s
    r   c                  C   s&   ddi} t |  | ddiks"td S )NallT)r   r=   r0   r>   r3   r3   r4   test_All_postprocess  s    
r   c                  C   s&   dt i} t|  | dt iks"td S )Ngen)r*   r   r=   r0   r>   r3   r3   r4   test_Gen_postprocess  s    
r   c                   C   s   t tdd  d S )Nc                   S   s
   t tS r7   )r   r8   r*   r3   r3   r3   r4   r9     r:   z)test_Symbols_preprocess.<locals>.<lambda>r)   r#   r3   r3   r3   r4   test_Symbols_preprocess  s    r   c                  C   s2   dt ttgi} t|  | dt ttgiks.td S )Nsymbols)r*   r+   r,   r   r=   r0   r>   r3   r3   r4   test_Symbols_postprocess  s    
r   c                   C   s   t tdd  d S )Nc                   S   s
   t dS )N
   )r   r8   r3   r3   r3   r4   r9     r:   z(test_Method_preprocess.<locals>.<lambda>r   r3   r3   r3   r4   test_Method_preprocess  s    r   c                  C   s&   ddi} t |  | ddiks"td S )NmethodZf5b)r   r=   r0   r>   r3   r3   r4   test_Method_postprocess  s    
r   N)c__doc__Zsympy.polys.polyoptionsr   r   r   r   r   r   r   r	   r
   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   Zsympy.polys.orderingsr   Zsympy.polys.domainsr   r   r   r   r   r    r!   r"   Zsympy.polys.polyerrorsr#   r$   Zsympy.core.numbersr%   r&   Zsympy.core.symbolr'   Z(sympy.functions.elementary.miscellaneousr(   Zsympy.testing.pytestr)   Z	sympy.abcr*   r+   r,   r5   r;   r?   rC   rD   rJ   rK   rL   rN   rO   rP   rQ   rS   rT   rU   r]   r`   ra   rd   re   rg   ri   rk   rl   rp   rq   rr   rs   ru   rv   rx   ry   r{   r|   r}   r~   r   r   r   r   r   r   r   r   r   r   r3   r3   r3   r4   <module>   sn   h(


@	










