def pitch_contour(annotation, **kwargs):
ax = kwargs.pop('<STR_LIT>', None)<EOL>ax = mir_eval.display.__get_axes(ax=ax)[<NUM_LIT:0>]<EOL>times, values = annotation.to_interval_values()<EOL>indices = np.unique([v['<STR_LIT:index>'] for v in values])<EOL>for idx in indices:<EOL><INDENT>rows = [i for (i, v) in enumerate(values) if v['<STR_LIT:index>'] == idx]<EOL>freqs = np.asarray([values[r]['<STR_LIT>'] for r in rows])<EOL>unvoiced = ~np.asarray([values[r]['<STR_LIT>'] for r in rows])<EOL>freqs[unvoiced] *= -<NUM_LIT:1><EOL>ax = mir_eval.display.pitch(times[rows, <NUM_LIT:0>], freqs, unvoiced=True,<EOL>ax=ax,<EOL>**kwargs)<EOL><DEDENT>return ax<EOL>
Plotting wrapper for pitch contours