code: def _create_import_hook_from_string(name):
      def import_hook(module):
          module_name, function = name.split(":")
          attrs = function.split(".")
          __import__(module_name)
          callback = sys.modules[module_name]
          for attr in attrs:
              callback = getattr(callback, attr)
          return callback(module)
  
      return import_hook
  
imports: import importlib
  import sys
  import threading
label_desc: Use image node_id 2 for calling a global function with example usage: _create_import_hook_from_string(name) and returns: import_hook, callback