def get_preparation_data(name, init_main_module=True):
_check_not_importing_main()<EOL>d = dict(<EOL>log_to_stderr=util._log_to_stderr,<EOL>authkey=bytes(process.current_process().authkey),<EOL>)<EOL>if util._logger is not None:<EOL><INDENT>d['<STR_LIT>'] = util._logger.getEffectiveLevel()<EOL>if len(util._logger.handlers) > <NUM_LIT:0>:<EOL><INDENT>h = util._logger.handlers[<NUM_LIT:0>]<EOL>d['<STR_LIT>'] = h.formatter._fmt<EOL><DEDENT><DEDENT>sys_path = [p for p in sys.path]<EOL>try:<EOL><INDENT>i = sys_path.index('<STR_LIT>')<EOL><DEDENT>except ValueError:<EOL><INDENT>pass<EOL><DEDENT>else:<EOL><INDENT>sys_path[i] = process.ORIGINAL_DIR<EOL><DEDENT>d.update(<EOL>name=name,<EOL>sys_path=sys_path,<EOL>sys_argv=sys.argv,<EOL>orig_dir=process.ORIGINAL_DIR,<EOL>dir=os.getcwd()<EOL>)<EOL>if sys.platform != "<STR_LIT:win32>":<EOL><INDENT>from . import semaphore_tracker<EOL>semaphore_tracker.ensure_running()<EOL>d['<STR_LIT>'] = semaphore_tracker._semaphore_tracker._pid<EOL><DEDENT>if init_main_module:<EOL><INDENT>main_module = sys.modules['<STR_LIT:__main__>']<EOL>try:<EOL><INDENT>main_mod_name = getattr(main_module.__spec__, "<STR_LIT:name>", None)<EOL><DEDENT>except BaseException:<EOL><INDENT>main_mod_name = None<EOL><DEDENT>if main_mod_name is not None:<EOL><INDENT>d['<STR_LIT>'] = main_mod_name<EOL><DEDENT>elif sys.platform != '<STR_LIT:win32>' or (not WINEXE and not WINSERVICE):<EOL><INDENT>main_path = getattr(main_module, '<STR_LIT>', None)<EOL>if main_path is not None:<EOL><INDENT>if (not os.path.isabs(main_path) and<EOL>process.ORIGINAL_DIR is not None):<EOL><INDENT>main_path = os.path.join(process.ORIGINAL_DIR, main_path)<EOL><DEDENT>d['<STR_LIT>'] = os.path.normpath(main_path)<EOL>d['<STR_LIT>'] = d['<STR_LIT>']<EOL><DEDENT><DEDENT><DEDENT>return d<EOL>
Return info about parent needed by child to unpickle process object