docstr: Helper function to obtain a Path from one bbox to another.
  
  Parameters
  ----------
  bbox1, bbox2 : `matplotlib.transforms.Bbox`
      Bounding boxes to connect.
  
  loc1 : {1, 2, 3, 4}
      Corner of *bbox1* to use. Valid values are::
  
          'upper right'  : 1,
          'upper left'   : 2,
          'lower left'   : 3,
          'lower right'  : 4
  
  loc2 : {1, 2, 3, 4}, optional
      Corner of *bbox2* to use. If None, defaults to *loc1*.
      Valid values are::
  
          'upper right'  : 1,
          'upper left'   : 2,
          'lower left'   : 3,
          'lower right'  : 4
  
  Returns
  -------
  path : `matplotlib.path.Path`
      A line segment from the *loc1* corner of *bbox1* to the *loc2*
      corner of *bbox2*.
docstr_tok: ["Helper","function","to","obtain","a","Path","from","one","bbox","to","another",".","Parameters","--","--","--","--","--","bbox1",",","bbox2",":","`","matplotlib.transforms.Bbox","`","Bounding","boxes","to","connect",".","loc1",":","{","1",",","2",",","3",",","4","}","Corner","of","*","bbox1","*","to","use",".","Valid","values","are",":",":","'upper","right","'",":","1",",","'upper","left","'",":","2",",","'lower","left","'",":","3",",","'lower","right","'",":","4","loc2",":","{","1",",","2",",","3",",","4","}",",","optional","Corner","of","*","bbox2","*","to","use",".","If","None",",","defaults","to","*","loc1","*",".","Valid","values","are",":",":","'upper","right","'",":","1",",","'upper","left","'",":","2",",","'lower","left","'",":","3",",","'lower","right","'",":","4","Returns","--","--","--","-","path",":","`","matplotlib.path.Path","`","A","line","segment","from","the","*","loc1","*","corner","of","*","bbox1","*","to","the","*","loc2","*","corner","of","*","bbox2","*","."]
code: def connect_bbox(bbox1, bbox2, loc1, loc2=None):
      """
      Helper function to obtain a Path from one bbox to another.
  
      Parameters
      ----------
      bbox1, bbox2 : `matplotlib.transforms.Bbox`
          Bounding boxes to connect.
  
      loc1 : {1, 2, 3, 4}
          Corner of *bbox1* to use. Valid values are::
  
              'upper right'  : 1,
              'upper left'   : 2,
              'lower left'   : 3,
              'lower right'  : 4
  
      loc2 : {1, 2, 3, 4}, optional
          Corner of *bbox2* to use. If None, defaults to *loc1*.
          Valid values are::
  
              'upper right'  : 1,
              'upper left'   : 2,
              'lower left'   : 3,
              'lower right'  : 4
  
      Returns
      -------
      path : `matplotlib.path.Path`
          A line segment from the *loc1* corner of *bbox1* to the *loc2*
          corner of *bbox2*.
      """
      if isinstance(bbox1, Rectangle):
          transform = bbox1.get_transfrom()
          bbox1 = Bbox.from_bounds(0, 0, 1, 1)
          bbox1 = TransformedBbox(bbox1, transform)
  
      if isinstance(bbox2, Rectangle):
          transform = bbox2.get_transform()
          bbox2 = Bbox.from_bounds(0, 0, 1, 1)
          bbox2 = TransformedBbox(bbox2, transform)
  
      if loc2 is None:
          loc2 = loc1
  
      x1, y1 = BboxConnector.get_bbox_edge_pos(bbox1, loc1)
      x2, y2 = BboxConnector.get_bbox_edge_pos(bbox2, loc2)
  
      verts = [[x1, y1], [x2, y2]]
      codes = [Path.MOVETO, Path.LINETO]
  
      return Path(verts, codes)
  
imports: from __future__ import absolute_import, division, print_function, unicode_literals
  import warnings
  from matplotlib import docstring
  import six
  from matplotlib.offsetbox import AnchoredOffsetbox
  from matplotlib.patches import Patch, Rectangle
  from matplotlib.path import Path
  from matplotlib.transforms import Bbox, BboxTransformTo
  from matplotlib.transforms import IdentityTransform, TransformedBbox
  from .None import axes_size
  from .parasite_axes import HostAxes
label_desc: Use image node_id 2 for calling the BboxConnector obj's underlying member method code with example usage: obj.connect_bbox(bbox1, bbox2, loc1, loc2) and returns: Path