modules/utils/notebook_utils/label_matrix_helper.py
def _label_candidates_multithread(lfs, multitask):
    """
    This function is called when each thread is created.

    lfs - the label functions to annotate candidates
    multitask - a boolean that tells the function to label candidates in a multitask format
    """
    while not(candidate_queue.empty()):
       
        candidate = candidate_queue.get()
        sys.stdout.write("\r{:7d}".format(candidate_queue.qsize()))
        sys.stdout.flush()
        
        if multitask:
            for task_index, lf_task in enumerate(lfs):
                for col_index, lf in enumerate(lf_task):
                    val = lf(candidate[1])
                    
                    if val != 0:
                        data_queue.put((task_index, candidate[0], col_index, val))
        else:
            for col_index, lf in enumerate(lfs):
                val = lf(candidate[1])
            
                if val != 0:
                    # put row_index, col_index and data onto a synchronized queue
                    data = (candidate[0], col_index, val)
                    data_queue.put(data)

    This function is called when each thread is created.

    lfs - the label functions to annotate candidates
    multitask - a boolean that tells the function to label candidates in a multitask format
    
This function is called when each thread is created.
lfs - the label functions to annotate candidates
multitask - a boolean that tells the function to label candidates in a multitask format
This function is called when each thread is created . lfs - the label functions to annotate candidates multitask - a boolean that tells the function to label candidates in a multitask format
def _label_candidates_multithread(lfs, multitask):
    while not(candidate_queue.empty()):
        candidate = candidate_queue.get()
        sys.stdout.write("\r{:7d}".format(candidate_queue.qsize()))
        sys.stdout.flush()
        if multitask:
            for task_index, lf_task in enumerate(lfs):
                for col_index, lf in enumerate(lf_task):
                    val = lf(candidate[1])
                    if val != 0:
                        data_queue.put((task_index, candidate[0], col_index, val))
        else:
            for col_index, lf in enumerate(lfs):
                val = lf(candidate[1])
                if val != 0:
                    data = (candidate[0], col_index, val)
                    data_queue.put(data)
def _label_candidates_multithread ( lfs , multitask ) : while not ( candidate_queue . empty ( ) ) : candidate = candidate_queue . get ( ) sys . stdout . write ( "\r{:7d}" . format ( candidate_queue . qsize ( ) ) ) sys . stdout . flush ( ) if multitask : for task_index , lf_task in enumerate ( lfs ) : for col_index , lf in enumerate ( lf_task ) : val = lf ( candidate [ 1 ] ) if val != 0 : data_queue . put ( ( task_index , candidate [ 0 ] , col_index , val ) ) else : for col_index , lf in enumerate ( lfs ) : val = lf ( candidate [ 1 ] ) if val != 0 : data = ( candidate [ 0 ] , col_index , val ) data_queue . put ( data )
This function is called when each thread is created.
This function is called when each thread is created .
"""
    This function is called when each thread is created.

    lfs - the label functions to annotate candidates
    multitask - a boolean that tells the function to label candidates in a multitask format
    """ # put row_index, col_index and data onto a synchronized queue
lfs
multitask