docstr: Returns indices sorted by length. So less padding is needed.
docstr_tok: ["Returns","indices","sorted","by","length",".","So","less","padding","is","needed","."]
code: def ordered_indices(self):
      """
      Returns indices sorted by length. So less padding is needed.
      """
      if len(self.datasets) == 1:
          return [self.datasets[0].ordered_indices()]
      indices_group = []
      for d_idx, ds in enumerate(self.datasets):
          sample_num = self.cumulative_sizes[d_idx]
          if d_idx > 0:
              sample_num = sample_num - self.cumulative_sizes[d_idx - 1]
          assert sample_num == len(ds)
          indices_group.append(ds.ordered_indices())
      return indices_group
  
imports: import logging
  import math
  from typing import List, Optional, NamedTuple
  import numpy
  import torch
  from fairseq.data import ConcatDataset, LanguagePairDataset, FileAudioDataset, data_utils
  from fairseq.data import FairseqDataset
label_desc: Use image node_id 7 for calling the MultiModalityDataset obj's underlying member method code with example usage: obj.ordered_indices() and returns: indices_group, list