<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def get_hit_count_from_obj_variable(context, obj_variable, tag_name):
 """ Helper function to return a HitCount for a given template object variable. Raises TemplateSyntaxError if the passed object variable cannot be parsed. """

    error_to_raise = template.TemplateSyntaxError(
        "'%(a)s' requires a valid individual model variable "
        "in the form of '%(a)s for [model_obj]'.\n"
        "Got: %(b)s" % {'a': tag_name, 'b': obj_variable}
    )

    try:
        obj = obj_variable.resolve(context)
    except template.VariableDoesNotExist:
        raise error_to_raise

    try:
        ctype = ContentType.objects.get_for_model(obj)
    except AttributeError:
        raise error_to_raise

    hit_count, created = HitCount.objects.get_or_create(
        content_type=ctype, object_pk=obj.pk)

    return hit_count