code: def test_disconnected():
      arr = tf.cast(
          [
              [1, 0, 0, 1, 0, 0, 0, 0, 1],
              [0, 1, 0, 0, 0, 1, 0, 1, 0],
              [1, 0, 1, 0, 0, 0, 1, 0, 0],
              [0, 0, 0, 0, 1, 0, 0, 0, 0],
              [0, 0, 1, 0, 0, 0, 0, 0, 0],
          ],
          tf.bool,
      )
      expected = [
          [1, 0, 0, 2, 0, 0, 0, 0, 3],
          [0, 4, 0, 0, 0, 5, 0, 6, 0],
          [7, 0, 8, 0, 0, 0, 9, 0, 0],
          [0, 0, 0, 0, 10, 0, 0, 0, 0],
          [0, 0, 11, 0, 0, 0, 0, 0, 0],
      ]
      np.testing.assert_equal(
          connected_components(arr).numpy(), expected
      )
  
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 1 for calling a global function with example usage: test_disconnected() without return types