def do_can_be_positioned(parser, token):
    """
    {% can_be_positioned [object] as [varname] %}
    {% can_be_positioned [content_type_id] [object_id] as [varname] %}
    {% can_be_positioned story as story_can_be_positioned %}
    {% can_be_positioned 23 1232 as object_can_be_positioned %}
    """
    argv = token.contents.split()
    argc = len(argv)
    
    if argc < 4 or argc > 5:
        raise TemplateSyntaxError, "Tag %s takes either 3 or 4 arguments," % argv[0]
        
    if argc == 4:
        if argv[2] != "as":
            raise TemplateSyntaxError, 'Second argument must be "as" for tag %s.' % argv[0]
        return CanBePositionedNode(obj=argv[1], varname=argv[3])
    elif argc == 5:
        if argv[3] != "as":
            raise TemplateSyntaxError, 'Third argument must be "as" for tag %s.' % argv[0]
        return CanBePositionedNode(content_type_id=argv[1], object_id=argv[2], varname=argv[4])
dataset/ETHPy150Open callowayproject/django-kamasutra/positions/templatetags/position_tags.py/do_can_be_positioned/original