code: def test_str_repr(self):
      x = MyTuple((1, [2.0, 3.0], [[4, 5], [6, 7]]))
      y = ops.convert_to_tensor_or_composite(value=x)
  
      if tf.executing_eagerly():
          expected = (
              "(<tf.Tensor: shape=(), dtype=int32, numpy=1>,"
              " <tf.Tensor: shape=(2,), dtype=float32,"
              " numpy=array([2.,3.], dtype=float32)>,"
              " <tf.Tensor: shape=(2,2), dtype=int32,"
              " numpy=array([[4,5],[6,7]], dtype=int32)>)"
          )
          regexp2 = re.compile(r"\s+([\d\[\]])")
  
          def _strip(s):
              s = s.replace("\n", "")
              s = re.sub(regexp2, r"\1", s)
              return s
  
          self.assertEqual(expected, _strip(str(y)))
          self.assertEqual(expected, _strip(repr(y)))
      else:
          expected = (
              "(<tf.Tensor 'Const:0' shape=() dtype=int32>,"
              " <tf.Tensor 'Const_1:0' shape=(2,) dtype=float32>,"
              " <tf.Tensor 'Const_2:0' shape=(2, 2) dtype=int32>)"
          )
          self.assertEqual(expected, str(y))
          self.assertEqual(expected, repr(y))
  
file_path: probability/tensorflow_probability/python/layers/internal/tensor_tuple_test.py
imports: import re
  import tensorflow.compat.v2
  from tensorflow_probability.python.internal import test_util
  from tensorflow_probability.python.layers.internal import tensor_tuple
  from tensorflow.python.framework import ops
label_desc: Use image node_id 4 for calling the CustomConvertToCompositeTensorTest obj's underlying member method code with example usage: obj.test_str_repr() and returns: s