code: def create_eager_metrics(
      metric_names, weights_fn=common_layers.weights_all
  ):
      """Create metrics accumulators and averager for Eager mode.
  
      Args:
        metric_names: list<str> from Metrics enum
        weights_fn: function that takes labels and returns a weights mask. Defaults
          to weights of all 1, i.e. common_layers.weights_all. Use
          common_layers.weights_nonzero if labels have 0-padding.
  
      Returns:
        (accum_fn(predictions, targets) => None,
         result_fn() => dict<str metric_name, float avg_val>
      """
      metric_fns = dict(
          [(name, METRICS_FNS[name]) for name in metric_names]
      )
      return create_eager_metrics_internal(metric_fns, weights_fn)
  
imports: from __future__ import absolute_import
  from __future__ import division
  from __future__ import print_function
  import numpy
  import six
  from tensor2tensor.layers import common_layers
  from tensor2tensor.layers import modalities
  from tensor2tensor.utils import bleu_hook
  from tensor2tensor.utils import contrib
  from tensor2tensor.utils import rouge
  from tensor2tensor.utils import sari_hook
  import tensorflow.compat.v1
  from tensorflow.python.util import tf_inspect
label_desc: Use image node_id 34 for calling a global function with example usage: create_eager_metrics(metric_names, weights_fn) and returns: create_eager_metrics_internal