code: def add_note(exc, note):
      try:
          exc.add_note(note)
      except AttributeError:
          if not hasattr(exc, "__notes__"):
              exc.__notes__ = []
          exc.__notes__.append(note)
  
imports: import codecs
  import copy
  import dataclasses
  import inspect
  import platform
  import sys
  import typing
  from functools import partial
  from typing import Any, ForwardRef, get_args
label_desc: Use image node_id 1 for calling a global function with example usage: add_note(exc, note) without return types