code: def sorted(collection):
          if len(collection) < 1:
              return collection
          if isinstance(collection, dict):
              return sorted(collection.items(), key=lambda x: x[0])
          if isinstance(list(collection)[0], Operation):
              key = lambda x: x.operation_id
          elif isinstance(list(collection)[0], str):
              key = lambda x: SchemaObjects.get(x).name
          else:
              raise TypeError(type(collection[0]))
          return sorted(collection, key=key)