class_docstr: Container objects attached to exceptions raised in user code.
  
  This metadata allows re-raising exceptions that occur in generated code, with
  a custom error message that includes a stack trace relative to user-readable
  code from which the generated code originated.
docstr: Creates exception from source_error.
docstr_tok: ["Creates","exception","from","source_error","."]
code: def create_exception(self, source_error):
      """Creates exception from source_error."""
      preferred_type = type(source_error)
      to_ret = None
      if preferred_type.__init__ is Exception.__init__:
          to_ret = preferred_type(self.get_message())
      if preferred_type in KNOWN_STRING_CONSTRUCTOR_ERRORS:
          to_ret = preferred_type(self.get_message())
      elif preferred_type is KeyError:
          to_ret = MultilineMessageKeyError(
              self.get_message(), self.cause_message
          )
  
      if to_ret is not None:
          return to_ret.with_traceback(source_error.__traceback__)
  
file_path: DALI/dali/python/nvidia/dali/_autograph/pyct/error_utils.py
imports: import collections
  from nvidia.dali._autograph.pyct import origin_info
label_desc: Use image node_id 3 for calling the ErrorMetadataBase obj's underlying member method code with example usage: obj.create_exception(source_error) and returns: to_ret