code: def repl():
      user_ns = {}
      py_main = __res.find("PY_MAIN")
  
      if py_main:
          mod_name, func_name = (py_main.split(b":", 1) + [None])[:2]
          try:
              import importlib
  
              mod = importlib.import_module(mod_name.decode("UTF-8"))
              user_ns = mod.__dict__
          except ModuleNotFoundError:
              import traceback
  
              traceback.print_exc()
  
          if func_name and "__main__" not in user_ns:
  
              def run(args):
                  if isinstance(args, str):
                      import shlex
  
                      args = shlex.split(args)
  
                  import sys
  
                  sys.argv = [sys.argv[0]] + args
                  getattr(mod, func_name)()
  
              user_ns["__main__"] = run
  
      try:
          import IPython
      except ModuleNotFoundError:
          pass
      else:
          return IPython.start_ipython(user_ns=user_ns)
  
      import code
  
      code.interact(local=user_ns)
  
imports: import sys
  import __res
label_desc: Use image node_id 1 for calling a global function with example usage: repl() and returns: IPython