code: def _init_sort(self):
          
          if not self.sorted:
              # Identify the snapshot that tracked the largest amount of memory.
              tmax = None
              maxsize = 0
              for snapshot in self.snapshots:
                  if snapshot.tracked_total > maxsize:
                      tmax = snapshot.timestamp
              for key in list(self.index.keys()):
                  for tobj in self.index[key]:
                      tobj.classname = key
                      tobj.size = tobj.get_max_size()
                      tobj.tsize = tobj.get_size_at_time(tmax)
                  self.sorted.extend(self.index[key])
docs: Prepare the data to be sorted.
          If not yet sorted, import all tracked objects from the tracked index.
          Extend the tracking information by implicit information to make
          sorting easier (DSU pattern).