@register.tag('view_count')
def do_count(parser, token):
    """example: {% view_count for app.model object_id as varname %}"""
    try:
        tag, tmp_for, package, obj, tmp_as, var = token.split_contents()
        if tmp_for != 'for': raise ValueError
        if tmp_as != 'as': raise ValueError
        app, model = package.split('.')
    except __HOLE__:
        raise template.TemplateSyntaxError, "The valid syntax for view_count tag is: 'view_count for app.model object_id as varname'"
    content_type = ContentType.objects.get(app_label__exact=app, model__exact=model)
    return ViewCountNode(content_type=content_type, obj=obj, var=var)
dataset/ETHPy150Open svetlyak40wt/django-counter/src/django_counter/templatetags/counter_tags.py/do_count