def render_last_xtdcomments(parser, token):
    """
    Render the last N XtdComments through the 
      ``comments_xtd/comment.html`` template

    Syntax::

        {% render_last_xtdcomments [N] for [app].[model] [[app].[model]] using [template] %}

    Example usage::

        {% render_last_xtdcomments 5 for blog.story blog.quote using "comments/blog/comment.html" %}

    """
    tokens = token.contents.split()

    try:
        count = tokens[1]
    except ValueError:
        raise TemplateSyntaxError(
            "Second argument in %r tag must be a integer" % tokens[0])

    if tokens[2] != 'for':
        raise TemplateSyntaxError(
            "Third argument in %r tag must be 'for'" % tokens[0])

    try:
        token_using = tokens.index("using")
        content_types = _get_content_types(tokens[0], tokens[3:token_using])
        try:
            template = tokens[token_using+1].strip('" ')
        except IndexError:
            raise TemplateSyntaxError(
                tokens[0] % "Last argument in %r tag must be a relative template path")       
    except ValueError:
        content_types = _get_content_types(tokens[0], tokens[3:])
        template = None

    return RenderLastXtdCommentsNode(count, content_types, template)
dataset/ETHPy150Open danirus/django-comments-xtd/django_comments_xtd/templatetags/comments_xtd.py/render_last_xtdcomments/swapped operands of `%`