Get available styles
515933
public static function getStyles()
    {
        $styles = [];

        $iterator = new \DirectoryIterator(ForumEnv::get('WEB_ROOT').'themes/');
        foreach ($iterator as $child) {
            if (!$child->isDot() && $child->isDir() &&
                file_exists($child->getPathname().DIRECTORY_SEPARATOR.'style.css')) {
                // If the theme is well formed, add it to the list
                $styles[] = $child->getFileName();
            }
        }

        natcasesort($styles);
        return $styles;
    }
821606
def list_styles(style_name):
    
    style = get_style_by_name(style_name)

    keys = list(style)[0][1]
    Styles = namedtuple("Style", keys)

    existing_styles = {}

    for ttype, ndef in style:
        s = Styles(**ndef)
        if s in existing_styles:
            existing_styles[s].append(ttype)
        else:
            existing_styles[s] = [ttype]

    for ndef, ttypes in existing_styles.items():
        print(ndef)
        for ttype in sorted(ttypes):
            print("\t%s" % str(ttype).split("Token.",1)[1])
1325223
function _getStyle(el, style) {
	return L.DomUtil.getStyle(el, style) || L.DomUtil.getStyle(el, _kebabToCamelCase(style));
}
523166
def _get_style_urls(self, asset_url_path):
        
        # Check cache
        if self.cache_path:
            cached = self._get_cached_style_urls(asset_url_path)
            # Skip fetching styles if there's any already cached
            if cached:
                return cached

        # Find style URLs
        r = requests.get(STYLE_URLS_SOURCE)
        if not 200 <= r.status_code < 300:
            print('Warning: retrieving styles gave status code',
                  r.status_code, file=sys.stderr)
        urls = []
        for style_urls_re in STYLE_URLS_RES:
            urls.extend(re.findall(style_urls_re, r.text))
        if not urls:
            print('Warning: no styles found - see https://github.com/joeyespo/'
                  'grip/issues/265', file=sys.stderr)

        # Cache the styles and their assets
        if self.cache_path:
            is_cached = self._cache_contents(urls, asset_url_path)
            if is_cached:
                urls = self._get_cached_style_urls(asset_url_path)

        return urls
895816
def get_style_defs(self, arg=None):
        
        if arg is None:
            arg = ('cssclass' in self.options and '.'+self.cssclass or '')
        if isinstance(arg, string_types):
            args = [arg]
        else:
            args = list(arg)

        def prefix(cls):
            if cls:
                cls = '.' + cls
            tmp = []
            for arg in args:
                tmp.append((arg and arg + ' ' or '') + cls)
            return ', '.join(tmp)

        styles = [(level, ttype, cls, style)
                  for cls, (style, ttype, level) in iteritems(self.class2style)
                  if cls and style]
        styles.sort()
        lines = ['%s { %s } /* %s */' % (prefix(cls), style, repr(ttype)[6:])
                 for (level, ttype, cls, style) in styles]
        if arg and not self.nobackground and \
           self.style.background_color is not None:
            text_style = ''
            if Text in self.ttype2class:
                text_style = ' ' + self.class2style[self.ttype2class[Text]][0]
            lines.insert(0, '%s { background: %s;%s }' %
                         (prefix(''), self.style.background_color, text_style))
        if self.style.highlight_color is not None:
            lines.insert(0, '%s.hll { background-color: %s }' %
                         (prefix(''), self.style.highlight_color))
        return '\n'.join(lines)
981705
def element_style(attrs, style_def, parent_style):
    """"""
    style = parent_style.copy()
    if 'class' in attrs:
        for css_class in attrs['class'].split():
            css_style = style_def['.' + css_class]
            style.update(css_style)
    if 'style' in attrs:
        immediate_style = dumb_property_dict(attrs['style'])
        style.update(immediate_style)
    return style
599675
private String fetchStyles(Document doc) {
        Elements els = doc.select(STYLE_TAG);
        StringBuilder styles = new StringBuilder();
        for (Element e : els) {
            if (e.attr("data-inline").equals("true")) {
                styles.append(e.data());
                e.remove();
            }
        }
        return styles.toString();
    }
94527
def load_styles(path_or_doc):
    """"""
    if isinstance(path_or_doc, string_types):
        doc = load(path_or_doc)
    else:
        # Recover the OpenDocumentText instance.
        if isinstance(path_or_doc, ODFDocument):
            doc = path_or_doc._doc
        else:
            doc = path_or_doc
        assert isinstance(doc, OpenDocument), doc
    styles = {_style_name(style): style for style in doc.styles.childNodes}
    return styles
859045
public function getStyles(): string
    {
        $str = '';

        if(isset($this->styles))
            foreach($this->styles as $style)
                if(isset($style['content']))
                    $str .= '<style type="'.$style['type'].'">'.$style['content'].'</style>';
                elseif(isset($style['href']))
                    $str .= '<link rel="'.$style['rel'].'" type="'.$style['type'].'" href="'.$style['href'].'"'.(($style['defer']) ? ' defer async' : '').' />';
                elseif(isset($style['raw']))
                    $str .= $style['raw'];

        return $str;
    }
470121
def _get_styles(self, style_urls, asset_url_path):
        
        styles = []
        for style_url in style_urls:
            urls_inline = STYLE_ASSET_URLS_INLINE_FORMAT.format(
                asset_url_path.rstrip('/'))
            asset_content = self._download(style_url)
            content = re.sub(urls_inline, self._match_asset, asset_content)
            styles.append(content)

        return styles
490035
public static function getKnownStyles()
    {
        $styles = array(
            static::BOLD      => static::BASH_BOLD,
            static::UNDERLINE => static::BASH_UNDERLINE,
            static::BLINK     => static::BASH_BLINK,
            static::INVISIBLE => static::BASH_INVISIBLE,
        );

        return $styles;
    }
1005205
function getCss(el, prop) {
  var styles = parse(el.attribs.style);
  if (typeof prop === 'string') {
    return styles[prop];
  } else if (Array.isArray(prop)) {
    return _.pick(styles, prop);
  } else {
    return styles;
  }
}
1128954
def getStyleCount(self, verbose=None):
        

        response=api(url=self.___url+'styles/count', method="GET", verbose=verbose, parse_params=False)
        return response
175503
function getStyle(options) {
  var styles = {
    nested: 0,
    expanded: 1,
    compact: 2,
    compressed: 3
  };

  return styles[options.outputStyle] || 0;
}
145938
def get_stylesheet(self, subreddit, **params):
        """"""
        url = self.config['stylesheet'].format(
            subreddit=six.text_type(subreddit))
        return self.request_json(url, params=params)['data']
334606
def getStyle(self, name, verbose=None):
        

        response=api(url=self.___url+'styles/'+str(name)+'.json', method="GET", verbose=verbose, parse_params=False)
        return response
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)