def installed_apps(parser, token):
    try:
        tag_name, arg = token.contents.split(None, 1)
    except __HOLE__:
        raise template.TemplateSyntaxError, "%r tag requires arguments" % token.contents.split()[0]
    m = re.search(r'as (\w+)', arg)
    if not m:
        raise template.TemplateSyntaxError, "%r tag had invalid arguments" % tag_name
    var_name = m.groups()[0]
    return InstalledAppsNode(var_name)
dataset/ETHPy150Open svetlyak40wt/django-apps/django_apps/templatetags/apps_tags.py/installed_apps