class_docstr: DatasetBuilder for MOVi-D dataset.
class_docstr_tok: ["DatasetBuilder","for","MOVi-D","dataset","."]
docstr: Returns SplitGenerators.
docstr_tok: ["Returns","SplitGenerators","."]
code: def _split_generators(
      self, unused_dl_manager: tfds.download.DownloadManager
  ):
      """Returns SplitGenerators."""
      del unused_dl_manager
      path = as_path(self.builder_config.train_val_path)
      all_subdirs = [str(d) for d in path.iterdir()]
      logging.info(
          "Found %d sub-folders in master path: %s",
          len(all_subdirs),
          path,
      )
  
      # shuffle
      rng = np.random.RandomState(seed=42)
      rng.shuffle(all_subdirs)
  
      validation_ratio = self.builder_config.validation_ratio
      validation_examples = max(
          1, round(len(all_subdirs) * validation_ratio)
      )
      training_examples = len(all_subdirs) - validation_examples
      logging.info(
          "Using %f of examples for validation for a total of %d",
          validation_ratio,
          validation_examples,
      )
      logging.info(
          "Using the other %d examples for training", training_examples
      )
  
      splits = {
          tfds.Split.TRAIN: self._generate_examples(
              all_subdirs[:training_examples]
          ),
          tfds.Split.VALIDATION: self._generate_examples(
              all_subdirs[training_examples:]
          ),
      }
  
      for key, path in self.builder_config.test_split_paths.items():
          path = as_path(path)
          split_dirs = [d for d in path.iterdir()]
          # sort the directories by their integer number
          split_dirs = sorted(split_dirs, key=lambda x: int(x.name))
          logging.info(
              "Found %d sub-folders in '%s' path: %s",
              len(split_dirs),
              key,
              path,
          )
          splits[key] = self._generate_examples(
              [str(d) for d in split_dirs]
          )
  
      return splits
  
imports: import dataclasses
  import json
  import logging
  import imageio
  import numpy
  import png
  import tensorflow
  import tensorflow_datasets.public_api
  from typing import List, Dict, Union
label_desc: Use image node_id 2 for calling the MoviD obj's underlying member method code with example usage: obj._split_generators(unused_dl_manager) and returns: splits