@register.tag
def categories_for_slugs(parser, token):
    try:
        # Splitting by None == splitting by spaces.
        tag_name, arg = token.contents.split(None, 1)
    except ValueError:
        raise TemplateSyntaxError, "%r tag requires arguments" \
              % token.contents.split()[0]

    m = re.search(r'"([^ "]+)" as (\w+)', arg)

    if not m:
        raise TemplateSyntaxError, "%r tag had invalid arguments" \
              % tag_name

    cat_slugs, var = m.groups()
    cats=[]

    for cat_slug in cat_slugs.split(','):
        try:
            cat = Category.objects.get(slug__iexact=cat_slug)
        except Category.DoesNotExist:
            log.warn("No category found for slug: %s", cat_slug)
            cat = None
        cats.append(cat)

    return SetVariableInContextNode(var, cats)
Trains Model.classifier with the document vectors.
dataset/ETHPy150Open dokterbob/satchmo/satchmo/apps/satchmo_store/shop/templatetags/satchmo_category.py/categories_for_slugs--crossover with--dataset/ETHPy150Open clips/pattern/pattern/vector/__init__.py/Model.train