code: def slow_hitmiss(A, Bc):
      res = np.zeros_like(A)
      for y in range(1, A.shape[0] - 1):
          for x in range(1, A.shape[1] - 1):
              value = 1
              for dy in (-1, 0, 1):
                  for dx in (-1, 0, 1):
                      ny = y + dy
                      nx = x + dx
                      if (
                          Bc[dy + 1, dx + 1] != 2
                          and Bc[dy + 1, dx + 1] != A[ny, nx]
                      ):
                          value = 0
              res[y, x] = value
      return res
  
imports: import mahotas
  import numpy
label_desc: Use image node_id 1 for calling a global function with example usage: slow_hitmiss(A, Bc) and returns: res