def test_lotsOfThreadsAreScheduledCorrectly(self):
        """
        L{IReactorThreads.callFromThread} can be used to schedule a large
        number of calls in the reactor thread.
        """
        def addAndMaybeFinish():
            self.counter += 1
            if self.counter == 100:
                self.deferred.callback(True)

        for i in range(100):
            self.schedule(addAndMaybeFinish)

        return self.deferred

        L{IReactorThreads.callFromThread} can be used to schedule a large
        number of calls in the reactor thread.
        
stackoverflow/venv/lib/python3.6/site-packages/twisted/test/test_internet.py