<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:

def get_unique_clause_indices( text ):
    ''' Returns a list of clause indices for the whole text. For each token in text, 
        the list contains index of the clause the word belongs to, and the indices
        are unique over the whole text. '''
    # Add clause boundary annotation (if missing)
    if not text.is_tagged( CLAUSES ):
        text.tag_clauses()
    # Collect (unique) clause indices over the whole text
    clause_indices = []
    sent_id = 0
    for sub_text in text.split_by( SENTENCES ):
        for word, cl_index in zip( sub_text.words, sub_text.clause_indices ):
            clause_indices.append( sent_id+cl_index )
        nr_of_clauses = len(set(sub_text.clause_indices))
        sent_id += nr_of_clauses
    assert len(clause_indices) == len(text.words), '(!) Number of clause indices should match nr of words!'
    return clause_indices