class_docstr: Encodes each NoteSequence example and emits the results in a tf.Example.
class_docstr_tok: ["Encodes","each","NoteSequence","example","and","emits","the","results","in","a","tf.Example","."]
code: def process(self, seq):
      split_seqs = split_note_sequence_on_time_changes(seq)
      if len(split_seqs) > 100:
          beam_metrics.counter(
              "ExtractExamplesDoFn",
              "filtered-too-many-sequence-time-splits",
          ).inc()
          return
      beam_metrics.counter(
          "ExtractExamplesDoFn", "sequence-time-splits"
      ).inc(len(split_seqs))
      for ns in split_seqs:
          for res in self._process_ns(ns):
              beam_metrics.counter(
                  "ExtractExamplesDoFn", "all-examples"
              ).inc()
              yield res
  
file_path: magenta/magenta/models/music_vae/preprocess_tfrecord.py
imports: import typing
  from absl import app
  from absl import flags
  from absl import logging
  import apache_beam
  from apache_beam import typehints
  from apache_beam.metrics import Metrics
  from magenta.models.music_vae import configs
  import note_seq
  from note_seq.sequences_lib import split_note_sequence_on_time_changes
  import numpy
label_desc: Use image node_id 3 for calling the ExtractExamplesDoFn obj's underlying member method code with example usage: obj.process(seq) without return types