code: def prepare(data, parent_sentinel=None):
      """Try to get current process ready to unpickle process object."""
      if "name" in data:
          process.current_process().name = data["name"]
  
      if "authkey" in data:
          process.current_process().authkey = data["authkey"]
  
      if "log_to_stderr" in data and data["log_to_stderr"]:
          util.log_to_stderr()
  
      if "log_level" in data:
          util.get_logger().setLevel(data["log_level"])
  
      if "log_fmt" in data:
          import logging
  
          util.get_logger().handlers[0].setFormatter(
              logging.Formatter(data["log_fmt"])
          )
  
      if "sys_path" in data:
          sys.path = data["sys_path"]
  
      if "sys_argv" in data:
          sys.argv = data["sys_argv"]
  
      if "dir" in data:
          os.chdir(data["dir"])
  
      if "orig_dir" in data:
          process.ORIGINAL_DIR = data["orig_dir"]
  
      if "mp_tracker_args" in data:
          from multiprocessing.resource_tracker import (
              _resource_tracker as mp_resource_tracker,
          )
  
          mp_resource_tracker._fd = data["mp_tracker_args"]["fd"]
          mp_resource_tracker._pid = data["mp_tracker_args"]["pid"]
      if "tracker_args" in data:
          from .resource_tracker import _resource_tracker
  
          _resource_tracker._pid = data["tracker_args"]["pid"]
          if sys.platform == "win32":
              handle = data["tracker_args"]["fh"]
              handle = duplicate(handle, source_process=parent_sentinel)
              _resource_tracker._fd = msvcrt.open_osfhandle(
                  handle, os.O_RDONLY
              )
          else:
              _resource_tracker._fd = data["tracker_args"]["fd"]
  
      if "init_main_from_name" in data:
          _fixup_main_from_name(data["init_main_from_name"])
      elif "init_main_from_path" in data:
          _fixup_main_from_path(data["init_main_from_path"])
  
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 4 for calling a global function with example usage: prepare(data, parent_sentinel) without return types