/usr/local/lib/python3.6/site-packages/jinja2/__pycache__
NameSizeModeActions
async_utils.cpython-36.pyc24350644editdlrm
bccache.cpython-36.pyc130970644editdlrm
compiler.cpython-36.pyc543690644editdlrm
constants.cpython-36.pyc14960644editdlrm
debug.cpython-36.pyc53440644editdlrm
defaults.cpython-36.pyc12410644editdlrm
environment.cpython-36.pyc523970644editdlrm
exceptions.cpython-36.pyc54980644editdlrm
ext.cpython-36.pyc262740644editdlrm
filters.cpython-36.pyc497540644editdlrm
idtracking.cpython-36.pyc111250644editdlrm
lexer.cpython-36.pyc199830644editdlrm
loaders.cpython-36.pyc202170644editdlrm
meta.cpython-36.pyc37460644editdlrm
nativetypes.cpython-36.pyc48050644editdlrm
nodes.cpython-36.pyc411930644editdlrm
optimizer.cpython-36.pyc18610644editdlrm
parser.cpython-36.pyc276350644editdlrm
runtime.cpython-36.pyc328630644editdlrm
sandbox.cpython-36.pyc116960644editdlrm
tests.cpython-36.pyc64820644editdlrm
utils.cpython-36.pyc272170644editdlrm
visitor.cpython-36.pyc38390644editdlrm
_identifier.cpython-36.pyc18500644editdlrm
__init__.cpython-36.pyc18650644editdlrm
Edit: /usr/local/lib/python3.6/site-packages/jinja2/__pycache__/nodes.cpython-36.pyc (41193B)
3 ^TBg @s&UdZddlZddlZddlZddlmZddlmZddl m Z ej r\ddl Z ddlmZejdd d Zejejejejejejejd Zejeejejejgejffejejej d Z!ejeejejgejff!ej"ej#ej$ej%ej&ej'd ddddZ(ejeejejejgejff(Gddde)Z*Gddde+Z,GdddZ-d ej.e-e-dddZ/Gdd d e,dZ0Gddde0Z1Gddde0Z2Gd d!d!e0Z3Gd"d#d#e1Z4Gd$d%d%e1Z5Gd&d'd'e1Z6Gd(d)d)e1Z7Gd*d+d+e1Z8Gd,d-d-e1Z9Gd.d/d/e1Z:Gd0d1d1e1Z;Gd2d3d3e1ZGd8d9d9e1Z?Gd:d;d;e1Z@Gdd?d?e1ZBGd@dAdAe0ZCGdBdCdCeCZDGdDdEdEeCZEGdFdGdGeCZFGdHdIdIeCZGGdJdKdKeCZHGdLdMdMeHZIGdNdOdOeHZJGdPdQdQeHZKGdRdSdSeHZLGdTdUdUeHZGdVdWdWe2ZMGdXdYdYe2ZNGdZd[d[eCZOejPdej.e-ejKejLejejejejffd^d_d`ZQGdad\d\eCZRGdbdcdceRZSGdddedeeRZTGdfd]d]eCZUGdgdhdheCZVGdidjdjeCZWGdkdldleCZXGdmdndneCZYGdodpdpeCZZGdqdrdre2Z[GdsdtdteDZ\GdudvdveDZ]GdwdxdxeDZ^GdydzdzeDZ_Gd{d|d|eDZ`Gd}d~d~eDZaGdddeDZbGdddeDZcGdddeDZdGdddeEZeGdddeEZfGdddeEZgGdddeCZhGdddeCZiGdddeCZjGdddeCZkGdddeCZlGdddeCZmGdddeCZnGdddeCZoGddde1ZpGddde1ZqGddde1ZrGddde1ZsGddde1ZtGdddetZuejejddddZveweve,_x[vdS)zAST nodes generated by the parser for the compiler. Also provides some node tree helper functions used by the parser and compiler in order to normalize nodes. N)deque)Markup)_PassArg) Environment _NodeBoundNode)Zbound)*/z//z**%+-)notr r cCs||kS)N)abrr./tmp/pip-build-0s3hx122/Jinja2/jinja2/nodes.py+srcCs||kS)Nr)rrrrrr,s)eqnegtZgteqltZlteqinnotinc@seZdZdZdS) Impossiblez8Raised if the node could not perform a requested action.N)__name__ __module__ __qualname____doc__rrrrr0src@seZdZdZddZdS)NodeTypezA metaclass for nodes that handles the field and attribute inheritance. fields and attributes from the parent class are automatically forwarded to the child.cCsx|d D]t}g}|jt|r |dnt|f|j|j|ft|dksRtdt|tt|ksntdt|||<qW|jddt j ||||S) Nfields attributesrrz multiple inheritance not allowedzlayout conflictabstractF)r r!) extendgetattrobjectgetlenAssertionErrorsettuple setdefaulttype__new__)ZmcsnamebasesdattrZstoragerrrr-9s  zNodeType.__new__N)rrrrr-rrrrr4src@s`eZdZdZd dejeddddZejeej fddd Z ejeej fdd d d Z dS) EvalContextzcHolds evaluation time information. Custom attributes can be attached to it in extensions. Nr) environment template_namereturncCs0||_t|jr|j||_n|j|_d|_dS)NF)r3callable autoescapevolatile)selfr3r4rrr__init__Js  zEvalContext.__init__)r5cCs |jjS)N)__dict__copy)r9rrrsaveTszEvalContext.save)oldr5cCs|jj|jj|dS)N)r;clearupdate)r9r>rrrrevertWs zEvalContext.revert)N) rrrrtOptionalstrr:MappingAnyr=rArrrrr2Es  r2)nodectxr5cCs(|dkr$|jdkrtdt|jS|S)NzIif no eval context is passed, the node must have an attached environment.)r3 RuntimeErrorr2)rGrHrrrget_eval_context\s   rJc@seZdZUdZfZejedfd'ZejedfdZ e  ej d ejejddd d Zd(ej ejeej ejeejejeejfd d d Zd)ej ejeej ejeejdd ddZejeej edddZejejeejejedffejedddZeddddZd*e eddddZdddddZejedd d!ZejZed"d#d$Z ed"d%d&Z!dS)+raBaseclass for all Jinja nodes. There are a number of nodes available of different types. There are four major types: - :class:`Stmt`: statements - :class:`Expr`: expressions - :class:`Helper`: helper nodes - :class:`Template`: the outermost wrapper node All nodes have fields and attributes. Fields may be other nodes, lists, or arbitrary values. Fields are passed to the constructor as regular positional arguments, attributes as keyword arguments. Each node has two attributes: `lineno` (the line number of the node) and `environment`. The `environment` attribute is set at the end of the parsing process for all nodes automatically. .linenor3TrN)r r!r5cOs|jrtd|rt|t|jkrt|js>tt|jdtt|jdt|jdt|jdkrjdndx$t|j|D]\}}t|||qWx"|jD]}t|||j |dqW|rtdt t |dS) Nz#abstract nodes are not instantiablez takes 0 argumentsz takes 0 or z argumentrszunknown attribute ) r" TypeErrorr'r r,rzipsetattrr!popnextiter)r9r r!r.argr1rrrr:s4 z Node.__init__)excludeonlyr5c csnxh|jD]^}|dkr|dks<|dk r,||ks<|dk r||kry|t||fVWqtk rdYqXqWdS)aZThis method iterates over all fields that are defined and yields ``(key, value)`` tuples. Per default all fields are returned, but it's possible to limit that to some fields by providing the `only` parameter or to exclude some using the `exclude` parameter. Both should be sets or tuples of field names. N)r r$AttributeError)r9rUrVr.rrr iter_fieldss zNode.iter_fieldsccsXxR|j||D]B\}}t|tr@x.|D]}t|tr&|Vq&Wqt|tr|VqWdS)zIterates over all direct child nodes of the node. This iterates over all fields and yields the values of they are nodes. If the value of a field is a list all the nodes in that list are returned. N)rX isinstancelistr)r9rUrV_itemnrrriter_child_nodess      zNode.iter_child_nodes) node_typer5cCsx|j|D]}|SWdS)ziFind the first node of a given type. If no such node exists the return value is `None`. N)find_all)r9r_resultrrrfindsz Node.findccs6x0|jD]$}t||r|V|j|EdHq WdS)zFind all the nodes of a given type. If the type is a tuple, the check is performed for any of the tuple items. N)r^rYr`)r9r_childrrrr`s z Node.find_all)rHr5cCs>t|g}x.|r8|j}d|jkr(||_|j|jq W|S)aReset the context of a node and all child nodes. Per default the parser will all generate nodes that have a 'load' context as it's the most common one. This method is used in the parser to set assignment targets and other nodes to a store context. rH)rpopleftr rHr#r^)r9rHtodorGrrrset_ctxs  z Node.set_ctxF)rKoverrider5cCsLt|g}x<|rF|j}d|jkr6|jdks0|r6||_|j|jq W|S)z.Set the line numbers of the node and children.rKN)rrdr!rKr#r^)r9rKrgrerGrrr set_linenos  zNode.set_lineno)r3r5cCs4t|g}x$|r.|j}||_|j|jq W|S)z"Set the environment for all nodes.)rrdr3r#r^)r9r3rerGrrrset_environments  zNode.set_environment)otherr5cCs,t|t|k rtSt|jt|jkS)N)r,NotImplementedr*rX)r9rjrrr__eq__sz Node.__eq__)r5cs0djfddjD}tjd|dS)Nz, c3s$|]}|dt|dVqdS)=N)r$).0r)r9rr sz Node.__repr__..())joinr r,r)r9args_strr)r9r__repr__sz Node.__repr__cs8tjttjfddfdd g|djS)N)rGr5cst|tsjt|dSjdt|jd|jsHjddSxt|jD]t\}}|rjjdt||}t|t rjdx*t|D]\}}|rjd|qWjdqT|qTWjddS)Nznodes.rprqz, []) rYrappendreprr,rr enumerater$rZ)rGidxfieldvaluer\)_dumpbufrrr}s(          zNode.dump.._dumprM)rBUnionrrFrr)r9r)r}r~rdumps"z Node.dump)rKr3)NN)NN)F)"rrrrr rBTuplerDr!r"intrKrCr3rFr: ContainerIteratorrXr^Typerrbrr`rfboolrhrirlr%__hash__rtrrrrrrgs.     "   ) metaclassc@seZdZdZdZdS)StmtzBase node for all statements.TN)rrrrr"rrrrrsrc@seZdZdZdZdS)Helperz,Nodes that exist in a specific context only.TN)rrrrr"rrrrrsrc@s eZdZUdZdZejedS)TemplatezjNode that represents a template. This must be the outermost node that is passed to the compiler. bodyN)r) rrrrr rBListrrrrrrr$s rc@s eZdZUdZdZejddS)OutputzA node that holds multiple expressions which are then printed out. This is used both for the `print` statement and the regular template data. nodesExprN)r)rrrrr rBrrrrrrr-s rc@seZdZUdZdZddS)Extendsz Represents an extends statement.templaterN)r)rrrrr rrrrrr6s rc@s@eZdZUdZd Zeeej e ej e ej e edS) ForaxThe for loop. `target` is the target for the iteration (usually a :class:`Name` or :class:`Tuple`), `iter` the iterable. `body` is a list of nodes that are used as loop-body, and `else_` a list of nodes for the `else` block. If no else node exists it has to be an empty list. For filtered nodes an expression can be stored as `test`, otherwise `None`. targetrSrelse_test recursiveN)rrSrrrr)rrrrr rrrSrBrrrrCrrrrrrrr=s    rc@s8eZdZUdZdZeeje ejd eje dS)Ifz4If `test` is true, `body` is rendered, else `else_`.rrelif_rN)rrrr) rrrrr rrrBrrrrrrrrrOs   rc@s8eZdZUdZd Zeejd ejd eje  dS) MacrozA macro definition. `name` is the name of the macro, `args` a list of arguments and `defaults` a list of defaults if there are any. `body` is a list of nodes for the macro body. r.argsdefaultsrNamerN)r.rrr) rrrrr rDr.rBrrrrrrrrrrYs   rc@s8eZdZUdZd Zdejdejd eje  d S) CallBlockzLike a macro without a name but a call instead. `call` is called with the unnamed macro as `caller` argument this node holds. callrrrCallrrN)rrrr) rrrrr rrBrrrrrrrrrrfs   rc@s$eZdZUdZdZejed dS) FilterBlockzNode for filter sections.rfilterFilterN)rr) rrrrr rBrrrrrrrrrrs  rc@s4eZdZUdZdZejdejdeje  dS)WithzSpecific node for with statements. In older versions of Jinja the with statement was implemented on the base of the `Scope` node instead. .. versionadded:: 2.9.3 targetsvaluesrrN)rrr) rrrrr rBrrrrrrrrrrzs   rc@s,eZdZUdZdZeeje  e  e  dS)BlockzkA node that represents a block. .. versionchanged:: 3.0.0 the `required` field was added. r.rscopedrequiredN)r.rrr)rrrrr rDr.rBrrrrrrrrrrrs  rc@s"eZdZUdZdZdeedS)Includez'A node that represents the include tag.r with_contextignore_missingrN)rrr) rrrrr rrrrrrrrrs rc@s"eZdZUdZdZdee dS)Importz&A node that represents the import tag.rrrrN)rrr) rrrrr rrDrrrrrrrrs rc@s<eZdZUdZdZdejeje ej e e ff e  dS) FromImportaA node that represents the from import tag. It's important to not pass unsafe names to the name attribute. The compiler translates the attribute lookups directly into getattr calls and does *not* use the subscript callback of the interface. As exported variables may not start with double underscores (which the parser asserts) this is not a problem for regular Jinja code, but if this node is used in an extension extra care must be taken. The list of names may contain tuples if aliases are wanted. rnamesrrN)rrr)rrrrr rrBrrrDrrrrrrrrrs rc@seZdZUdZdZedS)ExprStmtzAA statement that evaluates an expression and discards the result.rGN)rG)rrrrr rrGrrrrrs rc@seZdZUdZdZdedS)Assignz"Assigns an expression to a target.rrGrN)rrG)rrrrr rrrGrrrrrs rc@s.eZdZUdZdZdejdej e  dS) AssignBlockzAssigns a block to a target.rrrrrN)rrr) rrrrr rrBrCrrrrrrrrrs  rc@s<eZdZdZdZd ejeejdddZ e ddd Z dS) rzBaseclass for all expressions.TN)eval_ctxr5cCs tdS)anReturn the value of the expression as constant or raise :exc:`Impossible` if this was not possible. An :class:`EvalContext` can be provided, if none is given a default context is created which requires the nodes to have an attached environment. .. versionchanged:: 2.4 the `eval_ctx` parameter was added. N)r)r9rrrras_consts z Expr.as_const)r5cCsdS)z8Check if it's possible to assign something to this node.Fr)r9rrr can_assignszExpr.can_assign)N) rrrrr"rBrCr2rFrrrrrrrrs rc@s@eZdZUdZd Zeee dZ d e j e e jdddZdS) BinExprz%Baseclass for all binary expressions.leftrightTN)rr5cCszt||}|jjr&|j|jjkr&tt|j}y||jj||j j|St k rt}zt|WYdd}~XnXdS)N) rJr3 sandboxedoperatorZintercepted_binopsr_binop_to_funcrrr Exception)r9rferrrrs  zBinExpr.as_const)rr)N)rrrrr rrrrDrr"rBrCr2rFrrrrrrs rc@s<eZdZUdZdZeedZ d e j e e j dddZdS) UnaryExprz$Baseclass for all unary expressions.rGTN)rr5cCspt||}|jjr&|j|jjkr&tt|j}y||jj|St k rj}zt|WYdd}~XnXdS)N) rJr3rrZintercepted_unopsr _uaop_to_funcrGrr)r9rrrrrrr s  zUnaryExpr.as_const)rG)N)rrrrr rrGrDrr"rBrCr2rFrrrrrrs rc@s,eZdZUdZdZeeedddZ dS) ra Looks up a name or stores a value in a name. The `ctx` of the node can be one of the following values: - `store`: store a value in the name - `load`: load that name - `param`: like `store` but if the name was defined as function parameter. r.rH)r5cCs |jdkS)NtruefalsenoneTrueFalseNone>rrrrrr)r.)r9rrrr&szName.can_assignN)r.rH) rrrrr rDr.rHrrrrrrrs rc@s,eZdZUdZdZeeedddZ dS) NSRefz)Reference to a namespace value assignmentr.r1)r5cCsdS)NTr)r9rrrr1szNSRef.can_assignN)r.r1) rrrrr rDr.r1rrrrrrr*s rc@seZdZdZdZdS)LiteralzBaseclass for literals.TN)rrrrr"rrrrr9src@sXeZdZUdZd Zejd eje ejdddZ e d ejeje dddd d Z dS)ConstaAll constant values. The parser will return this node for simple constants such as ``42`` or ``"foo"`` but it can be used to store more complex values such as lists too. Only constants with a safe representation (objects where ``eval(repr(x)) == x`` is true). r|N)rr5cCs|jS)N)r|)r9rrrrrIszConst.as_constzt.Optional[Environment])r|rKr3r5cCs(ddlm}||st||||dS)zReturn a const object if the value is representable as constant value in the generated code, otherwise it will raise an `Impossible` exception. r) has_safe_repr)rKr3)compilerrr)clsr|rKr3rrrrfrom_untrustedLs zConst.from_untrusted)r|)N)NN)rrrrr rBrFr|rCr2r classmethodrrrrrrr?s rc@s2eZdZUdZdZedeje edddZ dS) TemplateDatazA constant template string.dataN)rr5cCs,t||}|jrt|jr&t|jS|jS)N)rJr8rr7rr)r9rrrrrds   zTemplateData.as_const)r)N) rrrrr rDrrBrCr2rrrrrr^s rc@sVeZdZUdZd Zejee  d ej e ej ejdfdddZed d d ZdS)rzFor loop unpacking and some other things like multiple arguments for subscripts. Like for :class:`Name` `ctx` specifies if the tuple is used for loading the names or storing. itemsrHN.)rr5cs"t|tfdd|jDS)Nc3s|]}|jVqdS)N)r)rnx)rrrroysz!Tuple.as_const..)rJr*r)r9rr)rrrws zTuple.as_const)r5cCs x|jD]}|jsdSqWdS)NFT)rr)r9r\rrrr{s zTuple.can_assign)rrH)N)rrrrr rBrrrrDrHrCr2rrFrrrrrrrrms  $rc@s@eZdZUdZdZejedej e ejej dddZ dS) rz&Any list literal such as ``[1, 2, 3]``rN)rr5cst|fdd|jDS)Ncsg|]}|jqSr)r)rnr)rrr sz!List.as_const..)rJr)r9rr)rrrs z List.as_const)r)N) rrrrr rBrrrrCr2rFrrrrrrs  rc@sFeZdZUdZdZejdd eje ej ej ej fdddZ dS) DictzeAny dict literal such as ``{1: 2, 3: 4}``. The items must be a list of :class:`Pair` nodes. rPairN)rr5cs"t|tfdd|jDS)Nc3s|]}|jVqdS)N)r)rnr)rrrrosz Dict.as_const..)rJdictr)r9rr)rrrs z Dict.as_const)r)N) rrrrr rBrrrCr2rrFrrrrrrs   rc@sDeZdZUdZdZeed ej e ej ej ej fdddZ dS) rzA key, value pair for dicts.keyr|N)rr5cCs"t||}|jj||jj|fS)N)rJrrr|)r9rrrrrs z Pair.as_const)rr|)N)rrrrr rrr|rBrCr2rrFrrrrrrs  rc@sBeZdZUdZdZeed e j e e j ee j fdddZdS) Keywordz>A key, value pair for keyword arguments where key is a string.rr|N)rr5cCst||}|j|jj|fS)N)rJrr|r)r9rrrrrs zKeyword.as_const)rr|)N)rrrrr rDrrr|rBrCr2rrFrrrrrrs rc@sBeZdZUdZd Zeeej e d ej e ej dddZ dS) CondExprzZA conditional expression (inline if expression). (``{{ foo if bar else baz }}``) rexpr1expr2N)rr5cCs>t||}|jj|r"|jj|S|jdkr2t|jj|S)N)rJrrrrr)r9rrrrrs     zCondExpr.as_const)rrr)N)rrrrr rrrrBrCrr2rFrrrrrrs  r_FilterTestCommonr)rGrr5csfdd|jD}tfdd|jD}|jdk rxy|j|jjWn*tk rv}zt|WYdd}~XnX|jdk ry|j |jjWn*tk r}zt|WYdd}~XnX||fS)Ncsg|]}|jqSr)r)rnr)rrrrsz!args_as_const..c3s|]}|jVqdS)N)r)rnr)rrrrosz args_as_const..) rrkwargsdyn_argsr#rrr dyn_kwargsr@)rGrrrrr)rr args_as_consts  rc@sdeZdZUd Zeeej e ej e  ej eej edZdZd ej eejd d d ZdS)rrGr.rrrrTN)rr5cCst||}|jrt|jr&|jj}n|jj}|j|j}t j |}|dksV|t j kr\t|jj rt |dddks~tj|rtt||\}}|jd|jj||t jkr|jd|n|t jkr|jd|jy |||Stk r }zt|WYdd}~XnXdS)NZjinja_async_variantFTr)rJr8r _is_filterr3filterstestsr&r.rZfrom_objcontextZis_asyncr$inspectZiscoroutinefunctionrinsertrGrZ eval_contextr)r9rZenv_mapfuncZpass_argrrrrrrrs0        z_FilterTestCommon.as_const)rGr.rrrr)N)rrrr rrGrDr.rBrrrrrCrrr"rr2rFrrrrrrs     cs>eZdZUdZejedejeej dfdd Z Z S)rzApply a filter to an expression. ``name`` is the name of the filter, the other fields are the same as :class:`Call`. If ``node`` is ``None``, the filter is being used in a filter block and is applied to the content of the block. N)rr5cs|jdkrttj|dS)N)r)rGrsuperr)r9r) __class__rrrs zFilter.as_const)N) rrrrrBrCrrGr2rFr __classcell__rr)rrrs  rc@seZdZdZdZdS)Testa/Apply a test to an expression. ``name`` is the name of the test, the other field are the same as :class:`Call`. .. versionchanged:: 3.0 ``as_const`` shares the same logic for filters and tests. Tests check for volatile, async, and ``@pass_context`` etc. decorators. FN)rrrrrrrrrr"src@sBeZdZUdZdZeeje eje  ej e ej edS) ra/Calls an expression. `args` is a list of arguments, `kwargs` a list of keyword arguments (list of :class:`Keyword` nodes), and `dyn_args` and `dyn_kwargs` has to be either `None` or a node that is used as node for dynamic positional (``*args``) or keyword (``**kwargs``) arguments. rGrrrrN)rGrrrr)rrrrr rrGrBrrrrrCrrrrrrr/s    c@s<eZdZUdZd Zeee d e j e e j dddZdS) Getitemz@Get an attribute or item from an expression and prefer the item.rGrTrHN)rr5cCsh|jdkrtt||}y|jj|jj||jj|Stk rb}zt|WYdd}~XnXdS)Nload) rHrrJr3getitemrGrrTr)r9rrrrrrGs  zGetitem.as_const)rGrTrH)N)rrrrr rrGrTrDrHrBrCr2rFrrrrrr?s rc@s<eZdZUdZd Zeee d e j e e j dddZdS) GetattrznGet an attribute or item from an expression that is a ascii-only bytestring and prefer the attribute. rGr1rHN)rr5cCsb|jdkrtt||}y|jj|jj||jStk r\}zt|WYdd}~XnXdS)Nr) rHrrJr3r$rGrr1r)r9rrrrrr_s  zGetattr.as_const)rGr1rH)N)rrrrr rrGrDr1rHrBrCr2rFrrrrrrUs rc@sLeZdZUdZd Zejeeje eje d eje e dddZ dS) Slicez_Represents a slice object. This must only be used as argument for :class:`Subscript`. startstopstepN)rr5csJt|tjttjtjdfdd }t||j||j||jS)N)objr5cs|dkr dS|jS)N)r)r)rrrconstxszSlice.as_const..const) rJrBrCrrFslicerrr)r9rrr)rrrus "zSlice.as_const)rrr)N)rrrrr rBrCrrrrr2rrrrrrrks    rc@s8eZdZUdZdZejedej e e dddZ dS) ConcatzXConcatenates the list of expressions provided after converting them to strings. rN)rr5cs$t|djfdd|jDS)NrMc3s|]}t|jVqdS)N)rDr)rnr)rrrrosz"Concat.as_const..)rJrrr)r9rr)rrrs zConcat.as_const)r)N) rrrrr rBrrrrCr2rDrrrrrrs  rc@s>eZdZUdZd Zeejd d ej e ej dddZ dS) CompareziCompares an expression with some other expressions. `ops` must be a list of :class:`Operand`\s. expropsOperandN)rr5cCst||}|jj|}}yeZdZUdZdZedeje ej e ej fdddZ dS) MarkSafeIfAutoescapezMark the wrapped expression as safe (wrap it as `Markup`) but only if autoescaping is active. .. versionadded:: 2.5 rN)rr5cCs4t||}|jrt|jj|}|jr0t|S|S)N)rJr8rrrr7r)r9rrrrrrNs  zMarkSafeIfAutoescape.as_const)r)N)rrrrr rrrBrCr2rrrFrrrrrrDs  rc@seZdZdZdS)ContextReferenceaMReturns the current template context. It can be used like a :class:`Name` node, with a ``'load'`` ctx and will return the current :class:`~jinja2.runtime.Context` object. Here an example that assigns the current template name to a variable named `foo`:: Assign(Name('foo', ctx='store'), Getattr(ContextReference(), 'name')) This is basically equivalent to using the :func:`~jinja2.pass_context` decorator when using the high-level API, which causes a reference to the context to be passed as the first argument to a function. N)rrrrrrrrrZsrc@seZdZdZdS)DerivedContextReferencezReturn the current template context including locals. Behaves exactly like :class:`ContextReference`, but includes local variables, such as from a ``for`` loop. .. versionadded:: 2.11 N)rrrrrrrrrlsrc@seZdZdZdS)ContinuezContinue a loop.N)rrrrrrrrrusrc@seZdZdZdS)Breakz Break a loop.N)rrrrrrrrrysrc@s eZdZUdZdZejedS)ScopezAn artificial scope.rN)r) rrrrr rBrrrrrrrr}s rc@s$eZdZUdZdZeeje  dS) OverlayScopeaAn overlay scope for extensions. This is a largely unoptimized scope that however can be used to introduce completely arbitrary variables into a sub scope from a dictionary or dictionary like object. The `context` field has to evaluate to a dictionary object. Example usage:: OverlayScope(context=self.call_method('get_context'), body=[...]) .. versionadded:: 2.10 rrN)rr) rrrrr rrrBrrrrrrrrs rc@s eZdZUdZdZejedS)EvalContextModifiera Modifies the eval context. For each option that should be modified, a :class:`Keyword` has to be added to the :attr:`options` list. Example to change the `autoescape` setting:: EvalContextModifier(options=[Keyword('autoescape', Const(True))]) optionsN)r) rrrrr rBrrrrrrrrs rc@s eZdZUdZdZejedS)ScopedEvalContextModifierzModifies the eval context and reverts it later. Works exactly like :class:`EvalContextModifier` but will only modify the :class:`~jinja2.nodes.EvalContext` for nodes in the :attr:`body`. rN)r) rrrrr rBrrrrrrrrs rz te.NoReturn)rrr5cOs tddS)Nzcan't create custom node types)rN)rrrrr _failing_newsr)rr)yrrrZtypingrB collectionsrZ markupsaferutilsrZ TYPE_CHECKINGZtyping_extensionster3rZTypeVarrmultruedivfloordivpowmodaddsubrrrDCallablerFnot_posnegrrrrgerlerrrr,rr2rCrJrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrr r r r r rrrrrrrrrrrrr staticmethodr-rrrrs    ,(. 2           .0