class_docstr: [Experimental] Base builder for views.
  
  Note that this is an experimental new feature, so the API may change.
  
  `ViewBuilder` can be used to define a new dataset as the transformation of an
  existing dataset.
class_docstr_tok: ["[","Experimental","]","Base","builder","for","views",".","Note","that","this","is","an","experimental","new","feature",",","so","the","API","may","change",".","`","ViewBuilder","`","can","be","used","to","define","a","new","dataset","as","the","transformation","of","an","existing","dataset","."]
code: def _generate_examples(
      self,
      builder: dataset_builder.DatasetBuilder,
      split_info: splits_lib.SplitInfo,
      ex_transformations: List[transform_lib.ExampleTransformFn],
      ds_transformations: List[
          Callable[[tf.data.Dataset], tf.data.Dataset]
      ],
  ) -> split_builder_lib.SplitGenerator:
      if ex_transformations and ds_transformations:
          raise ValueError(
              "It is not supported to have toth example and dataset "
              "transformations!"
          )
      if ex_transformations:
          if self.USE_BEAM:
              return _transform_per_example_beam(
                  builder=builder,
                  split_info=split_info,
                  transformations=ex_transformations,
                  workers_per_shard=self.BEAM_WORKERS_PER_SHARD,
              )
          else:
              return _transform_per_example(
                  builder=builder,
                  split_info=split_info,
                  transformations=ex_transformations,
              )
      elif ds_transformations:
          if self.USE_BEAM:
              # TODO(weide): add support for using Beam with tf.data transformations.
              raise ValueError(
                  "Using Apache Beam in combination with tf.data "
                  "transformations is not yet supported!"
              )
          return _transform_dataset(
              builder=builder,
              split_info=split_info,
              transformations=ds_transformations,
          )
      raise ValueError("No transformations were specified!")
  
imports: from __future__ import annotations
  import functools
  from typing import Callable, Dict, Iterator, List, Optional, Union
  from tensorflow_datasets.core import beam_utils
  from tensorflow_datasets.core import dataset_builder
  from tensorflow_datasets.core import dataset_utils
  from tensorflow_datasets.core import load
  from tensorflow_datasets.core import naming
  from tensorflow_datasets.core import registered
  from tensorflow_datasets.core import split_builder
  from tensorflow_datasets.core import splits
  from tensorflow_datasets.core import transform
  from tensorflow_datasets.core.download import download_manager
  from tensorflow_datasets.core.utils import read_config
  from tensorflow_datasets.core.utils.lazy_imports_utils import apache_beam
  from tensorflow_datasets.core.utils.lazy_imports_utils import tensorflow
label_desc: Use image node_id 7 for calling the ViewBuilder obj's underlying member method code with example usage: obj._generate_examples(builder, split_info, ex_transformations, ds_transformations) and returns: _transform_per_example_beam, _transform_per_example, _transform_dataset