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

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

?? difflib.py

?? PHP寫的圖片查看器
?? PY
?? 第 1 頁 / 共 2 頁
字號:
#! /usr/bin/env python# Backported to Python 1.5.2 for the ViewCVS project by pf@artcom-gmbh.de# 24-Dec-2001, original version "stolen" from Python-2.1.1"""Module difflib -- helpers for computing deltas between objects.Function get_close_matches(word, possibilities, n=3, cutoff=0.6):    Use SequenceMatcher to return list of the best "good enough" matches.    word is a sequence for which close matches are desired (typically a    string).    possibilities is a list of sequences against which to match word    (typically a list of strings).    Optional arg n (default 3) is the maximum number of close matches to    return.  n must be > 0.    Optional arg cutoff (default 0.6) is a float in [0, 1].  Possibilities    that don't score at least that similar to word are ignored.    The best (no more than n) matches among the possibilities are returned    in a list, sorted by similarity score, most similar first.    >>> get_close_matches("appel", ["ape", "apple", "peach", "puppy"])    ['apple', 'ape']    >>> import keyword    >>> get_close_matches("wheel", keyword.kwlist)    ['while']    >>> get_close_matches("apple", keyword.kwlist)    []    >>> get_close_matches("accept", keyword.kwlist)    ['except']Class SequenceMatcherSequenceMatcher is a flexible class for comparing pairs of sequences of anytype, so long as the sequence elements are hashable.  The basic algorithmpredates, and is a little fancier than, an algorithm published in the late1980's by Ratcliff and Obershelp under the hyperbolic name "gestalt patternmatching".  The basic idea is to find the longest contiguous matchingsubsequence that contains no "junk" elements (R-O doesn't address junk).The same idea is then applied recursively to the pieces of the sequences tothe left and to the right of the matching subsequence.  This does not yieldminimal edit sequences, but does tend to yield matches that "look right"to people.Example, comparing two strings, and considering blanks to be "junk":>>> s = SequenceMatcher(lambda x: x == " ",...                     "private Thread currentThread;",...                     "private volatile Thread currentThread;")>>>.ratio() returns a float in [0, 1], measuring the "similarity" of thesequences.  As a rule of thumb, a .ratio() value over 0.6 means thesequences are close matches:>>> print round(s.ratio(), 3)0.866>>>If you're only interested in where the sequences match,.get_matching_blocks() is handy:>>> for block in s.get_matching_blocks():...     print "a[%d] and b[%d] match for %d elements" % blocka[0] and b[0] match for 8 elementsa[8] and b[17] match for 6 elementsa[14] and b[23] match for 15 elementsa[29] and b[38] match for 0 elementsNote that the last tuple returned by .get_matching_blocks() is always adummy, (len(a), len(b), 0), and this is the only case in which the lasttuple element (number of elements matched) is 0.If you want to know how to change the first sequence into the second, use.get_opcodes():>>> for opcode in s.get_opcodes():...     print "%6s a[%d:%d] b[%d:%d]" % opcode equal a[0:8] b[0:8]insert a[8:8] b[8:17] equal a[8:14] b[17:23] equal a[14:29] b[23:38]See Tools/scripts/ndiff.py for a fancy human-friendly file differencer,which uses SequenceMatcher both to view files as sequences of lines, andlines as sequences of characters.See also function get_close_matches() in this module, which shows howsimple code building on SequenceMatcher can be used to do useful work.Timing:  Basic R-O is cubic time worst case and quadratic time expectedcase.  SequenceMatcher is quadratic time for the worst case and hasexpected-case behavior dependent in a complicated way on how manyelements the sequences have in common; best case time is linear.SequenceMatcher methods:__init__(isjunk=None, a='', b='')    Construct a SequenceMatcher.    Optional arg isjunk is None (the default), or a one-argument function    that takes a sequence element and returns true iff the element is junk.    None is equivalent to passing "lambda x: 0", i.e. no elements are    considered to be junk.  For example, pass        lambda x: x in " \\t"    if you're comparing lines as sequences of characters, and don't want to    synch up on blanks or hard tabs.    Optional arg a is the first of two sequences to be compared.  By    default, an empty string.  The elements of a must be hashable.    Optional arg b is the second of two sequences to be compared.  By    default, an empty string.  The elements of b must be hashable.set_seqs(a, b)    Set the two sequences to be compared.    >>> s = SequenceMatcher()    >>> s.set_seqs("abcd", "bcde")    >>> s.ratio()    0.75set_seq1(a)    Set the first sequence to be compared.    The second sequence to be compared is not changed.    >>> s = SequenceMatcher(None, "abcd", "bcde")    >>> s.ratio()    0.75    >>> s.set_seq1("bcde")    >>> s.ratio()    1.0    >>>    SequenceMatcher computes and caches detailed information about the    second sequence, so if you want to compare one sequence S against many    sequences, use .set_seq2(S) once and call .set_seq1(x) repeatedly for    each of the other sequences.    See also set_seqs() and set_seq2().set_seq2(b)    Set the second sequence to be compared.    The first sequence to be compared is not changed.    >>> s = SequenceMatcher(None, "abcd", "bcde")    >>> s.ratio()    0.75    >>> s.set_seq2("abcd")    >>> s.ratio()    1.0    >>>    SequenceMatcher computes and caches detailed information about the    second sequence, so if you want to compare one sequence S against many    sequences, use .set_seq2(S) once and call .set_seq1(x) repeatedly for    each of the other sequences.    See also set_seqs() and set_seq1().find_longest_match(alo, ahi, blo, bhi)    Find longest matching block in a[alo:ahi] and b[blo:bhi].    If isjunk is not defined:    Return (i,j,k) such that a[i:i+k] is equal to b[j:j+k], where        alo <= i <= i+k <= ahi        blo <= j <= j+k <= bhi    and for all (i',j',k') meeting those conditions,        k >= k'        i <= i'        and if i == i', j <= j'    In other words, of all maximal matching blocks, return one that starts    earliest in a, and of all those maximal matching blocks that start    earliest in a, return the one that starts earliest in b.    >>> s = SequenceMatcher(None, " abcd", "abcd abcd")    >>> s.find_longest_match(0, 5, 0, 9)    (0, 4, 5)    If isjunk is defined, first the longest matching block is determined as    above, but with the additional restriction that no junk element appears    in the block.  Then that block is extended as far as possible by    matching (only) junk elements on both sides.  So the resulting block    never matches on junk except as identical junk happens to be adjacent    to an "interesting" match.    Here's the same example as before, but considering blanks to be junk.    That prevents " abcd" from matching the " abcd" at the tail end of the    second sequence directly.  Instead only the "abcd" can match, and    matches the leftmost "abcd" in the second sequence:    >>> s = SequenceMatcher(lambda x: x==" ", " abcd", "abcd abcd")    >>> s.find_longest_match(0, 5, 0, 9)    (1, 0, 4)    If no blocks match, return (alo, blo, 0).    >>> s = SequenceMatcher(None, "ab", "c")    >>> s.find_longest_match(0, 2, 0, 1)    (0, 0, 0)get_matching_blocks()    Return list of triples describing matching subsequences.    Each triple is of the form (i, j, n), and means that    a[i:i+n] == b[j:j+n].  The triples are monotonically increasing in i    and in j.    The last triple is a dummy, (len(a), len(b), 0), and is the only triple    with n==0.    >>> s = SequenceMatcher(None, "abxcd", "abcd")    >>> s.get_matching_blocks()    [(0, 0, 2), (3, 2, 2), (5, 4, 0)]get_opcodes()    Return list of 5-tuples describing how to turn a into b.    Each tuple is of the form (tag, i1, i2, j1, j2).  The first tuple has    i1 == j1 == 0, and remaining tuples have i1 == the i2 from the tuple    preceding it, and likewise for j1 == the previous j2.    The tags are strings, with these meanings:    'replace':  a[i1:i2] should be replaced by b[j1:j2]    'delete':   a[i1:i2] should be deleted.                Note that j1==j2 in this case.    'insert':   b[j1:j2] should be inserted at a[i1:i1].                Note that i1==i2 in this case.    'equal':    a[i1:i2] == b[j1:j2]    >>> a = "qabxcd"    >>> b = "abycdf"    >>> s = SequenceMatcher(None, a, b)    >>> for tag, i1, i2, j1, j2 in s.get_opcodes():    ...    print ("%7s a[%d:%d] (%s) b[%d:%d] (%s)" %    ...           (tag, i1, i2, a[i1:i2], j1, j2, b[j1:j2]))     delete a[0:1] (q) b[0:0] ()      equal a[1:3] (ab) b[0:2] (ab)    replace a[3:4] (x) b[2:3] (y)      equal a[4:6] (cd) b[3:5] (cd)     insert a[6:6] () b[5:6] (f)ratio()    Return a measure of the sequences' similarity (float in [0,1]).    Where T is the total number of elements in both sequences, and M is the    number of matches, this is 2,0*M / T. Note that this is 1 if the    sequences are identical, and 0 if they have nothing in common.    .ratio() is expensive to compute if you haven't already computed    .get_matching_blocks() or .get_opcodes(), in which case you may want to    try .quick_ratio() or .real_quick_ratio() first to get an upper bound.    >>> s = SequenceMatcher(None, "abcd", "bcde")    >>> s.ratio()    0.75    >>> s.quick_ratio()    0.75    >>> s.real_quick_ratio()    1.0quick_ratio()    Return an upper bound on .ratio() relatively quickly.    This isn't defined beyond that it is an upper bound on .ratio(), and    is faster to compute.real_quick_ratio():    Return an upper bound on ratio() very quickly.    This isn't defined beyond that it is an upper bound on .ratio(), and    is faster to compute than either .ratio() or .quick_ratio()."""TRACE = 0class SequenceMatcher:    def __init__(self, isjunk=None, a='', b=''):        """Construct a SequenceMatcher.        Optional arg isjunk is None (the default), or a one-argument        function that takes a sequence element and returns true iff the        element is junk. None is equivalent to passing "lambda x: 0", i.e.        no elements are considered to be junk.  For example, pass            lambda x: x in " \\t"        if you're comparing lines as sequences of characters, and don't        want to synch up on blanks or hard tabs.        Optional arg a is the first of two sequences to be compared.  By        default, an empty string.  The elements of a must be hashable.  See        also .set_seqs() and .set_seq1().        Optional arg b is the second of two sequences to be compared.  By        default, an empty string.  The elements of b must be hashable. See        also .set_seqs() and .set_seq2().        """        # Members:        # a        #      first sequence        # b        #      second sequence; differences are computed as "what do        #      we need to do to 'a' to change it into 'b'?"        # b2j        #      for x in b, b2j[x] is a list of the indices (into b)        #      at which x appears; junk elements do not appear        # b2jhas        #      b2j.has_key        # fullbcount        #      for x in b, fullbcount[x] == the number of times x        #      appears in b; only materialized if really needed (used        #      only for computing quick_ratio())        # matching_blocks        #      a list of (i, j, k) triples, where a[i:i+k] == b[j:j+k];        #      ascending & non-overlapping in i and in j; terminated by        #      a dummy (len(a), len(b), 0) sentinel        # opcodes        #      a list of (tag, i1, i2, j1, j2) tuples, where tag is        #      one of        #          'replace'   a[i1:i2] should be replaced by b[j1:j2]        #          'delete'    a[i1:i2] should be deleted        #          'insert'    b[j1:j2] should be inserted        #          'equal'     a[i1:i2] == b[j1:j2]        # isjunk        #      a user-supplied function taking a sequence element and        #      returning true iff the element is "junk" -- this has        #      subtle but helpful effects on the algorithm, which I'll        #      get around to writing up someday <0.9 wink>.        #      DON'T USE!  Only __chain_b uses this.  Use isbjunk.        # isbjunk        #      for x in b, isbjunk(x) == isjunk(x) but much faster;        #      it's really the has_key method of a hidden dict.        #      DOES NOT WORK for x in a!        self.isjunk = isjunk        self.a = self.b = None        self.set_seqs(a, b)    def set_seqs(self, a, b):        """Set the two sequences to be compared.        >>> s = SequenceMatcher()        >>> s.set_seqs("abcd", "bcde")        >>> s.ratio()        0.75        """        self.set_seq1(a)        self.set_seq2(b)    def set_seq1(self, a):        """Set the first sequence to be compared.        The second sequence to be compared is not changed.        >>> s = SequenceMatcher(None, "abcd", "bcde")        >>> s.ratio()        0.75        >>> s.set_seq1("bcde")        >>> s.ratio()        1.0        >>>        SequenceMatcher computes and caches detailed information about the        second sequence, so if you want to compare one sequence S against        many sequences, use .set_seq2(S) once and call .set_seq1(x)        repeatedly for each of the other sequences.        See also set_seqs() and set_seq2().        """        if a is self.a:            return        self.a = a        self.matching_blocks = self.opcodes = None    def set_seq2(self, b):        """Set the second sequence to be compared.        The first sequence to be compared is not changed.        >>> s = SequenceMatcher(None, "abcd", "bcde")        >>> s.ratio()        0.75        >>> s.set_seq2("abcd")

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
日韩免费观看2025年上映的电影| 欧美日韩一区中文字幕| 337p亚洲精品色噜噜| 免费成人深夜小野草| 久久人人超碰精品| 91免费在线看| 精品一区二区三区的国产在线播放 | 在线观看视频91| 中日韩av电影| 欧美日韩一级大片网址| 亚洲一区二区三区四区在线观看 | 欧美高清在线视频| www.色综合.com| 蜜臀av亚洲一区中文字幕| 国产日韩亚洲欧美综合| 欧美中文一区二区三区| 日韩精品成人一区二区在线| 欧美午夜精品一区| 91亚洲永久精品| 国产精品一区二区久激情瑜伽| 国产精品福利一区二区| 精品国产第一区二区三区观看体验| 91一区一区三区| 国产91精品久久久久久久网曝门| 日韩av不卡在线观看| 中文字幕中文字幕在线一区 | 精品国产乱码久久久久久久久| 99在线精品免费| 国内成+人亚洲+欧美+综合在线 | 久久九九影视网| 日本一区二区三区四区在线视频 | 亚洲一区二区三区四区五区黄| 亚洲欧洲日韩一区二区三区| 国产精品色一区二区三区| 欧美国产日本视频| 久久久亚洲午夜电影| 欧美日韩中文字幕一区| 欧美色电影在线| 91精品国产综合久久婷婷香蕉| 欧美一区二区网站| 国产无一区二区| 一区二区三区在线视频观看| 亚洲福利一区二区| 亚洲一区二区视频在线观看| 午夜视频久久久久久| 国产成人免费视频精品含羞草妖精| 国产精品乡下勾搭老头1| 色综合久久综合网欧美综合网| 在线精品观看国产| 久久精品免费在线观看| 亚洲蜜臀av乱码久久精品蜜桃| 日本美女视频一区二区| 麻豆国产精品官网| 91久久久免费一区二区| 精品国免费一区二区三区| 亚洲桃色在线一区| 另类小说图片综合网| 欧美日韩精品欧美日韩精品 | 久久av资源站| 99国产麻豆精品| 911精品国产一区二区在线| 久久综合九色综合欧美亚洲| 亚洲精品国产一区二区精华液| 久久成人免费日本黄色| 色综合久久综合网97色综合| 国产日韩精品一区二区浪潮av | 日本va欧美va瓶| 一本一道久久a久久精品综合蜜臀| 亚洲精品在线观| 九九国产精品视频| 在线观看免费亚洲| 一区二区三区四区国产精品| 午夜精品123| 精品88久久久久88久久久| 久久精品国产免费| 久久久久久久电影| 风间由美中文字幕在线看视频国产欧美 | 亚洲精品国产第一综合99久久 | 懂色一区二区三区免费观看| 亚洲精品一区二区三区蜜桃下载 | 一区二区三区资源| 欧美日韩精品一区二区天天拍小说 | 高清shemale亚洲人妖| 亚洲人成伊人成综合网小说| 96av麻豆蜜桃一区二区| 亚洲国产精品久久不卡毛片| 91麻豆精品国产91久久久使用方法 | 亚洲精品欧美专区| 欧美一区二区在线免费观看| 粉嫩一区二区三区性色av| 亚洲男同1069视频| 日韩女优av电影| 91麻豆国产香蕉久久精品| 午夜精品久久久久久久久久久| 精品国偷自产国产一区| 大桥未久av一区二区三区中文| 亚洲综合999| 337p粉嫩大胆噜噜噜噜噜91av| 免费在线看成人av| 1024精品合集| 久久你懂得1024| 欧美视频日韩视频| 国产一区二区三区| 一区二区三区日韩欧美| 欧美国产视频在线| 欧美视频一区二区在线观看| 乱一区二区av| 日韩电影在线观看一区| 亚洲一区在线看| 国产精品久久午夜| 国产精品乱人伦中文| 久久久久亚洲蜜桃| 久久嫩草精品久久久精品| 欧美一级免费大片| 91精品国产综合久久久久久| 欧美日韩国产欧美日美国产精品| 色综合 综合色| 欧美在线免费视屏| 在线观看精品一区| 91激情五月电影| 欧美一级片在线看| 久久这里只有精品视频网| 久久精品欧美日韩精品| 亚洲嫩草精品久久| 天天免费综合色| 亚洲精品乱码久久久久久黑人| 亚洲韩国精品一区| 蜜桃av一区二区三区| eeuss国产一区二区三区| 波多野结衣亚洲一区| 色综合久久天天| 欧美一级搡bbbb搡bbbb| 国产精品全国免费观看高清| 日韩综合一区二区| 成人午夜激情视频| 欧美午夜精品一区二区蜜桃| 精品国产制服丝袜高跟| 中文字幕日韩av资源站| 麻豆国产精品777777在线| 国产精品亚洲视频| 日韩欧美一二三四区| 亚洲国产成人va在线观看天堂| 全国精品久久少妇| 色综合天天天天做夜夜夜夜做| 日韩欧美一区电影| 一区二区三区久久久| 国产乱人伦精品一区二区在线观看 | 久久久国产精华| 亚洲成a人片综合在线| 成人精品一区二区三区中文字幕| 日韩精品一区二区三区在线| 亚洲美女在线一区| av不卡在线观看| 中文字幕一区免费在线观看| 精品一区二区三区影院在线午夜 | 91精品国产综合久久久蜜臀图片| 亚洲精品免费播放| 欧美色偷偷大香| 蜜臀av国产精品久久久久| 欧美精品 国产精品| 青青草一区二区三区| 色av成人天堂桃色av| 欧美一卡二卡三卡四卡| 亚洲成av人片一区二区梦乃| 欧美丰满一区二区免费视频| 久久99精品久久只有精品| 久久久高清一区二区三区| 国产成都精品91一区二区三| 国产精品成人一区二区三区夜夜夜| av中文字幕亚洲| 亚洲五月六月丁香激情| 精品国产一区二区三区久久影院 | 久久你懂得1024| 欧美日韩精品欧美日韩精品| 成人污视频在线观看| 亚洲va韩国va欧美va| 国产欧美精品一区二区色综合朱莉| 色婷婷激情久久| 成人晚上爱看视频| 美日韩一区二区| 午夜视频一区二区| 洋洋成人永久网站入口| 久久久国产午夜精品| 日韩一级大片在线观看| 欧美伦理影视网| 色国产精品一区在线观看| 国产91精品在线观看| 国产一区二区三区免费播放| 亚洲成av人片在线观看无码| 最好看的中文字幕久久| 欧美激情一区二区三区在线| 久久久午夜精品理论片中文字幕| 日韩欧美在线网站| 欧美va亚洲va| 欧美一区二区精美| 日韩一区二区免费在线观看| 欧美日韩亚洲不卡| 日韩色在线观看| 精品精品欲导航| 国产日韩综合av|