def manual_pal(values):
max_n = len(values)<EOL>def _manual_pal(n):<EOL><INDENT>if n > max_n:<EOL><INDENT>msg = ("<STR_LIT>"<EOL>"<STR_LIT>")<EOL>warnings.warn(msg.format(max_n, n))<EOL><DEDENT>return values[:n]<EOL><DEDENT>return _manual_pal<EOL>
Create a palette from a list of values

Parameters
----------
values : sequence
    Values that will be returned by the palette function.

Returns
-------
out : function
    A function palette that takes a single
    :class:`int` parameter ``n`` and returns ``n`` values.

Examples
--------
>>> palette = manual_pal(['a', 'b', 'c', 'd', 'e'])
>>> palette(3)
['a', 'b', 'c']