class_docstr: For producing HTML side by side comparison with change highlights.
  
  This class can be used to create an HTML table (or a complete HTML file
  containing the table) showing a side by side, line by line comparison
  of text with inter-line and intra-line change highlights.  The table can
  be generated in either full or contextual difference mode.
  
  The following methods are provided for HTML generation:
  
  make_table -- generates HTML for a single side by side table
  make_file -- generates complete HTML file with a single side by side table
  
  See tools/scripts/diff.py for an example usage of this class.
docstr: Makes list of "next" links
docstr_tok: ["Makes","list","of","``","next","''","links"]
code: def _convert_flags(
      self, fromlist, tolist, flaglist, context, numlines
  ):
      """Makes list of "next" links"""
  
      # all anchor names will be generated using the unique "to" prefix
      toprefix = self._prefix[1]
  
      # process change flags, generating middle column of next anchors/links
      next_id = [""] * len(flaglist)
      next_href = [""] * len(flaglist)
      num_chg, in_change = 0, False
      last = 0
      for i, flag in enumerate(flaglist):
          if flag:
              if not in_change:
                  in_change = True
                  last = i
                  # at the beginning of a change, drop an anchor a few lines
                  # (the context lines) before the change for the previous
                  # link
                  i = max([0, i - numlines])
                  next_id[i] = ' id="difflib_chg_%s_%d"' % (
                      toprefix,
                      num_chg,
                  )
                  # at the beginning of a change, drop a link to the next
                  # change
                  num_chg += 1
                  next_href[
                      last
                  ] = '<a href="#difflib_chg_%s_%d">n</a>' % (
                      toprefix,
                      num_chg,
                  )
          else:
              in_change = False
      # check for cases where there is no content to avoid exceptions
      if not flaglist:
          flaglist = [False]
          next_id = [""]
          next_href = [""]
          last = 0
          if context:
              fromlist = [
                  "<td></td><td>&nbsp;No Differences Found&nbsp;</td>"
              ]
              tolist = fromlist
          else:
              fromlist = tolist = [
                  "<td></td><td>&nbsp;Empty File&nbsp;</td>"
              ]
      # if not a change on first line, drop a link
      if not flaglist[0]:
          next_href[0] = '<a href="#difflib_chg_%s_0">f</a>' % toprefix
      # redo the last link to link to the top
      next_href[last] = '<a href="#difflib_chg_%s_top">t</a>' % (
          toprefix
      )
  
      return fromlist, tolist, flaglist, next_href, next_id
  
imports: from heapq import nlargest
  from collections import namedtuple
  from types import GenericAlias
  import re
label_desc: Use image node_id 9 for calling the HtmlDiff obj's underlying member method code with example usage: obj._convert_flags(fromlist, tolist, flaglist, context, numlines) and returns: fromlist,  tolist,  flaglist,  next_href,  next_id