def tag_helper(tag, items, locked=True, remove=False):
if not isinstance(items, list):<EOL><INDENT>items = [items]<EOL><DEDENT>data = {}<EOL>if not remove:<EOL><INDENT>for i, item in enumerate(items):<EOL><INDENT>tagname = '<STR_LIT>' % (tag, i)<EOL>data[tagname] = item<EOL><DEDENT><DEDENT>if remove:<EOL><INDENT>tagname = '<STR_LIT>' % tag<EOL>data[tagname] = '<STR_LIT:U+002C>'.join(items)<EOL><DEDENT>data['<STR_LIT>' % tag] = <NUM_LIT:1> if locked else <NUM_LIT:0><EOL>return data<EOL>
Simple tag helper for editing a object.