class_docstr: Differ is a class for comparing sequences of lines of text, and
  producing human-readable differences or deltas.  Differ uses
  SequenceMatcher both to compare sequences of lines, and to compare
  sequences of characters within similar (near-matching) lines.
  
  Each line of a Differ delta begins with a two-letter code:
  
      '- '    line unique to sequence 1
      '+ '    line unique to sequence 2
      '  '    line common to both sequences
      '? '    line not present in either input sequence
  
  Lines beginning with '? ' attempt to guide the eye to intraline
  differences, and were not present in either input sequence.  These lines
  can be confusing if the sequences contain tab characters.
  
  Note that Differ makes no claim to produce a *minimal* diff.  To the
  contrary, minimal diffs are often counter-intuitive, because they synch
  up anywhere possible, sometimes accidental matches 100 pages apart.
  Restricting synch points to contiguous matches preserves some notion of
  locality, at the occasional cost of producing a longer diff.
  
  Example: Comparing two texts.
  
  First we set up the texts, sequences of individual single-line strings
  ending with newlines (such sequences can also be obtained from the
  `readlines()` method of file-like objects):
  
  >>> text1 = '''  1. Beautiful is better than ugly.
  ...   2. Explicit is better than implicit.
  ...   3. Simple is better than complex.
  ...   4. Complex is better than complicated.
  ... '''.splitlines(keepends=True)
  >>> len(text1)
  4
  >>> text1[0][-1]
  '\n'
  >>> text2 = '''  1. Beautiful is better than ugly.
  ...   3.   Simple is better than complex.
  ...   4. Complicated is better than complex.
  ...   5. Flat is better than nested.
  ... '''.splitlines(keepends=True)
  
  Next we instantiate a Differ object:
  
  >>> d = Differ()
  
  Note that when instantiating a Differ object we may pass functions to
  filter out line and character 'junk'.  See Differ.__init__ for details.
  
  Finally, we compare the two:
  
  >>> result = list(d.compare(text1, text2))
  
  'result' is a list of strings, so let's pretty-print it:
  
  >>> from pprint import pprint as _pprint
  >>> _pprint(result)
  ['    1. Beautiful is better than ugly.\n',
   '-   2. Explicit is better than implicit.\n',
   '-   3. Simple is better than complex.\n',
   '+   3.   Simple is better than complex.\n',
   '?     ++\n',
   '-   4. Complex is better than complicated.\n',
   '?            ^                     ---- ^\n',
   '+   4. Complicated is better than complex.\n',
   '?           ++++ ^                      ^\n',
   '+   5. Flat is better than nested.\n']
  
  As a single multi-line string it looks like this:
  
  >>> print(''.join(result), end="")
      1. Beautiful is better than ugly.
  -   2. Explicit is better than implicit.
  -   3. Simple is better than complex.
  +   3.   Simple is better than complex.
  ?     ++
  -   4. Complex is better than complicated.
  ?            ^                     ---- ^
  +   4. Complicated is better than complex.
  ?           ++++ ^                      ^
  +   5. Flat is better than nested.
docstr: Format "?" output and deal with tabs.
  
  Example:
  
  >>> d = Differ()
  >>> results = d._qformat('\tabcDefghiJkl\n', '\tabcdefGhijkl\n',
  ...                      '  ^ ^  ^      ', '  ^ ^  ^      ')
  >>> for line in results: print(repr(line))
  ...
  '- \tabcDefghiJkl\n'
  '? \t ^ ^  ^\n'
  '+ \tabcdefGhijkl\n'
  '? \t ^ ^  ^\n'
docstr_tok: ["Format","``","?","''","output","and","deal","with","tabs",".","Example",":",">",">",">","d","=","Differ","(",")",">",">",">","results","=","d._qformat","(","'\\tabcDefghiJkl\\n","'",",","'\\tabcdefGhijkl\\n","'",",","...","'","^","^","^","'",",","'","^","^","^","'",")",">",">",">","for","line","in","results",":","print","(","repr","(","line",")",")","...","'-","\\tabcDefghiJkl\\n'","'","?","\\t","^","^","^\\n'","'+","\\tabcdefGhijkl\\n'","'","?","\\t","^","^","^\\n","'"]
code: def _qformat(self, aline, bline, atags, btags):
      r"""
      Format "?" output and deal with tabs.
  
      Example:
  
      >>> d = Differ()
      >>> results = d._qformat('\tabcDefghiJkl\n', '\tabcdefGhijkl\n',
      ...                      '  ^ ^  ^      ', '  ^ ^  ^      ')
      >>> for line in results: print(repr(line))
      ...
      '- \tabcDefghiJkl\n'
      '? \t ^ ^  ^\n'
      '+ \tabcdefGhijkl\n'
      '? \t ^ ^  ^\n'
      """
      atags = _keep_original_ws(aline, atags).rstrip()
      btags = _keep_original_ws(bline, btags).rstrip()
  
      yield "- " + aline
      if atags:
          yield f"? {atags}\n"
  
      yield "+ " + bline
      if btags:
          yield f"? {btags}\n"
  
imports: from heapq import nlargest
  from collections import namedtuple
  from types import GenericAlias
  import re
label_desc: Use image node_id 7 for calling the Differ obj's underlying member method code with example usage: obj._qformat(aline, bline, atags, btags) without return types