def terminal_reserve(progress_obj, terminal_obj=None, verbose=0, identifier=None):
    if terminal_obj is None:
        terminal_obj = sys.stdout
    
    if identifier is None:
        identifier = ''
    else:
        identifier = identifier + ': ' 
    
    if terminal_obj in TERMINAL_RESERVATION:    # terminal was already registered
        if verbose > 1:
            print("{}this terminal {} has already been added to reservation list".format(identifier, terminal_obj))
        
        if TERMINAL_RESERVATION[terminal_obj] is progress_obj:
            if verbose > 1:
                print("{}we {} have already reserved this terminal {}".format(identifier, progress_obj, terminal_obj))
            return True
        else:
            if verbose > 1:
                print("{}someone else {} has already reserved this terminal {}".format(identifier, TERMINAL_RESERVATION[terminal_obj], terminal_obj))
            return False
    else:                                       # terminal not yet registered
        if verbose > 1:
            print("{}terminal {} was reserved for us {}".format(identifier, terminal_obj, progress_obj))
        TERMINAL_RESERVATION[terminal_obj] = progress_obj
        return True
Registers the terminal (stdout) for printing.
dataset/ETHPy150Open cimatosa/jobmanager/jobmanager/progress.py/terminal_reserve