human
I wrote the below code

    assert ((y_min is None) == (y_max is None))
    if (y_min is not None):
        def _ScaleAndEncode(series):
            series = ScaleData(series, y_min, y_max, encoder.min, encoder.max)
            return encoder.Encode(series)
        encoded_series = [_ScaleAndEncode(s) for s in series]
    else:
        encoded_series = [encoder.Encode(s) for s in series]
    result = JoinLists(**{'data': encoded_series})
    result['data'] = (encoder.prefix + result['data'])
    return result

What's a good function header?
assistant
#Here is Python program to fix + result['data'])
.

def EncodeData(chart, series, y_min, y_max, encoder):