def __invert__(self):
    try:
        arr = operator.inv(com.values_from_object(self))
        return self.__array_wrap__(arr)
    except Exception:
        if (not np.prod(self.shape)):
            return self
        raise
def __invert__(self):
    try:
        arr = operator.inv(com.values_from_object(self))
        return self.__array_wrap__(arr)
    except Exception:
        if (not np.prod(self.shape)):
            return self
        raise