code: def _assert_set_operation(
      self,
      expected_indices,
      expected_values,
      expected_shape,
      sparse_tensor_value,
      dtype,
  ):
      self.assertAllEqual(expected_indices, sparse_tensor_value.indices)
      self.assertAllEqual(len(expected_indices), len(expected_values))
      self.assertAllEqual(
          len(expected_values), len(sparse_tensor_value.values)
      )
      expected_set = set()
      actual_set = set()
      last_indices = None
      for indices, expected_value, actual_value in zip(
          expected_indices, expected_values, sparse_tensor_value.values
      ):
          if dtype == dtypes.string:
              actual_value = actual_value.decode("utf-8")
          if last_indices and (last_indices[:-1] != indices[:-1]):
              self.assertEqual(
                  expected_set,
                  actual_set,
                  "Expected %s, got %s, at %s."
                  % (expected_set, actual_set, indices),
              )
              expected_set.clear()
              actual_set.clear()
          expected_set.add(expected_value)
          actual_set.add(actual_value)
          last_indices = indices
      self.assertEqual(
          expected_set,
          actual_set,
          "Expected %s, got %s, at %s."
          % (expected_set, actual_set, last_indices),
      )
      self.assertAllEqual(
          expected_shape, sparse_tensor_value.dense_shape
      )
  
imports: from absl.testing import parameterized
  import numpy
  from tensorflow.python.framework import constant_op
  from tensorflow.python.framework import dtypes
  from tensorflow.python.framework import errors_impl
  from tensorflow.python.framework import sparse_tensor
  from tensorflow.python.framework import test_util
  from tensorflow.python.ops import array_ops
  from tensorflow.python.ops import gen_set_ops
  from tensorflow.python.ops import math_ops
  from tensorflow.python.ops import sets
  from tensorflow.python.ops import sparse_ops
  from tensorflow.python.platform import googletest
label_desc: Use image node_id 47 for calling the SetOpsTest obj's underlying member method code with example usage: obj._assert_set_operation(expected_indices, expected_values, expected_shape, sparse_tensor_value, dtype) without return types