code: def _add_split_if_exists(
      split_list, split, split_path, dl_manager, **kwargs
  ):
      """Add split to given list of splits only if the file exists."""
      if not tf.io.gfile.exists(split_path):
          logging.warning(
              (
                  "ImageNet 2012 Challenge %s split not found at %s. "
                  "Proceeding with data generation anyways but the split will be "
                  "missing from the dataset..."
              ),
              str(split),
              split_path,
          )
      else:
          split_list.append(
              tfds.core.SplitGenerator(
                  name=split,
                  gen_kwargs={
                      "archive": dl_manager.iter_archive(split_path),
                      **kwargs,
                  },
              ),
          )
  
file_path: datasets/tensorflow_datasets/datasets/imagenet2012/imagenet2012_dataset_builder.py
imports: import io
  import os
  from absl import logging
  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 1 for calling a global function with example usage: _add_split_if_exists(split_list, split, split_path, dl_manager) without return types