def chart(name, parser, token):
    args = token.split_contents()

    if len(args) < 2:
        raise template.TemplateSyntaxError(
                '%r statement requires at least one argument' %
                token.split_contents()[0])

    options = None
    if len(args) > 2:
        if args[2] != 'with':
            raise template.TemplateSyntaxError("Expected 'with' statement")

        try:
            options = parse_options(' '.join(args[3:]))
        except __HOLE__:
            raise template.TemplateSyntaxError('Invalid options')

    return ChartNode(name=name, variable=args[1], options=options)
dataset/ETHPy150Open mher/chartkick.py/chartkick/templatetags/chartkick.py/chart