code: def _held_figure(func, obj, ax=None, **kw):
      import matplotlib.pyplot as plt
  
      if ax is None:
          fig = plt.figure()
          ax = fig.gca()
          return func(obj, ax=ax, **kw)
  
      # As of matplotlib 2.0, the "hold" mechanism is deprecated.
      # When matplotlib 1.x is no longer supported, this check can be removed.
      was_held = getattr(ax, "ishold", lambda: True)()
      if was_held:
          return func(obj, ax=ax, **kw)
      try:
          ax.hold(True)
          return func(obj, ax=ax, **kw)
      finally:
          ax.hold(was_held)
  
file_path: catboost/contrib/python/scipy/py2/scipy/spatial/_plotutils.py
imports: from __future__ import division, print_function, absolute_import
  import numpy
  from scipy._lib.decorator import decorator
label_desc: Use image node_id 1 for calling a global function with example usage: _held_figure(func, obj, ax) and returns: func, func, func