code: def create_class_index(dataset):
      """
      Associate to each class the list of corresponding indices in the dataset
      """
      dataset.load_labels()
      labels = dataset.label_objs[0]
      class_index = {}
      for i, label in enumerate(labels):
          class_index.setdefault(label, []).append(i)
      return class_index, labels
  
imports: import logging
  import random
  import numpy
  import torch
  import torch.distributed
  from classy_vision.dataset import DataloaderAsyncGPUWrapper
  from torch.utils.data import DataLoader
  from vissl.data.airstore_dataset import AirstoreDataset
  from vissl.data.collators import get_collator
  from vissl.data.data_helper import ClassPowerlawSampler, DeterministicDistributedSampler, StatefulDistributedSampler, StratifiedClassSampler
  from vissl.data.dataloader_sync_gpu_wrapper import DataloaderSyncGPUWrapper
  from vissl.data.dataset_catalog import get_data_files, register_datasets, VisslDatasetCatalog
  from vissl.data.disk_dataset import DiskImageDataset
  from vissl.data.ssl_dataset import GenericSSLDataset
  from vissl.data.synthetic_dataset import SyntheticImageDataset
  from vissl.data.torchvision_dataset import TorchvisionDataset
  from vissl.utils.misc import set_dataloader_seeds, setup_multiprocessing_method
label_desc: Use image node_id 4 for calling a global function with example usage: create_class_index(dataset) and returns: class_index,  labels