code: def _print_popstat_info(tfpopstats, nppopstats):
      """Prints the average and std of population versus batch statistics."""
      mean_errors = []
      stdev_errors = []
      for j, (tfpopstat, nppopstat) in enumerate(
          zip(tfpopstats, nppopstats)
      ):
          moving_average = tfpopstat.eval()
          if j % 2 == 0:
              mean_errors.append(abs(moving_average - nppopstat))
          else:
              stdev_errors.append(
                  abs(np.sqrt(moving_average) - np.sqrt(nppopstat))
              )
  
      def flatmean(xs):
          return np.mean(np.concatenate([x.flatten() for x in xs]))
  
      print(
          "average of pop mean/stdev errors: %g %g"
          % (flatmean(mean_errors), flatmean(stdev_errors))
      )
      print(
          "average of batch mean/stdev: %g %g"
          % (
              flatmean(nppopstats[0::2]),
              flatmean([np.sqrt(ugh) for ugh in nppopstats[1::2]]),
          )
      )
  
imports: from __future__ import absolute_import
  from __future__ import division
  from __future__ import print_function
  import os
  import time
  from magenta.models.coconet import lib_data
  from magenta.models.coconet import lib_graph
  from magenta.models.coconet import lib_hparams
  from magenta.models.coconet import lib_util
  import numpy
  import six
  from six.moves import range
  from six.moves import zip
  import tensorflow.compat.v1
label_desc: Use image node_id 4 for calling a global function with example usage: _print_popstat_info(tfpopstats, nppopstats) and returns: np