(cls, path)
return recover_thread
Recover the multi_thread_state from path.

        Parameters
        ----------
        path: str
            the path to save the result files.
Recover the multi_thread_state from path.
Recover the multi_thread_state from path .
def recover(cls, path):
        """
        Recover the multi_thread_state from path.

        Parameters
        ----------
        path: str
            the path to save the result files.
        """
        # load breakpoint
        if not isinstance(path, str):
            raise TypeError("A string is expected, but received: %s" % str(type(path)))
        f = open(os.path.abspath(path), 'rb')
        breakpoint = pickle.load(f)
        f.close()
        if not isinstance(breakpoint, aceThreading):
            raise TypeError("Please enter the correct path to the multi-threading saving file.")

        # recover the workspace
        # init self
        recover_thread = cls(breakpoint._examples, breakpoint._labels, breakpoint._train_idx,
                             breakpoint._test_idx, breakpoint._label_index, breakpoint._unlabel_index,
                             breakpoint._target_func, breakpoint.__max_thread,
                             breakpoint._refresh_interval, breakpoint._saving_path)
        # loading tmp files
        state_path = os.path.join(breakpoint._saving_path, 'AL_result')
        recover_arr = [True] * breakpoint._round_num
        for i in range(breakpoint._round_num):
            file_dir = os.path.join(state_path, breakpoint._saver[i]._saving_file_name)
            if not breakpoint.__alive_thread[i]:
                if os.path.exists(file_dir) and os.path.getsize(file_dir) != 0:
                    # all finished
                    recover_thread._saver[i] = StateIO.load(
                        os.path.join(state_path, breakpoint._saver[i]._saving_file_name))
                    recover_arr[i] = False
                else:
                    # not started
                    pass
            else:
                if os.path.getsize(file_dir) == 0:
                    # not saving, but started, use the initialized stateIO object
                    continue
                # still running
                # load intermediate result file
                recover_thread._saver[i] = StateIO.load(
                    os.path.join(state_path, breakpoint._saver[i]._saving_file_name))
        recover_thread._recover_arr = recover_arr
        return recover_thread
def recover ( cls , path ) : # load breakpoint if not isinstance ( path , str ) : raise TypeError ( "A string is expected, but received: %s" % str ( type ( path ) ) ) f = open ( os . path . abspath ( path ) , 'rb' ) breakpoint = pickle . load ( f ) f . close ( ) if not isinstance ( breakpoint , aceThreading ) : raise TypeError ( "Please enter the correct path to the multi-threading saving file." ) # recover the workspace # init self recover_thread = cls ( breakpoint . _examples , breakpoint . _labels , breakpoint . _train_idx , breakpoint . _test_idx , breakpoint . _label_index , breakpoint . _unlabel_index , breakpoint . _target_func , breakpoint . __max_thread , breakpoint . _refresh_interval , breakpoint . _saving_path ) # loading tmp files state_path = os . path . join ( breakpoint . _saving_path , 'AL_result' ) recover_arr = [ True ] * breakpoint . _round_num for i in range ( breakpoint . _round_num ) : file_dir = os . path . join ( state_path , breakpoint . _saver [ i ] . _saving_file_name ) if not breakpoint . __alive_thread [ i ] : if os . path . exists ( file_dir ) and os . path . getsize ( file_dir ) != 0 : # all finished recover_thread . _saver [ i ] = StateIO . load ( os . path . join ( state_path , breakpoint . _saver [ i ] . _saving_file_name ) ) recover_arr [ i ] = False else : # not started pass else : if os . path . getsize ( file_dir ) == 0 : # not saving, but started, use the initialized stateIO object continue # still running # load intermediate result file recover_thread . _saver [ i ] = StateIO . load ( os . path . join ( state_path , breakpoint . _saver [ i ] . _saving_file_name ) ) recover_thread . _recover_arr = recover_arr return recover_thread