code: def make_axes(parent, **kw):
      """
      Resize and reposition a parent axes, and return a child
      axes suitable for a colorbar
  
      ::
  
          cax, kw = make_axes(parent, **kw)
  
      Keyword arguments may include the following (with defaults):
  
          *orientation*
              'vertical'  or 'horizontal'
  
      %s
  
      All but the first of these are stripped from the input kw set.
  
      Returns (cax, kw), the child axes and the reduced kw dictionary.
      """
      orientation = kw.setdefault("orientation", "vertical")
      fraction = kw.pop("fraction", 0.15)
      shrink = kw.pop("shrink", 1.0)
      aspect = kw.pop("aspect", 20)
      # pb = transforms.PBox(parent.get_position())
      pb = parent.get_position(original=True).frozen()
      if orientation == "vertical":
          pad = kw.pop("pad", 0.05)
          x1 = 1.0 - fraction
          pb1, pbx, pbcb = pb.splitx(x1 - pad, x1)
          pbcb = pbcb.shrunk(1.0, shrink).anchored("C", pbcb)
          anchor = (0.0, 0.5)
          panchor = (1.0, 0.5)
      else:
          pad = kw.pop("pad", 0.15)
          pbcb, pbx, pb1 = pb.splity(fraction, fraction + pad)
          pbcb = pbcb.shrunk(shrink, 1.0).anchored("C", pbcb)
          aspect = 1.0 / aspect
          anchor = (0.5, 1.0)
          panchor = (0.5, 0.0)
      parent.set_position(pb1)
      parent.set_anchor(panchor)
      fig = parent.get_figure()
      cax = fig.add_axes(pbcb)
      cax.set_aspect(aspect, anchor=anchor, adjustable="box")
      return cax, 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 for calling a global function with example usage: make_axes(parent) and returns: cax,  kw