def run(self, reactor):
        """
        Run reactor under the cProfile profiler.
        """
        try:
            import cProfile, pstats
        except __HOLE__, e:
            self._reportImportError("cProfile", e)

        p = cProfile.Profile()
        p.runcall(reactor.run)
        if self.saveStats:
            p.dump_stats(self.profileOutput)
        else:
            stream = open(self.profileOutput, 'w')
            s = pstats.Stats(p, stream=stream)
            s.strip_dirs()
            s.sort_stats(-1)
            s.print_stats()
            stream.close()
dataset/ETHPy150Open kuri65536/python-for-android/python-modules/twisted/twisted/application/app.py/CProfileRunner.run