class_docstr: Util class to build splits.
  
  Usage is as follow:
  
  ```py
  split_builder = SplitBuilder(...)
  
  with split_builder.maybe_beam_pipeline():
    split_info_future = split_builder.submit_split_generation(...)
  
  split_info = split_info_future.result()
  ```
  
  * submit_split_generation:
    * For generator based split: Generate the split
    * For Apache Beam based split: Create the `beam.PCollection` and returns
      a future.
  * `split_info_future.result()`: Called after all `beam.PCollection`s have
    finished. Finalize the `split_info` by collecting all pipeline results.
  
  `submit_split_generation` / `.result` should be called once per
  split.
class_docstr_tok: ["Util","class","to","build","splits",".","Usage","is","as","follow",":","``","`","py","split_builder","=","SplitBuilder","(","...",")","with","split_builder.maybe_beam_pipeline","(",")",":","split_info_future","=","split_builder.submit_split_generation","(","...",")","split_info","=","split_info_future.result","(",")","``","`","*","submit_split_generation",":","*","For","generator","based","split",":","Generate","the","split","*","For","Apache","Beam","based","split",":","Create","the","`","beam.PCollection","`","and","returns","a","future",".","*","`","split_info_future.result","(",")","`",":","Called","after","all","`","beam.PCollection","`","s","have","finished",".","Finalize","the","`","split_info","`","by","collecting","all","pipeline","results",".","`","submit_split_generation","`","\/","`",".result","`","should","be","called","once","per","split","."]
docstr: Start the split generation.
  
  Args:
    split_name: Name of the split to generate
    generator: Generator, beam.PTransform,... yielding the examples
    filename_template: Template to format the filename for a shard.
    disable_shuffling: Specifies whether to shuffle the examples
  
  Returns:
    split_info_future: Future containing the `split_info`, once generation
      is complete. The `tfds.core.SplitInfo` can be accessed through
      `split_info_future.result()`
docstr_tok: ["Start","the","split","generation",".","Args",":","split_name",":","Name","of","the","split","to","generate","generator",":","Generator",",","beam.PTransform",",","...","yielding","the","examples","filename_template",":","Template","to","format","the","filename","for","a","shard",".","disable_shuffling",":","Specifies","whether","to","shuffle","the","examples","Returns",":","split_info_future",":","Future","containing","the","`","split_info","`",",","once","generation","is","complete",".","The","`","tfds.core.SplitInfo","`","can","be","accessed","through","`","split_info_future.result","(",")","`"]
code: def submit_split_generation(
      self,
      split_name: str,
      generator: SplitGenerator,
      filename_template: naming.ShardedFileTemplate,
      disable_shuffling: bool,
  ) -> _SplitInfoFuture:
      """Start the split generation.
  
      Args:
        split_name: Name of the split to generate
        generator: Generator, beam.PTransform,... yielding the examples
        filename_template: Template to format the filename for a shard.
        disable_shuffling: Specifies whether to shuffle the examples
  
      Returns:
        split_info_future: Future containing the `split_info`, once generation
          is complete. The `tfds.core.SplitInfo` can be accessed through
          `split_info_future.result()`
      """
      build_kwargs = dict(
          split_name=split_name,
          generator=generator,
          filename_template=filename_template,
          disable_shuffling=disable_shuffling,
      )
      # Depending on the type of generator, we use the corresponding
      # `_build_from_xyz` method.
      if isinstance(generator, collections.abc.Iterable):
          return self._build_from_generator(**build_kwargs)
      else:  # Otherwise, beam required
          unknown_generator_type = TypeError(
              f"Invalid split generator value for split `{split_name}`. "
              "Expected generator or apache_beam object. Got: "
              f"{type(generator)}"
          )
          if isinstance(generator, beam.PTransform):
              # Generate the beam.PCollection
              pcollection = self.beam_pipeline | split_name >> generator
              build_kwargs["generator"] = pcollection
              return self._build_from_pcollection(**build_kwargs)
          elif isinstance(generator, beam.PCollection):
              return self._build_from_pcollection(**build_kwargs)
          else:
              raise unknown_generator_type
  
imports: import collections.abc
  import contextlib
  import dataclasses
  import functools
  import itertools
  import sys
  from typing import Any, Callable, Dict, Iterable, Iterator, List, Optional, Tuple, Union
  from absl import logging
  import click
  import psutil
  from tensorflow_datasets.core import example_serializer
  from tensorflow_datasets.core import features
  from tensorflow_datasets.core import file_adapters
  from tensorflow_datasets.core import naming
  from tensorflow_datasets.core import splits
  from tensorflow_datasets.core import utils
  from tensorflow_datasets.core import writer
  from tensorflow_datasets.core.utils import shard_utils
  from tensorflow_datasets.core.utils.lazy_imports_utils import apache_beam
label_desc: Use image node_id 5 for calling the SplitBuilder obj's underlying member method code with example usage: obj.submit_split_generation(split_name, generator, filename_template, disable_shuffling) and returns: self, self, self