code: def test(
      verbosity=None,
      coverage=False,
      switch_backend_warn=True,
      recursionlimit=0,
      **kwargs,
  ):
      from ... import default_test_modules, get_backend, use
  
      old_backend = get_backend()
      old_recursionlimit = sys.getrecursionlimit()
      try:
          use("agg")
          if recursionlimit:
              sys.setrecursionlimit(recursionlimit)
          import nose
          from nose.plugins import multiprocess
  
          # Nose doesn't automatically instantiate all of the plugins in the
          # child processes, so we have to provide the multiprocess plugin with
          # a list.
          extra_plugins = get_extra_test_plugins()
          multiprocess._instantiate_plugins = extra_plugins
  
          env = get_env()
          if coverage:
              env["NOSE_WITH_COVERAGE"] = 1
  
          if verbosity is not None:
              env["NOSE_VERBOSE"] = verbosity
  
          success = nose.run(
              addplugins=[plugin() for plugin in extra_plugins],
              env=env,
              defaultTest=default_test_modules,
              **kwargs,
          )
      finally:
          if old_backend.lower() != "agg":
              use(old_backend, warn=switch_backend_warn)
          if recursionlimit:
              sys.setrecursionlimit(old_recursionlimit)
  
      return success
  
imports: from __future__ import absolute_import, division, print_function, unicode_literals
  import sys
label_desc: Use image node_id 4 for calling a global function with example usage: test(verbosity, coverage, switch_backend_warn, recursionlimit) and returns: success