code: def test_simple():
      arr = [[0, 1, 0], [1, 1, 1], [0, 1, 0]]
  
      # Single component with id 1.
      np.testing.assert_equal(
          connected_components(tf.cast(arr, tf.bool)).numpy(), arr
      )
  
file_path: addons/tensorflow_addons/image/tests/connected_components_test.py
imports: import pytest
  import logging
  import tensorflow
  import numpy
  from tensorflow_addons.image.connected_components import connected_components
label_desc: Use image node_id 2 for calling a global function with example usage: test_simple() without return types