human
Here's a good function header given the following:
I wrote the below code

    def _sequence_to_pandas_dataframe(sequence):
        'Generates    a    pandas    dataframe    from    a    sequence.'
        pd_dict = collections.defaultdict(list)
        for note in sequence.notes:
            pd_dict['start_time'].append(note.start_time)
            pd_dict['end_time'].append(note.end_time)
            pd_dict['duration'].append((note.end_time - note.start_time))
            pd_dict['pitch'].append(note.pitch)
            pd_dict['bottom'].append((note.pitch - 0.4))
            pd_dict['top'].append((note.pitch + 0.4))
            pd_dict['velocity'].append(note.velocity)
            pd_dict['fill_alpha'].append((note.velocity / 128.0))
            pd_dict['instrument'].append(note.instrument)
            pd_dict['program'].append(note.program)
        if (np.max(pd_dict['velocity']) == np.min(pd_dict['velocity'])):
            pd_dict['fill_alpha'] = ([1.0] * len(pd_dict['fill_alpha']))
        return pd.DataFrame(pd_dict)
    fig = bokeh.plotting.figure(tools='hover,pan,resize,box_zoom,reset,previewsave')
    fig.plot_width = 500
    fig.plot_height = 200
    fig.xaxis.axis_label = 'time    (sec)'
    fig.yaxis.axis_label = 'pitch    (MIDI)'
    fig.yaxis.ticker = bokeh.models.SingleIntervalTicker(interval=12)
    fig.ygrid.ticker = bokeh.models.SingleIntervalTicker(interval=12)
    spectral_color_indexes = [7, 0, 6, 1, 5, 2, 3]
    dataframe = _sequence_to_pandas_dataframe(sequence)
    instruments = sorted(set(dataframe['instrument']))
    grouped_dataframe = dataframe.groupby('instrument')
    for (counter, instrument) in enumerate(instruments):
        instrument_df = grouped_dataframe.get_group(instrument)
        color_idx = spectral_color_indexes[(counter % len(spectral_color_indexes))]
        color = bokeh.palettes.Spectral8[color_idx]
        source = bokeh.plotting.ColumnDataSource(instrument_df)
        fig.quad(top='top', bottom='bottom', left='start_time', right='end_time', line_color='black', fill_color=color, fill_alpha='fill_alpha', source=source)
   ...

What's a good function header?
assistant
#Here's a good function header.

def plot_sequence(sequence, show_figure=True):