@register.tag
def banner(parser, token):
    """
    Use: {% banner place-slug as banner %} or {% banner place-slug %}
    """
    bits = token.contents.split()

    if [2, 4] not in len(bits):
        raise template.TemplateSyntaxError(_("banner tag takes three of four arguments"))

    if 4 == len(bits) and 'as' == bits[2]:
        place_slug = bits[1]
        varname = bits[3]
    else:
        place_slug = bits[1]
        varname = None

    return BannerNode(place_slug, varname)
dataset/ETHPy150Open martinogden/django-banner-rotator/banner_rotator/templatetags/banners.py/banner/swapped operands of `not in`