<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def extract_sentences(nodes, token_node_indices):
 """ given a list of ``SaltNode``\s, returns a list of lists, where each list contains the indices of the nodes belonging to that sentence. """

    sents = []
    tokens = []
    for i, node in enumerate(nodes):
        if i in token_node_indices:
            if node.features['tiger.pos'] != '$.':
                tokens.append(i)
            else:  # start a new sentence, if 'tiger.pos' is '$.'
                tokens.append(i)
                sents.append(tokens)
                tokens = []
    return sents