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 shuffle_fn(self, idxs):
      idxs = np.random.permutation(len(self.dataset))
      idx_max = np.where(idxs == self.idx_max)[0][0]
      idxs[0], idxs[idx_max] = idxs[idx_max], idxs[0]
      sz = self.bs * 50
      chunks = [idxs[i : i + sz] for i in range(0, len(idxs), sz)]
      chunks = [
          sorted(s, key=lambda i: self.res[i], reverse=True)
          for s in chunks
      ]
      sort_idx = np.concatenate(chunks)
  
      sz = self.bs
      batches = [
          sort_idx[i : i + sz] for i in range(0, len(sort_idx), sz)
      ]
      sort_idx = (
          np.concatenate(np.random.permutation(batches[1:-1]))
          if len(batches) > 2
          else np.array([], dtype=int)
      )
      sort_idx = np.concatenate(
          (batches[0], sort_idx)
          if len(batches) == 1
          else (batches[0], sort_idx, batches[-1])
      )
      return iter(sort_idx)
  
imports: from __future__ import annotations
  from ..torch_basics import *
  from ..data.all import *
  from .core import *
label_desc: Use image node_id 3 for calling the SortedDL obj's underlying member method code with example usage: obj.shuffle_fn(idxs) and returns: iter