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

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

?? pstats.py

?? mallet是自然語言處理、機器學習領域的一個開源項目。
?? PY
?? 第 1 頁 / 共 2 頁
字號:
"""Class for printing reports on profiled python code."""# Class for printing reports on profiled python code. rev 1.0  4/1/94## Based on prior profile module by Sjoerd Mullender...#   which was hacked somewhat by: Guido van Rossum## see profile.doc and profile.py for more info.# 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 osimport timeimport marshalimport re__all__ = ["Stats"]class Stats:    """This class is used for creating reports from data generated by the    Profile class.  It is a "friend" of that class, and imports data either    by direct access to members of Profile class, or by reading in a dictionary    that was emitted (via marshal) from the Profile class.    The big change from the previous Profiler (in terms of raw functionality)    is that an "add()" method has been provided to combine Stats from    several distinct profile runs.  Both the constructor and the add()    method now take arbitrarily many file names as arguments.    All the print methods now take an argument that indicates how many lines    to print.  If the arg is a floating point number between 0 and 1.0, then    it is taken as a decimal percentage of the available lines to be printed    (e.g., .1 means print 10% of all available lines).  If it is an integer,    it is taken to mean the number of lines of data that you wish to have    printed.    The sort_stats() method now processes some additional options (i.e., in    addition to the old -1, 0, 1, or 2).  It takes an arbitrary number of quoted    strings to select the sort order.  For example sort_stats('time', 'name')    sorts on the major key of "internal function time", and on the minor    key of 'the name of the function'.  Look at the two tables in sort_stats()    and get_sort_arg_defs(self) for more examples.    All methods now return "self",  so you can string together commands like:        Stats('foo', 'goo').strip_dirs().sort_stats('calls').\                            print_stats(5).print_callers(5)    """    def __init__(self, *args):        if not len(args):            arg = None        else:            arg = args[0]            args = args[1:]        self.init(arg)        apply(self.add, args)    def init(self, arg):        self.all_callees = None  # calc only if needed        self.files = []        self.fcn_list = None        self.total_tt = 0        self.total_calls = 0        self.prim_calls = 0        self.max_name_len = 0        self.top_level = {}        self.stats = {}        self.sort_arg_dict = {}        self.load_stats(arg)        trouble = 1        try:            self.get_top_level_stats()            trouble = 0        finally:            if trouble:                print "Invalid timing data",                if self.files: print self.files[-1],                print    def load_stats(self, arg):        if not arg:  self.stats = {}        elif type(arg) == type(""):            f = open(arg, 'rb')            self.stats = marshal.load(f)            f.close()            try:                file_stats = os.stat(arg)                arg = time.ctime(file_stats[8]) + "    " + arg            except:  # in case this is not unix                pass            self.files = [ arg ]        elif hasattr(arg, 'create_stats'):            arg.create_stats()            self.stats = arg.stats            arg.stats = {}        if not self.stats:            raise TypeError,  "Cannot create or construct a " \                      + `self.__class__` \                      + " object from '" + `arg` + "'"        return    def get_top_level_stats(self):        for func, (cc, nc, tt, ct, callers) in self.stats.items():            self.total_calls += nc            self.prim_calls  += cc            self.total_tt    += tt            if callers.has_key(("jprofile", 0, "profiler")):                self.top_level[func] = None            if len(func_std_string(func)) > self.max_name_len:                self.max_name_len = len(func_std_string(func))    def add(self, *arg_list):        if not arg_list: return self        if len(arg_list) > 1: apply(self.add, arg_list[1:])        other = arg_list[0]        if type(self) != type(other) or self.__class__ != other.__class__:            other = Stats(other)        self.files += other.files        self.total_calls += other.total_calls        self.prim_calls += other.prim_calls        self.total_tt += other.total_tt        for func in other.top_level.keys():            self.top_level[func] = None        if self.max_name_len < other.max_name_len:            self.max_name_len = other.max_name_len        self.fcn_list = None        for func in other.stats.keys():            if self.stats.has_key(func):                old_func_stat = self.stats[func]            else:                old_func_stat = (0, 0, 0, 0, {},)            self.stats[func] = add_func_stats(old_func_stat, other.stats[func])        return self    # list the tuple indices and directions for sorting,    # along with some printable description    sort_arg_dict_default = {              "calls"     : (((1,-1),              ), "call count"),              "cumulative": (((3,-1),              ), "cumulative time"),              "file"      : (((4, 1),              ), "file name"),              "line"      : (((5, 1),              ), "line number"),              "module"    : (((4, 1),              ), "file name"),              "name"      : (((6, 1),              ), "function name"),              "nfl"       : (((6, 1),(4, 1),(5, 1),), "name/file/line"),              "pcalls"    : (((0,-1),              ), "call count"),              "stdname"   : (((7, 1),              ), "standard name"),              "time"      : (((2,-1),              ), "internal time"),              }    def get_sort_arg_defs(self):        """Expand all abbreviations that are unique."""        if not self.sort_arg_dict:            self.sort_arg_dict = dict = {}            bad_list = {}            for word in self.sort_arg_dict_default.keys():                fragment = word                while fragment:                    if not fragment:                        break                    if dict.has_key(fragment):                        bad_list[fragment] = 0                        break                    dict[fragment] = self.sort_arg_dict_default[word]                    fragment = fragment[:-1]            for word in bad_list.keys():                del dict[word]        return self.sort_arg_dict    def sort_stats(self, *field):        if not field:            self.fcn_list = 0            return self        if len(field) == 1 and type(field[0]) == type(1):            # Be compatible with old profiler            field = [ {-1: "stdname",                      0:"calls",                      1:"time",                      2: "cumulative" }  [ field[0] ] ]        sort_arg_defs = self.get_sort_arg_defs()        sort_tuple = ()        self.sort_type = ""        connector = ""        for word in field:            sort_tuple = sort_tuple + sort_arg_defs[word][0]            self.sort_type += connector + sort_arg_defs[word][1]            connector = ", "        stats_list = []        for func in self.stats.keys():            cc, nc, tt, ct, callers = self.stats[func]            stats_list.append((cc, nc, tt, ct) + func +                              (func_std_string(func), func))        stats_list.sort(TupleComp(sort_tuple).compare)        self.fcn_list = fcn_list = []        for tuple in stats_list:            fcn_list.append(tuple[-1])        return self    def reverse_order(self):        if self.fcn_list:            self.fcn_list.reverse()        return self    def strip_dirs(self):        oldstats = self.stats        self.stats = newstats = {}        max_name_len = 0        for func in oldstats.keys():            cc, nc, tt, ct, callers = oldstats[func]            newfunc = func_strip_path(func)            if len(func_std_string(newfunc)) > max_name_len:                max_name_len = len(func_std_string(newfunc))            newcallers = {}            for func2 in callers.keys():                newcallers[func_strip_path(func2)] = callers[func2]            if newstats.has_key(newfunc):                newstats[newfunc] = add_func_stats(                                        newstats[newfunc],                                        (cc, nc, tt, ct, newcallers))            else:                newstats[newfunc] = (cc, nc, tt, ct, newcallers)        old_top = self.top_level        self.top_level = new_top = {}        for func in old_top.keys():            new_top[func_strip_path(func)] = None        self.max_name_len = max_name_len        self.fcn_list = None        self.all_callees = None        return self    def calc_callees(self):        if self.all_callees: return        self.all_callees = all_callees = {}        for func in self.stats.keys():            if not all_callees.has_key(func):                all_callees[func] = {}            cc, nc, tt, ct, callers = self.stats[func]            for func2 in callers.keys():                if not all_callees.has_key(func2):                    all_callees[func2] = {}                all_callees[func2][func]  = callers[func2]        return    #******************************************************************    # The following functions support actual printing of reports    #******************************************************************    # Optional "amount" is either a line count, or a percentage of lines.    def eval_print_amount(self, sel, list, msg):        new_list = list        if type(sel) == type(""):            new_list = []            for func in list:                if re.search(sel, func_std_string(func)):                    new_list.append(func)        else:            count = len(list)            if type(sel) == type(1.0) and 0.0 <= sel < 1.0:                count = int(count * sel + .5)                new_list = list[:count]            elif type(sel) == type(1) and 0 <= sel < count:                count = sel                new_list = list[:count]        if len(list) != len(new_list):            msg = msg + "   List reduced from " + `len(list)` \                      + " to " + `len(new_list)` + \                      " due to restriction <" + `sel` + ">\n"        return new_list, msg    def get_print_list(self, sel_list):        width = self.max_name_len        if self.fcn_list:            list = self.fcn_list[:]            msg = "   Ordered by: " + self.sort_type + '\n'        else:            list = self.stats.keys()            msg = "   Random listing order was used\n"        for selection in sel_list:            list, msg = self.eval_print_amount(selection, list, msg)        count = len(list)        if not list:            return 0, list        print msg        if count < len(self.stats):

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
日韩国产在线观看一区| 中文字幕永久在线不卡| 亚洲男人电影天堂| 91在线观看免费视频| 亚洲视频 欧洲视频| 色综合欧美在线视频区| 一区二区三区中文在线| 777xxx欧美| 国产一区二区伦理片| 国产精品高潮呻吟| 欧美在线播放高清精品| 免费一级片91| 国产三级欧美三级| 成人av网站在线| 亚洲国产精品久久久久婷婷884| 欧美视频在线一区二区三区| 久久99精品视频| 国产精品久久二区二区| 欧美日韩精品一区二区在线播放| 视频一区二区三区中文字幕| 欧美精品一区二| 91在线视频免费观看| 石原莉奈在线亚洲三区| 国产欧美一区二区三区在线老狼| 色狠狠一区二区三区香蕉| 美女网站视频久久| 亚洲免费毛片网站| 精品成人免费观看| 色哟哟欧美精品| 国产麻豆一精品一av一免费 | 欧美视频一区二区三区在线观看| 麻豆高清免费国产一区| 自拍偷在线精品自拍偷无码专区| 欧美日本视频在线| 99在线精品视频| 国产一区二三区| 亚洲国产日日夜夜| 欧美极品另类videosde| 日韩欧美中文字幕精品| 日本乱人伦aⅴ精品| 国产久卡久卡久卡久卡视频精品| 亚洲国产欧美在线| ...xxx性欧美| 国产精品全国免费观看高清 | 一区二区三区四区精品在线视频 | 国产精品理论在线观看| 日韩精品中文字幕一区二区三区| 色婷婷精品大视频在线蜜桃视频| 国产麻豆精品95视频| 天天综合色天天| 亚洲日本电影在线| 国产欧美久久久精品影院| 欧美一区二区三区在线| 欧美午夜理伦三级在线观看| 波多野结衣亚洲| 国产精品一区专区| 韩国v欧美v日本v亚洲v| 蜜桃av噜噜一区二区三区小说| 1区2区3区精品视频| 久久精品亚洲精品国产欧美kt∨| 欧美一区二区福利在线| 欧美日韩高清不卡| 色天使久久综合网天天| 91网页版在线| 99久久精品情趣| 91丨porny丨国产入口| 成人午夜免费av| 成人永久aaa| 成人激情免费视频| av激情综合网| 91免费观看视频| 91麻豆高清视频| 色婷婷精品大在线视频| 在线观看成人免费视频| 一本到高清视频免费精品| 91视频精品在这里| 日本高清视频一区二区| 欧美日韩视频在线第一区| 欧美日韩久久久一区| 欧美日韩精品欧美日韩精品| 欧美少妇一区二区| 91麻豆精品国产| 欧美mv和日韩mv的网站| 亚洲欧美偷拍三级| 一区二区三区在线免费视频| 一区二区三区不卡视频| 天堂久久久久va久久久久| 奇米一区二区三区| 国产精品中文字幕日韩精品| 国产资源精品在线观看| 国产成人精品免费看| bt欧美亚洲午夜电影天堂| 91久久免费观看| 337p亚洲精品色噜噜| 欧美精品一区二区三区久久久| 日本一区二区三级电影在线观看 | 国产丝袜在线精品| 中文字幕在线观看一区| 亚洲国产sm捆绑调教视频 | 激情另类小说区图片区视频区| 精品一区二区三区免费毛片爱| 国产精品白丝jk黑袜喷水| 成+人+亚洲+综合天堂| 欧美日韩在线直播| 精品成人私密视频| 一区二区三区在线免费观看 | 午夜精品福利在线| 国产九色sp调教91| 欧洲一区在线电影| 日韩欧美在线123| 国产欧美久久久精品影院| 亚洲国产精品久久不卡毛片| 九九久久精品视频| 成人av免费在线观看| 91精品国产色综合久久ai换脸| 久久午夜电影网| 亚洲影院理伦片| 国产一区不卡视频| 色婷婷av一区二区三区大白胸 | 久久精品夜夜夜夜久久| 亚洲另类春色校园小说| 9久草视频在线视频精品| 欧美三级一区二区| 国产欧美日韩综合| 婷婷综合久久一区二区三区| 成人免费看黄yyy456| 欧美日韩三级一区| 中文字幕一区二区在线观看| 免费成人你懂的| 欧美自拍偷拍午夜视频| 国产午夜精品一区二区| 日韩精品成人一区二区在线| 91视频.com| 欧美国产丝袜视频| 另类小说图片综合网| 欧美亚洲日本国产| 国产精品沙发午睡系列990531| 天天影视网天天综合色在线播放| 成人晚上爱看视频| 久久这里只有精品视频网| 午夜精品久久久| 在线免费观看成人短视频| 中文字幕 久热精品 视频在线 | 国产精品二三区| 国产一级精品在线| 日韩精品专区在线影院观看| 天天操天天干天天综合网| 91搞黄在线观看| 亚洲欧美影音先锋| 国产91精品一区二区麻豆网站| 日韩精品自拍偷拍| 丝袜美腿高跟呻吟高潮一区| 色88888久久久久久影院野外| 日本一区二区三区电影| 国产精品亚洲视频| 久久九九国产精品| 国产麻豆精品theporn| 精品国产乱码久久久久久影片| 日韩精品欧美精品| 欧美性受xxxx| 亚洲国产日产av| 欧美日韩中文国产| 亚洲6080在线| 欧美日韩久久一区| 日韩av不卡在线观看| 日韩三级免费观看| 日本伊人色综合网| 日韩欧美色电影| 国产在线播精品第三| 亚洲一区日韩精品中文字幕| 色婷婷综合激情| 夜夜精品视频一区二区| 欧美日韩国产免费| 蜜桃视频在线观看一区| 日韩欧美在线观看一区二区三区| 久久国产视频网| 久久精品日产第一区二区三区高清版| 国产伦精品一区二区三区在线观看| 久久青草欧美一区二区三区| 国产91综合网| 亚洲欧美激情在线| 欧美色图第一页| 韩国成人在线视频| 成人国产在线观看| 91小视频免费看| 亚洲另类中文字| 欧美日韩国产一级片| 免费人成精品欧美精品| 欧美精品一区二区蜜臀亚洲| 国产91清纯白嫩初高中在线观看| 中文字幕欧美日本乱码一线二线| 成人理论电影网| 亚洲日韩欧美一区二区在线| 欧美日韩中文一区| 久久69国产一区二区蜜臀| 国产精品不卡视频| 777奇米四色成人影色区| 国产一区二区三区精品视频| 亚洲黄一区二区三区| 日韩亚洲欧美一区二区三区|