<commit_before># -*- coding: utf-8 -*-
""" Models for display visual shapes whose attributes can be associated
with data columns from data sources.

"""
from __future__ import absolute_import

from ..enums import Direction, Anchor
from ..mixins import FillProps, LineProps, TextProps
from ..plot_object import PlotObject
from ..properties import (abstract, AngleSpec, Bool, DistanceSpec, Enum, Float,
                          Include, Instance, NumberSpec, StringSpec)
from .. import themes

from .mappers import LinearColorMapper

@abstract
class Glyph(PlotObject):
    """ Base class for all glyph models. """

    def __init__(self, **kwargs):
        props = dict()
        if "line_alpha" in self.__class__.__dict__.keys():
            props.update(themes.default['line_defaults'])
        if "fill_alpha" in self.__class__.__dict__.keys():
            props.update(themes.default['fill_defaults'])
        if "text_alpha" in self.__class__.__dict__.keys():
            props.update(themes.default['text_defaults'])
        props.update(kwargs)
        super(Glyph, self).__init__(**props)


    visible = Bool(True, help="""
    Whether the glyph should render or not.
    """)

class AnnularWedge(Glyph):
    """ Render annular wedges. """

    __example__ = "tests/glyphs/AnnularWedge.py"

    # a canonical order for positional args that can be used for any
    # functions derived from this class<commit_msg>slightly better approach to apply default visual props to glyphs<commit_after># -*- coding: utf-8 -*-
""" Models for display visual shapes whose attributes can be associated
with data columns from data sources.

"""
from __future__ import absolute_import

from ..enums import Direction, Anchor
from ..mixins import FillProps, LineProps, TextProps
from ..plot_object import PlotObject
from ..properties import (abstract, AngleSpec, Bool, DistanceSpec, Enum, Float,
                          Include, Instance, NumberSpec, StringSpec)
from .. import themes

from .mappers import LinearColorMapper

@abstract
class Glyph(PlotObject):
    """ Base class for all glyph models. """

    def __init__(self, **kwargs):
        props = dict()
        if hasattr(self.__class__, "line_alpha"):
            props.update(themes.default['line_defaults'])
        if hasattr(self.__class__, "fill_alpha"):
            props.update(themes.default['fill_defaults'])
        if hasattr(self.__class__, "text_alpha"):
            props.update(themes.default['text_defaults'])
        props.update(kwargs)
        super(Glyph, self).__init__(**props)

    visible = Bool(True, help="""
    Whether the glyph should render or not.
    """)

class AnnularWedge(Glyph):
    """ Render annular wedges. """

    __example__ = "tests/glyphs/AnnularWedge.py"

    # a canonical order for positional args that can be used for any
    # functions derived from this class
{'fraction_non_alphanumeric': 0.105907025515554, 'fraction_numerical': 0.0006990562740300594, 'mean_word_length': 3.284431137724551, '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': '4904674', 'n_tokens_mistral': 800, 'n_tokens_neox': 765, 'n_words': 253}