亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關于我們
? 蟲蟲下載站

?? profile.py

?? mallet是自然語言處理、機器學習領域的一個開源項目。
?? PY
?? 第 1 頁 / 共 2 頁
字號:
            assert frame is self.cur[-2].f_back, ("Bad return", self.cur[-3])            self.trace_dispatch_return(self.cur[-2], 0)        # Prefix "r" means part of the Returning or exiting frame.        # Prefix "p" means part of the Previous or Parent or older frame.        rpt, rit, ret, rfn, frame, rcur = self.cur        rit = rit + t        frame_total = rit + ret        ppt, pit, pet, pfn, pframe, pcur = rcur        self.cur = ppt, pit + rpt, pet + frame_total, pfn, pframe, pcur        timings = self.timings        cc, ns, tt, ct, callers = timings[rfn]        if not ns:            # This is the only occurrence of the function on the stack.            # Else this is a (directly or indirectly) recursive call, and            # its cumulative time will get updated when the topmost call to            # it returns.            ct = ct + frame_total            cc = cc + 1        if callers.has_key(pfn):            callers[pfn] = callers[pfn] + 1  # hack: gather more            # stats such as the amount of time added to ct courtesy            # of this specific call, and the contribution to cc            # courtesy of this call.        else:            callers[pfn] = 1        timings[rfn] = cc, ns - 1, tt + rit, ct, callers        return 1    dispatch = {        "call": trace_dispatch_call,        "exception": trace_dispatch_exception,        "return": trace_dispatch_return,        }    # The next few functions play with self.cmd. By carefully preloading    # our parallel stack, we can force the profiled result to include    # an arbitrary string as the name of the calling function.    # We use self.cmd as that string, and the resulting stats look    # very nice :-).    def set_cmd(self, cmd):        if self.cur[-1]: return   # already set        self.cmd = cmd        self.simulate_call(cmd)    class fake_code:        def __init__(self, filename, line, name):            self.co_filename = filename            self.co_line = line            self.co_name = name            self.co_firstlineno = 0        def __repr__(self):            return repr((self.co_filename, self.co_line, self.co_name))    class fake_frame:        def __init__(self, code, prior):            self.f_code = code            self.f_back = prior    def simulate_call(self, name):        code = self.fake_code('profile', 0, name)        if self.cur:            pframe = self.cur[-2]        else:            pframe = None        frame = self.fake_frame(code, pframe)        self.dispatch['call'](self, frame, 0)    # collect stats from pending stack, including getting final    # timings for self.cmd frame.    def simulate_cmd_complete(self):        get_time = self.get_time        t = get_time() - self.t        while self.cur[-1]:            # We *can* cause assertion errors here if            # dispatch_trace_return checks for a frame match!            self.dispatch['return'](self, self.cur[-2], t)            t = 0        self.t = get_time() - t    def print_stats(self):        import pstats        pstats.Stats(self).strip_dirs().sort_stats(-1). \                  print_stats()    def dump_stats(self, file):        f = open(file, 'wb')        self.create_stats()        marshal.dump(self.stats, f)        f.close()    def create_stats(self):        self.simulate_cmd_complete()        self.snapshot_stats()    def snapshot_stats(self):        self.stats = {}        for func in self.timings.keys():            cc, ns, tt, ct, callers = self.timings[func]            callers = callers.copy()            nc = 0            for func_caller in callers.keys():                nc = nc + callers[func_caller]            self.stats[func] = cc, nc, tt, ct, callers    # The following two methods can be called by clients to use    # a profiler to profile a statement, given as a string.    def run(self, cmd):        import __main__        dict = __main__.__dict__        return self.runctx(cmd, dict, dict)    def runctx(self, cmd, globals, locals):        self.set_cmd(cmd)        sys.setprofile(self.dispatcher)        try:            exec cmd in globals, locals        finally:            sys.setprofile(None)        return self    # This method is more useful to profile a single function call.    def runcall(self, func, *args, **kw):        self.set_cmd(`func`)        sys.setprofile(self.dispatcher)        try:            return apply(func, args, kw)        finally:            sys.setprofile(None)    #******************************************************************    # The following calculates the overhead for using a profiler.  The    # problem is that it takes a fair amount of time for the profiler    # to stop the stopwatch (from the time it receives an event).    # Similarly, there is a delay from the time that the profiler    # re-starts the stopwatch before the user's code really gets to    # continue.  The following code tries to measure the difference on    # a per-event basis.    #    # Note that this difference is only significant if there are a lot of    # events, and relatively little user code per event.  For example,    # code with small functions will typically benefit from having the    # profiler calibrated for the current platform.  This *could* be    # done on the fly during init() time, but it is not worth the    # effort.  Also note that if too large a value specified, then    # execution time on some functions will actually appear as a    # negative number.  It is *normal* for some functions (with very    # low call counts) to have such negative stats, even if the    # calibration figure is "correct."    #    # One alternative to profile-time calibration adjustments (i.e.,    # adding in the magic little delta during each event) is to track    # more carefully the number of events (and cumulatively, the number    # of events during sub functions) that are seen.  If this were    # done, then the arithmetic could be done after the fact (i.e., at    # display time).  Currently, we track only call/return events.    # These values can be deduced by examining the callees and callers    # vectors for each functions.  Hence we *can* almost correct the    # internal time figure at print time (note that we currently don't    # track exception event processing counts).  Unfortunately, there    # is currently no similar information for cumulative sub-function    # time.  It would not be hard to "get all this info" at profiler    # time.  Specifically, we would have to extend the tuples to keep    # counts of this in each frame, and then extend the defs of timing    # tuples to include the significant two figures. I'm a bit fearful    # that this additional feature will slow the heavily optimized    # event/time ratio (i.e., the profiler would run slower, fur a very    # low "value added" feature.)    #**************************************************************    def calibrate(self, m, verbose=0):        if self.__class__ is not Profile:            raise TypeError("Subclasses must override .calibrate().")        saved_bias = self.bias        self.bias = 0        try:            return self._calibrate_inner(m, verbose)        finally:            self.bias = saved_bias    def _calibrate_inner(self, m, verbose):        get_time = self.get_time        # Set up a test case to be run with and without profiling.  Include        # lots of calls, because we're trying to quantify stopwatch overhead.        # Do not raise any exceptions, though, because we want to know        # exactly how many profile events are generated (one call event, +        # one return event, per Python-level call).        def f1(n):            for i in range(n):                x = 1        def f(m, f1=f1):            for i in range(m):                f1(100)        f(m)    # warm up the cache        # elapsed_noprofile <- time f(m) takes without profiling.        t0 = get_time()        f(m)        t1 = get_time()        elapsed_noprofile = t1 - t0        if verbose:            print "elapsed time without profiling =", elapsed_noprofile        # elapsed_profile <- time f(m) takes with profiling.  The difference        # is profiling overhead, only some of which the profiler subtracts        # out on its own.        p = Profile()        t0 = get_time()        p.runctx('f(m)', globals(), locals())        t1 = get_time()        elapsed_profile = t1 - t0        if verbose:            print "elapsed time with profiling =", elapsed_profile        # reported_time <- "CPU seconds" the profiler charged to f and f1.        total_calls = 0.0        reported_time = 0.0        for (filename, line, funcname), (cc, ns, tt, ct, callers) in \                p.timings.items():            if funcname in ("f", "f1"):                total_calls += cc                reported_time += tt        if verbose:            print "'CPU seconds' profiler reported =", reported_time            print "total # calls =", total_calls        if total_calls != m + 1:            raise ValueError("internal error: total calls = %d" % total_calls)        # reported_time - elapsed_noprofile = overhead the profiler wasn't        # able to measure.  Divide by twice the number of calls (since there        # are two profiler events per call in this test) to get the hidden        # overhead per event.        mean = (reported_time - elapsed_noprofile) / 2.0 / total_calls        if verbose:            print "mean stopwatch overhead per profile event =", mean        return mean#****************************************************************************def Stats(*args):    print 'Report generating functions are in the "pstats" module\a'# When invoked as main program, invoke the profiler on a scriptif __name__ == '__main__':    if not sys.argv[1:]:        print "usage: profile.py scriptfile [arg] ..."        sys.exit(2)    filename = sys.argv[1]  # Get script filename    del sys.argv[0]         # Hide "profile.py" from argument list    # Insert script directory in front of module search path    sys.path.insert(0, os.path.dirname(filename))    run('execfile(' + `filename` + ')')

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
国产麻豆成人精品| 欧美一区二区三区在线观看| 色欧美日韩亚洲| 欧美久久一二区| 欧美国产亚洲另类动漫| 无码av中文一区二区三区桃花岛| 国精产品一区一区三区mba视频 | 久久精品视频一区二区三区| 一区二区三区精品| 一区二区三区四区在线免费观看| 日本视频中文字幕一区二区三区| 99久久精品久久久久久清纯| 欧美精品一区二区三区在线 | 日本韩国欧美三级| 国产欧美一区视频| 男人的j进女人的j一区| 91女厕偷拍女厕偷拍高清| 日韩一二三区视频| 亚洲chinese男男1069| 成人sese在线| 国产欧美一区二区精品仙草咪| 日韩专区在线视频| 欧美亚洲高清一区| 亚洲天天做日日做天天谢日日欢 | 国产精品久久久久久福利一牛影视| 日韩不卡一二三区| 欧美欧美午夜aⅴ在线观看| 国产精品国产三级国产aⅴ无密码| 精品一区二区三区在线播放| 欧美精品第一页| 亚洲丰满少妇videoshd| 欧洲精品视频在线观看| 一区二区三国产精华液| 一本到一区二区三区| 国产精品护士白丝一区av| 懂色av噜噜一区二区三区av| 国产午夜亚洲精品不卡| 国产一区二区三区免费播放| 欧美精品一区二区三区视频| 国产一区二区三区四区在线观看| 久久亚洲一级片| 国产乱人伦精品一区二区在线观看 | 精品国产麻豆免费人成网站| 麻豆精品蜜桃视频网站| 日韩精品专区在线| 国产乱淫av一区二区三区 | 久久天堂av综合合色蜜桃网| 色偷偷久久人人79超碰人人澡| 国产精品嫩草99a| 91在线精品一区二区三区| 一区在线播放视频| 欧美亚洲日本一区| 免费人成黄页网站在线一区二区| 日韩小视频在线观看专区| 精品中文字幕一区二区| 亚洲国产精品高清| 一本到不卡免费一区二区| 天天色综合天天| 久久综合九色综合久久久精品综合 | 欧美激情一区二区三区不卡| 91香蕉视频污在线| 日韩专区中文字幕一区二区| 久久久亚洲精品石原莉奈| eeuss鲁片一区二区三区在线看| 亚洲激情男女视频| 日韩欧美在线1卡| 成人黄色片在线观看| 一区二区三区资源| 日韩精品一区二区三区老鸭窝| 国产寡妇亲子伦一区二区| 亚洲精品一二三| 欧美一区二区三区的| 成人免费毛片嘿嘿连载视频| 一区二区三区日韩欧美精品| 日韩欧美国产一区二区在线播放 | 蜜桃av噜噜一区| 国产精品不卡在线观看| 欧美日韩久久一区| 成人一区二区在线观看| 五月婷婷久久丁香| 国产精品嫩草久久久久| 日韩午夜激情电影| 在线一区二区视频| 国产一区二区女| 亚洲电影视频在线| 国产精品美女久久福利网站| 欧美精品三级在线观看| 成人精品电影在线观看| 美日韩一区二区| 亚洲一区二区黄色| 国产精品乱子久久久久| 欧美一二三区在线观看| 日本乱人伦aⅴ精品| 国产一区999| 日韩精品色哟哟| 一区二区三区色| 最新国产成人在线观看| 精品成人免费观看| 宅男噜噜噜66一区二区66| 色成人在线视频| 成人aa视频在线观看| 国产美女精品一区二区三区| 日韩制服丝袜先锋影音| 亚洲乱码国产乱码精品精小说| 久久理论电影网| 欧美mv和日韩mv国产网站| 欧美亚一区二区| 91视频你懂的| 成人午夜激情在线| 国产精品99久久久久| 久久国产精品99精品国产| 日韩成人午夜电影| 日韩国产一区二| 五月天一区二区三区| 亚洲一区国产视频| 一区二区三区日韩在线观看| 国产精品激情偷乱一区二区∴| 久久久久久黄色| 精品成人一区二区| 国产欧美一区二区精品性| 国产视频一区不卡| 国产视频911| 国产精品亲子伦对白| 国产日产亚洲精品系列| 国产精品天干天干在观线| 国产女主播视频一区二区| 国产欧美一区二区精品秋霞影院| 国产色爱av资源综合区| 中文乱码免费一区二区| 亚洲天堂av老司机| 一区二区三区免费在线观看| 亚洲国产精品久久久男人的天堂| 亚洲成人福利片| 免费在线观看视频一区| 国产在线观看一区二区| 国产精品一区二区x88av| 丁香婷婷深情五月亚洲| 91在线视频免费观看| 欧美性色欧美a在线播放| 8v天堂国产在线一区二区| 欧美mv日韩mv国产| 国产精品―色哟哟| 一区二区理论电影在线观看| 午夜精品久久久久久久99水蜜桃| 日本麻豆一区二区三区视频| 国产一区二区在线观看免费 | 亚洲v中文字幕| 久久精品国产99| 国产成人免费视频网站高清观看视频 | 91在线精品一区二区三区| 欧美日韩一区二区在线观看视频| 欧美一区二区三区在线观看| 国产日韩欧美高清在线| 亚洲综合色视频| 国内欧美视频一区二区| 99久久久无码国产精品| 91精品国产综合久久久久久久久久| 久久久影视传媒| 亚洲尤物在线视频观看| 国产一区二区三区四区五区美女| 91丨九色丨尤物| 精品国产在天天线2019| 亚洲精品国产高清久久伦理二区 | 亚洲色图视频免费播放| 蜜桃久久精品一区二区| 一本色道久久综合亚洲精品按摩| 日韩午夜小视频| 亚洲日本电影在线| 国产在线精品国自产拍免费| 色噜噜久久综合| 国产欧美一区视频| 图片区小说区区亚洲影院| 97se亚洲国产综合自在线| 日韩欧美美女一区二区三区| 亚洲精品国产成人久久av盗摄 | 国产黄人亚洲片| 91.麻豆视频| 一区二区三区四区不卡在线 | 一本大道综合伊人精品热热| 精品国产一二三| 丝袜诱惑亚洲看片| 92精品国产成人观看免费| 精品裸体舞一区二区三区| 五月天欧美精品| 在线精品视频一区二区三四| 日本一区免费视频| 精品一区二区免费在线观看| 在线播放中文一区| 亚洲制服欧美中文字幕中文字幕| 国产91富婆露脸刺激对白| 久久综合色之久久综合| 久久国产精品无码网站| 欧美精品日韩精品| 亚洲自拍偷拍九九九| 日本高清不卡在线观看| 亚洲另类中文字| 91浏览器入口在线观看| 亚洲精品一二三四区| 91麻豆免费在线观看| 成人免费小视频|