@register.tag(name="macro_kwarg")
def do_macro_kwarg(parser, token):
    """ Function taking a parsed template tag
    to a MacroKwargNode.
    """
    try:
        tag_name, keyword = token.split_contents()
    except __HOLE__:
        raise template.TemplateSyntaxError(
            "{0} tag requires exactly one argument, a keyword".format(
                token.contents.split()[0]))

    # add some validation of the keyword argument here.
    nodelist = parser.parse(('endmacro_kwarg',))
    parser.delete_first_token()
    return MacroKwargNode(keyword, nodelist)
dataset/ETHPy150Open nalourie/django-macros/build/lib/macros/templatetags/macros.py/do_macro_kwarg