code: def _fixup_main_from_path(main_path):
      # If this process was forked, __main__ may already be populated
      current_main = sys.modules["__main__"]
  
      # Unfortunately, the main ipython launch script historically had no
      # "if __name__ == '__main__'" guard, so we work around that
      # by treating it like a __main__.py file
      # See https://github.com/ipython/ipython/issues/4698
      main_name = os.path.splitext(os.path.basename(main_path))[0]
      if main_name == "ipython":
          return
  
      # Otherwise, if __file__ already has the setting we expect,
      # there's nothing more to do
      if getattr(current_main, "__file__", None) == main_path:
          return
  
      # If the parent process has sent a path through rather than a module
      # name we assume it is an executable script that may contain
      # non-main code that needs to be executed
      old_main_modules.append(current_main)
      main_module = types.ModuleType("__mp_main__")
      main_content = runpy.run_path(main_path, run_name="__mp_main__")
      main_module.__dict__.update(main_content)
      sys.modules["__main__"] = sys.modules["__mp_main__"] = main_module
  
file_path: catboost/contrib/python/joblib/joblib/externals/loky/backend/spawn.py
imports: import os
  import sys
  import runpy
  import textwrap
  import types
  from multiprocessing import process, util
label_desc: Use image node_id 6 for calling a global function with example usage: _fixup_main_from_path(main_path) without return types