code: def test_reduce_batch_weighted_counts(
      self,
      x,
      x_spec,
      weights,
      filter_regex,
      expected_unique_x,
      expected_summed_weights_per_x,
      function_handler,
  ):
      input_signature = [x_spec, tf.TensorSpec(None, tf.float32)]
  
      @function_handler(input_signature=input_signature)
      def _reduce_batch_weighted_counts(x, weights):
          (
              unique_x,
              summed_weights_per_x,
              summed_positive_per_x_and_y,
              counts_per_x,
          ) = tf_utils.reduce_batch_weighted_counts(
              x, weights, filter_regex=filter_regex
          )
          self.assertIsNone(summed_positive_per_x_and_y)
          self.assertIsNone(counts_per_x)
          return unique_x, summed_weights_per_x
  
      unique_x, summed_weights_per_x = _reduce_batch_weighted_counts(
          x, weights
      )
  
      self.assertAllEqual(unique_x, expected_unique_x)
      self.assertAllEqual(
          summed_weights_per_x, expected_summed_weights_per_x
      )
  
imports: import os
  import numpy
  from packaging import version
  import tensorflow
  from tensorflow_transform import analyzers
  from tensorflow_transform import annotators
  from tensorflow_transform import tf_utils
  from tensorflow_transform import test_case
  from tensorflow.python.framework import composite_tensor
label_desc: Use image node_id 5 for calling the TFUtilsTest obj's underlying member method code with example usage: obj.test_reduce_batch_weighted_counts(x, x_spec, weights, filter_regex, expected_unique_x, expected_summed_weights_per_x, function_handler) and returns: unique_x,  summed_weights_per_x