def do_render_item(parser, token):
    """
    {% supertag_render [SuperTag or SuperTaggedItem or SuperTagRelation or SuperTaggedRelationItem] [with] [suffix=S] [template=T] %}
    {% supertag_render tag %}
    {% supertag_render tagged_item with suffix=custom %}
    {% supertag_render rel_item with template=mycustomtemplates/supertags/custom.html %}
    
    Only suffix OR template can be specified, but not both.
    """
    argv = token.contents.split()
    argc = len(argv)
    
    if argc < 2 or argc > 4:
        raise TemplateSyntaxError, "Tag %s takes either two or four arguments." % argv[0]
        
    if argc == 2:
        return RenderItemNode(argv[1])
    else:
        if argv[2] != 'with':
            raise TemplateSyntaxError, 'Second argument must be "with" for tag %s.' % argv[0]
        extra = argv[3].split('=')
        if len(extra) != 2:
            raise TemplateSyntaxError, "Last argument must be formated correctly for tag %s." % argv[0]
        if not extra[0] in ['suffix', 'template']:
            raise TemplateSyntaxError, "Last argment must of either suffix or template for tag %s." % argv[0]
            
        kwargs = {str(extra[0]): extra[1],}
        return RenderItemNode(argv[1], **kwargs)
dataset/ETHPy150Open callowayproject/django-supertagging/supertagging/templatetags/supertagging_tags.py/do_render_item/original