def METHOD_NAME(self, ignore_n_events):
    """Context to set how many onSettingsChanged events to be ignored"""
    self.ignore_n_events += ignore_n_events
    try:
        yield
    except Exception:  # pylint: disable=broad-except
        self.ignore_n_events = 0
        raise