<commit_before>from __future__ import absolute_import

from ..plot_object import PlotObject
from ..properties import Float, Color, Enum, Seq
from ..enums import Palette
from .. import palettes

class ColorMapper(PlotObject):
    """ Base class for color mapper objects. """

class LinearColorMapper(ColorMapper):
    palette = Seq(Color).accepts(Enum(Palette), lambda pal: getattr(palettes, pal))

    low = Float
    high = Float

    reserve_color = Color("#ffffff")    # TODO: What is the color code for transparent?
    reserve_val = Float(default=None)<commit_msg>Restore LinearColorMapper(palette) syntax<commit_after>from __future__ import absolute_import

from ..plot_object import PlotObject
from ..properties import Float, Color, Enum, Seq
from ..enums import Palette
from .. import palettes

class ColorMapper(PlotObject):
    """ Base class for color mapper objects. """

class LinearColorMapper(ColorMapper):
    palette = Seq(Color).accepts(Enum(Palette), lambda pal: getattr(palettes, pal))

    low = Float
    high = Float

    reserve_color = Color("#ffffff")    # TODO: What is the color code for transparent?
    reserve_val = Float(default=None)

    def __init__(self, palette=None, **kwargs):
        if palette is not None: kwargs['palette'] = palette
        super(LinearColorMapper, self).__init__(**kwargs)
{'fraction_non_alphanumeric': 0.1005251312828207, 'fraction_numerical': 0.0, 'mean_word_length': 4.40080971659919, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6164718', 'n_tokens_mistral': 385, 'n_tokens_neox': 373, 'n_words': 122}