code: def test_reduce_batch_coocurrences(
      self,
      x,
      weights,
      y,
      expected_result,
      filter_regex,
      function_handler,
  ):
      input_signature = [
          tf.TensorSpec(None, tf.string),
          tf.TensorSpec(None, tf.int64),
          tf.TensorSpec(None, tf.int64),
      ]
  
      @function_handler(input_signature=input_signature)
      def _reduce_batch_weighted_cooccurrences(x, y, weights):
          return tf_utils.reduce_batch_weighted_cooccurrences(
              x, y, weights, filter_regex=filter_regex
          )
  
      result = _reduce_batch_weighted_cooccurrences(x, y, weights)
  
      self.assertAllEqual(result.unique_x, expected_result.unique_x)
      self.assertAllEqual(
          result.summed_weights_per_x,
          expected_result.summed_weights_per_x,
      )
      self.assertAllEqual(
          result.summed_positive_per_x_and_y,
          expected_result.summed_positive_per_x_and_y,
      )
      self.assertAllEqual(
          result.counts_per_x, expected_result.counts_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 9 for calling the TFUtilsTest obj's underlying member method code with example usage: obj.test_reduce_batch_coocurrences(x, weights, y, expected_result, filter_regex, function_handler) and returns: tf_utils