def children_to_list(node):
if node['<STR_LIT:type>'] == '<STR_LIT>' and len(node['<STR_LIT>']) == <NUM_LIT:0>:<EOL><INDENT>del node['<STR_LIT>']<EOL><DEDENT>else:<EOL><INDENT>node['<STR_LIT:type>'] = '<STR_LIT>'<EOL>node['<STR_LIT>'] = list(node['<STR_LIT>'].values())<EOL>node['<STR_LIT>'].sort(key=lambda x: x['<STR_LIT:name>'])<EOL>node['<STR_LIT>'] = map(children_to_list, node['<STR_LIT>'])<EOL><DEDENT>return node<EOL>
Organize children structure.