code: def append_obj(module, d, name, obj, autoload=False):
      in_module = (
          hasattr(obj, "__module__")
          and obj.__module__ == module.__name__
      )
      if autoload:
          # check needed for module global built-ins
          if not in_module and name in mod_attrs:
              return False
      else:
          if not in_module:
              return False
  
      key = (module.__name__, name)
      try:
          d.setdefault(key, []).append(weakref.ref(obj))
      except TypeError:
          pass
      return True
  
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 7 for calling a global function with example usage: append_obj(module, d, name, obj, autoload) and returns: True, False, False