code: def retina_figure(fig, **kwargs):
      """format a figure as a pixel-doubled (retina) PNG"""
      pngdata = print_figure(fig, fmt="retina", **kwargs)
      # Make sure that retina_figure acts just like print_figure and returns
      # None when the figure is empty.
      if pngdata is None:
          return
      w, h = _pngxy(pngdata)
      metadata = dict(width=w // 2, height=h // 2)
      return pngdata, metadata
  
file_path: catboost/contrib/python/ipython/py2/IPython/core/pylabtools.py
imports: from __future__ import print_function
  from io import BytesIO
  from IPython.core.display import _pngxy
  from IPython.utils.decorators import flag_calls
  from IPython.utils import py3compat
label_desc: Use image node_id 4 for calling a global function with example usage: retina_figure(fig) and returns: pngdata,  metadata