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

        p = profile.Profile()
        p.runcall(reactor.run)
        if self.saveStats:
            p.dump_stats(self.profileOutput)
        else:
            tmp, sys.stdout = sys.stdout, open(self.profileOutput, 'a')
            try:
                p.print_stats()
            finally:
                sys.stdout, tmp = tmp, sys.stdout
                tmp.close()
dataset/ETHPy150Open kuri65536/python-for-android/python-modules/twisted/twisted/application/app.py/ProfileRunner.run