o
    ®Ÿ?eA  ã                   @   sN   d Z ddlZddlmZ ddlmZ ddlmZ G dd„ dejƒZdd	„ Z	dS )
z*Converts the ternary conditional operator.é    N)Ú	converter)Úparser)Ú	templatesc                   @   s   e Zd ZdZdd„ ZdS )Ú ConditionalExpressionTransformerz4Converts conditional expressions to functional form.c              	   C   s<   d}t j|jdd ¡ }tj||j|j|jtj	|d ddS )Nz‚
        ag__.if_exp(
            test,
            lambda: true_expr,
            lambda: false_expr,
            expr_repr)
    F)Zinclude_encoding_marker)Úkind)ÚtestZ	true_exprZ
false_exprÚ	expr_repr)
r   Úunparser   Ústripr   Zreplace_as_expressionÚbodyÚorelseÚgastÚConstant)ÚselfÚnodeÚtemplater   © r   ú/home/www/facesmatcher.com/pyenv/lib/python3.10/site-packages/tensorflow/python/autograph/converters/conditional_expressions.pyÚvisit_IfExp   s   ûz,ConditionalExpressionTransformer.visit_IfExpN)Ú__name__Ú
__module__Ú__qualname__Ú__doc__r   r   r   r   r   r      s    r   c                 C   s   t |ƒ | ¡} | S )N)r   Úvisit)r   Úctxr   r   r   Ú	transform,   s   r   )
r   r   Z tensorflow.python.autograph.corer   Z tensorflow.python.autograph.pyctr   r   ZBaser   r   r   r   r   r   Ú<module>   s   