code: def setastest(tf=True):
      """
      Signals to nose that this function is or is not a test.
  
      Parameters
      ----------
      tf : bool
          If True, specifies that the decorated callable is a test.
          If False, specifies that the decorated callable is not a test.
          Default is True.
  
      Notes
      -----
      This decorator can't use the nose namespace, because it can be
      called from a non-test module. See also ``istest`` and ``nottest`` in
      ``nose.tools``.
  
      Examples
      --------
      `setastest` can be used in the following way::
  
        from numpy.testing.decorators import setastest
  
        @setastest(False)
        def func_with_test_in_name(arg1, arg2):
            pass
  
      """
  
      def set_test(t):
          t.__test__ = tf
          return t
  
      return set_test
  
imports: import warnings
  from ._numpy_testing_utils import WarningManager
label_desc: Use image node_id 2 for calling a global function with example usage: setastest(tf) and returns: set_test, t