code: def test_from_4D_image_with_invalid_data():
      with np.testing.assert_raises(
          (ValueError, tf.errors.InvalidArgumentError)
      ):
          img_utils.from_4D_image(tf.ones(shape=(2, 2, 4, 1)), 2)
  
      with np.testing.assert_raises(
          (ValueError, tf.errors.InvalidArgumentError)
      ):
          img_utils.from_4D_image(
              tf.ones(shape=(2, 2, 4, 1)), tf.constant(2)
          )
  
file_path: addons/tensorflow_addons/image/tests/utils_test.py
imports: import pytest
  import numpy
  import tensorflow
  from tensorflow_addons.image import utils
label_desc: Use image node_id 5 for calling a global function with example usage: test_from_4D_image_with_invalid_data() without return types