code: def deprecated(conditional=True):
      """
      Filter deprecation warnings while running the test suite.
  
      This decorator can be used to filter DeprecationWarning's, to avoid
      printing them during the test suite run, while checking that the test
      actually raises a DeprecationWarning.
  
      Parameters
      ----------
      conditional : bool or callable, optional
          Flag to determine whether to mark test as deprecated or not. If the
          condition is a callable, it is used at runtime to dynamically make the
          decision. Default is True.
  
      Returns
      -------
      decorator : function
          The `deprecated` decorator itself.
  
      Notes
      -----
      .. versionadded:: 1.4.0
  
      """
  
      def deprecate_decorator(f):
          # Local import to avoid a hard nose dependency and only incur the
          # import time overhead at actual test-time.
          import nose
  
          def _deprecated_imp(*args, **kwargs):
              # Poor man's replacement for the with statement
              with assert_warns(DeprecationWarning):
                  f(*args, **kwargs)
  
          if isinstance(conditional, collections_abc.Callable):
              cond = conditional()
          else:
              cond = conditional
          if cond:
              return nose.tools.make_decorator(f)(_deprecated_imp)
          else:
              return f
  
      return deprecate_decorator
  
imports: from __future__ import division, absolute_import, print_function
  from .utils import SkipTest, assert_warns, HAS_REFCOUNT
label_desc: Use image node_id 5 for calling a global function with example usage: deprecated(conditional) and returns: deprecate_decorator, nose, f