@register.tag<EOL>def plot(parser, token):
tokens = token.split_contents()<EOL>tokens.pop(<NUM_LIT:0>)<EOL>graph = tokens.pop(<NUM_LIT:0>)<EOL>attrs = dict([token.split("<STR_LIT:=>") for token in tokens])<EOL>if '<STR_LIT:id>' not in attrs.keys():<EOL><INDENT>attrs['<STR_LIT:id>'] = '<STR_LIT>'.join([chr(choice(range(<NUM_LIT>, <NUM_LIT>))) for i in range(<NUM_LIT:0>, <NUM_LIT:5>)])<EOL><DEDENT>else:<EOL><INDENT>attrs['<STR_LIT:id>'] = attrs['<STR_LIT:id>'][<NUM_LIT:1>:len(attrs['<STR_LIT:id>'])-<NUM_LIT:1>]<EOL><DEDENT>attr_string = '<STR_LIT>'.join(["<STR_LIT>" % (k, v) for k, v in attrs.iteritems()])<EOL>return GraphRenderer(graph, attr_string, attrs['<STR_LIT:id>'])<EOL>
Tag to plot graphs into the template