class_docstr: Long-tailed version of the ImageNet2012 dataset.
class_docstr_tok: ["Long-tailed","version","of","the","ImageNet2012","dataset","."]
docstr: Returns SplitGenerators.
docstr_tok: ["Returns","SplitGenerators","."]
code: def _split_generators(self, dl_manager):
      """Returns SplitGenerators."""
  
      train_path = os.path.join(
          dl_manager.manual_dir, "ILSVRC2012_img_train.tar"
      )
      val_path = os.path.join(
          dl_manager.manual_dir, "ILSVRC2012_img_val.tar"
      )
  
      # We don't import the original test split, as it doesn't include labels.
      # These were never publicly released.
      if not tf.io.gfile.exists(train_path) or not tf.io.gfile.exists(
          val_path
      ):
          raise AssertionError(
              "ImageNet-LT requires manual download of the ImageNet2012 data. "
              "Please download the train and val set and place them into:"
              "{}, {}".format(train_path, val_path)
          )
  
      # Download and load subset file.
      downloaded_dirs = dl_manager.download(
          {
              "train": _TRAIN_SUBSET,
              "validation": _VAL_SUBSET,
          }
      )
  
      with tf.io.gfile.GFile(downloaded_dirs["train"]) as fp:
          train_subset = fp.read().splitlines()
      train_subset = self._postprocess_subset_list(train_subset)
  
      with tf.io.gfile.GFile(downloaded_dirs["validation"]) as fp:
          val_subset = fp.read().splitlines()
      val_subset = self._postprocess_subset_list(val_subset)
  
      return {
          "train": self._generate_examples(
              archive=dl_manager.iter_archive(train_path),
              subset=train_subset,
          ),
          "validation": self._generate_examples(
              archive=dl_manager.iter_archive(train_path),
              subset=val_subset,
          ),
          "test": self._generate_examples(
              archive=dl_manager.iter_archive(val_path),
              validation_labels=imagenet_common.get_validation_labels(
                  val_path
              ),
          ),
      }
  
file_path: datasets/tensorflow_datasets/datasets/imagenet_lt/imagenet_lt_dataset_builder.py
imports: import io
  import os
  from tensorflow_datasets.core.utils.lazy_imports_utils import tensorflow
  from tensorflow_datasets.datasets.imagenet2012 import imagenet_common
  import tensorflow_datasets.public_api
label_desc: Use image node_id 3 for calling the Builder obj's underlying member method code with example usage: obj._split_generators(dl_manager) and returns: dict