class_docstr: An exception ready for rendering.
  
  The traceback module captures enough attributes from the original exception
  to this intermediary form to ensure that no references are held, while
  still being able to fully print or format it.
  
  max_group_width and max_group_depth control the formatting of exception
  groups. The depth refers to the nesting level of the group, and the width
  refers to the size of a single exception group's exceptions array. The
  formatted output is truncated when either limit is exceeded.
  
  Use `from_exception` to create TracebackException instances from exception
  objects, or the constructor to create TracebackException instances from
  individual components.
  
  - :attr:`__cause__` A TracebackException of the original *__cause__*.
  - :attr:`__context__` A TracebackException of the original *__context__*.
  - :attr:`exceptions` For exception groups - a list of TracebackException
    instances for the nested *exceptions*.  ``None`` for other exceptions.
  - :attr:`__suppress_context__` The *__suppress_context__* value from the
    original exception.
  - :attr:`stack` A `StackSummary` representing the traceback.
  - :attr:`exc_type` The class of the original traceback.
  - :attr:`filename` For syntax errors - the filename where the error
    occurred.
  - :attr:`lineno` For syntax errors - the linenumber where the error
    occurred.
  - :attr:`end_lineno` For syntax errors - the end linenumber where the error
    occurred. Can be `None` if not present.
  - :attr:`text` For syntax errors - the text where the error
    occurred.
  - :attr:`offset` For syntax errors - the offset into the text where the
    error occurred.
  - :attr:`end_offset` For syntax errors - the end offset into the text where
    the error occurred. Can be `None` if not present.
  - :attr:`msg` For syntax errors - the compiler error message.
class_docstr_tok: ["An","exception","ready","for","rendering",".","The","traceback","module","captures","enough","attributes","from","the","original","exception","to","this","intermediary","form","to","ensure","that","no","references","are","held",",","while","still","being","able","to","fully","print","or","format","it",".","max_group_width","and","max_group_depth","control","the","formatting","of","exception","groups",".","The","depth","refers","to","the","nesting","level","of","the","group",",","and","the","width","refers","to","the","size","of","a","single","exception","group","'s","exceptions","array",".","The","formatted","output","is","truncated","when","either","limit","is","exceeded",".","Use","`","from_exception","`","to","create","TracebackException","instances","from","exception","objects",",","or","the","constructor","to","create","TracebackException","instances","from","individual","components",".","-",":","attr",":","`","__cause__","`","A","TracebackException","of","the","original","*","__cause__","*",".","-",":","attr",":","`","__context__","`","A","TracebackException","of","the","original","*","__context__","*",".","-",":","attr",":","`","exceptions","`","For","exception","groups","-","a","list","of","TracebackException","instances","for","the","nested","*","exceptions","*",".","``","None","``","for","other","exceptions",".","-",":","attr",":","`","__suppress_context__","`","The","*","__suppress_context__","*","value","from","the","original","exception",".","-",":","attr",":","`","stack","`","A","`","StackSummary","`","representing","the","traceback",".","-",":","attr",":","`","exc_type","`","The","class","of","the","original","traceback",".","-",":","attr",":","`","filename","`","For","syntax","errors","-","the","filename","where","the","error","occurred",".","-",":","attr",":","`","lineno","`","For","syntax","errors","-","the","linenumber","where","the","error","occurred",".","-",":","attr",":","`","end_lineno","`","For","syntax","errors","-","the","end","linenumber","where","the","error","occurred",".","Can","be","`","None","`","if","not","present",".","-",":","attr",":","`","text","`","For","syntax","errors","-","the","text","where","the","error","occurred",".","-",":","attr",":","`","offset","`","For","syntax","errors","-","the","offset","into","the","text","where","the","error","occurred",".","-",":","attr",":","`","end_offset","`","For","syntax","errors","-","the","end","offset","into","the","text","where","the","error","occurred",".","Can","be","`","None","`","if","not","present",".","-",":","attr",":","`","msg","`","For","syntax","errors","-","the","compiler","error","message","."]
code: def __init__(
      self,
      exc_type,
      exc_value,
      exc_traceback,
      *,
      limit=None,
      lookup_lines=True,
      capture_locals=False,
      compact=False,
      max_group_width=15,
      max_group_depth=10,
      _seen=None,
  ):
      # NB: we need to accept exc_traceback, exc_value, exc_traceback to
      # permit backwards compat with the existing API, otherwise we
      # need stub thunk objects just to glue it together.
      # Handle loops in __cause__ or __context__.
      is_recursive_call = _seen is not None
      if _seen is None:
          _seen = set()
      _seen.add(id(exc_value))
  
      self.max_group_width = max_group_width
      self.max_group_depth = max_group_depth
  
      self.stack = StackSummary._extract_from_extended_frame_gen(
          _walk_tb_with_full_positions(exc_traceback),
          limit=limit,
          lookup_lines=lookup_lines,
          capture_locals=capture_locals,
      )
      self.exc_type = exc_type
      # Capture now to permit freeing resources: only complication is in the
      # unofficial API _format_final_exc_line
      self._str = _safe_string(exc_value, "exception")
      self.__notes__ = getattr(exc_value, "__notes__", None)
  
      if exc_type and issubclass(exc_type, SyntaxError):
          # Handle SyntaxError's specially
          self.filename = exc_value.filename
          lno = exc_value.lineno
          self.lineno = str(lno) if lno is not None else None
          end_lno = exc_value.end_lineno
          self.end_lineno = (
              str(end_lno) if end_lno is not None else None
          )
          self.text = exc_value.text
          self.offset = exc_value.offset
          self.end_offset = exc_value.end_offset
          self.msg = exc_value.msg
      if lookup_lines:
          self._load_lines()
      self.__suppress_context__ = (
          exc_value.__suppress_context__
          if exc_value is not None
          else False
      )
  
      # Convert __cause__ and __context__ to `TracebackExceptions`s, use a
      # queue to avoid recursion (only the top-level call gets _seen == None)
      if not is_recursive_call:
          queue = [(self, exc_value)]
          while queue:
              te, e = queue.pop()
              if (
                  e
                  and e.__cause__ is not None
                  and id(e.__cause__) not in _seen
              ):
                  cause = TracebackException(
                      type(e.__cause__),
                      e.__cause__,
                      e.__cause__.__traceback__,
                      limit=limit,
                      lookup_lines=lookup_lines,
                      capture_locals=capture_locals,
                      max_group_width=max_group_width,
                      max_group_depth=max_group_depth,
                      _seen=_seen,
                  )
              else:
                  cause = None
  
              if compact:
                  need_context = (
                      cause is None
                      and e is not None
                      and not e.__suppress_context__
                  )
              else:
                  need_context = True
              if (
                  e
                  and e.__context__ is not None
                  and need_context
                  and id(e.__context__) not in _seen
              ):
                  context = TracebackException(
                      type(e.__context__),
                      e.__context__,
                      e.__context__.__traceback__,
                      limit=limit,
                      lookup_lines=lookup_lines,
                      capture_locals=capture_locals,
                      max_group_width=max_group_width,
                      max_group_depth=max_group_depth,
                      _seen=_seen,
                  )
              else:
                  context = None
  
              if e and isinstance(e, BaseExceptionGroup):
                  exceptions = []
                  for exc in e.exceptions:
                      texc = TracebackException(
                          type(exc),
                          exc,
                          exc.__traceback__,
                          limit=limit,
                          lookup_lines=lookup_lines,
                          capture_locals=capture_locals,
                          max_group_width=max_group_width,
                          max_group_depth=max_group_depth,
                          _seen=_seen,
                      )
                      exceptions.append(texc)
              else:
                  exceptions = None
  
              te.__cause__ = cause
              te.__context__ = context
              te.exceptions = exceptions
              if cause:
                  queue.append((te.__cause__, e.__cause__))
              if context:
                  queue.append((te.__context__, e.__context__))
              if exceptions:
                  queue.extend(zip(te.exceptions, e.exceptions))
  
imports: import collections.abc
  import itertools
  import linecache
  import sys
  import textwrap
  from contextlib import suppress
label_desc: Use image node_id 1 to create a new TracebackException object  with example: obj = TracebackException(exc_type, exc_value, exc_traceback)