class_docstr: Base test class for testing tf-transform preprocessing functions.
class_docstr_tok: ["Base","test","class","for","testing","tf-transform","preprocessing","functions","."]
code: def _getMetricsCounter(
      self,
      metrics: beam.metrics.Metrics,
      name: str,
      namespaces_list: Iterable[str],
  ) -> int:
      metrics_filter = beam.metrics.MetricsFilter().with_name(name)
      if namespaces_list:
          metrics_filter = metrics_filter.with_namespaces(
              namespaces_list
          )
      metric = metrics.query(metrics_filter)["counters"]
      committed = sum([r.committed for r in metric])
      attempted = sum([r.attempted for r in metric])
      self.assertEqual(
          committed,
          attempted,
          msg=f"Attempted counter {name} from namespace {namespaces_list}",
      )
      return committed
  
imports: import os
  import tempfile
  from typing import Dict, Iterable, List, Optional, Tuple
  from absl import logging
  import apache_beam
  import pyarrow
  import tensorflow
  import tensorflow_transform
  import tensorflow_transform.beam
  from tensorflow_transform.beam.tft_beam_io import transform_fn_io
  from tensorflow_transform import test_case
  from tensorflow_transform.beam import test_helpers
  from tensorflow_transform.tf_metadata import dataset_metadata
  from tfx_bsl.coders import example_coder
  import unittest
  from tensorflow.python.util.protobuf import compare
  from tensorflow_metadata.proto.v0 import schema_pb2
label_desc: Use image node_id 2 for calling the TransformTestCase obj's underlying member method code with example usage: obj._getMetricsCounter(metrics, name, namespaces_list) and returns: committed