code: def __init__(self, ax, mappable, **kw):
      mappable.autoscale_None()  # Ensure mappable.norm.vmin, vmax
      # are set when colorbar is called,
      # even if mappable.draw has not yet
      # been called.  This will not change
      # vmin, vmax if they are already set.
      self.mappable = mappable
      kw["cmap"] = mappable.cmap
      kw["norm"] = mappable.norm
      kw["alpha"] = mappable.get_alpha()
      if isinstance(mappable, contour.ContourSet):
          CS = mappable
          kw["boundaries"] = CS._levels
          kw["values"] = CS.cvalues
          kw["extend"] = CS.extend
          # kw['ticks'] = CS._levels
          kw.setdefault(
              "ticks", ticker.FixedLocator(CS.levels, nbins=10)
          )
          kw["filled"] = CS.filled
          ColorbarBase.__init__(self, ax, **kw)
          if not CS.filled:
              self.add_lines(CS)
      else:
          ColorbarBase.__init__(self, ax, **kw)
  
imports: from __future__ import absolute_import, division, print_function, unicode_literals
  import six
  from six.moves import xrange, zip
  import numpy
  import matplotlib
  import matplotlib.colors
  import matplotlib.cm
  from matplotlib import docstring
  import matplotlib.ticker
  import matplotlib.cbook
  import matplotlib.collections
  import matplotlib.contour
  from matplotlib.path import Path
  from matplotlib.patches import PathPatch
  from matplotlib.transforms import Bbox
label_desc: Use image node_id 1 to create a new Colorbar object from inherited base classes: ColorbarBase with example: obj = Colorbar(ax, mappable)