code: def test_subnetwork_metrics_user_metric_fn_overrides_metrics(self):
      with context.graph_mode():
          self.setup_graph()
          overridden_value = 100.0
  
          def _overriding_metric_fn():
              value = tf.constant(overridden_value)
              return {"metric_1": tf_compat.v1.metrics.mean(value)}
  
          metrics = tu.create_subnetwork_metrics(
              _overriding_metric_fn,
              features=self._features,
              labels=self._labels,
              estimator_spec=self._estimator_spec,
          )
  
          actual = self._run_metrics(metrics.eval_metrics_tuple())
  
          expected = {"loss": 2.0, "metric_1": overridden_value}
          self.assertEqual(actual, expected)
  
imports: from __future__ import absolute_import
  from __future__ import division
  from __future__ import print_function
  from absl.testing import parameterized
  from adanet import tf_compat
  from adanet.core.architecture import _Architecture
  from adanet.core.eval_metrics import _call_eval_metrics
  import adanet.core.testing_utils
  import tensorflow.compat.v2
  from tensorflow.python.eager import context
  from tensorflow.python.framework import test_util
label_desc: Use image node_id 7 for calling the MetricsTest obj's underlying member method code with example usage: obj.test_subnetwork_metrics_user_metric_fn_overrides_metrics() and returns: dict