code: def get_stats_of_glyphazzn(filepattern, output_path):
      """Computes the Mean and Std across examples in glyphazzn dataset."""
  
      def pipeline(root):
          """Pipeline for computing means/std from dataset."""
          examples = (
              root
              | "Read"
              >> beam.io.tfrecordio.ReadFromTFRecord(filepattern)
          )
          examples = examples | "Deserialize" >> beam.Map(
              _decode_tfexample
          )
          examples = examples | "GetMeanStdev" >> beam.CombineGlobally(
              MeanStddev()
          )
          examples = (
              examples
              | "MeanStdevToSerializedTFRecord"
              >> beam.Map(_mean_to_example)
          )
          (
              examples
              | "WriteToTFRecord"
              >> beam.io.tfrecordio.WriteToTFRecord(
                  output_path,
                  coder=beam.coders.ProtoCode(tf.train.Example),
              )
          )
  
      return pipeline
  
imports: from absl import app
  from absl import flags
  import apache_beam
  from magenta.models.svg_vae import svg_utils
  import numpy
  from tensor2tensor.data_generators import generator_utils
  import tensorflow.compat.v1
label_desc: Use image node_id 8 for calling a global function with example usage: get_stats_of_glyphazzn(filepattern, output_path) and returns: pipeline