def set_link_color_palette(palette):
    if palette is None:
        # reset to its default
        palette = ['g', 'r', 'c', 'm', 'y', 'k']
    elif type(palette) not in (list, tuple):
        raise TypeError("palette must be a list or tuple")
    _ptypes = [isinstance(p, string_types) for p in palette]

    if False in _ptypes:
        raise TypeError("all palette list elements must be color strings")

    for i in list(_link_line_colors):
        _link_line_colors.remove(i)
    _link_line_colors.extend(list(palette))
Set list of matplotlib color codes for use by dendrogram.
dataset/ETHPy150Open scipy/scipy/scipy/cluster/hierarchy.py/set_link_color_palette