
    /h!                       d Z ddl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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lmZ d
dlmZ d
dlmZ d
dlm Z  d
dl!m"Z" ej#        r
ddl$Z%d
dl&m'Z'  ej(        dej)        dej*        f                   Z+dddddd d!d"d#Z,d$e+d%e+fd&Z-d'e.d%ej)        d(ej/        d)gdf         fd*Z0d'e.d%ej)        d(ej1        d)gdf         fd+Z2	 	 	 dHd.ej3        d/d0d1ej4        e.         d2ej4        e.         d3ej4        ej5                 d4e6d5e6d%ej4        e.         fd6Z7d7ej*        d%e6fd8Z8d9ej9        ej:                 d:ej9        e.         d%ej;        e.         fd;Z< G d< d=          Z= G d> d)          Z> G d? d@e?          Z@ G dA dBe"          ZA G dC dDe"          ZB G dE dFeC          ZD G dG d(e"          ZEdS )Iz0Compiles nodes from the parser into Python code.    N)contextmanager)update_wrapper)StringIO)chain)	iskeyword)escape)Markup   )nodes)TemplateAssertionError)Symbols)VAR_LOAD_ALIAS)VAR_LOAD_PARAMETER)VAR_LOAD_RESOLVE)VAR_LOAD_UNDEFINED)EvalContext)	Optimizer)_PassArg)concat)NodeVisitor)EnvironmentF.)boundz==z!=>z>=<z<=inznot in)eqnegtgteqltlteqr   notinfreturnc           
           dddt           j        dddt          j        dt          j        f
 fd}t	          |           S )	NselfCodeGeneratornodeframeFramekwargsr%   c                     | j         H|j        j        s<| j                             ||j                  }||k    r|                     ||          S  | ||fi |S N)	optimizereval_ctxvolatilevisit)r'   r)   r*   r,   new_noder$   s        B/var/www/html/venv/lib/python3.11/site-packages/jinja2/compiler.pynew_funczoptimizeconst.<locals>.new_func.   sk     >%en.E%~++D%.AAH4zz(E222qtU--f---    )r   ExprtAnyr   )r$   r5   s   ` r4   optimizeconstr:   -   sa    
.
.%*Z
.8?
.KL5
.	

. 
. 
. 
. 
. 
. (A&&&r6   opr(   r+   c           	      \     t           dddt          j        dt          dd f fd            }|S )Nr'   r(   r)   r*   r%   c                    | j         j        rs| j         j        v re|                     dd           |                     |j        |           |                     d           |                     |j        |           nd|                     d           |                     |j        |           |                     d d           |                     |j        |           |                     d           d S )Nz environment.call_binop(context, , ( ))environment	sandboxedintercepted_binopswriter2   leftrightr'   r)   r*   r;   s      r4   visitorz_make_binop.<locals>.visitor>   s     &	*+-1A1T+T+TJJB"BBBCCCJJty%(((JJtJJtz5))))JJsOOOJJty%(((JJy2yyy!!!JJtz5)))

3r6   )r:   r   BinExprr+   r;   rI   s   ` r4   _make_binoprL   =   sP    o U] 5 T      ]  Nr6   c           	      \     t           dddt          j        dt          dd f fd            }|S )Nr'   r(   r)   r*   r%   c                 6   | j         j        rC| j         j        v r5|                     dd           |                     |j        |           n3|                     dz              |                     |j        |           |                     d           d S )Nzenvironment.call_unop(context, r>   r?   rA   )rB   rC   intercepted_unopsrE   r2   r)   rH   s      r4   rI   z_make_unop.<locals>.visitorU   s     &	)+-1A1S+S+SJJAAAABBBJJty%((((JJsRx   JJty%(((

3r6   )r:   r   	UnaryExprr+   rK   s   ` r4   
_make_unoprQ   R   sR     
o 
U_ 
U 
t 
 
 
 
 
 ]
 Nr6   FTr)   rB   r   namefilenamestream
defer_init	optimizedc                     t          | t          j                  st          d          |                    ||||||          }|                    |            ||j                                        S dS )z+Generate the python source for a node tree.z Can't compile non template nodesN)
isinstancer   Template	TypeErrorcode_generator_classr2   rT   getvalue)r)   rB   rR   rS   rT   rU   rV   	generators           r4   generater^   e   s|     dEN++ <:;;;00T8VZ I OOD~((***4r6   valuec                    | | t           u s	| t          u rdS t          |           t          t          t
          t          t          t          t          hv rdS t          |           t          t          t          t          hv rt          d | D                       S t          |           t          u r+t          d |                                 D                       S dS )z)Does the node have a safe representation?NTc              3   4   K   | ]}t          |          V  d S r.   has_safe_repr).0vs     r4   	<genexpr>z has_safe_repr.<locals>.<genexpr>   s*      33=##333333r6   c              3   X   K   | ]%\  }}t          |          ot          |          V  &d S r.   rb   rd   kre   s      r4   rf   z has_safe_repr.<locals>.<genexpr>   s;      SSTQ=##8a(8(8SSSSSSr6   F)NotImplementedEllipsistypeboolintfloatcomplexrangestrr	   tuplelistset	frozensetalldictitemsr_   s    r4   rc   rc   }   s    }//5H3D3DtE{{tS%%fEEEtE{{udC33333U333333E{{dSSU[[]]SSSSSS5r6   r   namesc                     t          |          }	 | D ]}|                    |           n# t          $ r Y nw xY w|j        S )zCheck if the names passed are accessed undeclared.  The return value
    is a set of all the undeclared names from the sequence of names found.
    )UndeclaredNameVisitorr2   VisitorExit
undeclared)r   r{   rI   r)   s       r4   find_undeclaredr      sh     $E**G 	  	 DMM$	    s   , 
99c                   L    e Zd Zdej        ej        ej        f         ddfdZdS )MacroRefr)   r%   Nc                 >    || _         d| _        d| _        d| _        d S NF)r)   accesses_calleraccesses_kwargsaccesses_varargsr'   r)   s     r4   __init__zMacroRef.__init__   s'    	$$ %r6   )	__name__
__module____qualname__r8   Unionr   Macro	CallBlockr    r6   r4   r   r      sF        &QWU[%/%AB &t & & & & & &r6   r   c            	           e Zd ZdZ	 	 ddedej        d          dej        e         ddfdZdd	Z	dde
dd fdZddZe	ZdS )r+   z&Holds compile time information for us.Nr0   parentlevelr%   c                 @   || _         || _        |+t          |          | _        d| _        d | _        d | _        n?t          |j        |          | _        |j        | _        |j        | _        |j        | _        d| _        d| _        d| _	        d| _
        d| _        d S )Nr   F)r0   r   r   symbolsrequire_output_checkbufferblocktoplevel	rootlevel
loop_frameblock_frame
soft_frame)r'   r0   r   r   s       r4   r   zFrame.__init__   s     ! >"///DL ).D% ,0DK +/DJJ #6>???DL(.(CD% -DKDJ 
    
  r6   te.Selfc                     t                               | j                  }|j                            | j                   | j                                        |_        |S )z!Create a copy of the current one.)object__new__	__class____dict__updater   copyr'   rvs     r4   r   z
Frame.copy   sG    ^^DN++
4=)))\&&((
	r6   Fisolatedc                 v    |r#t          | j        | j        j        dz             S t          | j        |           S )zReturn an inner frame.r
   r   )r+   r0   r   r   )r'   r   s     r4   innerzFrame.inner   s<     	Fdl.@1.DEEEET]D)))r6   c                 J    |                                  }d|_        d|_        |S )a&  Return a soft frame.  A soft frame may not be modified as
        standalone thing as it shares the resources with the frame it
        was created of, but it's not a rootlevel frame any longer.

        This is only used to implement if-statements and conditional
        expressions.
        FT)r   r   r   r   s     r4   softz
Frame.soft   s$     YY[[	r6   )NN)r%   r   F)r   r   r   __doc__r   r8   Optionalrn   r   r   rm   r   r   __copy__r   r6   r4   r+   r+      s        00
 '+!%	1  1 1  
7#1  z#	1 
 
1  1  1  1 f   * *d *w * * * *    HHHr6   c                       e Zd ZdZdS )r~   z?Exception used by the `UndeclaredNameVisitor` to signal a stop.Nr   r   r   r   r   r6   r4   r~   r~      s        IIIIr6   r~   c                   h    e Zd ZdZd	dZdej        ddfdZdej        ddfdZ	dej
        ddfdZdS )
DependencyFinderVisitorz.A visitor that collects filter and test calls.r%   Nc                 R    t                      | _        t                      | _        d S r.   )ru   filterstestsr'   s    r4   r   z DependencyFinderVisitor.__init__   s    #&55!$


r6   r)   c                 n    |                      |           | j                            |j                   d S r.   )generic_visitr   addrR   r   s     r4   visit_Filterz$DependencyFinderVisitor.visit_Filter  s4    4   #####r6   c                 n    |                      |           | j                            |j                   d S r.   )r   r   r   rR   r   s     r4   
visit_Testz"DependencyFinderVisitor.visit_Test  s2    4   
ty!!!!!r6   c                     dS )zStop visiting at blocks.Nr   r   s     r4   visit_Blockz#DependencyFinderVisitor.visit_Block        r6   r%   N)r   r   r   r   r   r   Filterr   Testr   Blockr   r   r6   r4   r   r      s        88' ' ' '$ $$ $ $ $ $"uz "d " " " "' ' ' ' ' ' ' 'r6   r   c                   l    e Zd ZdZdej        e         ddfdZdej	        ddfdZ
dej        ddfdZdS )	r}   zA visitor that checks if a name is accessed without being
    declared.  This is different from the frame visitor as it will
    not stop at closure frames.
    r{   r%   Nc                 T    t          |          | _        t                      | _        d S r.   )ru   r{   r   )r'   r{   s     r4   r   zUndeclaredNameVisitor.__init__  s    ZZ
&)eer6   r)   c                     |j         dk    rM|j        | j        v r?| j                            |j                   | j        | j        k    rt                      d S | j                            |j                   d S )Nload)ctxrR   r{   r   r   r~   discardr   s     r4   
visit_Namez UndeclaredNameVisitor.visit_Name  sv    8v$)tz"9"9O	***$*,,!mm# -, Jty)))))r6   c                     dS )zStop visiting a blocks.Nr   r   s     r4   r   z!UndeclaredNameVisitor.visit_Block!  r   r6   )r   r   r   r   r8   Iterablerr   r   r   Namer   r   r   r   r6   r4   r}   r}     s         
,ajo ,$ , , , ,*uz *d * * * *& & & & & & & &r6   r}   c                       e Zd ZdZdS )CompilerExitzRaised if the compiler encountered a situation where it just
    doesn't make sense to further process the code.  Any block that
    raises such an exception is not further processed.
    Nr   r   r6   r4   r   r   %  s           r6   r   c                      e Zd ZU 	 	 	 ddddej        e         dej        e         dej        ej                 d	ed
eddfdZe	defd            Z
dededdfdZdefdZdeddfdZ	 ddededdfdZddZddeddfdZddedej        ej                 ddfdZdeddfdZ	 ddededej        ej                 ddfdZd ej        ej                 deddfd!Zd"eddfd#Z	 dd"edej        ej                 d%eddfd&Zddej        ej                 d%eddfd'Z	 ddej        ej        ej        ej         f         ded(ej        ej!        eej"        f                  ddfd)Z#d ej        ej                 ddfd*Z$deddfd+Z%dded,eddfd-Z&dd0ed1edefd2Z'dedefd3Z(dej        ej)        ej*        f         dedej+        ee,f         fd4Z-d5e,deddfd6Z.dej        defd7Z/dedefd8Z0dd9Z1deddfd:Z2dd;Z3d<eddfd=Z4d<eddfd>Z5dd?Z6defd@Z7defdAZ8dedefdBZ9d<edefdCZ:ddDZ;deddfdEZ<	 ddej=        dej        e         ddfdFZ>dej?        deddfdGZ@dejA        deddfdHZBdejC        deddfdIZDdej        ejE        ejF        f         deddfdJZGdejE        deddfdKZHdejF        deddfdLZIdejJ        deddfdMZKdejL        deddfdNZMdej)        deddfdOZNdej*        deddfdPZOdejP        deddfdQZQdejR        deddfdRZSdejT        deddfdSZU G dT dUejV                  ZWeXdVej"        dej"        fdW            ZYdZZej        eW         e[dX<   deWfdYZ\dZej        ej"                 defd[Z]dej^        ded\eWdefd]Z_dej^        ded\eWddfd^Z`dej^        ded\eWddfd_Zadejb        deddfd`Zcdejd        deddfdaZedejf        deddfdbZgdejh        deddfdcZidejj        deddfddZkdejl        deddfdeZmdejn        deddfdfZodej+        deddfdgZpdejq        deddfdhZrdejs        deddfdiZt eudj          Zv eudk          Zw eudl          Zx eudm          Zy eudn          Zz eudo          Z{ eudp          Z| eudq          Z} eudr          Z~ edj          Z edk          Z eds          Zedej        deddfdt            Zedej        deddfdu            Zdej        deddfdvZedej        deddfdw            Zedej        deddfdx            Zdej        deddfdyZedej        ej        ej         f         dedzedej        d         fd{            Zedej        deddfd|            Zedej         deddfd}            Zedej        deddfd~            Ze	 ddej        dededdfd            Zdej        deddfdZdej        deddfdZdej        deddfdZdej        deddfdZdej        deddfdZdej        deddfdZdej        deddfdZdej        deddfdZdej        deddfdZdej        deddfdZdej        deddfdZdej        deddfdZdej        deddfdZdej        deddfdZdej        deddfdZdS )r(   NFTrB   r   rR   rS   rT   rU   rV   r%   c                    |t                      }|| _        || _        || _        || _        d| _        || _        d | _        |rt          |          | _        i | _	        i | _
        d| _        d| _        d| _        i | _        i | _        g | _        d | _        d| _        d| _        d| _        d| _        d| _        g | _        g | _        dg| _        d S )NFr   r
   Tcontext)r   rB   rR   rS   rT   created_block_contextrU   r/   r   import_aliasesblocksextends_so_farhas_known_extendscode_linenor   r   
debug_info_write_debug_info
_new_lines
_last_line_first_write_last_identifier_indentation_assign_stack_param_def_block_context_reference_stack)r'   rB   rR   rS   rT   rU   rV   s          r4   r   zCodeGenerator.__init__-  s    >ZZF&	 %*"$04 	4&{33DN 13 13  
 "'  (*
)+ 6826   ! !"  24 57 *3%%%r6   c                     | j         d uS r.   )r/   r   s    r4   rV   zCodeGenerator.optimizedv  s    ~T))r6   msglinenozte.NoReturnc                 :    t          ||| j        | j                  )z*Fail with a :exc:`TemplateAssertionError`.)r   rR   rS   )r'   r   r   s      r4   failzCodeGenerator.fail|  s    $S&$)T]KKKr6   c                 6    | xj         dz  c_         d| j          S )zGet a new unique identifier.r
   t_)r   r   s    r4   temporary_identifierz"CodeGenerator.temporary_identifier  s'    "+D)+++r6   r*   c                 r    |                                  |_        |                     |j         d           dS )z7Enable buffering for the frame from that point onwards.z = []N)r   r   	writeliner'   r*   s     r4   r   zCodeGenerator.buffer  s8    0022%,---.....r6   force_unescapedc                 &   |s|j         j        r|                     d           |                                  |                     d|j         d           |                                  |                     d           |                                  |                     d|j         d           |                                  dS |j         j        r |                     d|j         d           dS |                     d|j         d           dS )z(Return the buffer contents of the frame.zif context.eval_ctx.autoescape:zreturn Markup(concat())else:zreturn concat(rA   N)r0   r1   r   indentr   outdent
autoescape)r'   r*   r   s      r4   return_buffer_contentsz$CodeGenerator.return_buffer_contents  s     	~& @AAAGu|GGGHHHw'''????@@@* Gu|GGGHHH777788888r6   c                 &    | xj         dz  c_         dS )zIndent by one.r
   Nr   r   s    r4   r   zCodeGenerator.indent  s    Qr6   r
   stepc                 &    | xj         |z  c_         dS )zOutdent by step.Nr   )r'   r   s     r4   r   zCodeGenerator.outdent  s    T!r6   r)   c                     |j         |                     d|           dS |                     |j          d|           dS )z%Yield or write into the frame buffer.Nyield .append()r   r   )r'   r*   r)   s      r4   start_writezCodeGenerator.start_write  sI    <NN8T*****NNel444d;;;;;r6   c                 B    |j         |                     d           dS dS )z1End the writing process started by `start_write`.NrA   )r   rE   r   s     r4   	end_writezCodeGenerator.end_write  s%    <#JJsOOOOO $#r6   sc                     |                      ||           |                     |           |                     |           dS )z4Simple shortcut for start_write + write + end_write.N)r   rE   r  )r'   r  r*   r)   s       r4   simple_writezCodeGenerator.simple_write  sA     	%%%

1ur6   r   c                     	 |                      d           |D ]}|                     ||           dS # t          $ r Y dS w xY w)zVisit a list of nodes as block in a frame.  If the current frame
        is no buffer a dummy ``if 0: yield None`` is written automatically.
        passN)r   r2   r   )r'   r   r*   r)   s       r4   
blockvisitzCodeGenerator.blockvisit  sk    	NN6""" ( (

4''''( ( 	 	 	DD	s   04 
AAxc                    | j         r| j        sk| j                            d| j         z             | xj        | j         z  c_        | j        -| j                            | j        | j        f           d| _        d| _        | j                            d| j        z             d| _         | j                            |           dS )z&Write a string into the output stream.
NFz    r   )	r   r   rT   rE   r   r   r   appendr   )r'   r	  s     r4   rE   zCodeGenerator.write  s    ? 		 $ 2!!$"8999  DO3  )5O**D,BDDT+UVVV-1D* %DKft'88999DO!r6   r   extrac                 \    |                      ||           |                     |           dS )z!Combination of newline and write.N)newlinerE   )r'   r	  r)   r  s       r4   r   zCodeGenerator.writeline  s+     	T5!!!

1r6   c                     t          | j        d|z             | _        |*|j        | j        k    r|j        | _        |j        | _        dS dS dS )z/Add one or more newlines before the next write.r
   N)maxr   r   r   r   )r'   r)   r  s      r4   r  zCodeGenerator.newline  sR    doq5y99t > >%)[D""kDOOO  > >r6   extra_kwargsc                    t          d t          d |j        D             |pd          D                       }|j        D ]-}|                     d           |                     ||           .|sl|j        D ]-}|                     d           |                     ||           .|5|                                D ] \  }}|                     d| d|            !|j        r0|                     d           |                     |j        |           |r%|j        |                     d           n|                     d	           |j        D ]O}|                     |j	        d
           |                     |j
        |           |                     d           P|5|                                D ] \  }}|                     |d
| d           !|j        G|                     d           |                     |j        |           |                     d           dS |                     d           dS |j        2|                     d           |                     |j        |           dS dS )a+  Writes a function call to the stream for the current node.
        A leading comma is added automatically.  The extra keyword
        arguments may not include python keywords otherwise a syntax
        error could occur.  The extra keyword arguments should be given
        as python dict.
        c              3   d   K   | ]+}t          t          j        t          |                    V  ,d S r.   )is_python_keywordr8   castrr   )rd   ri   s     r4   rf   z*CodeGenerator.signature.<locals>.<genexpr>  sH       
 
 afS!nn--
 
 
 
 
 
r6   c              3   $   K   | ]}|j         V  d S r.   )keyrd   r	  s     r4   rf   z*CodeGenerator.signature.<locals>.<genexpr>  s$      77aAE777777r6   r   r>   N=z, *z
, **dict({z, **{: z}, **rA   }z, **)anyr   r,   argsrE   r2   ry   dyn_args
dyn_kwargsr  r_   )	r'   r)   r*   r  kwarg_workaroundargkwargr  r_   s	            r4   	signaturezCodeGenerator.signature  s     
 
774;7779KLL
 
 
 
 

 9 	# 	#CJJtJJsE"""" 	3 ) )

4   

5%(((('"."4"4"6"6 3 3JCJJ1C11%112222= 	-JJuJJt}e,,, 	/*

<((((

7### ! !

ei---...

5;...

4    '"."4"4"6"6 6 6JCJJ#4454445555*

7###

4?E222

3

3_(JJvJJt..... )(r6   c           
      >   t                      }|D ]}|                    |           | j        |j        df| j        |j        dffD ]T\  }}}t	          |          D ]<}||vr|                                 ||<   |                     d           |                                  |                     ||          d| d|d           |                                  |                     d           |                                  |                     d           |                     d	||          d
           |                                  |                     d|dd          d|d           |                                  |                                  >VdS )a  Find all filter and test names used in the template and
        assign them to variables in the compiled namespace. Checking
        that the names are registered with the environment is done when
        compiling the Filter and Test nodes. If the node is in an If or
        CondExpr node, the check is done at runtime instead.

        .. versionchanged:: 3.0
            Filters and tests in If and CondExpr nodes are checked at
            runtime instead of compile time.
        r   r   try:z = environment.[]zexcept KeyError:z@internalcodedef z
(*unused):zraise TemplateRuntimeError("No N named z	 found."))	r   r2   r   r   sortedr   r   r   r   )r'   r   rI   r)   id_mapr{   
dependencyrR   s           r4   pull_dependencieszCodeGenerator.pull_dependencies  s    *++ 	  	 DMM$ \7?I6
*
 	 	%FE: u  v%%#'#<#<#>#>F4L v&&&&,UUzUUDUUUVVV1222///>fTl>>>???0j"o 0 0"0 0 0   )	 	r6   c           	         g }|j         j                                        D ]\  }\  }}|t          k    r|t          k    r1|                     | d|                                  d|d           P|t          k    r|                     | d|            v|t          k    r|	                    |           t          d          |r-|                     d                    |           d           d S d S )N = r?   rA   zunknown load instruction
 = missing)r   loadsry   r   r   r   get_resolve_funcr   r   r  NotImplementedErrorjoin)r'   r*   undefstargetactionparams         r4   enter_framezCodeGenerator.enter_frameH  s$   ',}':'@'@'B'B 
	F 
	F#FOVU++++++&QQT-B-B-D-DQQuQQQRRRR>))&44U445555---f%%%%)*DEEE 	>NNejj00<<<=====	> 	>r6   with_python_scopec                     |sUg }|j         j        D ]}|                    |           |r/|                     d                    |           d           d S d S d S )Nr1  r2  )r   r3  r  r   r6  )r'   r*   r<  r7  r8  s        r4   leave_framezCodeGenerator.leave_frameX  s      	BF-- & &f%%%% B%**V"4"4@@@AAAAA	B 	BB Br6   async  async_value
sync_valuec                 "    | j         j        r|n|S r.   )rB   is_async)r'   rA  rB  s      r4   choose_asynczCodeGenerator.choose_async`  s    ".7G{{ZGr6   c                 4    |                                   d| S )Nr)  )rE  )r'   rR   s     r4   funczCodeGenerator.funcc  s"    ##%%114111r6   c           
      P   |                                 }|j                            |           t          |          }d}t	                      }g }t          |j                  D ]g\  }}|j        dk    r|}|j        dv r|                    |j                   |	                    |j        
                    |j                             ht          |j        d          }	d|	v r|O	 |j        |t          |j                  z
            nX# t          $ r |                     d|j                   Y n1w xY w|	                    |j                            d                     d|_        d|	v r8d|vr4|	                    |j                            d                     d|_        d|	v r8d|vr4|	                    |j                            d                     d|_        d	|_        |j                            |           |                     |                     d
           dd                    |           d|           |                                  |                     |           |                     |           |                     |           t          |j                  D ]\  }}|j        
                    |j                  }
|                     d|
 d           |                                  	 |j        |t          |j                  z
           }|                     |
 d           |                     ||           n8# t          $ r+ |                     |
 d|j        d|j        d           Y nw xY w|                     |
           |                                   | !                                 | "                    |j        |           | #                    |d           | $                    |d           |                                   ||fS )z/Dump the function def of a macro or call block.Ncaller)r,   varargs)rI  r,   rJ  zhWhen defining macros or call blocks the special "caller" argument must be omitted or be given a default.Tr,   rJ  Fmacror?   r>   ):if  is missing:r1  z = undefined("parameter z was not provided", name=rA   )r   r<  )%r   r   analyze_noder   ru   	enumerater  rR   r   r  refr   bodydefaultslen
IndexErrorr   r   declare_parameterr   r   r   r   r   rG  r6  r   r   r;  push_parameter_definitionsr2   mark_parameter_storedr   pop_parameter_definitionsr  r   r>  )r'   r)   r*   	macro_refexplicit_callerskip_special_paramsr  idxr"  r   rR  defaults               r4   
macro_bodyzCodeGenerator.macro_bodyf  sM    ""4(((TNN	!ee!$),, 	5 	5HCx8##"%x000#''111KK))#(334444$TY0OPP
z!! *M/C	NN"BCCC!   II1 	     EM;;HEEFFF(,I%z!!h6I&I&IKK77AABBB(,I%
""y8K'K'KKK77	BBCCC)-I& &+"""4((($))G,,BBtyyBBBDIIIE''...!$),, 	 	HC-##CH--CNN2222333KKMMM	+-c$)nn(<= #{{{+++

7E****     + +CH + + X+ + +     &&s+++LLNNNN&&(((	5)))##E4#@@@$777is$   ("D %D32D3?"M2NNr[  c                 0   d                     d |j        j        D                       }t          |j        dd          }t	          |j        j                  dk    r|dz  }|                     d|d| d	|j        d|j        d|j        d
           dS )z<Dump the macro definition for the def created by macro_body.r>   c              3   >   K   | ]}t          |j                  V  d S r.   )reprrR   r  s     r4   rf   z*CodeGenerator.macro_def.<locals>.<genexpr>  s*      HHqd16llHHHHHHr6   rR   Nr
   ,zMacro(environment, macro, z, (z), z, context.eval_ctx.autoescape))	r6  r)   r  getattrrU  rE   r   r   r   )r'   r[  r*   	arg_tuplerR   s        r4   	macro_defzCodeGenerator.macro_def  s    IIHHIN4GHHHHH	y~vt44y~"##q((I

L L LI L L)L L/8/IL L)L L L	
 	
 	
 	
 	
r6   c                 @    d|j          }| j        | d| j        }|S )z.Return a human readable position for the node.zline N in )r   rR   )r'   r)   r   s      r4   positionzCodeGenerator.position  s3    "T[""9 ))DI))B	r6   c                     d                     d |j                                                                        D                       }d| dS )Nr>   c              3   *   K   | ]\  }}|d | V  dS r  Nr   )rd   rR   r8  s      r4   rf   z3CodeGenerator.dump_local_context.<locals>.<genexpr>  sH       
 
f !!!!
 
 
 
 
 
r6   {r  )r6  r   dump_storesry   )r'   r*   items_kvs      r4   dump_local_contextz CodeGenerator.dump_local_context  s^    99 
 
 % 9 9 ; ; A A C C
 
 
 
 
 !H    r6   c                     |                      d           |                      d           |                      d           |                      d           |                      d           dS )zWrites a common preamble that is used by root and block functions.
        Primarily this sets up common local helpers and enforces a generator
        through a dead branch.
        z$resolve = context.resolve_or_missingz!undefined = environment.undefinedzconcat = environment.concatzcond_expr_undefined = Undefinedzif 0: yield NoneNr   r   s    r4   write_commonszCodeGenerator.write_commons  sk    
 	=>>>:;;;4555 	8999)*****r6   c                 h    | j                             |j                                                   dS )aQ  Pushes all parameter targets from the given frame into a local
        stack that permits tracking of yet to be assigned parameters.  In
        particular this enables the optimization from `visit_Name` to skip
        undefined expressions for parameters in macros as macros can reference
        otherwise unbound parameters.
        N)r   r  r   dump_param_targetsr   s     r4   rX  z(CodeGenerator.push_parameter_definitions  s/     	$$U]%E%E%G%GHHHHHr6   c                 8    | j                                          dS )z+Pops the current parameter definitions set.N)r   popr   s    r4   rZ  z'CodeGenerator.pop_parameter_definitions  s    !!#####r6   r8  c                 X    | j         r"| j         d                             |           dS dS )zMarks a parameter in the current parameter definitions as stored.
        This will skip the enforced undefined checks.
        r*  N)r   r   r'   r8  s     r4   rY  z#CodeGenerator.mark_parameter_stored  s;       	6!"%--f55555	6 	6r6   c                 :    | j                             |           d S r.   )r   r  rz  s     r4   push_context_referencez$CodeGenerator.push_context_reference  s    %,,V44444r6   c                 8    | j                                          d S r.   )r   rx  r   s    r4   pop_context_referencez#CodeGenerator.pop_context_reference  s    %))+++++r6   c                     | j         d         S )Nr*  r   r   s    r4   get_context_refzCodeGenerator.get_context_ref  s    ,R00r6   c                 6    | j         d         }|dk    rdS | dS )Nr*  r   resolvez.resolver  rz  s     r4   r4  zCodeGenerator.get_resolve_func  s.    .r2Y9""""r6   c                 \    |                                   d|                     |           dS )Nz	.derived(rA   )r  rq  r   s     r4   derive_contextzCodeGenerator.derive_context  s3    &&((TT43J3J53Q3QTTTTr6   c                 2    | j         sdS || j         d         v S )z4Checks if a given target is an undeclared parameter.Fr*  )r   rz  s     r4   parameter_is_undeclaredz%CodeGenerator.parameter_is_undeclared  s%    $ 	5.r222r6   c                 R    | j                             t                                 dS )z+Pushes a new layer for assignment tracking.N)r   r  ru   r   s    r4   push_assign_trackingz"CodeGenerator.push_assign_tracking  s#    !!#%%(((((r6   c                    | j                                         }|j        s|j        s|j        r|sdS d |D             }t          |          dk    rt          t          |                    }|j        	                    |          }|j        r| 
                    d|d|            dS |j        r| 
                    d|d|            dS | 
                    d|d|            n|j        r| 
                    d           n2|j        r| 
                    d	           n| 
                    d
           t          t          |                    D ]P\  }}|r|                     d           |j        	                    |          }|                     |d|            Q|                     d           |j        s|j        s|rt          |          dk    r!| 
                    d|d         d           dS d                    t          t           t          |                              }| 
                    d| d           dS dS dS dS )zoPops the topmost level for assignment tracking and updates the
        context variables if necessary.
        Nc                 .    g | ]}|d d         dk    |S )Nr
   _r   r  s     r4   
<listcomp>z5CodeGenerator.pop_assign_tracking.<locals>.<listcomp>  s%    888a1RaR5C<<<<<r6   r
   z_loop_vars[] = z_block_vars[context.vars[z_loop_vars.update({z_block_vars.update({context.vars.update({r>   r  })context.exported_vars.add(r   rA   zcontext.exported_vars.update((r   )r   rx  r   r   r   rU  nextiterr   rR  r   rQ  r,  rE   r6  maprc  )r'   r*   varspublic_namesrR   rR  r^  	names_strs           r4   pop_assign_trackingz!CodeGenerator.pop_assign_tracking  s    !%%''!	$	 N	 		 F884888t99>>T

##D-##D))C >T>>>>???  ?d??#??@@@NN<4<<s<<==== 845555" 8566666777&vd||44 / /	T %JJt$$$m''--

d----....JJt  	O)9 	Ol 	O<  A%%PLOPPPQQQQQ IIc$|0D0D&E&EFF	M	MMMNNNNN	O 	O 	O 	O 	O 	Or6   c           	         |
J d            t          | j        | j                  }ddlm} ddlm} | j        j        rt          ||z             }nt          |          }|                     dd	                    |          z              | j
        rdnd}|                    t          j                  d u}|                    t          j                  D ]C}	|	j        | j        v r$|                     d	|	j        d
|	j                   |	| j        |	j        <   D|                    t          j                  D ]}
|
j        | j        vr||
j        }|                                 x| j        |<   }d|v r8|                    dd          \  }}|                     d| d| d|            q|                     d| d|            |                     d| j                   |                     |                     d           d| dd           |                                  |                                  t7          |          }dt9          |j        d          v r2|j                            d          }|                     | d           |j                             |           dx|_!        |_"        |o| j#         |_$        |r|                     d           | %                    |           | &                    |j                   | '                    |j        |           | (                    |d           | )                                 |r=| j#        s)|                                  |                     d           |                                  | j        j        s|                     d           n|                     d           |                     d           |                                  |                     d           |                                  |                     d            | )                                 | )                                 |                     d!           | )                    d| j#         z              | j        *                                D ]\  }}	|                     |                     d"|z              d| d|	d           |                                  |                                  t7          |          }d|_+        t9          |	j        d#          }d|v r2|j                            d          }|                     | d           d$|v r8|j                            d$          }|                     | d%|d&| d'           |j                             |	           ||_,        |                     d(           | %                    |           | &                    |	j                   | '                    |	j        |           | (                    |d           | )                                 d	                    d) | j        D                       }|                     d*| d+d           d,	                    d- | j-        D                       }|                     d.|           d S )/Nzno root frame allowedr
   )async_exported)exportedzfrom jinja2.runtime import r>   r@  z, environment=environmentzblock z defined twice.zfrom z import z as zimport zname = rootz(context, missing=missingrL  )r  r'   r   z = TemplateReference(context)Tzparent_template = NonerO  if parent_template is not None:z4yield from parent_template.root_render_func(context)z0agen = parent_template.root_render_func(context)r&  zasync for event in agen:zyield eventzfinally: await agen.aclose()block_)r'   superr  z = context.super(z, block_rA   z_block_vars = {}c              3   $   K   | ]}|d | V  dS )z: block_Nr   r  s     r4   rf   z/CodeGenerator.visit_Template.<locals>.<genexpr>  s0      !K!K!Q"5"5!"5"5!K!K!K!K!K!Kr6   z
blocks = {r  &c              3   *   K   | ]\  }}| d | V  dS )r  Nr   rh   s      r4   rf   z/CodeGenerator.visit_Template.<locals>.<genexpr>  s0      GGtq!1

q

GGGGGGr6   zdebug_info = ).r   rB   rR   runtimer  r  rD  r,  r   r6  rU   findr   Extendsfind_allr   r   r   r   ImportedName
importnamer   r   rsplitrG  r   rt  r+   r   rS  r   rW  rP  r   r   r   r   r;  r/  r  r>  r   ry   r   r   r   )r'   r)   r*   r0   r  r  exported_namesenvenvhave_extendsr   import_impaliasmoduleobjrR  rR   r   r   blocks_kv_strdebug_kv_strs                        r4   visit_TemplatezCodeGenerator.visit_Template=  s    }}5}}}t/;;++++++%%%%%%$ 	.#H~$=>>NN#H--N4tyy7P7PPQQQ G,G yy//t; ]]5;// 	, 	,EzT[((		?5:???NNN&+DK
## }}U%788 	? 	?G!)<<<(373L3L3N3NN#C(5#::"%**S!"4"4KFCNN#K6#K#K3#K#KE#K#KLLLLNN#=S#=#=e#=#=>>> 	.../// 	yy  EE6EEEQ 	 	
 	
 	
 	 h_TY	::::-11&99CNNc@@@AAA""4(((+//%1%P$:P6P" 	5NN3444ty)))	5)))$777  	;) B@AAAKKMMM#, ?UVVVVQRRRv&&&9:::}---=>>>LL$"889:::  ;,,.. 	 	KD%NN99X_--RRRRR  
 KKMMM     //K&*K#(5FGGJ##!);;FCC#DDDEEE*$$!);;GDD#OOOOOOOPPP,,U333 $KNN-...[)))""5:...OOEJ444[DAAALLNNNN		!K!Kt{!K!K!KKK6]666a@@@xxGGtGGGGG7|7788888r6   c                 T   d}|j         rB| j        rdS | j        dk    r.|                     d           |                                  |dz  }|j        r|                     |          }n|                                 }|j        rf|                     d|j	        d|           |                                  |                     d|j	        d|           | 
                                 | j        j        s*|j        #|                     d	|j	        d
| d|           n|                     d|j	        d
| d           |                     d           |                                  |                     |                                  d|           |                                  |                     d|           | 
                                 | 
                                 |                     d|                     dd                      | 
                    |           dS )z.Call a block and register it for the template.r   Nif parent_template is None:r
   zif len(context.blocks[z]) <= 1:z+raise TemplateRuntimeError("Required block z not found")zyield from context.blocks[z][0](rA   zgen = context.blocks[r&  for event in gen:event	finally: await gen.aclose()gen.close())r   r   r   r   r   scopedr  r  requiredrR   r   rB   rD  r   rE  r  )r'   r)   r*   r   r   s        r4   r   zCodeGenerator.visit_Block  sJ   > 	 % "Q&&<===
; 	-))%00GG**,,G= 	NNIDIIII4PPPKKMMMNNWdiWWW   LLNNN( 	U\-ANNITYIIwIII4    NNO49OOWOOOPPPNN6"""KKMMMNN$$&&999   KKMMMgu---LLNNNLLNNNNNTD--.BMRRTT   	Ur6   c                    |j         s|                     d|j                   | j        dk    rn| j        s)|                     d           |                                  |                     d           | j        rt                      |                                  |                     d|           | 	                    |j
        |           |                     d| j        d           |                     d           |                                  |                     d	           |                                  |j        rd
| _        | xj        dz  c_        dS )zCalls the extender.z,cannot use extend from a non top-level scoper   r  z5raise TemplateRuntimeError("extended multiple times")z+parent_template = environment.get_template(r>   rA   z9for name, parent_block in parent_template.blocks.items():z8context.blocks.setdefault(name, []).append(parent_block)Tr
   N)r   r   r   r   r   r   r   r   r   r2   templaterE   rR   r   r'   r)   r*   s      r4   visit_ExtendszCodeGenerator.visit_Extends  sS   ~ 	SIIDdkRRR
 ""
 ) @AAANNRSSS % "nn$DdKKK

4=%(((

&	&&&'''RSSSQRRR
 ? 	*%)D" 	q r6   c                     |j         r)                     d                                             d}t          |j        t
          j                  rKt          |j        j        t                    rd}nVt          |j        j        t          t          f          rd}n-t          |j        t
          j        t
          j        f          rd}                     d| d|                                |j                                        d j        d           |j         r                                                       d	                                                                  d
                                                                  d                                             d fd}|j        rʉ                     d                                d                                d                                                                                                    d            |                                                                    d                     dd                      nA j        j        r                      d            |             n                     d           |j         r                                  dS dS )zHandles includes.r&  get_or_select_templateget_templateselect_templateztemplate = environment.r?   r>   rA   zexcept TemplateNotFound:r  r   r%   Nc                                                                            d                                             d S )Nr  )r   r  r   )r*   r'   s   r4   	loop_bodyz.CodeGenerator.visit_Include.<locals>.loop_body-  s7    KKMMMgu---LLNNNNNr6   zNgen = template.root_render_func(template.new_context(context.get_all(), True, r   r  r  r  r  zGfor event in (await template._get_default_module_async())._body_stream:z6yield from template._get_default_module()._body_streamr   )ignore_missingr   r   rX   r  r   Constr_   rr   rs   rt   TupleListr2   rE   rR   r   with_contextrq  rE  rB   rD  )r'   r)   r*   	func_namer  s   ` `  r4   visit_IncludezCodeGenerator.visit_Include  s    	NN6"""KKMMM,	dmU[11 	*$--s33 .*		DM/%?? .-	UZ'@AA 	*)I====tDDD

4=%(((

&	&&&''' 	LLNNNNN5666KKMMMNN6"""LLNNNNN7###KKMMM	 	 	 	 	 	 	
  	UNN7++E227 7 7  
 NN6"""KKMMMNNd//11DDDEEEIKKKLLNNNNNTD--.BMRRTT    & 	UNN!   IKKKKNNSTTT 	LLNNNNN	 	r6   c                    |                      |                     d           d           |                     |j        |           |                      d| j        d           |j        rHd|                     d           }|                      | d|                     |           d           d S |                      d	|                     d           d
           d S )Nawait zenvironment.get_template(r>   z).make_module_asyncz(context.get_all(), True, rA   _get_default_modulez	(context))rE   rE  r2   r  rR   r  rq  )r'   r)   r*   f_names       r4   _import_commonzCodeGenerator._import_commonL  s     	

d''11LLLMMM

4=%(((

'	'''((( 	U@4#4#4X#>#>@@FJJVVT5L5LU5S5SVVV     JJST->->x-H-HSSSTTTTTr6   c                 n   |                      |j                            |j                   d|           |j        r|                     d|j        d           |                     ||           |j        r:|j                            d          s"|                      d|j        d           dS dS dS )zVisit regular imports.r1  r  r  r  context.exported_vars.discard(rA   N)r   r   rR  r8  r   rE   r  
startswithr  s      r4   visit_ImportzCodeGenerator.visit_Import[  s    %-++DK88===tDDD> 	<JJ:t{:::;;;D%(((> 	N$+"8"8"="= 	NNNLDKLLLMMMMM	N 	N 	N 	Nr6   c           	         |                      |           |                     d           |                     |           g }g }|j        D ]m}t	          |t
                    r|\  }}n|}|                     j                            |           d|d           |                     dj                            |           d           | 	                                 | 
                    |                              dd                              dd	          }d
| d|}|                     j                            |           d|d|d           |                                  j        r?|                    |           |                    d          s|                    |           o|rt!          |          dk    r<|d         }|                     d|dj                            |                      n:d                    fd|D                       }	|                     d|	 d           |rwt!          |          dk    r!|                     d|d         d           dS d                    t%          t&          |                    }
|                     d|
 d           dS dS )zVisit named imports.zincluded_template = z = getattr(included_template, z
, missing)rM  rN  rn  z{{r  z}}z9the template {included_template.__name__!r} (imported on z%) does not export the requested name z = undefined(fz, name=rA   r  r
   r   r  r  r>   c              3   V   K   | ]#}|d j                             |           V  $dS rm  )r   rR  )rd   rR   r*   s     r4   rf   z1CodeGenerator.visit_FromImport.<locals>.<genexpr>  sR       % %?Ct::!2!24!8!8::% % % % % %r6   r  r  r  z)context.exported_vars.difference_update((r   N)r  rE   r  r{   rX   rs   r   r   rR  r   rj  replacer   r   r  r  rU  r6  r  rc  )r'   r)   r*   	var_namesdiscarded_namesrR   r  rj  messagenames_kvr  s     `        r4   visit_FromImportzCodeGenerator.visit_FromImportf  sD   T

)***D%(((	J 	2 	2D$&& "eeNN=$$U++ B B/3B B B   NNG!2!25!9!9GGGHHHKKMMM
 }}T**223==EEc4PPH@!)@ @7;@ @ 
 NN=$$U++VV7VVTVVV   LLNNN~ 2  ''''',, 2#**5111 	G9~~"" |TtTT5=;L;LT;R;RTTUUUU99 % % % %GP% % %   EEEEFFF 	?##q((WPQ@RWWWXXXXX IIc$&@&@AA	M	MMM    	 	r6   c                    |                                 }d|_        |                                 }|                                 }|j        p[dt          |                    d          d          v p5t          d |                    t          j                  D                       }d }|r|j	        
                    d          }|j	                            |d           |j        r|j	                            |d	           |j        r|                                 }|j	                            |d
           |                     |                     |           d|j                   |                                  |                     |           |                     |                     dd                     |                     |j        |           |                     d           |                     |                     dd                     |                     d           |                                  |                     d|j                   |                     |j        |           |                     d           |                                  |                     d           |                     |j        |           |                     d           |                     |d           |j        ra|                     |                     d           d|           |                                  |                     |           |j        |_        |r|                     | d           |                    t          j                  D ]3}	|	j        dk    r&|	j        dk    r|                     d|	j                   4|j        r,|                                 }
|                     |
 d           |                     |                     dd          |           |                     |j        |           |r0|                     d| d|                     d           d           n|                     d           |j        r|                     | d           |j        r|                     d           na| j        j         r|s|                     d            |                     |j!        |           | j        j         r|s|                     d!           |j        r|                     d!           |j        r|                     d"           n|                     |rd#nd           |                                  |                     |           |                     d$           | "                    |j#        |           |j        r|                     |
 d%           |                                  |                     ||j        o|j                    |j        r|                     d|
 d           |                                  |                     |           | "                    |j        |           |                     |           |                                  |j        r| $                    |           |                                  | %                    ||           |                     |                     d&           d'           | j        j         r|                     d            |                     |j!        |           | j        j         r|                     d!           |                     d(           | &                    |           | j'        r,| j'        d)         (                    |j	        j)                   d S d S )*NTloop)rS  )only)r  c              3   $   K   | ]}|j         V  d S r.   )r  )rd   r   s     r4   rf   z*CodeGenerator.visit_For.<locals>.<genexpr>  s$      HHE5<HHHHHHr6   rS  )
for_branchelsetestz(fiter):z
async for zfor ri  zauto_aiter(fiter)fiter:rM  r      rO  z%(reciter, loop_render_func, depth=0):r2  storez8Can't assign to special loop variable in for-loop targetz = 1r>   AsynczLoopContext(r?   reciterzauto_aiter(rA   z&, undefined, loop_render_func, depth):z, undefined):z_loop_vars = {}z = 0r  zloop(z, loop)r*  )*r   r   	recursiver   iter_child_nodesr  r  r   r   r   rW  rP  else_r  r   r   rG  r   r;  rE  r2   r8  rE   r   r>  r   r   r   rR   r   r   rB   rD  r  r  rS  r   r   r  r   difference_updatestores)r'   r)   r*   r   
test_frame
else_frameextended_looploop_refloop_filter_funcrR   iteration_indicators              r4   	visit_ForzCodeGenerator.visit_For  s   [[]]
 $
[[]]
[[]]
 N It44)4DDiPPQI HHT]]5;-G-GHHHHH	 	  	D!);;FCCH'''@@@: 	E++DV+DDD9 	A#88::++DV+DDDNNdii(899CCCTYOOOKKMMMZ(((NN4,,\6BBCCCJJt{J///JJvJJt(()<gFFGGGJJsOOOKKMMMNN5$),,,JJty*---JJsOOOKKMMMNN8$$$JJt{J///LLOOOZ4@@@
 > 	2NN99V$$KKKT   KKMMMKK
### !+ 1J  	4NNh222333MM%*-- 	 	Dx7""tyF':':		NK  
 : 	9"&";";"="=NN1777888t((v>>EEE

4;
+++ 	JJRHRR$*;*;G*D*DRRRSSSSJJv9 	/JJ*---...> 	 JJy!!!!( * *

=)))JJty%((((    

39 	JJsOOO> 	BJJ?@@@@JJ-@SAAA$$$()))	:...: 	9NN1777888$.*K^ 	 	
 	
 	
 : 	NN7!4777888KKMMMZ(((OODJ
333Z(((LLNNN > 	"''
333LLNNNUD)))JJ$++H55<<<===( *

=)))JJty%((((  

3JJy!!!NN5!!!  	Pr"44Z5G5NOOOOO	P 	Pr6   c                 (   |                                 }|                     d|           |                     |j        |           |                     d           |                                  |                     |j        |           |                                  |j	        D ]}|                     d|           |                     |j        |           |                     d           |                                  |                     |j        |           |                                  |j
        rZ|                     d           |                                  |                     |j
        |           |                                  d S d S )NrM  r  zelif r   )r   r   r2   r  rE   r   r  rS  r   elif_r  )r'   r)   r*   if_framer  s        r4   visit_IfzCodeGenerator.visit_If(  sN   ::<<ud###

49h'''

3	8,,,Z 	 	ENN7E***JJuz8,,,JJsOOOKKMMMOOEJ111LLNNNN: 	NN7###KKMMMOODJ111LLNNNNN		 	r6   c                    |                      ||          \  }}|                                  |j        rV|j                            d          s|                     d|j        d           |                     d|j        d           |                     |j                            |j                   d           | 	                    ||           d S )Nr  r  rA   r  r  r1  )
r`  r  r   rR   r  rE   r   r   rR  rg  )r'   r)   r*   macro_framer[  s        r4   visit_MacrozCodeGenerator.visit_Macro=  s    !%u!=!=Y> 	>9'',, H

F	FFFGGGNN<49<<<===

em''	22777888y+.....r6   c                    |                      ||          \  }}|                     d           |                     ||           |                     ||           |                     |j        |d           |                     |           d S )Nz	caller = T)forward_caller)r`  r   rg  r   
visit_Callcallr  )r'   r)   r*   
call_framer[  s        r4   visit_CallBlockzCodeGenerator.visit_CallBlockG  s     $e < <
I{###y*---%%%	5>>>ur6   c                    |                                 }|j                            |           |                     |           |                     |           |                     |j        |           |                     ||           |                     |j	        |           | 
                    |           |                     |           d S r.   )r   r   rP  r;  r   r  rS  r   r   filterr  r>  )r'   r)   r*   filter_frames       r4   visit_FilterBlockzCodeGenerator.visit_FilterBlockO  s    {{}}))$///&&&L!!!	<000%%%$+|444u&&&&&r6   c                    |                                 }|j                            |           |                     |           t	          |j        |j                  D ]Z\  }}|                                  |                     ||           | 	                    d           |                     ||           [| 
                    |j        |           |                     |           d S )Nr1  )r   r   rP  r;  ziptargetsvaluesr  r2   rE   r  rS  r>  )r'   r)   r*   
with_framer8  exprs         r4   
visit_WithzCodeGenerator.visit_WithZ  s    [[]]
''---$$$dk:: 	$ 	$LFDLLNNNJJvz***JJuJJtU####	:...$$$$$r6   c                 f    |                      |           |                     |j        |           d S r.   )r  r2   r)   r  s      r4   visit_ExprStmtzCodeGenerator.visit_ExprStmtf  s0    T

49e$$$$$r6   c                   j    e Zd ZU ej        ej        def                  ed<   ej        e         ed<   dS )CodeGenerator._FinalizeInfo.constsrcN)r   r   r   r8   r   Callablerr   __annotations__r   r6   r4   _FinalizeInfor  j  sB         z!*S#X.////Z_r6   r  r_   c                      t          |           S )zThe default finalize function if the environment isn't
        configured with one. Or, if the environment has one, this is
        called on that function's output for constants.
        )rr   rz   s    r4   _default_finalizezCodeGenerator._default_finalizen  s     5zzr6   	_finalizec                      j          j         S  j        x}d} j        j        rd} j        j        t          j        dt          j        dt          j        di                    t	          j                            }d}| dt          j
        dt          j
        ffd}n-| | d	}|dk    r dt          j
        dt          j
        f fd
}                     ||           _          j         S )a  Build the finalize function to be used on constants and at
        runtime. Cached so it's only created once for all output nodes.

        Returns a ``namedtuple`` with the following attributes:

        ``const``
            A function to finalize constant data at compile time.

        ``src``
            Source code to output around nodes to be evaluated at
            runtime.
        Nzenvironment.finalize(r   context.eval_ctxrB   r_   r%   c                 ,      |                     S r.   r   )r_   r_  env_finalizes    r4   finalizez.CodeGenerator._make_finalize.<locals>.finalize  s    "7<<#6#6777r6   r>   c                 8      j         |                     S r.   )rB   )r_   r_  r$  r'   s    r4   r%  z.CodeGenerator._make_finalize.<locals>.finalize  s"    &w||D4De'L'LMMMr6   )r   r  rB   r%  r   r   eval_contextgetfrom_objr8   r9   r  )r'   r%  r  pass_argr_  r$  s   `   @@r4   _make_finalizezCodeGenerator._make_finalizex  sX    >%>! "337$ 	N)C+4L )%'9$m c!,// 	  H8AE 8ae 8 8 8 8 8 8 8 8 *h***},,N N!% N N N N N N N N ++Hc::~r6   groupc                 :    t          t          |                    S )zGiven a group of constant values converted from ``Output``
        child nodes, produce a string to write to the template module
        source.
        )rc  r   )r'   r,  s     r4   _output_const_reprz CodeGenerator._output_const_repr  s    
 F5MM"""r6   r%  c                     |                     |j                  }|j        j        rt          |          }t	          |t
          j                  rt          |          S |                    |          S )aC  Try to optimize a child of an ``Output`` node by trying to
        convert it to constant, finalized data at compile time.

        If :exc:`Impossible` is raised, the node is not constant and
        will be evaluated at runtime. Any other exception will also be
        evaluated at runtime for easier debugging.
        )	as_constr0   r   r   rX   r   TemplateDatarr   r  )r'   r)   r*   r%  r  s        r4   _output_child_to_constz$CodeGenerator._output_child_to_const  sd     en-->$ 	"5MME dE.// 	u::~~e$$$r6   c                     |j         j        r|                     d           n7|j         j        r|                     d           n|                     d           |j        |                     |j                   dS dS )zXOutput extra source code before visiting a child of an
        ``Output`` node.
        z1(escape if context.eval_ctx.autoescape else str)(zescape(zstr(N)r0   r1   rE   r   r  r'   r)   r*   r%  s       r4   _output_child_prezCodeGenerator._output_child_pre  s     >" 	JJJKKKK^& 	JJy!!!!JJv<#JJx|$$$$$ $#r6   c                 l    |                      d           |j        |                      d           dS dS )zWOutput extra source code after visiting a child of an
        ``Output`` node.
        rA   N)rE   r  r4  s       r4   _output_child_postz CodeGenerator._output_child_post  s6     	

3<#JJsOOOOO $#r6   c                    |j         r2| j        rd S |                     d           |                                  |                                 }g }|j        D ]}	 |j        s-t          |t
          j                  st          j	                    | 
                    |||          }n1# t
          j	        t          f$ r |                    |           Y |w xY w|r7t          |d         t                    r|d                             |           |                    |g           |j        bt          |          dk    r|                     |j         d           n|                     |j         d           |                                  |D ]}t          |t                    rN|                     |          }|j        |                     d|z              L|                     |dz              e|j        |                     d|           n|                     |           |                     |||           |                     ||           |                     |||           |j        |                     d           |j        >|                                  |                     t          |          dk    rdnd	           |j         r|                                  d S d S )
Nr  r*  r
   r   z	.extend((r   rd  rA   r   )r   r   r   r   r+  r   r  rX   r1  
Impossibler2  	Exceptionr  rt   r   rU  r.  r  r5  r2   r7  rE   r   )	r'   r)   r*   r%  rS  childr  itemvals	            r4   visit_OutputzCodeGenerator.visit_Output  s    % 	% NN8999KKMMM&&((;=
 Z 	% 	%E N- "%);<<-  *,,,33E5(KK$i0    E"""  %
48T22 %R&&&&UG$$$$<#4yyA~~%,8889999%,999:::KKMMM 	$ 	$D$%% $--d33<'NN8c>2222NN39----<'NN8T2222LL&&& &&tUH===

4'''''eX>>><+JJsOOO<#LLNNNNN#d))q..33d;;;% 	LLNNNNN	 	s   AB&&+CCc                    |                                   t                      }|                    t          j                  D ]}|j        |v r|                    |j                   |j                            |j                  }| 	                    d| d           | 
                                 | 	                    d           |                                  |                     |           |                     |j        |           |                     d           |                     |j        |           |                     |           d S )Nzif not isinstance(z, Namespace):zMraise TemplateRuntimeError("cannot assign attribute on non-namespace object")r1  )r  ru   r  r   NSRefrR   r   r   rR  r   r   r   r  r2   r8  rE   r)   r  )r'   r)   r*   	seen_refsnsrefrR  s         r4   visit_AssignzCodeGenerator.visit_Assign.  s;   !!### !$	]]5;// 	 	EzY&& MM%*%%%-##EJ//CNNBBBBCCCKKMMMNNF   LLNNNNT

4;&&&

5

49e$$$  '''''r6   c                    |                                   |                                }d|_        |j                            |           |                     |           |                     |           |                     |j        |           | 	                    |           | 
                    |j        |           |                     d           |j        |                     |j        |           n|                     d|j         d           |                     d           |                     |           |                     |           d S )NFz9 = (Markup if context.eval_ctx.autoescape else identity)(concat(rA   )r  r   r   r   rP  r;  r   r  rS  r  r2   r8  rE   r  r   r  r>  )r'   r)   r*   r   s       r4   visit_AssignBlockzCodeGenerator.visit_AssignBlockM  s:   !!###kkmm ,1(((...%%%K   	;///T

4;&&&

NOOO;"dk;7777JJ6!3666777

3  '''%%%%%r6   c           	         |j         dk    rA|j        s|j        s|j        r,| j        r%| j        d                             |j                   |j                            |j                  }|j         dk    rh|j        	                    |          }|&|d         t          k    r|                     |          r&|                     d|j        d| d| d           d S |                     |           d S )	Nr  r*  r   r   z(undefined(name=z) if z is missing else rA   )r   r   r   r   r   r   rR   r   rR  	find_loadr   r  rE   )r'   r)   r*   rR  r   s        r4   r   zCodeGenerator.visit_Namee  s   8wN #. 272C  ! 6"2&**49555m	**
 8v=**3//D G11144S99 2 

UtyUUUUsUUU   

3r6   c                     |j                             |j                  }|                     | d|j        d           d S )Nr'  r(  )r   rR  rR   r   attr)r'   r)   r*   rR  s       r4   visit_NSRefzCodeGenerator.visit_NSRef~  sF    
 m	**#..	.../////r6   c                     |                     |j                  }t          |t                    r$|                     t          |                     d S |                     t          |                     d S r.   )r0  r0   rX   ro   rE   rr   rc  )r'   r)   r*   r=  s       r4   visit_ConstzCodeGenerator.visit_Const  sc    mmEN++c5!! 	"JJs3xx     JJtCyy!!!!!r6   c                     	 |                      t          |                    |j                                       d S # t          j        $ r" |                      d|j        d           Y d S w xY wNz6(Markup if context.eval_ctx.autoescape else identity)(rA   )rE   rc  r0  r0   r   r9  datar  s      r4   visit_TemplateDataz CodeGenerator.visit_TemplateData  s    	JJtDMM%.99::;;;;; 	 	 	JJWWWW     	s   :> -A/.A/c                     |                      d           d}t          |j                  D ]2\  }}|r|                      d           |                     ||           3|                      |dk    rdnd           d S )Nr?   r*  r>   r   z,)rA   rE   rQ  ry   r2   r'   r)   r*   r^  r<  s        r4   visit_TuplezCodeGenerator.visit_Tuple  s    

3"4:.. 	$ 	$IC !

4   JJtU####

3!8844-----r6   c                     |                      d           t          |j                  D ]2\  }}|r|                      d           |                     ||           3|                      d           d S )Nr'  r>   r(  rS  rT  s        r4   
visit_ListzCodeGenerator.visit_List  sr    

3"4:.. 	$ 	$IC !

4   JJtU####

3r6   c                 R   |                      d           t          |j                  D ]g\  }}|r|                      d           |                     |j        |           |                      d           |                     |j        |           h|                      d           d S )Nrn  r>   r  r  )rE   rQ  ry   r2   r  r_   rT  s        r4   
visit_DictzCodeGenerator.visit_Dict  s    

3"4:.. 	* 	*IC !

4   JJtx'''JJtJJtz5))))

3r6   +-*/z//z**%andorznot c                 
   |j         j        rd}n|j         j        rd}nd}|                     | d           |j        D ]-}|                     ||           |                     d           .|                     d           d S )Nz8(markup_join if context.eval_ctx.volatile else str_join)markup_joinstr_joinz((r>   r   )r0   r1   r   rE   r   r2   )r'   r)   r*   r  r"  s        r4   visit_ConcatzCodeGenerator.visit_Concat  s    >" 	#RII^& 	#%II"I

i###$$$: 	 	CJJsE"""JJt

4r6   c                     |                      d           |                     |j        |           |j        D ]}|                     ||           |                      d           d S )Nr?   rA   )rE   r2   r  opsrH   s       r4   visit_ComparezCodeGenerator.visit_Compare  sb    

3

49e$$$( 	" 	"BJJr5!!!!

3r6   c                     |                      dt          |j                  d           |                     |j        |           d S )Nr@   )rE   	operatorsr;   r2   r  r  s      r4   visit_OperandzCodeGenerator.visit_Operand  sC    

,y),,,---

49e$$$$$r6   c                 *   | j         j        r|                     d           |                     d           |                     |j        |           |                     d|j        d           | j         j        r|                     d           d S d S )N(await auto_await(zenvironment.getattr(r>   rA   r   )rB   rD  rE   r2   r)   rJ  r  s      r4   visit_GetattrzCodeGenerator.visit_Getattr  s    $ 	-JJ+,,,

)***

49e$$$

&	&&&'''$ 	JJt	 	r6   c                 z   t          |j        t          j                  rb|                     |j        |           |                     d           |                     |j        |           |                     d           d S | j        j        r|                     d           |                     d           |                     |j        |           |                     d           |                     |j        |           |                     d           | j        j        r|                     d           d S d S )Nr'  r(  rl  zenvironment.getitem(r>   rA   r   )	rX   r"  r   Slicer2   r)   rE   rB   rD  r  s      r4   visit_GetitemzCodeGenerator.visit_Getitem  s    dh,, 	!JJty%(((JJsOOOJJtx'''JJsOOOOO( 1

/000JJ-...JJty%(((JJtJJtx'''JJsOOO( !

4     ! !r6   c                 *   |j         |                     |j         |           |                     d           |j        |                     |j        |           |j        2|                     d           |                     |j        |           d S d S )Nr  )startr2   rE   stopr   r  s      r4   visit_SlicezCodeGenerator.visit_Slice  s    :!JJtz5)))

39 JJty%(((9 JJsOOOJJty%((((( ! r6   	is_filterc              #   \  K   | j         j        r|                     d           |rM|                     | j        |j                  d           | j         j                            |j                  }nL|                     | j        |j                  d           | j         j                            |j                  }|4|j        s-|rdnd}|                     d| d|j        d|j	                   t          j        dt          j        d	t          j         d
i                    t          j        |                    }||                     | d           d V  |                     ||           |                     d           | j         j        r|                     d           d S d S )Nrl  r?   r  r  zNo r+  r  r   r"  rB   r>   rA   r   )rB   rD  rE   r   rR   r(  r   r   r   r   r   r   r'  r)  r$  )r'   r)   r*   ru  rG  	type_namer*  s          r4   _filter_test_commonz!CodeGenerator._filter_test_common  s      $ 	-JJ+,,, 	9JJ$,ty1444555#+//	::DDJJ$*TY/222333#)--di88D
 < 0<$-96III<I<<di<<<dkJJJ i!#5 -
 #d##
 
	 	 JJ(''' 	tU###

3$ 	JJt	 	r6   c                    |                      ||d          5  |j        |                     |j        |           n||j        j        r'|                     d|j         d|j         d           nI|j        j        r|                     d|j         d           n|                     d|j         d           d d d            d S # 1 swxY w Y   d S )NTz(Markup(concat(z.)) if context.eval_ctx.autoescape else concat(r   zMarkup(concat(rE  rA   )rx  r)   r2   r0   r1   rE   r   r   r  s      r4   r   zCodeGenerator.visit_Filter,  sH   %%dE488 	6 	6 y$

49e,,,,( 6

Tel T TCH<T T T    * 6

<EL<<<====

4U\444555	6 	6 	6 	6 	6 	6 	6 	6 	6 	6 	6 	6 	6 	6 	6 	6 	6 	6s   B CC	C	c                     |                      ||d          5  |                     |j        |           d d d            d S # 1 swxY w Y   d S r   )rx  r2   r)   r  s      r4   r   zCodeGenerator.visit_Test=  s    %%dE599 	) 	)JJty%(((	) 	) 	) 	) 	) 	) 	) 	) 	) 	) 	) 	) 	) 	) 	) 	) 	) 	)s   AAAc                 l                                     d fd}                     d                                j                                        d                                j                                        d            |                                  d           d S )Nr%   c                      j                             j                     d S                     d                               d           d S )Nz1cond_expr_undefined("the inline if-expression on z6 evaluated to false and no else section was defined."))expr2r2   rE   rj  )r*   r)   r'   s   r4   write_expr2z1CodeGenerator.visit_CondExpr.<locals>.write_expr2F  si    z%

4:u---JJ+MM$''+ + +    r6   r?   z if z else rA   r   )r   rE   r2   expr1r  )r'   r)   r*   r~  s   ``` r4   visit_CondExprzCodeGenerator.visit_CondExprB  s    

		 		 		 		 		 		 		 		 	

3

4:u%%%

6

49e$$$

8

3r6   r  c                    | j         j        r|                     d           | j         j        r|                     d           n|                     d           |                     |j        |           |rddind }|j        rddini }|j        rddini }|r |j        |fi | n|s|rt          |fi |}| 
                    |||           |                     d           | j         j        r|                     d           d S d S )	Nrl  zenvironment.call(context, zcontext.call(rI  
_loop_vars_block_varsrA   r   )rB   rD  rE   rC   r2   r)   r   r   r   rx   r$  )r'   r)   r*   r  r  loop_kwargsblock_kwargss          r4   r  zCodeGenerator.visit_CallY  sS    $ 	-JJ+,,,% 	(JJ34444JJ'''

49e$$$/=G(++46;6FN|\22B9>9JR}55PR 	=L<<|<<<< 	=L 	=<<|<<LtUL111

3$ 	JJt	 	r6   c                 v    |                      |j        dz              |                     |j        |           d S )Nr  )rE   r  r2   r_   r  s      r4   visit_KeywordzCodeGenerator.visit_Keywordp  s6    

48c>"""

4:u%%%%%r6   c                     |                      d           |                     |j        |           |                      d           d S )NzMarkup(rA   rE   r2   r  r  s      r4   visit_MarkSafezCodeGenerator.visit_MarkSafev  s=    

9

49e$$$

3r6   c                     |                      d           |                     |j        |           |                      d           d S rO  r  r  s      r4   visit_MarkSafeIfAutoescapez(CodeGenerator.visit_MarkSafeIfAutoescape{  s@     	

KLLL

49e$$$

3r6   c                 @    |                      d|j        z              d S )Nzenvironment.rE   rR   r  s      r4   visit_EnvironmentAttributez(CodeGenerator.visit_EnvironmentAttribute  s#     	

>DI-.....r6   c                 P    |                      d|j        d|j                    d S )Nzenvironment.extensions[z].)rE   
identifierrR   r  s      r4   visit_ExtensionAttributez&CodeGenerator.visit_ExtensionAttribute  s1     	

MT_MM$)MMNNNNNr6   c                 P    |                      | j        |j                            d S r.   )rE   r   r  r  s      r4   visit_ImportedNamez CodeGenerator.visit_ImportedName  s$    

4&t788888r6   c                 :    |                      |j                   d S r.   r  r  s      r4   visit_InternalNamez CodeGenerator.visit_InternalName  s    

49r6   c                 0    |                      d           d S )Nr   )rE   r  s      r4   visit_ContextReferencez$CodeGenerator.visit_ContextReference  s     	

9r6   c                 V    |                      |                     |                     d S r.   )rE   r  r  s      r4   visit_DerivedContextReferencez+CodeGenerator.visit_DerivedContextReference  s*     	

4&&u--.....r6   c                 2    |                      d|           d S )Ncontinuers  r  s      r4   visit_ContinuezCodeGenerator.visit_Continue  s    z4(((((r6   c                 2    |                      d|           d S )Nbreakrs  r  s      r4   visit_BreakzCodeGenerator.visit_Break  s    w%%%%%r6   c                     |                                 }|j                            |           |                     |           |                     |j        |           |                     |           d S r.   )r   r   rP  r;  r  rS  r>  )r'   r)   r*   scope_frames       r4   visit_ScopezCodeGenerator.visit_Scope  sj    kkmm((...%%%	;///%%%%%r6   c                 *   |                                  }|                     | d|                     |                      |                     | d           |                     |j        |           |                     |           |                    d          }|j                            |           | 	                    |           | 
                    |j        |           |                     |           |                                  d S )Nr1  z.vars = T)r   )r   r   r  r2   r   r|  r   r   rP  r;  r  rS  r>  r~  )r'   r)   r*   r   r  s        r4   visit_OverlayScopez CodeGenerator.visit_OverlayScope  s   ''))#>>$"5"5e"<"<>>???#'''(((

4<'''##C(((kk4k00((...%%%	;///%%%""$$$$$r6   c                 D   |j         D ]}|                     d|j         d           |                     |j        |           	 |j                            |j                  }t          |j        |j        |           w# t          j	        $ r d|j        _
        Y w xY wd S )Nzcontext.eval_ctx.r1  T)optionsr   r  r2   r_   r0  r0   setattrr   r9  r1   )r'   r)   r*   keywordr=  s        r4   visit_EvalContextModifierz'CodeGenerator.visit_EvalContextModifier  s     | 	: 	:GNN?w{???@@@JJw}e,,,:m,,U^<< S9999 # / / /*.'''/	: 	:s   A??BBc                 b   |                                  }|j                                        }|                     | d           |                     ||           |j        D ]}|                     ||           |j                            |           |                     d| d           d S )Nz = context.eval_ctx.save()zcontext.eval_ctx.revert(rA   )r   r0   saver   r  rS  r2   revert)r'   r)   r*   old_ctx_name	saved_ctxr;  s         r4   visit_ScopedEvalContextModifierz-CodeGenerator.visit_ScopedEvalContextModifier  s     0022N''))	,BBBCCC&&tU333Y 	% 	%EJJue$$$$i(((A,AAABBBBBr6   NFTr   r   )r
   r.   )Nr   )r?  r@  )r   r   r   r8   r   rr   TextIOrm   r   propertyrV   rn   r   r   r+   r   r   r   r   r   Noder   r  r  r   r  rE   r   r  r   Callr   r   Mappingr9   r$  r/  r;  r>  rE  rG  r   r   r  r   r`  rg  rj  rq  rt  rX  rZ  rY  r|  r~  r  r4  r  r  r  r  rY   r  r   r   r  r  Includer  Import
FromImportr  r  r  Forr  Ifr   r  r	  FilterBlockr  Withr  ExprStmtr  
NamedTupler  staticmethodr  r   r  r+  r.  r7   r2  r5  r7  Outputr>  AssignrC  AssignBlockrF  r   r   r@  rK  r  rM  r1  rQ  rU  r  rW  DictrY  rL   	visit_Add	visit_Sub	visit_Mul	visit_Divvisit_FloorDiv	visit_Pow	visit_Mod	visit_Andvisit_OrrQ   	visit_Pos	visit_Neg	visit_Notr:   Concatrd  Comparerg  Operandrj  Getattrrm  Getitemrp  ro  rt  r   Iteratorrx  r   r   CondExprr  r  Keywordr  MarkSafer  MarkSafeIfAutoescaper  EnvironmentAttributer  ExtensionAttributer  r  r  InternalNamer  ContextReferencer  DerivedContextReferencer  Continuer  Breakr  Scoper  OverlayScoper  EvalContextModifierr  ScopedEvalContextModifierr  r   r6   r4   r(   r(   ,  s,         (, G4 G4"G4 joG4 *S/	G4
 
18$G4 G4 G4 
G4 G4 G4 G4R *4 * * * X*
L LS L] L L L L,c , , , ,
/E /d / / / / 5:9 99-19	9 9 9 9(   " "C " " " " "< < <aj.D <PT < < < <u      DH "*+*UZ*@	   	
5: 6 	u 	 	 	 	 	s t     IJ Juz2BE	   * *AJuz2 *# *d * * * * ;?	7/ 7/gej%,
:;7/ 7/ j3:!67	7/
 
7/ 7/ 7/ 7/r,qz%*'= ,$ , , , ,\> >4 > > > > B B B4 BD B B B BH H HC HQT H H H H2 2 2 2 2 2Q GEK89Q BGQ 	
	!Q  Q  Q  Q f

8 

E 

d 

 

 

 

UZ C    ! !# ! ! ! !+ + + +I I$ I I I I$ $ $ $6C 6D 6 6 6 65S 5T 5 5 5 5, , , ,1 1 1 1 1## # # # #UE Uc U U U U3c 3d 3 3 3 3) ) ) ))O )O4 )O )O )O )O\ @Dx9 x9Nx9+,:e+<x9	x9 x9 x9 x9t/ /E /d / / / /b(!%- (! (!$ (! (! (! (!T8%- 8 8$ 8 8 8 8tUGEL%*::;UDIU	U U U U	N 	Ne 	N 	N 	N 	N 	N5U%5 5e 5 5 5 5 5nIPei IP IP$ IP IP IP IPVUX e     */ /E /d / / / /EO E d    	'e&7 	' 	'$ 	' 	' 	' 	'
%uz 
%% 
%D 
% 
% 
% 
%%5> %% %D % % % %         15    \ ,0Iqz-(///. . . . .`#
15(9 #c # # # #%J%',%8E%	% % % %*%J%',%8E%	% % % % 	J	',	8E			 	 	 	M Me M M M M M^( (e ( ( ( ( (>&e&7 & &$ & & & &0uz % D    20 0E 0d 0 0 0 0" "E "d " " " "u'9 % D    . .E .d . . . .uz % D    uz % D     C  IC  IC  IC  I [&&ND!!IC  IE""I{4  H
3I
3I
6""I e     ] %-  $    ]%%- % %$ % % % % 	%- 	 	$ 	 	 	 ]	 !%- ! !$ ! ! ! ]!() )E )d ) ) ) ) 'GEL%*45'>C'PT'	
D	' ' ' ^'R 6 6e 6 6 6 6 ]6  )uz )% )D ) ) ) ]) 5> % D    ], EJ J',>B	   ],&%- & &$ & & & &5> % D    
.7<	   /./7</	/ / / /
O,O5:O	O O O O
9u'9 9% 9D 9 9 9 9u'9 % D    *38	   
/1/:?/	/ / / /
)5> )% )D ) ) ) )& &E &d & & & && &E &d & & & &%u'9 %% %D % % % %:-:6;:	: : : :
C3
C<A
C	
C 
C 
C 
C 
C 
Cr6   r  )Fr   typingr8   
contextlibr   	functoolsr   ior   	itertoolsr   r  r   r  
markupsafer   r	   r@  r   
exceptionsr   
idtrackingr   r   r   r   r   r   r/   r   utilsr   r   rI   r   TYPE_CHECKINGtyping_extensionsterB   r   TypeVarr  r9   r   ri  r:   rr   rJ   rL   rP   rQ   rY   r   r  rm   r^   rc   r   r  Setr   r   r+   RuntimeErrorr~   r   r}   r:  r   r(   r   r6   r4   <module>r     s   6 6     % % % % % % $ $ $ $ $ $             2 2 2 2 2 2                   . . . . . .       & & & & & & * * * * * * ( ( ( ( ( ( * * * * * *                                          ? )""""((((((AIcCJ/000 



	 		'Q '1 ' ' ' ' C AJ'PRV'VW    *Z%/7;TAB   0 $( 
. *S/ jo	
 Jqx    Z_   0 4    ":ej!*+*S/U3Z   & & & & & & & &P P P P P P P PfJ J J J J, J J J' ' ' ' 'k ' ' '&& & & & &K & & &,    9   bC bC bC bC bCK bC bC bC bC bCr6   