def do_score_for_object(parser, token):
 bits = token.contents.split()
 if (len(bits) != 4):
  raise template.TemplateSyntaxError(("'%s' tag takes exactly three arguments" % bits[0]))
 if (bits[2] != 'as'):
  raise template.TemplateSyntaxError(("second argument to '%s' tag must be 'as'" % bits[0]))
 return ScoreForObjectNode(bits[1], bits[3])

def do_score_for_object ( parser , token ) : bits = token . contents . split ( ) if ( len ( bits ) != 4 ) : raise template . TemplateSyntaxError ( ( "'%s' tag takes exactly three arguments" % bits [ 0 ] ) ) if ( bits [ 2 ] != 'as' ) : raise template . TemplateSyntaxError ( ( "second argument to '%s' tag must be 'as'" % bits [ 0 ] ) ) return ScoreForObjectNode ( bits [ 1 ] , bits [ 3 ] )
retrieves the total score for an object and the number of votes its received and stores them in a context variable which has score and num_votes properties .