class_docstr: This class connects a :class:`ColorbarBase` to a
  :class:`~matplotlib.cm.ScalarMappable` such as a
  :class:`~matplotlib.image.AxesImage` generated via
  :meth:`~matplotlib.axes.Axes.imshow`.
  
  It is not intended to be instantiated directly; instead,
  use :meth:`~matplotlib.figure.Figure.colorbar` or
  :func:`~matplotlib.pyplot.colorbar` to make your colorbar.
class_docstr_tok: ["This","class","connects","a",":","class",":","`","ColorbarBase","`","to","a",":","class",":","`","~matplotlib.cm.ScalarMappable","`","such","as","a",":","class",":","`","~matplotlib.image.AxesImage","`","generated","via",":","meth",":","`","~matplotlib.axes.Axes.imshow","`",".","It","is","not","intended","to","be","instantiated","directly",";","instead",",","use",":","meth",":","`","~matplotlib.figure.Figure.colorbar","`","or",":","func",":","`","~matplotlib.pyplot.colorbar","`","to","make","your","colorbar","."]
docstr: Add the lines from a non-filled
  :class:`~matplotlib.contour.ContourSet` to the colorbar.
  
  Set *erase* to False if these lines should be added to
  any pre-existing lines.
docstr_tok: ["Add","the","lines","from","a","non-filled",":","class",":","`","~matplotlib.contour.ContourSet","`","to","the","colorbar",".","Set","*","erase","*","to","False","if","these","lines","should","be","added","to","any","pre-existing","lines","."]
code: def add_lines(self, CS, erase=True):
      """
      Add the lines from a non-filled
      :class:`~matplotlib.contour.ContourSet` to the colorbar.
  
      Set *erase* to False if these lines should be added to
      any pre-existing lines.
      """
      if not isinstance(CS, contour.ContourSet) or CS.filled:
          raise ValueError(
              "add_lines is only for a ContourSet of lines"
          )
      tcolors = [c[0] for c in CS.tcolors]
      tlinewidths = [t[0] for t in CS.tlinewidths]
      # The following was an attempt to get the colorbar lines
      # to follow subsequent changes in the contour lines,
      # but more work is needed: specifically, a careful
      # look at event sequences, and at how
      # to make one object track another automatically.
      # tcolors = [col.get_colors()[0] for col in CS.collections]
      # tlinewidths = [col.get_linewidth()[0] for lw in CS.collections]
      ColorbarBase.add_lines(
          self, CS.levels, tcolors, tlinewidths, erase=erase
      )
  
imports: from __future__ import absolute_import, division, print_function, unicode_literals
  import six
  from six.moves import xrange, zip
  import warnings
  import numpy
  import matplotlib
  import matplotlib.artist
  import matplotlib.cbook
  import matplotlib.collections
  import matplotlib.colors
  import matplotlib.contour
  import matplotlib.cm
  import matplotlib.gridspec
  import matplotlib.patches
  import matplotlib.path
  import matplotlib.ticker
  import matplotlib.transforms
  import matplotlib._layoutbox
  import matplotlib._constrained_layout
  from matplotlib import docstring
label_desc: Use image node_id 3 for calling the Colorbar obj's underlying member method code with example usage: obj.add_lines(CS, erase) without return types