parameters: (style_config)
return_statement: return _CreateStyleFromConfigParser(config)
docstring: Create a style dict from the given config.
  
    Arguments:
      style_config: either a style name or a file name. The file is expected to
        contain settings. It can have a special BASED_ON_STYLE setting naming the
        style which it derives from. If no such setting is found, it derives from
        the default style. When style_config is None, the _GLOBAL_STYLE_FACTORY
        config is created.
  
    Returns:
      A style dict.
  
    Raises:
      StyleConfigError: if an unknown style option was encountered.
docstring_summary: Create a style dict from the given config.
docstring_tokens: Create a style dict from the given config .
function: def CreateStyleFromConfig(style_config):
    """Create a style dict from the given config.
  
    Arguments:
      style_config: either a style name or a file name. The file is expected to
        contain settings. It can have a special BASED_ON_STYLE setting naming the
        style which it derives from. If no such setting is found, it derives from
        the default style. When style_config is None, the _GLOBAL_STYLE_FACTORY
        config is created.
  
    Returns:
      A style dict.
  
    Raises:
      StyleConfigError: if an unknown style option was encountered.
    """
  
    def GlobalStyles():
      for style, _ in _DEFAULT_STYLE_TO_FACTORY:
        yield style
  
    def_style = False
    if style_config is None:
      for style in GlobalStyles():
        if _style == style:
          def_style = True
          break
      if not def_style:
        return _style
      return _GLOBAL_STYLE_FACTORY()
    style_factory = _STYLE_NAME_TO_FACTORY.get(style_config.lower())
    if style_factory is not None:
      return style_factory()
    if style_config.startswith('{'):
      # Most likely a style specification from the command line.
      config = _CreateConfigParserFromConfigString(style_config)
    else:
      # Unknown config name: assume it's a file name then.
      config = _CreateConfigParserFromConfigFile(style_config)
    return _CreateStyleFromConfigParser(config)
function_tokens: def CreateStyleFromConfig ( style_config ) : def GlobalStyles ( ) : for style , _ in _DEFAULT_STYLE_TO_FACTORY : yield style def_style = False if style_config is None : for style in GlobalStyles ( ) : if _style == style : def_style = True break if not def_style : return _style return _GLOBAL_STYLE_FACTORY ( ) style_factory = _STYLE_NAME_TO_FACTORY . get ( style_config . lower ( ) ) if style_factory is not None : return style_factory ( ) if style_config . startswith ( '{' ) : # Most likely a style specification from the command line. config = _CreateConfigParserFromConfigString ( style_config ) else : # Unknown config name: assume it's a file name then. config = _CreateConfigParserFromConfigFile ( style_config ) return _CreateStyleFromConfigParser ( config )