code: def test_with_rank_ndarray(self):
      x = np.array([2], dtype=np.int32)
      with self.assertRaises(ValueError):
          tensorshape_util.with_rank(x, 2)
  
      x = np.array([2, 3, 4], dtype=np.int32)
      y = tensorshape_util.with_rank(x, 3)
      self.assertAllEqual(x, y)
  
      x = np.array([2, 3, 4, 5], dtype=np.int32)
      y = tensorshape_util.with_rank_at_least(x, 3)
      self.assertAllEqual(x, y)
  
file_path: probability/tensorflow_probability/python/internal/tensorshape_util_test.py
imports: import numpy
  import tensorflow.compat.v2
  from tensorflow_probability.python.internal import tensorshape_util
  from tensorflow_probability.python.internal import test_util
label_desc: Use image node_id 2 for calling the TensorShapeUtilTestTest obj's underlying member method code with example usage: obj.test_with_rank_ndarray() without return types