def stop(self):
        """
        See twisted.internet.interfaces.IReactorCore.stop.
        """
        if self._stopped:
            raise error.ReactorNotRunning(
                "Can't stop reactor that isn't running.")
        self._stopped = True
        self._justStopped = True
        self._startedBefore = True

        See twisted.internet.interfaces.IReactorCore.stop.
        
stackoverflow/venv/lib/python3.6/site-packages/twisted/internet/base.py