code: def with_requires(*requirements):
      """Run a test case only when given requirements are satisfied.
  
      .. admonition:: Example
  
         This test case runs only when `numpy>=1.10` is installed.
  
         >>> import unittest
         >>> from chainer import testing
         >>> class Test(unittest.TestCase):
         ...     @testing.with_requires('numpy>=1.10')
         ...     def test_for_numpy_1_10(self):
         ...         pass
  
      Args:
          requirements: A list of string representing requirement condition to
              run a given test case.
  
      """
      ws = pkg_resources.WorkingSet()
      try:
          ws.require(*requirements)
          skip = False
      except pkg_resources.ResolutionError:
          skip = True
  
      msg = "requires: {}".format(",".join(requirements))
      return unittest.skipIf(skip, msg)
  
file_path: chainer/chainer/testing/helper.py
imports: import contextlib
  import sys
  import unittest
  import warnings
  import pkg_resources
label_desc: Use image node_id 2 for calling a global function with example usage: with_requires() and returns: unittest