@register.tag(name="use_macro")
def do_usemacro(parser, token):
    tag_name, macro_name, args, kwargs = parse_macro_params(token)
    try:
        macro = parser._macros[macro_name]
    except (AttributeError, KeyError):
        raise template.TemplateSyntaxError(
            "Macro '{0}' is not defined previously to the {1} tag".format(
                macro_name, tag_name))
    macro.parser = parser
    return UseMacroNode(macro, args, kwargs)
The function taking a parsed template tag
dataset/ETHPy150Open nalourie/django-macros/build/lib/macros/templatetags/macros.py/do_usemacro