code: def hitmiss(input, Bc, out=None, output=None):
      """
      filtered = hitmiss(input, Bc, out=np.zeros_like(input))
  
      Hit & Miss transform
  
      For a given pixel position, the hit&miss is ``True`` if, when ``Bc`` is
      overlaid on ``input``, centered at that position, the ``1`` values line up
      with ``1``\s, while the ``0``\s line up with ``0``\s (``2``\s correspond to
      *don't care*).
  
      Examples
      --------
  
      ::
  
          print(hitmiss(np.array([
                      [0,0,0,0,0],
                      [0,1,1,1,1],
                      [0,0,1,1,1]]),
                  np.array([
                      [0,0,0],
                      [2,1,1],
                      [2,1,1]])))
  
          prints::
  
              [[0 0 0 0 0]
               [0 0 1 1 0]
               [0 0 0 0 0]]
  
  
  
      Parameters
      ----------
      input : input ndarray
          This is interpreted as a binary array.
      Bc : ndarray
          hit & miss template, values must be one of (0, 1, 2)
      out : ndarray, optional
          Used for output. Must be Boolean ndarray of same size as ``input``
      output : deprecated
          Do not use
  
      Returns
      -------
      filtered : ndarray
      """
      _verify_is_integer_type(input, "hitmiss")
      _verify_is_integer_type(Bc, "hitmiss")
      if input.dtype != Bc.dtype:
          if input.dtype == np.bool_:
              input = input.view(np.uint8)
              if Bc.dtype == np.bool_:
                  Bc = Bc.view(np.uint8)
              else:
                  Bc = Bc.astype(np.uint8)
          else:
              Bc = Bc.astype(input.dtype)
  
      if out is None and output is not None:  # pragma: no cover
          out = output
  
      # We cannot call internal._get_output here because the conditions around
      # dtypes are different from those implemented in `internal._get_output`
  
      if out is None:
          out = np.empty_like(input)
      else:
          if out.shape != input.shape:
              raise ValueError(
                  "mahotas.hitmiss: out must be of same shape as input"
              )
          if out.dtype != input.dtype:
              if out.dtype == np.bool_ and input.dtype == np.uint8:
                  out = out.view(np.uint8)
              else:
                  raise TypeError(
                      "mahotas.hitmiss: out must be of same type as input"
                  )
      return _morph.hitmiss(input, Bc, out)
  
imports: from __future__ import division
  import numpy
  from .internal import _get_output, _verify_is_integer_type, _check_2
  from .None import _morph
label_desc: Use image node_id 8 for calling a global function with example usage: hitmiss(input, Bc, out, output) and returns: _morph