code: def _reraise_with_stack(func, e):
      if func.stack is not None:
          # Reraise any type of exceptions including the following:
          # - Chainer raises RuntimeError for NaN values; and
          # - NumPy raises FloatingPointError for invalid values.
  
          # TODO(kataoka): unify variable._check_grad_type and below
          additional_message = (
              "\n{}\nStacktrace of the function is below:\n{}".format(
                  "-" * _get_columns(),
                  "".join(traceback.format_list(func.stack[:-1])),
              )
          )
          if e.args:
              e.args = (e.args[0] + additional_message,) + e.args[1:]
          else:
              e.args = (additional_message,)
      raise
  
imports: import os
  import shutil
  import sys
  import traceback
  import six
  import chainer
label_desc: Use image node_id 7 for calling a global function with example usage: _reraise_with_stack(func, e) without return types