a
    Df	                     @   s|   d Z ddlmZmZmZ ddlmZmZ edZej	Z	e	dej
dd Ze	dejdd Ze	eeejd	d
 ZdS )z7
This file implements print functionality for the CPU.
    )typestypingcgutils)Registryimpl_ret_untrackedZ	printimpl
print_itemc           	      C   sT   |j \}|j}| |}|||}|| || |  }t| ||j	|S )z(
    Print a single constant value.
    )
argsZliteral_valueget_python_apiZunserializeZserialize_objectprint_objectdecrefget_dummy_valuer   return_type)	contextbuildersigr   tyvalpyapistrobjres r   d/nfs/NAS7/SABIOD/METHODE/ermites/ermites_venv/lib/python3.9/site-packages/numba/cpython/printimpl.pyprint_item_impl   s    


r   c              	   C   s   |j \}|\}| |}| |}| jr8| j||| ||||}|jt	||dd\}	}
|	$ |
| || W d   n1 s0    Y  |
< | |jd}||}|| || W d   n1 s0    Y  W d   n1 s0    Y  |  }t| ||j|S )z~
    Print a single native value by boxing it in a Python object and
    invoking the Python interpreter's print routine.
    T)ZlikelyNzthe print() function)r   r	   Zget_env_managerZ
enable_nrtZnrtZincrefZfrom_native_valueZif_elser   Zis_not_nullr
   r   Zinsert_const_stringmoduleZstring_from_stringZerr_write_unraisabler   r   r   )r   r   r   r   r   r   r   Zenv_managerobjZif_okZif_errorZcstrr   r   r   r   r   r   !   s(    


(

Fc                 C   s   |  |}| }tt|j|D ]L\}\}}ttj|}	| 	d|	}
|
||g |t
|d k r"|d q"|d || |  }t| ||j|S )z 
    A entire print() call.
    r       
)r	   Z
gil_ensure	enumeratezipr   r   	signaturer   noneZget_functionlenZprint_stringZgil_releaser   r   r   )r   r   r   r   r   ZgiliZargtypeargvalr    impr   r   r   r   print_varargs_impl@   s    


r&   N)__doc__Z
numba.corer   r   r   Znumba.core.imputilsr   r   registrylowerLiteralr   AnyprintZVarArgr&   r   r   r   r   <module>   s   



