code: def test_border():
      labeled = np.zeros((32, 32), np.uint8)
      labeled[8:11] = 1
      labeled[11:14] = 2
      labeled[14:17] = 3
      labeled[10, 8:] = 0
      b12 = mahotas.labeled.border(labeled, 1, 2)
      YX = np.where(b12)
      YX = np.array(YX).T
      b13 = mahotas.labeled.border(labeled, 1, 3)
  
      assert not np.any(b13)
      assert np.any(b12)
      assert (11, 0) in YX
      assert (11, 1) in YX
      assert (12, 1) in YX
      assert (12, 9) not in YX
  
      b13 = mahotas.labeled.border(labeled, 1, 3, always_return=0)
      assert b13 is None
  
imports: import numpy
  import mahotas
  import mahotas.labeled
  from pytest import raises
label_desc: Use image node_id 1 for calling a global function with example usage: test_border() without return types