code: def _parameterize_test_case(base, i, param):
      cls_name = _make_class_name(base.__name__, i, param)
  
      def __str__(self):
          name = base.__str__(self)
          return "%s  parameter: %s" % (name, param)
  
      mb = {"__str__": __str__}
      for k, v in sorted(param.items()):
          if isinstance(v, types.FunctionType):
  
              def create_new_v():
                  f = v
  
                  def new_v(self, *args, **kwargs):
                      return f(*args, **kwargs)
  
                  return new_v
  
              mb[k] = create_new_v()
          else:
              mb[k] = v
  
      def method_generator(base_method):
          # Generates a wrapped test method
  
          @functools.wraps(base_method)
          def new_method(self, *args, **kwargs):
              try:
                  return base_method(self, *args, **kwargs)
              except unittest.SkipTest:
                  raise
              except Exception as e:
                  s = six.StringIO()
                  s.write("Parameterized test failed.\n\n")
                  s.write(
                      "Base test method: {}.{}\n".format(
                          base.__name__, base_method.__name__
                      )
                  )
                  s.write("Test parameters:\n")
                  for k, v in sorted(param.items()):
                      s.write("  {}: {}\n".format(k, v))
                  err_class = e.__class__
                  if err_class.__name__ == "OutOfMemoryError":
                      err_class = MemoryError
                  utils._raise_from(err_class, s.getvalue(), e)
  
          return new_method
  
      return (cls_name, mb, method_generator)
  
imports: import functools
  import itertools
  import types
  import typing
  import unittest
  import numpy
  import six
  from chainer.testing import _bundle
  from chainer import utils
label_desc: Use image node_id 5 for calling a global function with example usage: _parameterize_test_case(base, i, param) and returns: cls_name,  mb,  method_generator, unknown, new_method, new_v, base_method, f