code: def operator_is(u):
      
      global _aux
      if np.ndim(u) == 2:
          P = _P2
      elif np.ndim(u) == 3:
          P = _P3
      else:
          raise ValueError("u has an invalid number of dimensions "
                           "(should be 2 or 3)")
      
      if u.shape != _aux.shape[1:]:
          _aux = np.zeros((len(P),) + u.shape)
      
      for _aux_i, P_i in zip(_aux, P):
          _aux_i[:] = binary_dilation(u, P_i)
      
      return _aux.min(0)
docs: operator_is operator.