code: def estimate_popstats(unused_sv, sess, m, dataset, unused_hparams):
      """Averages over mini batches for population statistics for batch norm."""
      print("Estimating population statistics...")
      tfbatchstats, tfpopstats = list(
          zip(*list(m.popstats_by_batchstat.items()))
      )
  
      nepochs = 3
      nppopstats = [lib_util.AggregateMean("") for _ in tfpopstats]
      for _ in range(nepochs):
          batches = dataset.get_featuremaps().batches(
              size=m.batch_size, shuffle=True
          )
          for unused_step, batch in enumerate(batches):
              feed_dict = batch.get_feed_dict(m.placeholders)
              npbatchstats = sess.run(tfbatchstats, feed_dict=feed_dict)
              for nppopstat, npbatchstat in zip(
                  nppopstats, npbatchstats
              ):
                  nppopstat.add(npbatchstat)
      nppopstats = [nppopstat.mean for nppopstat in nppopstats]
  
      _print_popstat_info(tfpopstats, nppopstats)
  
      # Update tfpopstat variables.
      for unused_j, (tfpopstat, nppopstat) in enumerate(
          zip(tfpopstats, nppopstats)
      ):
          tfpopstat.load(nppopstat)
  
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 1 for calling a global function with example usage: estimate_popstats(unused_sv, sess, m, dataset, unused_hparams) without return types