@staticmethod<EOL><INDENT>def sorted(collection):<DEDENT>
if len(collection) < <NUM_LIT:1>:<EOL><INDENT>return collection<EOL><DEDENT>if isinstance(collection, dict):<EOL><INDENT>return sorted(collection.items(), key=lambda x: x[<NUM_LIT:0>])<EOL><DEDENT>if isinstance(list(collection)[<NUM_LIT:0>], Operation):<EOL><INDENT>key = lambda x: x.operation_id<EOL><DEDENT>elif isinstance(list(collection)[<NUM_LIT:0>], str):<EOL><INDENT>key = lambda x: SchemaObjects.get(x).name<EOL><DEDENT>else:<EOL><INDENT>raise TypeError(type(collection[<NUM_LIT:0>]))<EOL><DEDENT>return sorted(collection, key=key)<EOL>
sorting dict by key,
schema-collection by schema-name
operations by id