code: def get_toplosses_idxs(cls, learn, n_imgs, **kwargs):
          "Sorts `ds_type` dataset by top losses and returns dataset and sorted indices."
          dl = learn.data.fix_dl
          if not n_imgs: n_imgs = len(dl.dataset)
          _,_,top_losses = learn.get_preds(ds_type=DatasetType.Fix, with_loss=True)
          idxs = torch.topk(top_losses, n_imgs)[1]
          return cls.padded_ds(dl.dataset, **kwargs), idxf get_toplosses_idxs(cls, learn, n_imgs, **kwargs):
          "Sorts `ds_type` dataset by top losses and returns dataset and sorted indices."
          dl = learn.data.fix_dl
          if not n_imgs: n_imgs = len(dl.dataset)
          _,_,top_losses = learn.get_preds(ds_type=DatasetType.Fix, with_loss=True)
          idxs = torch.topk(top_losses, n_imgs)[1]
          return cls.padded_ds(dl.dataset, **kwargs), idxs
docs: Sorts `ds_type` dataset by top losses and returns dataset and sorted indices.