class_docstr: A `DataLoader` that goes throught the item in the order given by `sort_func`
class_docstr_tok: ["A","`","DataLoader","`","that","goes","throught","the","item","in","the","order","given","by","`","sort_func","`"]
code: def __init__(self, dataset, sort_func=None, res=None, **kwargs):
      super().__init__(dataset, **kwargs)
      self.sort_func = _default_sort if sort_func is None else sort_func
      if res is None and self.sort_func == _default_sort:
          res = _get_lengths(dataset)
      self.res = (
          [
              self.sort_func(self.do_item(i))
              for i in range_of(self.dataset)
          ]
          if res is None
          else res
      )
      if len(self.res) > 0:
          self.idx_max = np.argmax(self.res)
  
imports: from __future__ import annotations
  from ..torch_basics import *
  from ..data.all import *
  from .core import *
label_desc: Use image node_id 1 to create a new SortedDL object from inherited base classes: TfmdDL with example: obj = SortedDL(dataset, sort_func, res)