docstr: Generate examples as dicts.
docstr_tok: ["Generate","examples","as","dicts","."]
code: def _generate_examples(self, num_examples):
      """Generate examples as dicts."""
      examples = beam.Create(range(num_examples)) | beam.Map(
          _gen_example
      )
  
      # Can save int, str,... metadata but not `beam.PTransform`
      self.info.metadata[f"valid_{num_examples}"] = num_examples
      with pytest.raises(
          NotImplementedError,
          match="can't be used on `beam.PTransform`",
      ):
          self.info.metadata[f"invalid_{num_examples}"] = _compute_sum(
              examples
          )
      return examples
  
imports: import pathlib
  from typing import Callable
  from unittest import mock
  import apache_beam
  from etils import epath
  import numpy
  import pytest
  import tensorflow
  from tensorflow_datasets.core import dataset_builder
  from tensorflow_datasets.core import dataset_info
  from tensorflow_datasets.core import dataset_utils
  from tensorflow_datasets.core import download
  from tensorflow_datasets.core import features
  from tensorflow_datasets.core import utils
label_desc: Use image node_id 3 for calling the DummyBeamDataset obj's underlying member method code with example usage: obj._generate_examples(num_examples) and returns: examples