Path 1: 179 calls (1.0)

IS_CHARACTER_JUNK def (93) None (81) TestWithAscii.test_bjunk.. def (3) def (2)

'' (105) ['hello', 'andr\udce9'] (12) ['\udca3odz is a city in Poland.'] (6) ['', ' 1. Beautiful is beTTer than ugly.', ' 2. Explicit is better th...

'' (105) ['hello', 'andr\udce9'] (6) ['hello', 'andr\udcc3\udca9'] (6) ['\udcc5\udc81odz is a city in Poland.'] (6) [] (5) 'two' (4) ['', ' 1. Beaut...

True (178) False (1)

1def __init__(self, isjunk=None, a='', b='', autojunk=True):
2        """Construct a SequenceMatcher.
3
4        Optional arg isjunk is None (the default), or a one-argument
5        function that takes a sequence element and returns true iff the
6        element is junk.  None is equivalent to passing "lambda x: 0", i.e.
7        no elements are considered to be junk.  For example, pass
8            lambda x: x in " \\t"
9        if you're comparing lines as sequences of characters, and don't
10        want to synch up on blanks or hard tabs.
11
12        Optional arg a is the first of two sequences to be compared.  By
13        default, an empty string.  The elements of a must be hashable.  See
14        also .set_seqs() and .set_seq1().
15
16        Optional arg b is the second of two sequences to be compared.  By
17        default, an empty string.  The elements of b must be hashable. See
18        also .set_seqs() and .set_seq2().
19
20        Optional arg autojunk should be set to False to disable the
21        "automatic junk heuristic" that treats popular elements as junk
22        (see module documentation for more information).
23        """
24
25        # Members:
26        # a
27        #      first sequence
28        # b
29        #      second sequence; differences are computed as "what do
30        #      we need to do to 'a' to change it into 'b'?"
31        # b2j
32        #      for x in b, b2j[x] is a list of the indices (into b)
33        #      at which x appears; junk and popular elements do not appear
34        # fullbcount
35        #      for x in b, fullbcount[x] == the number of times x
36        #      appears in b; only materialized if really needed (used
37        #      only for computing quick_ratio())
38        # matching_blocks
39        #      a list of (i, j, k) triples, where a[i:i+k] == b[j:j+k];
40        #      ascending & non-overlapping in i and in j; terminated by
41        #      a dummy (len(a), len(b), 0) sentinel
42        # opcodes
43        #      a list of (tag, i1, i2, j1, j2) tuples, where tag is
44        #      one of
45        #          'replace'   a[i1:i2] should be replaced by b[j1:j2]
46        #          'delete'    a[i1:i2] should be deleted
47        #          'insert'    b[j1:j2] should be inserted
48        #          'equal'     a[i1:i2] == b[j1:j2]
49        # isjunk
50        #      a user-supplied function taking a sequence element and
51        #      returning true iff the element is "junk" -- this has
52        #      subtle but helpful effects on the algorithm, which I'll
53        #      get around to writing up someday <0.9 wink>.
54        #      DON'T USE!  Only __chain_b uses this.  Use "in self.bjunk".
55        # bjunk
56        #      the items in b for which isjunk is True.
57        # bpopular
58        #      nonjunk items in b treated as junk by the heuristic (if used).
59
60        self.isjunk = isjunk
61        self.a = self.b = None
62        self.autojunk = autojunk
63        self.set_seqs(a, b)