def do_rating_by_user(parser, token):
bits = token.contents.split()<EOL>if len(bits) != <NUM_LIT:6>:<EOL><INDENT>raise template.TemplateSyntaxError("<STR_LIT>" % bits[<NUM_LIT:0>])<EOL><DEDENT>if bits[<NUM_LIT:2>] != '<STR_LIT>':<EOL><INDENT>raise template.TemplateSyntaxError("<STR_LIT>" % bits[<NUM_LIT:0>])<EOL><DEDENT>if bits[<NUM_LIT:4>] != '<STR_LIT>':<EOL><INDENT>raise template.TemplateSyntaxError("<STR_LIT>" % bits[<NUM_LIT:0>])<EOL><DEDENT>return RatingByUserNode(bits[<NUM_LIT:1>], bits[<NUM_LIT:3>], bits[<NUM_LIT:5>])<EOL>
Retrieves the ``Vote`` cast by a user on a particular object and
stores it in a context variable. If the user has not voted, the
context variable will be 0.

Example usage::

    {% rating_by_user user on instance as vote %}