Return a style object of the appropriate |BaseStyle| subclass, according
    to the type of *style_elm*.
436197
def StyleFactory(style_elm):
    
    style_cls = {
        WD_STYLE_TYPE.PARAGRAPH: _ParagraphStyle,
        WD_STYLE_TYPE.CHARACTER: _CharacterStyle,
        WD_STYLE_TYPE.TABLE:     _TableStyle,
        WD_STYLE_TYPE.LIST:      _NumberingStyle
    }[style_elm.type]

    return style_cls(style_elm)
613743
def _get_subclass(name):
        
        return next(x for x in BaseContainer.__subclasses__() if x.__name__ == name)
1175274
def edge_style(self, head, tail, **kwargs):
        '''
        
        '''
        if tail not in self.nodes:
            raise GraphError("invalid node %s" % (tail,))

        try:
            if tail not in self.edges[head]:
                self.edges[head][tail]= {}
            self.edges[head][tail] = kwargs
        except KeyError:
            raise GraphError("invalid edge  %s -> %s " % (head, tail) )
114610
def style_node(self, additional_style_attrib=None):
        
        style_attrib = {"style:name": self.name, "style:family": self.FAMILY}
        if additional_style_attrib:
            style_attrib.update(additional_style_attrib)
        if self.PARENT_STYLE_DICT:
            style_attrib.update(self.PARENT_STYLE_DICT)

        node = el("style:style", attrib=style_attrib)
        props = sub_el(node, self.STYLE_PROP, attrib=self.styles)
        return node
339432
def find_subclass(base: type, name: str) -> type:
    
    class_candidates = [klass
                        for klass in all_subclasses(base)
                        if klass.__name__ == name
                        ]
    if len(class_candidates) == 0:
        raise RuntimeError("No \"{0}\" subclass of \"{1}\".".format(base.__name__, name))
    elif len(class_candidates) > 1:
        raise RuntimeError("Multiple \"{0}\" subclasses of \"{1}\".".format(base.__name__, name))
    return class_candidates[0]
682817
def styleProperties(Class, style):
        
        properties = Dict()
        for property in style.getProperties(all=True):
            stylename = property.name + ':'
            properties[stylename] = property.value
            if property.priority != '':
                properties[stylename] = ' !'+property.priority
        return properties
75742
def _convert_to_style(cls, style_dict):
        

        from openpyxl.style import Style
        xls_style = Style()
        for key, value in style_dict.items():
            for nk, nv in value.items():
                if key == "borders":
                    (xls_style.borders.__getattribute__(nk)
                     .__setattr__('border_style', nv))
                else:
                    xls_style.__getattribute__(key).__setattr__(nk, nv)

        return xls_style
211478
def create_style_from_font(font):
    

    if font is None:
        return ''

    if type(font) is str:
        _font = font.split(' ')
    else:
        _font = font

    style = ''
    style += 'font-family: %s;\n' % _font[0]
    style += 'font-size: %spt;\n' % _font[1]
    font_items = ''
    for item in _font[2:]:
        if item == 'underline':
            style += 'text-decoration: underline;\n'
        else:
            font_items += item + ' '
    if font_items != '':
        style += 'font: %s;\n' % (font_items)
    return style
1307689
function getStyle(el, styleProp) {
  if (typeof window === 'undefined') {
    return;
  }

  var style;
  if (el.currentStyle) {
    style = el.currentStyle[styleProp];
  } else if (window.getComputedStyle) {
    style = document.defaultView.getComputedStyle(el, null).getPropertyValue(styleProp);
  }
  if (style && style.length === 0) {
    style = null;
  }
  return style;
}
788357
def subclass(cls, vt_code, vt_args):
        
        return type(vt_code.replace('/', '_'), (cls,), {'vt_code': vt_code, 'vt_args': vt_args})
1093717
def get_by_id(self, style_id, style_type = None):
        

        for st in self.styles.values():
            if st:
                if st.style_id == style_id:
                    return st

        if style_type:
            return self.styles.get(self.default_styles[style_type], None)
        return None
569209
def get_inline_styles(cls, instance):
        
        inline_styles = getattr(cls, 'default_inline_styles', {})
        css_style = instance.glossary.get('inline_styles')
        if css_style:
            inline_styles.update(css_style)
        return inline_styles
1293660
def _get_css_class(self, ttype):
        """"""
        ttypeclass = _get_ttype_class(ttype)
        if ttypeclass:
            return self.classprefix + ttypeclass
        return ''
278975
def get_pygments_style(style):
    """"""
    if isinstance(style, StyleMeta):
        return style
    if '.' in style:  # by python package/module
        module, name = style.rsplit('.', 1)
        return getattr(__import__(module, None, None, ['__name__']), name)
    else:             # by name
        if style == 'sphinx':
            from sphinx.pygments_styles import SphinxStyle
            return SphinxStyle
        elif style == 'pyramid':
            from sphinx.pygments_styles import PyramidStyle
            return PyramidStyle
        elif style == 'none':
            from sphinx.pygments_styles import NoneStyle
            return NoneStyle
        else:
            return get_style_by_name(style)
1252317
def style_defs(cls):
        
        formatter = HtmlFormatter()
        formatter.style.highlight_color = cls.VIOLATION_COLOR
        return formatter.get_style_defs()
889602
def bootstrap_styled(cls=None, add_meta=True, form_group=True, 
    input_class='form-control'):
    

    def real_decorator(cls):
        class NewClass(cls): pass
        NewClass.__name__ = cls.__name__
        NewClass = custom_widget_wrapper(NewClass)

        _call = NewClass.__call__

        def call(*args, **kwargs):
            if input_class:
                kwargs.setdefault('class', input_class)

            return _call(*args, **kwargs)

        if add_meta: call = meta_wrapped(call)
        if form_group: call = form_group_wrapped(call)

        NewClass.__call__ = call
        return NewClass

    if cls:
        # Allow calling decorator(cls) instead of decorator()(cls)
        rv = real_decorator(cls)
        return rv

    return real_decorator
853066
def add_style_of_type(self, name, style_type, builtin):
        
        style = self.add_style()
        style.type = style_type
        style.customStyle = None if builtin else True
        style.styleId = styleId_from_name(name)
        style.name_val = name
        return style