code: def handle_exceptions(fn: Callable) -> Callable:
      @functools.wraps(fn)
      def _handle_exceptions(*args, **kwargs):
          """Catch all exceptions and raise them in IvyException.
  
          Parameters
          ----------
          args
              The arguments to be passed to the function.
  
          kwargs
              The keyword arguments to be passed to the function.
  
          Returns
          -------
              The return of the function, or raise IvyException if error is thrown.
          """
          try:
              return fn(*args, **kwargs)
          except IvyException as e:
              _handle_exceptions_helper(e, type(e))
          except Exception as e:
              ivy_exception = _non_ivy_exceptions_mapping.get(
                  type(e), IvyBackendException
              )
              _handle_exceptions_helper(e, ivy_exception)
  
      def _handle_exceptions_helper(e, cls):
          _configure_stack_trace(e.__traceback__)
          raise cls(fn.__name__, str(e), include_backend=True)
  
      _handle_exceptions.handle_exceptions = True
      return _handle_exceptions
  
imports: import warnings
  import ivy
  import functools
  from typing import Callable
  import traceback
  import inspect
  import os
  import ast
  import builtins
label_desc: Use image node_id 8 for calling a global function with example usage: handle_exceptions(fn) and returns: _handle_exceptions, fn