code: def apply_wrapper(wrapper, func):
      """Apply a wrapper to a function for decoration.
  
      This mixes Michele Simionato's decorator tool with nose's make_decorator,
      to apply a wrapper in a decorator so that all nose attributes, as well as
      function signature and other properties, survive the decoration cleanly.
      This will ensure that wrapped functions can still be well introspected via
      IPython, for example.
      """
      warnings.warn(
          "The function `apply_wrapper` is deprecated since IPython 4.0",
          DeprecationWarning,
          stacklevel=2,
      )
      import nose.tools
  
      return decorator(
          wrapper, nose.tools.make_decorator(func)(wrapper)
      )
  
file_path: catboost/contrib/python/ipython/py2/IPython/testing/decorators.py
imports: import sys
  import os
  import tempfile
  import unittest
  import warnings
  from decorator import decorator
  from .ipunittest import ipdoctest, ipdocstring
  from IPython.external.decorators import *
  from IPython.utils.py3compat import string_types, which, PY2, PY3, PYPY
label_desc: Use image node_id 2 for calling a global function with example usage: apply_wrapper(wrapper, func) and returns: decorator