code: def _wrap_exception(exception_class):
      to_return = _derived_exceptions.get(exception_class)
      if to_return is not None:
          return to_return
  
      class WithPrettyPrinting(exception_class):
          def __str__(self):
              try:
                  text = super(WithPrettyPrinting, self).__str__()
              except:  # noqa E722
                  text = "<Garbled exception>"
              # if getattr(self, "_missing_deserializer", False):
              #     text += (
              #         "\n\n===== WARNING: User data from the exception was not deserialized "
              #         "-- possible missing information =====\n"
              #     )
              # if getattr(self, "_missing_str", False):
              #     text += "\n\n===== WARNING: Could not set class specific __str__ "
              #     "-- possible missing information =====\n"
              # if getattr(self, "_missing_repr", False):
              #     text += "\n\n===== WARNING: Could not set class specific __repr__ "
              #     "-- possible missing information =====\n"
              remote_tb = getattr(
                  self, "_remote_tb", "No remote traceback available"
              )
              text += "\n\n===== Remote (on server) traceback =====\n"
              text += remote_tb
              text += "========================================\n"
              return text
  
      WithPrettyPrinting.__name__ = exception_class.__name__
      WithPrettyPrinting.__module__ = exception_class.__module__
      WithPrettyPrinting.__realclass__ = exception_class
      _derived_exceptions[exception_class] = WithPrettyPrinting
      return WithPrettyPrinting
  
imports: import sys
  import traceback
label_desc: Use image node_id 3 for calling a global function with example usage: _wrap_exception(exception_class) and returns: WithPrettyPrinting, to_return, text