code: def test__cooccurence():
      cooccurence = mahotas.features._texture.cooccurence
      f = np.array(
          [
              [0, 1, 1, 1],
              [0, 0, 1, 1],
              [2, 2, 2, 2],
          ]
      )
      Bc = np.zeros((3, 3), f.dtype)
      Bc[1, 2] = 1
      res = np.zeros((5, 5), np.int32)
      cooccurence(f, res, Bc, 0)
      assert res[0, 0] == 1
      assert res[0, 1] == 2
      assert res[1, 0] == 0
      assert res[1, 1] == 3
      assert res[2, 2] == 3
      assert not np.any(res[2, :2])
      assert not np.any(res[:2, 2])
      res[:3, :3] = 0
      assert not np.any(res)
  
      res = np.zeros((5, 5), np.int32)
      Bc = np.zeros((3, 3), f.dtype)
      Bc[2, 2] = 1
      cooccurence(f, res, Bc, 0)
      assert res[0, 0] == 1
      assert res[0, 1] == 0
      assert res[0, 2] == 2
      assert res[1, 0] == 0
      assert res[1, 1] == 2
      assert res[1, 2] == 1
      res[:3, :3] = 0
      assert not np.any(res)
  
imports: import numpy
  from mahotas.features import texture
  import mahotas
  import mahotas.features._texture
  import pytest
label_desc: Use image node_id 1 for calling a global function with example usage: test__cooccurence() without return types