(data)
Try to get current process ready to unpickle process object
Try to get current process ready to unpickle process object
Try to get current process ready to unpickle process object
def prepare(data):
    '''
    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 '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 'start_method' in data:
        set_start_method(data['start_method'], force=True)

    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'])
def prepare ( data ) : 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 '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 'start_method' in data : set_start_method ( data [ 'start_method' ] , force = True ) 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' ] )