class_docstr: Interface for simple dictionary-based dataset format. The dictionary
  keys correspond to the column (i.e. dimension) names and the values
  are collections representing the values in that column.
class_docstr_tok: ["Interface","for","simple","dictionary-based","dataset","format",".","The","dictionary","keys","correspond","to","the","column","(","i.e",".","dimension",")","names","and","the","values","are","collections","representing","the","values","in","that","column","."]
code: def sort(cls, dataset, by=None, reverse=False):
      if by is None:
          by = []
      by = [dataset.get_dimension(d).name for d in by]
      if len(by) == 1:
          sorting = cls.values(dataset, by[0]).argsort()
      else:
          arrays = [dataset.dimension_values(d) for d in by]
          sorting = util.arglexsort(arrays)
      return dict(
          [
              (
                  d,
                  v
                  if isscalar(v)
                  else (v[sorting][::-1] if reverse else v[sorting]),
              )
              for d, v in dataset.data.items()
          ]
      )
  
imports: from collections import OrderedDict, defaultdict
  import numpy
  from ..None import util
  from ..dimension import dimension_name
  from ..element import Element
  from ..ndmapping import NdMapping, item_check, sorted_context
  from ..util import isscalar
  from .interface import DataError, Interface
label_desc: Use image node_id 13 for calling the DictInterface obj's underlying member method code with example usage: obj.sort(cls, dataset, by, reverse) and returns: dict