class_docstr: Mozilla Common Voice Dataset.
class_docstr_tok: ["Mozilla","Common","Voice","Dataset","."]
docstr: Generate Voice samples and statements given the data paths.
  
  Args:
    pipeline: Beam pipeline
    clips_pipeline: Beam pipeline with a stage that outputs a all audio clips
      keyed by the clip filename.
    examples: the examples in the split for which we need to generate
      examples.
  
  Returns:
    pipeline that produces dataset.
docstr_tok: ["Generate","Voice","samples","and","statements","given","the","data","paths",".","Args",":","pipeline",":","Beam","pipeline","clips_pipeline",":","Beam","pipeline","with","a","stage","that","outputs","a","all","audio","clips","keyed","by","the","clip","filename",".","examples",":","the","examples","in","the","split","for","which","we","need","to","generate","examples",".","Returns",":","pipeline","that","produces","dataset","."]
code: def _generate_examples(
      self,
      pipeline,
      clips_pipeline,
      examples: Sequence[_IndexedExample],
  ):
      """Generate Voice samples and statements given the data paths.
  
      Args:
        pipeline: Beam pipeline
        clips_pipeline: Beam pipeline with a stage that outputs a all audio clips
          keyed by the clip filename.
        examples: the examples in the split for which we need to generate
          examples.
  
      Returns:
        pipeline that produces dataset.
      """
      beam = tfds.core.lazy_imports.apache_beam
      counter = functools.partial(
          beam.metrics.Metrics.counter, _BEAM_NAMESPACE
      )
  
      def _process_join(el):
          try:
              (_, values) = el
              examples = values["examples"]
              if len(examples) != 1:
                  counter(f"{len(examples)}_examples").inc()
                  return
              indexed_example = examples[0]
  
              clips = values["clips"]
              if len(clips) != 1:
                  counter("{len(clips)}_clips").inc()
                  return
              clip = clips[0]
  
          except ValueError as e:
              raise ValueError(f"Unpacking element {el} failed") from e
          example = indexed_example.example.copy()
          example["voice"] = clip
          yield indexed_example.index, example
  
      examples_pipeline = (
          pipeline
          | "Collection of examples"
          >> beam.Create([[ex.clip_filename, ex] for ex in examples])
      )
  
      return (
          {"examples": examples_pipeline, "clips": clips_pipeline}
          | "Group by clip path" >> beam.CoGroupByKey()
          | "Reshuffle" >> beam.Reshuffle()
          | "Process and yield examples" >> beam.FlatMap(_process_join)
      )
  
imports: import csv
  import dataclasses
  import functools
  import io
  import re
  from typing import Any, Mapping, Sequence
  from etils import epath
  import numpy
  import tensorflow_datasets.public_api
label_desc: Use image node_id 4 for calling the CommonVoice obj's underlying member method code with example usage: obj._generate_examples(pipeline, clips_pipeline, examples) and returns: unknown