class_docstr: Base TFDS builder.
  
  The functions to overwrite are:
  
  * `_info`: Defines dataset features and metadata (see TFDS docs:
    https://www.tensorflow.org/datasets/add_dataset#_info_dataset_metadata)
  * `split_to_scene_configs`: Define the splits and scenes
  * `generate_scene`: Generate a single scene and returns the examples.
  
  Usage: See `HelloBeamWorker` for an example.
class_docstr_tok: ["Base","TFDS","builder",".","The","functions","to","overwrite","are",":","*","`","_info","`",":","Defines","dataset","features","and","metadata","(","see","TFDS","docs",":","https",":","\/\/www.tensorflow.org\/datasets\/add_dataset","#","_info_dataset_metadata",")","*","`","split_to_scene_configs","`",":","Define","the","splits","and","scenes","*","`","generate_scene","`",":","Generate","a","single","scene","and","returns","the","examples",".","Usage",":","See","`","HelloBeamWorker","`","for","an","example","."]
docstr: Validate and normalize the scene outputs.
docstr_tok: ["Validate","and","normalize","the","scene","outputs","."]
code: def _normalize_scene_output(
      self,
      *,
      scene_id: int,
      scene_output: SceneOutput,
      split_to_scenes: SplitScenesMapping,
  ) -> SplitToSceneExs:
      """Validate and normalize the scene outputs."""
      expected_splits = split_to_scenes.scene_id_to_split_names[
          scene_id
      ]
  
      # 2 cases:
      # * User returned `SceneExs` directly
      # * User returned `SplitDict[SceneExs]` mapping split to examples
  
      if isinstance(scene_output, dict) and set(scene_output) == set(
          expected_splits
      ):
          # If the user did specified the wrong splits, the error will be raised
          # in `_assert_single_split` bellow.
          # If the user specify a single wrong split, the error will be raised
          # during encoding.
          return {
              split_name: self._normalize_scene_examples(exs)
              for split_name, exs in scene_output.items()
          }
      else:
          _assert_single_split(expected_splits)
          (split,) = expected_splits
          return {split: self._normalize_scene_examples(scene_output)}
  
imports: from __future__ import annotations
  import abc
  import collections
  import dataclasses
  import itertools
  import tempfile
  from typing import Any, Dict, Iterator, List, Optional, TypeVar, Union
  import apache_beam
  from etils import edc
  from etils import epath
  import kubric
  import tensorflow_datasets
label_desc: Use image node_id 3 for calling the KubricBuilder obj's underlying member method code with example usage: obj._normalize_scene_output() and returns: unknown, dict