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

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

?? profile.py

?? mallet是自然語言處理、機器學習領域的一個開源項目。
?? PY
?? 第 1 頁 / 共 2 頁
字號:
#! /usr/bin/env python## Class for profiling python code. rev 1.0  6/2/94## Based on prior profile module by Sjoerd Mullender...#   which was hacked somewhat by: Guido van Rossum## See profile.doc for more information"""Class for profiling Python code."""# Copyright 1994, by InfoSeek Corporation, all rights reserved.# Written by James Roskind## Permission to use, copy, modify, and distribute this Python software# and its associated documentation for any purpose (subject to the# restriction in the following sentence) without fee is hereby granted,# provided that the above copyright notice appears in all copies, and# that both that copyright notice and this permission notice appear in# supporting documentation, and that the name of InfoSeek not be used in# advertising or publicity pertaining to distribution of the software# without specific, written prior permission.  This permission is# explicitly restricted to the copying and modification of the software# to remain in Python, compiled Python, or other languages (such as C)# wherein the modified or derived code is exclusively imported into a# Python module.## INFOSEEK CORPORATION DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS# SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND# FITNESS. IN NO EVENT SHALL INFOSEEK CORPORATION BE LIABLE FOR ANY# SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER# RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF# CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN# CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.import sysimport osimport timeimport marshal__all__ = ["run","help","Profile"]# Sample timer for use with#i_count = 0#def integer_timer():#       global i_count#       i_count = i_count + 1#       return i_count#itimes = integer_timer # replace with C coded timer returning integers#**************************************************************************# The following are the static member functions for the profiler class# Note that an instance of Profile() is *not* needed to call them.#**************************************************************************def run(statement, filename=None):    """Run statement under profiler optionally saving results in filename    This function takes a single argument that can be passed to the    "exec" statement, and an optional file name.  In all cases this    routine attempts to "exec" its first argument and gather profiling    statistics from the execution. If no file name is present, then this    function automatically prints a simple profiling report, sorted by the    standard name string (file/line/function-name) that is presented in    each line.    """    prof = Profile()    try:        prof = prof.run(statement)    except SystemExit:        pass    if filename is not None:        prof.dump_stats(filename)    else:        return prof.print_stats()# print helpdef help():    for dirname in sys.path:        fullname = os.path.join(dirname, 'profile.doc')        if os.path.exists(fullname):            sts = os.system('${PAGER-more} ' + fullname)            if sts: print '*** Pager exit status:', sts            break    else:        print 'Sorry, can\'t find the help file "profile.doc"',        print 'along the Python search path.'if os.name == "mac":    import MacOS    def _get_time_mac(timer=MacOS.GetTicks):        return timer() / 60.0if hasattr(os, "times"):    def _get_time_times(timer=os.times):        t = timer()        return t[0] + t[1]class Profile:    """Profiler class.    self.cur is always a tuple.  Each such tuple corresponds to a stack    frame that is currently active (self.cur[-2]).  The following are the    definitions of its members.  We use this external "parallel stack" to    avoid contaminating the program that we are profiling. (old profiler    used to write into the frames local dictionary!!) Derived classes    can change the definition of some entries, as long as they leave    [-2:] intact (frame and previous tuple).  In case an internal error is    detected, the -3 element is used as the function name.    [ 0] = Time that needs to be charged to the parent frame's function.           It is used so that a function call will not have to access the           timing data for the parent frame.    [ 1] = Total time spent in this frame's function, excluding time in           subfunctions (this latter is tallied in cur[2]).    [ 2] = Total time spent in subfunctions, excluding time executing the           frame's function (this latter is tallied in cur[1]).    [-3] = Name of the function that corresponds to this frame.    [-2] = Actual frame that we correspond to (used to sync exception handling).    [-1] = Our parent 6-tuple (corresponds to frame.f_back).    Timing data for each function is stored as a 5-tuple in the dictionary    self.timings[].  The index is always the name stored in self.cur[-3].    The following are the definitions of the members:    [0] = The number of times this function was called, not counting direct          or indirect recursion,    [1] = Number of times this function appears on the stack, minus one    [2] = Total time spent internal to this function    [3] = Cumulative time that this function was present on the stack.  In          non-recursive functions, this is the total execution time from start          to finish of each invocation of a function, including time spent in          all subfunctions.    [4] = A dictionary indicating for each function name, the number of times          it was called by us.    """    bias = 0  # calibration constant    def __init__(self, timer=None, bias=None):        self.timings = {}        self.cur = None        self.cmd = ""        if bias is None:            bias = self.bias        self.bias = bias     # Materialize in local dict for lookup speed.        if not timer:            if os.name == 'mac':                self.timer = MacOS.GetTicks                self.dispatcher = self.trace_dispatch_mac                self.get_time = _get_time_mac            elif hasattr(time, 'clock'):                self.timer = self.get_time = time.clock                self.dispatcher = self.trace_dispatch_i            elif hasattr(os, 'times'):                self.timer = os.times                self.dispatcher = self.trace_dispatch                self.get_time = _get_time_times            else:                self.timer = self.get_time = time.time                self.dispatcher = self.trace_dispatch_i        else:            self.timer = timer            t = self.timer() # test out timer function            try:                length = len(t)            except TypeError:                self.get_time = timer                self.dispatcher = self.trace_dispatch_i            else:                if length == 2:                    self.dispatcher = self.trace_dispatch                else:                    self.dispatcher = self.trace_dispatch_l                # This get_time() implementation needs to be defined                # here to capture the passed-in timer in the parameter                # list (for performance).  Note that we can't assume                # the timer() result contains two values in all                # cases.                import operator                def get_time_timer(timer=timer,                                   reduce=reduce, reducer=operator.add):                    return reduce(reducer, timer(), 0)                self.get_time = get_time_timer        self.t = self.get_time()        self.simulate_call('profiler')    # Heavily optimized dispatch routine for os.times() timer    def trace_dispatch(self, frame, event, arg):        timer = self.timer        t = timer()        t = t[0] + t[1] - self.t - self.bias        if self.dispatch[event](self, frame,t):            t = timer()            self.t = t[0] + t[1]        else:            r = timer()            self.t = r[0] + r[1] - t # put back unrecorded delta    # Dispatch routine for best timer program (return = scalar, fastest if    # an integer but float works too -- and time.clock() relies on that).    def trace_dispatch_i(self, frame, event, arg):        timer = self.timer        t = timer() - self.t - self.bias        if self.dispatch[event](self, frame,t):            self.t = timer()        else:            self.t = timer() - t  # put back unrecorded delta    # Dispatch routine for macintosh (timer returns time in ticks of    # 1/60th second)    def trace_dispatch_mac(self, frame, event, arg):        timer = self.timer        t = timer()/60.0 - self.t - self.bias        if self.dispatch[event](self, frame, t):            self.t = timer()/60.0        else:            self.t = timer()/60.0 - t  # put back unrecorded delta    # SLOW generic dispatch routine for timer returning lists of numbers    def trace_dispatch_l(self, frame, event, arg):        get_time = self.get_time        t = get_time() - self.t - self.bias        if self.dispatch[event](self, frame, t):            self.t = get_time()        else:            self.t = get_time() - t # put back unrecorded delta    # In the event handlers, the first 3 elements of self.cur are unpacked    # into vrbls w/ 3-letter names.  The last two characters are meant to be    # mnemonic:    #     _pt  self.cur[0] "parent time"   time to be charged to parent frame    #     _it  self.cur[1] "internal time" time spent directly in the function    #     _et  self.cur[2] "external time" time spent in subfunctions    def trace_dispatch_exception(self, frame, t):        rpt, rit, ret, rfn, rframe, rcur = self.cur        if (rframe is not frame) and rcur:            return self.trace_dispatch_return(rframe, t)        self.cur = rpt, rit+t, ret, rfn, rframe, rcur        return 1    def trace_dispatch_call(self, frame, t):        if self.cur and frame.f_back is not self.cur[-2]:            rpt, rit, ret, rfn, rframe, rcur = self.cur            if not isinstance(rframe, Profile.fake_frame):                assert rframe.f_back is frame.f_back, ("Bad call", rfn,                                                       rframe, rframe.f_back,                                                       frame, frame.f_back)                self.trace_dispatch_return(rframe, 0)                assert (self.cur is None or \                        frame.f_back is self.cur[-2]), ("Bad call",                                                        self.cur[-3])        fcode = frame.f_code        fn = (fcode.co_filename, fcode.co_firstlineno, fcode.co_name)        self.cur = (t, 0, 0, fn, frame, self.cur)        timings = self.timings        if timings.has_key(fn):            cc, ns, tt, ct, callers = timings[fn]            timings[fn] = cc, ns + 1, tt, ct, callers        else:            timings[fn] = 0, 0, 0, 0, {}        return 1    def trace_dispatch_return(self, frame, t):        if frame is not self.cur[-2]:

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
成人av免费在线观看| 国产一区福利在线| 日韩女优制服丝袜电影| 色综合中文字幕| 成人av网站大全| 欧美一区日本一区韩国一区| 欧美伊人久久久久久久久影院| 波多野结衣中文字幕一区二区三区| 欧美午夜精品久久久久久超碰| 久久久久久亚洲综合| 久久综合视频网| 欧美国产综合色视频| 久久久久高清精品| 丝袜国产日韩另类美女| 青娱乐精品视频| 国内精品久久久久影院一蜜桃| 国产米奇在线777精品观看| 欧美艳星brazzers| 中文字幕亚洲成人| 亚洲一区在线观看免费| 视频一区二区欧美| 91蝌蚪porny九色| 欧美日韩亚洲不卡| 久久一留热品黄| 麻豆精品一区二区三区| 国产成人鲁色资源国产91色综 | 国产一区二区三区在线观看免费| 在线观看一区二区视频| 欧美一级精品在线| 国产精品视频一二三区| 亚洲福利一区二区| 国产乱国产乱300精品| 99国产精品国产精品久久| 欧美顶级少妇做爰| 欧美激情在线一区二区三区| 国产一区二区在线免费观看| 2023国产精品自拍| 精品一区二区三区免费观看| 菠萝蜜视频在线观看一区| 欧美国产日本视频| av毛片久久久久**hd| 在线播放视频一区| 日本不卡视频在线| 精品精品欲导航| 久久毛片高清国产| 国产乱码精品一区二区三区忘忧草| 精品国产一区二区三区忘忧草| 久久精品国产亚洲a| 欧美在线免费视屏| 日本不卡不码高清免费观看| 日韩欧美一级片| 国产高清无密码一区二区三区| 日本一区二区成人| 欧美伊人精品成人久久综合97 | 国产精品美女视频| 不卡视频一二三四| 一二三区精品视频| 国产精品一二三| 国产精品无遮挡| 欧美三片在线视频观看| 免费高清在线视频一区·| 久久影院午夜论| 色哟哟欧美精品| 国产日产精品1区| 国产一区二区三区黄视频| 中文字幕人成不卡一区| 欧美视频中文字幕| 国产一区二区三区久久久| 亚洲欧美偷拍卡通变态| 北条麻妃国产九九精品视频| 一区二区三区产品免费精品久久75| 欧美高清hd18日本| 大胆亚洲人体视频| 中文字幕欧美国产| 欧美日韩亚洲综合一区| 国产盗摄视频一区二区三区| 亚洲一区二区综合| 久久久精品日韩欧美| 欧美中文字幕亚洲一区二区va在线 | 成人午夜伦理影院| 亚洲成av人片在线观看| 在线观看一区日韩| 韩国三级电影一区二区| 亚洲乱码国产乱码精品精的特点| 成人av网址在线观看| 免费av成人在线| 麻豆91在线看| 中文字幕欧美一| 欧美不卡一区二区| 欧美日韩综合在线免费观看| 成人av影院在线| 蜜臀久久99精品久久久画质超高清| 国产精品福利一区二区| 一本色道亚洲精品aⅴ| 狠狠色狠狠色综合系列| 午夜精品一区在线观看| 欧美一卡二卡在线观看| 色噜噜狠狠色综合欧洲selulu| 一区二区欧美国产| 国产精品萝li| 国产色产综合产在线视频| 91丨porny丨在线| 风间由美一区二区三区在线观看 | 欧美色窝79yyyycom| 成人动漫一区二区在线| 国产精品一线二线三线精华| 奇米色一区二区三区四区| 午夜精品一区二区三区免费视频| 一区二区三区在线播放| 国产精品久久久久久久久动漫 | 欧美日韩精品一区视频| 久久精品国产精品青草| 亚洲成av人片在线| 亚洲国产成人av| 亚洲chinese男男1069| 国产精品一区二区x88av| 日韩 欧美一区二区三区| 久久精品人人做人人综合| 日韩免费一区二区| 精品日韩一区二区| 精品免费一区二区三区| 精品国产麻豆免费人成网站| 欧美不卡视频一区| 久久人人超碰精品| 精品国产3级a| 久久亚洲二区三区| 国产午夜精品久久| 亚洲欧洲韩国日本视频| 亚洲精品国产一区二区精华液 | 国产精品入口麻豆原神| 亚洲国产精品v| 亚洲天天做日日做天天谢日日欢| 日韩一级二级三级| 日韩久久免费av| 国产日产欧美一区二区三区| 亚洲色图视频网站| 亚洲夂夂婷婷色拍ww47| 美女国产一区二区三区| 国产精品1区2区3区| 成人a级免费电影| 欧美日韩色综合| 欧美电影免费观看高清完整版在线 | 日本特黄久久久高潮| 国产真实乱对白精彩久久| 国产91在线观看| 在线一区二区三区做爰视频网站| 欧美乱妇23p| 久久久久久97三级| 亚洲精品久久7777| 精品一区二区三区日韩| 成人网页在线观看| 欧美日韩1234| 中文字幕欧美日本乱码一线二线 | 国产精品久久国产精麻豆99网站 | 国产精品剧情在线亚洲| 亚洲激情网站免费观看| 日韩电影在线观看网站| 国产传媒一区在线| 欧美日韩一卡二卡三卡| 国产人妖乱国产精品人妖| 一区二区三区高清在线| 国产精品亚洲综合一区在线观看| 91国产成人在线| 久久综合九色综合97婷婷女人| 亚洲人成网站色在线观看 | 五月天婷婷综合| 国产精品456| 91精品国产综合久久精品性色| 欧美色国产精品| 久久精品夜夜夜夜久久| 日韩激情中文字幕| 99久久99久久精品免费看蜜桃| 日韩欧美在线观看一区二区三区| 亚洲日本电影在线| 国产精品中文有码| 欧美久久久久久久久| 亚洲色图制服诱惑 | 色综合久久综合中文综合网| 精品剧情v国产在线观看在线| 亚洲欧洲综合另类| 成人一级视频在线观看| 欧美成人a在线| 婷婷夜色潮精品综合在线| 色美美综合视频| 中文字幕一区视频| 国产91色综合久久免费分享| 日韩欧美国产综合一区| 午夜不卡av在线| 欧美挠脚心视频网站| 亚洲欧美日韩国产手机在线 | 久久久久久久av麻豆果冻| 免费在线观看成人| 欧美久久婷婷综合色| 天堂午夜影视日韩欧美一区二区| av男人天堂一区| 国产精品亲子乱子伦xxxx裸| 风间由美性色一区二区三区| 国产欧美日韩三级| 成人免费高清视频| 国产精品超碰97尤物18|