def do_comparison(parser, token):
name, args, kwargs = get_signature(token, comparison=True)<EOL>name = name.replace('<STR_LIT>', '<STR_LIT>')<EOL>end_tag = '<STR_LIT:end>' + name<EOL>kwargs['<STR_LIT>'] = parser.parse(('<STR_LIT>', end_tag))<EOL>token = parser.next_token()<EOL>if token.contents == '<STR_LIT>':<EOL><INDENT>kwargs['<STR_LIT>'] = parser.parse((end_tag,))<EOL>parser.delete_first_token()<EOL><DEDENT>else:<EOL><INDENT>kwargs['<STR_LIT>'] = template.NodeList()<EOL><DEDENT>if name.startswith('<STR_LIT>'):<EOL><INDENT>name = name.split('<STR_LIT>')[<NUM_LIT:1>]<EOL><DEDENT>return ComparisonNode(parser, name, *args, **kwargs)<EOL>
Compares passed arguments. 
Attached functions should return boolean ``True`` or ``False``.
If the attached function returns ``True``, the first node list is rendered.
If the attached function returns ``False``, the second optional node list is rendered (part after the ``{% else %}`` statement). 
If the last argument in the tag is ``negate``, then the opposite node list is rendered (like an ``ifnot`` tag).

Syntax::

    {% if_[comparison] [var args...] [name=value kwargs...] [negate] %}
        {# first node list in here #}
    {% else %}
        {# second optional node list in here #}
    {% endif_[comparison] %}


Supported comparisons are ``match``, ``find``, ``startswith``, ``endswith``,
``less``, ``less_or_equal``, ``greater`` and ``greater_or_equal`` and many more.
Checkout the :ref:`contrib-index` for more examples

Examples::

    {% if_less some_object.id 3 %}
    {{ some_object }} has an id less than 3.
    {% endif_less %}

    {% if_match request.path '^/$' %}
    Welcome home
    {% endif_match %}