@register.tag
def autoescape(parser, token):
 args = token.contents.split()
 if (len(args) != 2):
  raise TemplateSyntaxError("'autoescape' tag requires exactly one argument.")
 arg = args[1]
 if (arg not in ('on', 'off')):
  raise TemplateSyntaxError("'autoescape' argument should be 'on' or 'off'")
 nodelist = parser.parse(('endautoescape',))
 parser.delete_first_token()
 return AutoEscapeControlNode((arg == 'on'), nodelist)

@ register . tag def autoescape ( parser , token ) : args = token . contents . split ( ) if ( len ( args ) != 2 ) : raise TemplateSyntaxError ( "'autoescape' tag requires exactly one argument." ) arg = args [ 1 ] if ( arg not in ( 'on' , 'off' ) ) : raise TemplateSyntaxError ( "'autoescape' argument should be 'on' or 'off'" ) nodelist = parser . parse ( ( 'endautoescape' , ) ) parser . delete_first_token ( ) return AutoEscapeControlNode ( ( arg == 'on' ) , nodelist )
force autoescape behavior for this block .