Helper function for creating a new style.
334258
def _create_style(name, family=None, **kwargs):
    """"""
    if family == 'paragraph' and 'marginbottom' not in kwargs:
        kwargs['marginbottom'] = '.5cm'
    style = Style(name=name, family=family)
    # Extract paragraph properties.
    kwargs_par = {}
    keys = sorted(kwargs.keys())
    for k in keys:
        if 'margin' in k:
            kwargs_par[k] = kwargs.pop(k)
    style.addElement(TextProperties(**kwargs))
    if kwargs_par:
        style.addElement(ParagraphProperties(**kwargs_par))
    return style
705122
def add_style(self, name, style_type, builtin=False):
        
        style_name = BabelFish.ui2internal(name)
        if style_name in self:
            raise ValueError("document already contains style '%s'" % name)
        style = self._element.add_style_of_type(
            style_name, style_type, builtin
        )
        return StyleFactory(style)
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
438634
def css(self, *props, **kwprops):
        """"""
        self._stable = False
        styles = {}
        if props:
            if len(props) == 1 and isinstance(props[0], Mapping):
                styles = props[0]
            else:
                raise WrongContentError(self, props, "Arguments not valid")
        elif kwprops:
            styles = kwprops
        else:
            raise WrongContentError(self, None, "args OR wkargs are needed")
        return self.attr(style=styles)
916885
function( styleDefinition, variableName )
				{

					var elementMigrateFilter = this.elementMigrateFilter;
					return function( value, element )
					{
						// Build an stylish element first.
						var styleElement = new CKEDITOR.htmlParser.element( null ),
							variables = {};

						variables[ variableName ] = value;
						elementMigrateFilter( styleDefinition, variables )( styleElement );
						// Place the new element inside the existing span.
						styleElement.children = element.children;
						element.children = [ styleElement ];
					};
				}
604017
def add_styles(self, **styles):
        """"""
        for stylename in sorted(styles):
            self._doc.styles.addElement(styles[stylename])
740845
def _fnop_style(schema, op, name):
        """"""
        if is_common(schema):
            if name in op.params:
                del op.params[name]
            return
        if _is_pending(schema):
            ntp = 'pending'
        elif schema.style is tuple:
            ntp = 'tuple'
        elif schema.style is _spl_dict:
            ntp = 'dict'
        elif _is_namedtuple(schema.style) and hasattr(schema.style, '_splpy_namedtuple'):
            ntp = 'namedtuple:' + schema.style._splpy_namedtuple
        else:
            return
        op.params[name] = ntp
584586
function(element, style) {
  Object.keys(style).forEach(function(key) {
    if (key in element.style) {
      element.style[key] = style[key];
    } else if (prefix(key) in element.style) {
      element.style[prefix(key)] = style[key];
    } else {
      util.warn('No such style property: ' + key);
    }
  });
  return element;
}
829069
function fixStyle(style) {
  Object.keys(style.sources).forEach(function (sourceId) {
    style.sources[sourceId] = fixRasterSource(style.sources[sourceId]);
  });
  return style;
}
96015
def stylify_code(code):
    """"""
    try:
        output = check_output(
            ['astyle', '--max-code-length=69', '--indent=spaces=2'],
            universal_newlines=True, input=code
        )
    except (OSError, CalledProcessError, TypeError):
        logging.debug(_('failed to stylify code'))
        return code
    return output
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
850811
function initStyle(opt_config) {
  var config = objects.clone(defaultConfig);
  if (opt_config) {
    objects.merge(config, opt_config);
  }
  var attrName = config.attributeName;
  var selector = '[' + attrName + ']';
  var rules = {};
  rules[selector] = {'display': 'none !important'};
  ui.createStyle(rules);
}
899248
function injectStyles() {
  if (_stylesInjected) return;
  _stylesInjected = true;

  let node = doc.createElement('style');
  node.innerHTML = css;
  node.type = 'text/css';

  if (doc.head.childNodes.length > 0) {
    doc.head.insertBefore(node, doc.head.childNodes[0]);
  } else {
    doc.head.appendChild(node);
  }
}
831308
function replace(styleUrls, options) {
  var styles = '';
  var urls = eval('({' + styleUrls + '}).styleUrls');
  if (urls) {
    urls.forEach(function (url, i) {
      var coma = i > 0 ? ', ' : '';
      styles += coma + getStylesString(url, options);
    });
  }


  var newLines = STYLES + ': [' + styles + ']';
  newLines += hasTraillingComa(styleUrls) ? ',' : '';
  return newLines;
}
1031364
function updatePseudoClassStyle(styleId, properties, preventFocusStyleForTouchAndClick) {
  let focusStyle;
  if (preventFocusStyleForTouchAndClick) {
    focusStyle = { outline: 0 };
  } else {
    focusStyle = {
      ...style.focusStyle,
      ...properties.focusStyle,
    };
  }

  const styles = [
    {
      id: styleId,
      style: focusStyle,
      pseudoClass: 'focus',
    },
  ];

  injectStyles(styles);
}
1073941
function patch(element, previous, style) {
  if (!previous && !style) {
    return style;
  }
  var rule;
  if (typeof style === 'object') {
    if (typeof previous === 'object') {
      for (rule in previous) {
        if (!style[rule]) {
          domElementCss(element, rule, null);
        }
      }
      domElementCss(element, style);
    } else {
      if (previous) {
        element.setAttribute('style', '');
      }
      domElementCss(element, style);
    }
  } else {
    element.setAttribute('style', style || '');
  }
}
1248921
def set_style(self, style):
        
        style = SolarizedStyle  # get_style_by_name(style)
        self._style = style
        self._clear_caches()