<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def eeg_microstates_relabel(method, results, microstates_labels, reverse_microstates=None):
 """ Relabel the microstates. """


    microstates = list(method['microstates'])

    for index, microstate in enumerate(method['microstates']):

        if microstate in list(reverse_microstates.keys()):
            microstates[index] = reverse_microstates[microstate]
            method["data"][index] = -1*method["data"][index]

        if microstate in list(microstates_labels.keys()):
            microstates[index] = microstates_labels[microstate]

    method['microstates'] = np.array(microstates)

    return(results, method)