code: def from_exception(
      cls, exception: BaseException, /
  ) -> "InterestingOrigin":
      filename, lineno = None, None
      if tb := get_trimmed_traceback(exception):
          filename, lineno, *_ = traceback.extract_tb(tb)[-1]
      return cls(
          type(exception),
          filename,
          lineno,
          # Note that if __cause__ is set it is always equal to __context__, explicitly
          # to support introspection when debugging, so we can use that unconditionally.
          cls.from_exception(exception.__context__)
          if exception.__context__
          else (),
          # We distinguish exception groups by the inner exceptions, as for __context__
          tuple(map(cls.from_exception, exception.exceptions))
          if isinstance(exception, BaseExceptionGroup)
          else (),
      )
  
imports: import contextlib
  import os
  import sys
  import textwrap
  import traceback
  from inspect import getframeinfo
  from pathlib import Path
  from typing import Dict, NamedTuple, Optional, Type
  import hypothesis
  from hypothesis.errors import DeadlineExceeded, HypothesisException, StopTest, UnsatisfiedAssumption, _Trimmable
  from hypothesis.internal.compat import BaseExceptionGroup
  from hypothesis.utils.dynamicvariables import DynamicVariable
label_desc: Use image node_id 2 for calling the InterestingOrigin obj's underlying member method code with example usage: obj.from_exception() and returns: cls