def do_relations_for_tag_in_object(parser, token):
    """
    Retrieves a list of ``Relations`` for a given tag that is also in object
    
    Useage::
        
        {% relations_for [tag] in [object] as [varname] %}
        
    Example::
    
        {% relations_for state_tag in obj as obj_relations %}
        
    """
    bits = token.contents.split()
    if len(bits) != 6:
        raise TemplateSyntaxError(_('%s tag requires exactly five arguments') % bits[0])
    if bits[2] != 'in':
        raise TemplateSyntaxError(_("Second argument to %s tag must be 'in'") % bits[0])
    if bits[4] != 'as':
        raise TemplateSyntaxError(_("Second argument to %s tag must be 'as'") % bits[0])
    return RelationsForTagInObjectNode(bits[1], bits[3], bits[5])
dataset/ETHPy150Open callowayproject/django-supertagging/supertagging/templatetags/supertagging_tags.py/do_relations_for_tag_in_object/original