class_docstr: Base class for Cityscapes datasets.
class_docstr_tok: ["Base","class","for","Cityscapes","datasets","."]
code: def _split_generators(self, dl_manager):
      paths = {}
      for split, (zip_file, _) in self.builder_config.zip_root.items():
          paths[split] = os.path.join(dl_manager.manual_dir, zip_file)
  
      if any(not tf.io.gfile.exists(z) for z in paths.values()):
          msg = "You must download the dataset files manually and place them in: "
          msg += ", ".join(paths.values())
          raise AssertionError(msg)
  
      for split, (_, zip_root) in self.builder_config.zip_root.items():
          paths[split] = os.path.join(
              dl_manager.extract(paths[split]), zip_root
          )
  
      splits = [
          tfds.core.SplitGenerator(
              name=tfds.Split.TRAIN,
              gen_kwargs={
                  feat_dir: os.path.join(path, "train")
                  for feat_dir, path in paths.items()
                  if not feat_dir.endswith("/extra")
              },
          ),
          tfds.core.SplitGenerator(
              name=tfds.Split.VALIDATION,
              gen_kwargs={
                  feat_dir: os.path.join(path, "val")
                  for feat_dir, path in paths.items()
                  if not feat_dir.endswith("/extra")
              },
          ),
      ]
  
      # Test split does not exist in coarse dataset
      if not self.builder_config.train_extra_split:
          splits.append(
              tfds.core.SplitGenerator(
                  name=tfds.Split.TEST,
                  gen_kwargs={
                      feat_dir: os.path.join(path, "test")
                      for feat_dir, path in paths.items()
                      if not feat_dir.endswith("/extra")
                  },
              )
          )
      else:
          splits.append(
              tfds.core.SplitGenerator(
                  name="train_extra",
                  gen_kwargs={  # pylint: disable=g-complex-comprehension
                      feat_dir.replace("/extra", ""): os.path.join(
                          path, "train_extra"
                      )
                      for feat_dir, path in paths.items()
                      if feat_dir.endswith("/extra")
                  },
              )
          )
      return splits
  
file_path: datasets/tensorflow_datasets/datasets/cityscapes/cityscapes_dataset_builder.py
imports: import os
  import re
  from tensorflow_datasets.core.utils.lazy_imports_utils import tensorflow
  import tensorflow_datasets.public_api
label_desc: Use image node_id 2 for calling the Builder obj's underlying member method code with example usage: obj._split_generators(dl_manager) and returns: splits