o
    3Ih^                     @   s   d dl mZmZ d dlmZ d dlmZ d dlmZ d dl	m
Z
 d dlmZ d dlm
Z d dlmZ dd	 Zd
d Zdd Zdd Zdd ZdS )    )CodePrinterPrintMethodNotImplementedError)symbols)Dummy)raises)cos)lambdify)LambdaPrinterc                  K   s   t | d}t |_t |_|S )N)settings)r   set_not_supported_number_symbols)kwargsp r   e/home/air/sanwanet/gpt-api/venv/lib/python3.10/site-packages/sympy/printing/tests/test_codeprinter.pysetup_test_printer   s   
r   c                  C   s*   t d} t }|| d| j ksJ d S )Ndzd_%i)r   r   _print_Dummydummy_index)r   r   r   r   r   test_print_Dummy   s   r   c                  C   s   t d\} }t }|| dksJ ||dksJ |jdg ||dks+J tdd}|jdg tt || W d    n1 sKw   Y  tdd}|jdg ||d	kseJ d S )
Nzx, ifxifif_T)error_on_reserved_He_Man)reserved_word_suffix	if_He_Man)r   r   _printreserved_wordsupdater   
ValueError)r   yr   r   r   r   test_print_Symbol   s   


r#   c                  C   s|   t d\} }t| |gt| d |d  }|ddtdks J t }|t| d |d  }d|v s6J d|v s<J d S )Nz	x_{1} x_2         x_1x_2)r   r   r   math_cosr	   doprint)x1x2f1r   expr_strr   r   r   'test_lambdify_LaTeX_symbols_issue_23374,   s   r/   c                  C   s   G dd dt } ddlm}m} |  }tt ||ddi  W d    n1 s+w   Y  tt ||ddi  W d    d S 1 sIw   Y  d S )Nc                   @   s   e Zd Zdd ZdS )z-test_issue_15791.<locals>.CrashingCodePrinterc                 S   s   t )N)NotImplementedError)selfobjr   r   r   emptyPrinter?   s   z:test_issue_15791.<locals>.CrashingCodePrinter.emptyPrinterN)__name__
__module____qualname__r3   r   r   r   r   CrashingCodePrinter>   s    r7   r   )MutableSparseMatrixImmutableSparseMatrixr$   )r   sympy.matricesr8   r9   r   r   r*   )r7   r8   r9   cr   r   r   test_issue_15791=   s   

"r<   N)sympy.printing.codeprinterr   r   
sympy.corer   sympy.core.symbolr   sympy.testing.pytestr   sympyr   sympy.utilities.lambdifyr   mathr)   sympy.printing.lambdareprr	   r   r   r#   r/   r<   r   r   r   r   <module>   s    