code: def get_bboxes(objs, r, expand, ax):
      if ax is None:
          ax = plt.gca()
      try:
          return [
              i.get_window_extent(r)
              .expanded(*expand)
              .transformed(ax.transData.inverted())
              for i in objs
          ]
      except (AttributeError, TypeError):
          try:
              if all(
                  [
                      isinstance(obj, matplotlib.transforms.BboxBase)
                      for obj in objs
                  ]
              ):
                  return objs
          except TypeError:
              return get_bboxes_pathcollection(objs, ax)
  
imports: from __future__ import division
  import sys
  from itertools import product
  from operator import itemgetter
  import matplotlib
  import numpy
  from matplotlib import pyplot
  from matplotlib.path import get_path_collection_extents
label_desc: Use image node_id 3 for calling a global function with example usage: get_bboxes(objs, r, expand, ax) and returns: unknown, objs, get_bboxes_pathcollection