<s> """<STR_LIT>""" <EOL> import operator <EOL> from itertools import chain , izip <EOL> from collections import deque <EOL> from jinja2 . utils import Markup , MethodType , FunctionType <EOL> _context_function_types = ( FunctionType , MethodType ) <EOL> _binop_to_func = { <EOL> '<STR_LIT:*>' : operator . mul , <EOL> '<STR_LIT:/>' : operator . truediv , <EOL> '<STR_LIT>' : operator . floordiv , <EOL> '<STR_LIT>' : operator . pow , <EOL> '<STR_LIT:%>' : operator . mod , <EOL> '<STR_LIT:+>' : operator . add , <EOL> '<STR_LIT:->' : operator . sub <EOL> } <EOL> _uaop_to_func = { <EOL> '<STR_LIT>' : operator . not_ , <EOL> '<STR_LIT:+>' : operator . pos , <EOL> '<STR_LIT:->' : operator . neg <EOL> } <EOL> _cmpop_to_func = { <EOL> '<STR_LIT>' : operator . eq , <EOL> '<STR_LIT>' : operator . ne , <EOL> '<STR_LIT>' : operator . gt , <EOL> '<STR_LIT>' : operator . ge , <EOL> '<STR_LIT>' : operator . lt , <EOL> '<STR_LIT>' : operator . le , <EOL> '<STR_LIT>' : lambda a , b : a in b , <EOL> '<STR_LIT>' : lambda a , b : a not in b <EOL> } <EOL> class Impossible ( Exception ) : <EOL> """<STR_LIT>""" <EOL> class NodeType ( type ) : <EOL> """<STR_LIT>""" <EOL> def __new__ ( cls , name , bases , d ) : <EOL> for attr in '<STR_LIT>' , '<STR_LIT>' : <EOL> storage = [ ] <EOL> storage . extend ( getattr ( bases [ <NUM_LIT:0> ] , attr , ( ) ) ) <EOL> storage . extend ( d . get ( attr , ( ) ) ) <EOL> assert len ( bases ) == <NUM_LIT:1> , '<STR_LIT>' <EOL> assert len ( storage ) == len ( set ( storage ) ) , '<STR_LIT>' <EOL> d [ attr ] = tuple ( storage ) <EOL> d . setdefault ( '<STR_LIT>' , False ) <EOL> return type . __new__ ( cls , name , bases , d ) <EOL> class EvalContext ( object ) : <EOL> """<STR_LIT>""" <EOL> def __init__ ( self , environment , template_name = None ) : <EOL> self . environment = environment <EOL> if callable ( environment . autoescape ) : <EOL> self . autoescape = environment . autoescape ( template_name ) <EOL> else : <EOL> self . autoescape = environment . autoescape <EOL> self . volatile = False <EOL> def save ( self ) : <EOL> return self . __dict__ . copy ( ) <EOL> def revert ( self , old ) : <EOL> self . __dict__ . clear ( ) <EOL> self . __dict__ . update ( old ) <EOL> def get_eval_context ( node , ctx ) : <EOL> if ctx is None : <EOL> if node . environment is None : <EOL> raise RuntimeError ( '<STR_LIT>' <EOL> '<STR_LIT>' <EOL> '<STR_LIT>' ) <EOL> return EvalContext ( node . environment ) <EOL> return ctx <EOL> class Node ( object ) : <EOL> """<STR_LIT>""" <EOL> __metaclass__ = NodeType <EOL> fields = ( ) <EOL> attributes = ( '<STR_LIT>' , '<STR_LIT>' ) <EOL> abstract = True <EOL> def __init__ ( self , * fields , ** attributes ) : <EOL> if self . abstract : <EOL> raise TypeError ( '<STR_LIT>' ) <EOL> if fields : <EOL> if len ( fields ) != len ( self . fields ) : <EOL> if not self . fields : <EOL> raise TypeError ( '<STR_LIT>' % <EOL> self . __class__ . __name__ ) <EOL> raise TypeError ( '<STR_LIT>' % ( <EOL> self . __class__ . __name__ , <EOL> len ( self . fields ) , <EOL> len ( self . fields ) != <NUM_LIT:1> and '<STR_LIT:s>' or '<STR_LIT>' <EOL> ) ) <EOL> for name , arg in izip ( self . fields , fields ) : <EOL> setattr ( self , name , arg ) <EOL> for attr in self . attributes : <EOL> setattr ( self , attr , attributes . pop ( attr , None ) ) <EOL> if attributes : <EOL> raise TypeError ( '<STR_LIT>' % <EOL> iter ( attributes ) . next ( ) ) <EOL> def iter_fields ( self , exclude = None , only = None ) : <EOL> """<STR_LIT>""" <EOL> for name in self . fields : <EOL> if ( exclude is only is None ) or ( exclude is not None and name not in exclude ) or ( only is not None and name in only ) : <EOL> try : <EOL> yield name , getattr ( self , name ) <EOL> except AttributeError : <EOL> pass <EOL> def iter_child_nodes ( self , exclude = None , only = None ) : <EOL> """<STR_LIT>""" <EOL> for field , item in self . iter_fields ( exclude , only ) : <EOL> if isinstance ( item , list ) : <EOL> for n in item : <EOL> if isinstance ( n , Node ) : <EOL> yield n <EOL> elif isinstance ( item , Node ) : <EOL> yield item <EOL> def find ( self , node_type ) : <EOL> """<STR_LIT>""" <EOL> for result in self . find_all ( node_type ) : <EOL> return result <EOL> def find_all ( self , node_type ) : <EOL> """<STR_LIT>""" <EOL> for child in self . iter_child_nodes ( ) : <EOL> if isinstance ( child , node_type ) : <EOL> yield child <EOL> for result in child . find_all ( node_type ) : <EOL> yield result <EOL> def set_ctx ( self , ctx ) : <EOL> """<STR_LIT>""" <EOL> todo = deque ( [ self ] ) <EOL> while todo : <EOL> node = todo . popleft ( ) <EOL> if '<STR_LIT>' in node . fields : <EOL> node . ctx = ctx <EOL> todo . extend ( node . iter_child_nodes ( ) ) <EOL> return self <EOL> def set_lineno ( self , lineno , override = False ) : <EOL> """<STR_LIT>""" <EOL> todo = deque ( [ self ] ) <EOL> while todo : <EOL> node = todo . popleft ( ) <EOL> if '<STR_LIT>' in node . attributes : <EOL> if node . lineno is None or override : <EOL> node . lineno = lineno <EOL> todo . extend ( node . iter_child_nodes ( ) ) <EOL> return self <EOL> def set_environment ( self , environment ) : <EOL> """<STR_LIT>""" <EOL> todo = deque ( [ self ] ) <EOL> while todo : <EOL> node = todo . popleft ( ) <EOL> node . environment = environment <EOL> todo . extend ( node . iter_child_nodes ( ) ) <EOL> return self <EOL> def __eq__ ( self , other ) : <EOL> return type ( self ) is type ( other ) and tuple ( self . iter_fields ( ) ) == tuple ( other . iter_fields ( ) ) <EOL> def __ne__ ( self , other ) : <EOL> return not self . __eq__ ( other ) <EOL> def __repr__ ( self ) : <EOL> return '<STR_LIT>' % ( <EOL> self . __class__ . __name__ , <EOL> '<STR_LIT:U+002CU+0020>' . join ( '<STR_LIT>' % ( arg , getattr ( self , arg , None ) ) for <EOL> arg in self . fields ) <EOL> ) <EOL> class Stmt ( Node ) : <EOL> """<STR_LIT>""" <EOL> abstract = True <EOL> class Helper ( Node ) : <EOL> """<STR_LIT>""" <EOL> abstract = True <EOL> class Template ( Node ) : <EOL> """<STR_LIT>""" <EOL> fields = ( '<STR_LIT:body>' , ) <EOL> class Output ( Stmt ) : <EOL> """<STR_LIT>""" <EOL> fields = ( '<STR_LIT>' , ) <EOL> class Extends ( Stmt ) : <EOL> """<STR_LIT>""" <EOL> fields = ( '<STR_LIT>' , ) <EOL> class For ( Stmt ) : <EOL> """<STR_LIT>""" <EOL> fields = ( '<STR_LIT:target>' , '<STR_LIT>' , '<STR_LIT:body>' , '<STR_LIT>' , '<STR_LIT:test>' , '<STR_LIT>' ) <EOL> class If ( Stmt ) : <EOL> """<STR_LIT>""" <EOL> fields = ( '<STR_LIT:test>' , '<STR_LIT:body>' , '<STR_LIT>' ) <EOL> class Macro ( Stmt ) : <EOL> """<STR_LIT>""" <EOL> fields = ( '<STR_LIT:name>' , '<STR_LIT:args>' , '<STR_LIT>' , '<STR_LIT:body>' ) <EOL> class CallBlock ( Stmt ) : <EOL> """<STR_LIT>""" <EOL> fields = ( '<STR_LIT>' , '<STR_LIT:args>' , '<STR_LIT>' , '<STR_LIT:body>' ) <EOL> class FilterBlock ( Stmt ) : <EOL> """<STR_LIT>""" <EOL> fields = ( '<STR_LIT:body>' , '<STR_LIT>' ) <EOL> class Block ( Stmt ) : <EOL> """<STR_LIT>""" <EOL> fields = ( '<STR_LIT:name>' , '<STR_LIT:body>' , '<STR_LIT>' ) <EOL> class Include ( Stmt ) : <EOL> """<STR_LIT>""" <EOL> fields = ( '<STR_LIT>' , '<STR_LIT>' , '<STR_LIT>' ) <EOL> class Import ( Stmt ) : <EOL> """<STR_LIT>""" <EOL> fields = ( '<STR_LIT>' , '<STR_LIT:target>' , '<STR_LIT>' ) <EOL> class FromImport ( Stmt ) : <EOL> """<STR_LIT>""" <EOL> fields = ( '<STR_LIT>' , '<STR_LIT>' , '<STR_LIT>' ) <EOL> class ExprStmt ( Stmt ) : <EOL> """<STR_LIT>""" <EOL> fields = ( '<STR_LIT>' , ) <EOL> class Assign ( Stmt ) : <EOL> """<STR_LIT>""" <EOL> fields = ( '<STR_LIT:target>' , '<STR_LIT>' ) <EOL> class Expr ( Node ) : <EOL> """<STR_LIT>""" <EOL> abstract = True <EOL> def as_const ( self , eval_ctx = None ) : <EOL> """<STR_LIT>""" <EOL> raise Impossible ( ) <EOL> def can_assign ( self ) : <EOL> """<STR_LIT>""" <EOL> return False <EOL> class BinExpr ( Expr ) : <EOL> """<STR_LIT>""" <EOL> fields = ( '<STR_LIT:left>' , '<STR_LIT:right>' ) <EOL> operator = None <EOL> abstract = True <EOL> def as_const ( self , eval_ctx = None ) : <EOL> eval_ctx = get_eval_context ( self , eval_ctx ) <EOL> if self . environment . sandboxed and self . operator in self . environment . intercepted_binops : <EOL> raise Impossible ( ) <EOL> f = _binop_to_func [ self . operator ] <EOL> try : <EOL> return f ( self . left . as_const ( eval_ctx ) , self . right . as_const ( eval_ctx ) ) <EOL> except Exception : <EOL> raise Impossible ( ) <EOL> class UnaryExpr ( Expr ) : <EOL> """<STR_LIT>""" <EOL> fields = ( '<STR_LIT>' , ) <EOL> operator = None <EOL> abstract = True <EOL> def as_const ( self , eval_ctx = None ) : <EOL> eval_ctx = get_eval_context ( self , eval_ctx ) <EOL> if self . environment . sandboxed and self . operator in self . environment . intercepted_unops : <EOL> raise Impossible ( ) <EOL> f = _uaop_to_func [ self . operator ] <EOL> try : <EOL> return f ( self . node . as_const ( eval_ctx ) ) <EOL> except Exception : <EOL> raise Impossible ( ) <EOL> class Name ( Expr ) : <EOL> """<STR_LIT>""" <EOL> fields = ( '<STR_LIT:name>' , '<STR_LIT>' ) <EOL> def can_assign ( self ) : <EOL> return self . name not in ( '<STR_LIT:true>' , '<STR_LIT:false>' , '<STR_LIT:none>' , <EOL> '<STR_LIT:True>' , '<STR_LIT:False>' , '<STR_LIT:None>' ) <EOL> class Literal ( Expr ) : <EOL> """<STR_LIT>""" <EOL> abstract = True <EOL> class Const ( Literal ) : <EOL> """<STR_LIT>""" <EOL> fields = ( '<STR_LIT:value>' , ) <EOL> def as_const ( self , eval_ctx = None ) : <EOL> return self . value <EOL> @ classmethod <EOL> def from_untrusted ( cls , value , lineno = None , environment = None ) : <EOL> """<STR_LIT>""" <EOL> from compiler import has_safe_repr <EOL> if not has_safe_repr ( value ) : <EOL> raise Impossible ( ) <EOL> return cls ( value , lineno = lineno , environment = environment ) <EOL> class TemplateData ( Literal ) : <EOL> """<STR_LIT>""" <EOL> fields = ( '<STR_LIT:data>' , ) <EOL> def as_const ( self , eval_ctx = None ) : <EOL> eval_ctx = get_eval_context ( self , eval_ctx ) <EOL> if eval_ctx . volatile : <EOL> raise Impossible ( ) <EOL> if eval_ctx . autoescape : <EOL> return Markup ( self . data ) <EOL> return self . data <EOL> class Tuple ( Literal ) : <EOL> """<STR_LIT>""" <EOL> fields = ( '<STR_LIT>' , '<STR_LIT>' ) <EOL> def as_const ( self , eval_ctx = None ) : <EOL> eval_ctx = get_eval_context ( self , eval_ctx ) <EOL> return tuple ( x . as_const ( eval_ctx ) for x in self . items ) <EOL> def can_assign ( self ) : <EOL> for item in self . items : <EOL> if not item . can_assign ( ) : <EOL> return False <EOL> return True <EOL> class List ( Literal ) : <EOL> """<STR_LIT>""" <EOL> fields = ( '<STR_LIT>' , ) <EOL> def as_const ( self , eval_ctx = None ) : <EOL> eval_ctx = get_eval_context ( self , eval_ctx ) <EOL> return [ x . as_const ( eval_ctx ) for x in self . items ] <EOL> class Dict ( Literal ) : <EOL> """<STR_LIT>""" <EOL> fields = ( '<STR_LIT>' , ) <EOL> def as_const ( self , eval_ctx = None ) : <EOL> eval_ctx = get_eval_context ( self , eval_ctx ) <EOL> return dict ( x . as_const ( eval_ctx ) for x in self . items ) <EOL> class Pair ( Helper ) : <EOL> """<STR_LIT>""" <EOL> fields = ( '<STR_LIT:key>' , '<STR_LIT:value>' ) <EOL> def as_const ( self , eval_ctx = None ) : <EOL> eval_ctx = get_eval_context ( self , eval_ctx ) <EOL> return self . key . as_const ( eval_ctx ) , self . value . as_const ( eval_ctx ) <EOL> class Keyword ( Helper ) : <EOL> """<STR_LIT>""" <EOL> fields = ( '<STR_LIT:key>' , '<STR_LIT:value>' ) <EOL> def as_const ( self , eval_ctx = None ) : <EOL> eval_ctx = get_eval_context ( self , eval_ctx ) <EOL> return self . key , self . value . as_const ( eval_ctx ) <EOL> class CondExpr ( Expr ) : <EOL> """<STR_LIT>""" <EOL> fields = ( '<STR_LIT:test>' , '<STR_LIT>' , '<STR_LIT>' ) <EOL> def as_const ( self , eval_ctx = None ) : <EOL> eval_ctx = get_eval_context ( self , eval_ctx ) <EOL> if self . test . as_const ( eval_ctx ) : <EOL> return self . expr1 . as_const ( eval_ctx ) <EOL> if self . expr2 is None : <EOL> raise Impossible ( ) <EOL> return self . expr2 . as_const ( eval_ctx ) <EOL> class Filter ( Expr ) : <EOL> """<STR_LIT>""" <EOL> fields = ( '<STR_LIT>' , '<STR_LIT:name>' , '<STR_LIT:args>' , '<STR_LIT>' , '<STR_LIT>' , '<STR_LIT>' ) <EOL> def as_const ( self , eval_ctx = None ) : <EOL> eval_ctx = get_eval_context ( self , eval_ctx ) <EOL> if eval_ctx . volatile or self . node is None : <EOL> raise Impossible ( ) <EOL> filter_ = self . environment . filters . get ( self . name ) <EOL> if filter_ is None or getattr ( filter_ , '<STR_LIT>' , False ) : <EOL> raise Impossible ( ) <EOL> obj = self . node . as_const ( eval_ctx ) <EOL> args = [ x . as_const ( eval_ctx ) for x in self . args ] <EOL> if getattr ( filter_ , '<STR_LIT>' , False ) : <EOL> args . insert ( <NUM_LIT:0> , eval_ctx ) <EOL> elif getattr ( filter_ , '<STR_LIT>' , False ) : <EOL> args . insert ( <NUM_LIT:0> , self . environment ) <EOL> kwargs = dict ( x . as_const ( eval_ctx ) for x in self . kwargs ) <EOL> if self . dyn_args is not None : <EOL> try : <EOL> args . extend ( self . dyn_args . as_const ( eval_ctx ) ) <EOL> except Exception : <EOL> raise Impossible ( ) <EOL> if self . dyn_kwargs is not None : <EOL> try : <EOL> kwargs . update ( self . dyn_kwargs . as_const ( eval_ctx ) ) <EOL> except Exception : <EOL> raise Impossible ( ) <EOL> try : <EOL> return filter_ ( obj , * args , ** kwargs ) <EOL> except Exception : <EOL> raise Impossible ( ) <EOL> class Test ( Expr ) : <EOL> """<STR_LIT>""" <EOL> fields = ( '<STR_LIT>' , '<STR_LIT:name>' , '<STR_LIT:args>' , '<STR_LIT>' , '<STR_LIT>' , '<STR_LIT>' ) <EOL> class Call ( Expr ) : <EOL> """<STR_LIT>""" <EOL> fields = ( '<STR_LIT>' , '<STR_LIT:args>' , '<STR_LIT>' , '<STR_LIT>' , '<STR_LIT>' ) <EOL> def as_const ( self , eval_ctx = None ) : <EOL> eval_ctx = get_eval_context ( self , eval_ctx ) <EOL> if eval_ctx . volatile : <EOL> raise Impossible ( ) <EOL> obj = self . node . as_const ( eval_ctx ) <EOL> args = [ x . as_const ( eval_ctx ) for x in self . args ] <EOL> if isinstance ( obj , _context_function_types ) : <EOL> if getattr ( obj , '<STR_LIT>' , False ) : <EOL> raise Impossible ( ) <EOL> elif getattr ( obj , '<STR_LIT>' , False ) : <EOL> args . insert ( <NUM_LIT:0> , eval_ctx ) <EOL> elif getattr ( obj , '<STR_LIT>' , False ) : <EOL> args . insert ( <NUM_LIT:0> , self . environment ) <EOL> kwargs = dict ( x . as_const ( eval_ctx ) for x in self . kwargs ) <EOL> if self . dyn_args is not None : <EOL> try : <EOL> args . extend ( self . dyn_args . as_const ( eval_ctx ) ) <EOL> except Exception : <EOL> raise Impossible ( ) <EOL> if self . dyn_kwargs is not None : <EOL> try : <EOL> kwargs . update ( self . dyn_kwargs . as_const ( eval_ctx ) ) <EOL> except Exception : <EOL> raise Impossible ( ) <EOL> try : <EOL> return obj ( * args , ** kwargs ) <EOL> except Exception : <EOL> raise Impossible ( ) <EOL> class Getitem ( Expr ) : <EOL> """<STR_LIT>""" <EOL> fields = ( '<STR_LIT>' , '<STR_LIT>' , '<STR_LIT>' ) <EOL> def as_const ( self , eval_ctx = None ) : <EOL> eval_ctx = get_eval_context ( self , eval_ctx ) <EOL> if self . ctx != '<STR_LIT>' : <EOL> raise Impossible ( ) <EOL> try : <EOL> return self . environment . getitem ( self . node . as_const ( eval_ctx ) , <EOL> self . arg . as_const ( eval_ctx ) ) <EOL> except Exception : <EOL> raise Impossible ( ) <EOL> def can_assign ( self ) : <EOL> return False <EOL> class Getattr ( Expr ) : <EOL> """<STR_LIT>""" <EOL> fields = ( '<STR_LIT>' , '<STR_LIT>' , '<STR_LIT>' ) <EOL> def as_const ( self , eval_ctx = None ) : <EOL> if self . ctx != '<STR_LIT>' : <EOL> raise Impossible ( ) <EOL> try : <EOL> eval_ctx = get_eval_context ( self , eval_ctx ) <EOL> return self . environment . getattr ( self . node . as_const ( eval_ctx ) , <EOL> self . attr ) <EOL> except Exception : <EOL> raise Impossible ( ) <EOL> def can_assign ( self ) : <EOL> return False <EOL> class Slice ( Expr ) : <EOL> """<STR_LIT>""" <EOL> fields = ( '<STR_LIT:start>' , '<STR_LIT>' , '<STR_LIT>' ) <EOL> def as_const ( self , eval_ctx = None ) : <EOL> eval_ctx = get_eval_context ( self , eval_ctx ) <EOL> def const ( obj ) : <EOL> if obj is None : <EOL> return None <EOL> return obj . as_const ( eval_ctx ) <EOL> return slice ( const ( self . start ) , const ( self . stop ) , const ( self . step ) ) <EOL> class Concat ( Expr ) : <EOL> """<STR_LIT>""" <EOL> fields = ( '<STR_LIT>' , ) <EOL> def as_const ( self , eval_ctx = None ) : <EOL> eval_ctx = get_eval_context ( self , eval_ctx ) <EOL> return '<STR_LIT>' . join ( unicode ( x . as_const ( eval_ctx ) ) for x in self . nodes ) <EOL> class Compare ( Expr ) : <EOL> """<STR_LIT>""" <EOL> fields = ( '<STR_LIT>' , '<STR_LIT>' ) <EOL> def as_const ( self , eval_ctx = None ) : <EOL> eval_ctx = get_eval_context ( self , eval_ctx ) <EOL> result = value = self . expr . as_const ( eval_ctx ) <EOL> try : <EOL> for op in self . ops : <EOL> new_value = op . expr . as_const ( eval_ctx ) <EOL> result = _cmpop_to_func [ op . op ] ( value , new_value ) <EOL> value = new_value <EOL> except Exception : <EOL> raise Impossible ( ) <EOL> return result <EOL> class Operand ( Helper ) : <EOL> """<STR_LIT>""" <EOL> fields = ( '<STR_LIT>' , '<STR_LIT>' ) <EOL> if __debug__ : <EOL> Operand . __doc__ += '<STR_LIT>' + '<STR_LIT:U+002CU+0020>' . join ( sorted ( '<STR_LIT>' % x for x in set ( _binop_to_func ) | <EOL> set ( _uaop_to_func ) | set ( _cmpop_to_func ) ) ) <EOL> class Mul ( BinExpr ) : <EOL> """<STR_LIT>""" <EOL> operator = '<STR_LIT:*>' <EOL> class Div ( BinExpr ) : <EOL> """<STR_LIT>""" <EOL> operator = '<STR_LIT:/>' <EOL> class FloorDiv ( BinExpr ) : <EOL> """<STR_LIT>""" <EOL> operator = '<STR_LIT>' <EOL> class Add ( BinExpr ) : <EOL> """<STR_LIT>""" <EOL> operator = '<STR_LIT:+>' <EOL> class Sub ( BinExpr ) : <EOL> """<STR_LIT>""" <EOL> operator = '<STR_LIT:->' <EOL> class Mod ( BinExpr ) : <EOL> """<STR_LIT>""" <EOL> operator = '<STR_LIT:%>' <EOL> class Pow ( BinExpr ) : <EOL> """<STR_LIT>""" <EOL> operator = '<STR_LIT>' <EOL> class And ( BinExpr ) : <EOL> """<STR_LIT>""" <EOL> operator = '<STR_LIT>' <EOL> def as_const ( self , eval_ctx = None ) : <EOL> eval_ctx = get_eval_context ( self , eval_ctx ) <EOL> return self . left . as_const ( eval_ctx ) and self . right . as_const ( eval_ctx ) <EOL> class Or ( BinExpr ) : <EOL> """<STR_LIT>""" <EOL> operator = '<STR_LIT>' <EOL> def as_const ( self , eval_ctx = None ) : <EOL> eval_ctx = get_eval_context ( self , eval_ctx ) <EOL> return self . left . as_const ( eval_ctx ) or self . right . as_const ( eval_ctx ) <EOL> class Not ( UnaryExpr ) : <EOL> """<STR_LIT>""" <EOL> operator = '<STR_LIT>' <EOL> class Neg ( UnaryExpr ) : <EOL> """<STR_LIT>""" <EOL> operator = '<STR_LIT:->' <EOL> class Pos ( UnaryExpr ) : <EOL> """<STR_LIT>""" <EOL> operator = '<STR_LIT:+>' <EOL> class EnvironmentAttribute ( Expr ) : <EOL> """<STR_LIT>""" <EOL> fields = ( '<STR_LIT:name>' , ) <EOL> class ExtensionAttribute ( Expr ) : <EOL> """<STR_LIT>""" <EOL> fields = ( '<STR_LIT>' , '<STR_LIT:name>' ) <EOL> class ImportedName ( Expr ) : <EOL> """<STR_LIT>""" <EOL> fields = ( '<STR_LIT>' , ) <EOL> class InternalName ( Expr ) : <EOL> """<STR_LIT>""" <EOL> fields = ( '<STR_LIT:name>' , ) <EOL> def __init__ ( self ) : <EOL> raise TypeError ( '<STR_LIT>' <EOL> '<STR_LIT>' ) <EOL> class MarkSafe ( Expr ) : <EOL> """<STR_LIT>""" <EOL> fields = ( '<STR_LIT>' , ) <EOL> def as_const ( self , eval_ctx = None ) : <EOL> eval_ctx = get_eval_context ( self , eval_ctx ) <EOL> return Markup ( self . expr . as_const ( eval_ctx ) ) <EOL> class MarkSafeIfAutoescape ( Expr ) : <EOL> """<STR_LIT>""" <EOL> fields = ( '<STR_LIT>' , ) <EOL> def as_const ( self , eval_ctx = None ) : <EOL> eval_ctx = get_eval_context ( self , eval_ctx ) <EOL> if eval_ctx . volatile : <EOL> raise Impossible ( ) <EOL> expr = self . expr . as_const ( eval_ctx ) <EOL> if eval_ctx . autoescape : <EOL> return Markup ( expr ) <EOL> return expr <EOL> class ContextReference ( Expr ) : <EOL> """<STR_LIT>""" <EOL> class Continue ( Stmt ) : <EOL> """<STR_LIT>""" <EOL> class Break ( Stmt ) : <EOL> """<STR_LIT>""" <EOL> class Scope ( Stmt ) : <EOL> """<STR_LIT>""" <EOL> fields = ( '<STR_LIT:body>' , ) <EOL> class EvalContextModifier ( Stmt ) : <EOL> """<STR_LIT>""" <EOL> fields = ( '<STR_LIT>' , ) <EOL> class ScopedEvalContextModifier ( EvalContextModifier ) : <EOL> """<STR_LIT>""" <EOL> fields = ( '<STR_LIT:body>' , ) <EOL> def _failing_new ( * args , ** kwargs ) : <EOL> raise TypeError ( '<STR_LIT>' ) <EOL> NodeType . __new__ = staticmethod ( _failing_new ) ; del _failing_new </s>
