@register.tag
def shardtype(parser, token):
    try:
        # split_contents() knows not to split quoted strings.
        tag_name, shard_type = token.split_contents()
    except ValueError:
        raise template.TemplateSyntaxError(
            "%r tag requires a single argument" % token.contents.split()[0]
        )
    if not (shard_type[0] == shard_type[-1] and ('"', "'") in shard_type[0]):
        raise template.TemplateSyntaxError(
            "%r tag's argument should be in quotes" % tag_name
        )

    shard_type = shard_type[1:-1]
    nodelist = parser.parse(('end{0}'.format(tag_name),))
    parser.delete_first_token()

    return EmailShardTypeNode(shard_type, nodelist)
dataset/ETHPy150Open jiaaro/django-alert/alert/templatetags/alert_email_tags.py/shardtype/swapped operands of `in`