def _getReactor(self):
        """
        Get either the passed-in reactor or the global reactor.
        """
        if self.reactor is not None:
            reactor = self.reactor
        else:
            from twisted.internet import reactor
        return reactor

        Get either the passed-in reactor or the global reactor.
        
stackoverflow/venv/lib/python3.6/site-packages/twisted/trial/util.py