code: def testTwoClassAccuracyMetric(self):
      predictions = tf.constant(
          [0.0, 0.2, 0.4, 0.6, 0.8, 1.0], dtype=tf.float32
      )
      targets = tf.constant([0, 0, 1, 0, 1, 1], dtype=tf.int32)
      expected = 2.0 / 3.0
      with self.test_session() as session:
          accuracy, _ = metrics.two_class_accuracy(predictions, targets)
          session.run(tf.global_variables_initializer())
          session.run(tf.local_variables_initializer())
          actual = session.run(accuracy)
      self.assertAlmostEqual(actual, expected)
  
imports: from __future__ import absolute_import
  from __future__ import division
  from __future__ import print_function
  import numpy
  from tensor2tensor.utils import metrics
  import tensorflow.compat.v1
label_desc: Use image node_id 5 for calling the MetricsTest obj's underlying member method code with example usage: obj.testTwoClassAccuracyMetric() without return types