#NEWLINE# def do_assign( parser , token ) : #NEWLINE# #INDENT# '\n    Assign an expression to a variable in the current context.\n    \n    Syntax::\n        {% assign [name] [value] %}\n    Example::\n        {% assign list entry.get_related %}\n        \n    ' #NEWLINE# bits = token . contents . split ( ) #NEWLINE# if ( len ( bits ) != 3 ) : #NEWLINE# #INDENT# raise template . TemplateSyntaxError ( ( "'%s' tag takes two arguments" % bits [ 0 ] ) ) #NEWLINE# #UNINDENT# value = parser . compile_filter ( value [ 2 ] ) #NEWLINE# return AssignNode ( bits [ 1 ] , value )