code: def _mean_to_example(mean_stdev):
      """Converts the found mean and stdev to tfrecords example."""
      # mean_stdev is a dict
      mean_stdev["mean"] = (
          np.reshape(mean_stdev["mean"], [10])
          .astype(np.float32)
          .tolist()
      )
      mean_stdev["variance"] = (
          np.reshape(mean_stdev["variance"], [10])
          .astype(np.float32)
          .tolist()
      )
      mean_stdev["stddev"] = (
          np.reshape(mean_stdev["stddev"], [10])
          .astype(np.float32)
          .tolist()
      )
      mean_stdev["count"] = (
          np.reshape(mean_stdev["count"], [1]).astype(np.int64).tolist()
      )
      return generator_utils.to_example(mean_stdev)
  
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 6 for calling a global function with example usage: _mean_to_example(mean_stdev) and returns: generator_utils