code: def test_label():
      A = np.zeros((128, 128), np.int_)
      L, n = label(A)
      assert not L.max()
      assert n == 0
  
      A[2:5, 2:5] = 34
      A[10:50, 10:50] = 34
      L, n = label(A)
      assert L.max() == 2
      assert L.max() == n
      assert np.sum(L > 0) == (40 * 40 + 3 * 3)
      assert np.all((L > 0) == (A > 0))
      assert set(L.ravel()) == set([0, 1, 2])
  
imports: from mahotas import label
  import numpy
label_desc: Use image node_id 1 for calling a global function with example usage: test_label() without return types