def METHOD_NAME(
    self, logger: Optional[Logger] = None, reason: Optional[str] = None
) -> Generator:
    """
    Temporarily disable watcher due to the passed in reason,
    or some unknown reason.
    """
    if self._tracer is None:
        yield
    else:
        prev_disabled = self._disabled
        self._disabled = True
        logger.warning(reason)
        try:
            yield
        finally:
            self._disabled = prev_disabled