code: def update_function(old, new):
      """Upgrade the code object of a function"""
      for name in func_attrs:
          try:
              setattr(old, name, getattr(new, name))
          except (AttributeError, TypeError):
              pass
  
imports: from IPython.core import magic_arguments
  from IPython.core.magic import Magics, magics_class, line_magic
  import os
  import sys
  import traceback
  import types
  import weakref
  import gc
  import logging
  from importlib import import_module, reload
  from importlib.util import source_from_cache
label_desc: Use image node_id 1 for calling a global function with example usage: update_function(old, new) without return types