code: def test_snake_disconnected():
      for i in range(SNAKE.shape[0]):
          for j in range(SNAKE.shape[1]):
              # If we disconnect any part of the snake except for the endpoints,
              # there will be 2 components.
              if SNAKE[i, j] and (i, j) not in [(1, 1), (6, 3)]:
                  disconnected_snake = SNAKE.copy()
                  disconnected_snake[i, j] = 0
                  components = connected_components(
                      tf.cast(disconnected_snake, tf.bool)
                  )
                  assert np.max(components) == 2
  
                  bins = np.bincount(components.numpy().ravel())
                  # Nonzero number of pixels labeled 0, 1, or 2.
                  assert bins[0] > 0
                  assert bins[1] > 0
                  assert bins[2] > 0
  
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 4 for calling a global function with example usage: test_snake_disconnected() without return types