code: def get_indices_task(self, task):
      all_class_indices = self._get_class_indices(task)
      indices = OrderedDict([(split, []) for split in self.splits])
  
      min_samples = min(
          [
              len(class_indices)
              for class_indices in all_class_indices.values()
          ]
      )
      if min_samples < self._min_samples_per_class:
          raise ValueError(
              "The smallest number of samples in a class ({0}) "
              "is smaller than the minimum number of samples per class "
              "required by `WeightedClassSplitter` ({1}).".format(
                  min_samples, self._min_samples_per_class
              )
          )
  
      for i, class_indices in enumerate(all_class_indices.values()):
          num_samples = (
              min_samples
              if self.force_equal_per_class
              else len(class_indices)
          )
          if self.shuffle:
              seed = (hash(task) + i + self.random_state_seed) % (
                  2**32
              )
              dataset_indices = np.random.RandomState(seed).permutation(
                  num_samples
              )
          else:
              dataset_indices = np.arange(num_samples)
  
          ptr = 0
          for split, weight in self.splits.items():
              num_split = max(
                  self.min_num_samples[split], int(weight * num_samples)
              )
              if self.max_num_samples is not None:
                  num_split = min(
                      self.max_num_samples[split], num_split
                  )
              split_indices = dataset_indices[ptr : ptr + num_split]
              if self.shuffle:
                  self.np_random.shuffle(split_indices)
              indices[split].extend(
                  [class_indices[idx] for idx in split_indices]
              )
              ptr += num_split
  
      return indices
  
imports: import torch
  import numpy
  from collections import OrderedDict, defaultdict
  from torchmeta.utils.data.task import Task, ConcatTask, SubsetTask
  from torchmeta.transforms.utils import apply_wrapper
label_desc: Use image node_id 2 for calling the WeightedClassSplitter_ obj's underlying member method code with example usage: obj.get_indices_task(task) and returns: indices