Get the ConfigParser object which represents the content.

        This property is cached and only parses the content once.
963440
def parsed(self):
        
        if not self._parsed:

            self._parsed = ConfigParser()
            self._parsed.readfp(io.StringIO(self.content))

        return self._parsed
569786
def parser(input_file_path='config.json'):
    '''
    
    '''

    # --- Read .json file
    try:
        with open(input_file_path, 'r') as config_file:
            config_new = json.load(config_file)
            config_file.close()
    except:
        raise Exception('Config file "'+input_file_path+'" not loaded properly. Please check it an try again.')

    import copy
    options = update_config(config_new, copy.deepcopy(default_config))

    return options
522265
def parser(self):
        """"""
        parser = configparser.RawConfigParser()
        for filename in self.available_files:
            friendly_name = format_path(filename)
            logger.debug("Loading configuration file: %s", friendly_name)
            loaded_files = parser.read(filename)
            if len(loaded_files) == 0:
                self.report_issue("Failed to load configuration file! (%s)", friendly_name)
        logger.debug("Loaded %s from %s.",
                     pluralize(len(parser.sections()), "section"),
                     pluralize(len(self.available_files), "configuration file"))
        return parser
1157385
function parseFromConfigurationObject(configuration) {
  if (!configuration.document) {
    throw new Error('The parsed JDL content must be passed.');
  }
  init(configuration);
  fillApplications();
  fillDeployments();
  fillEnums();
  fillClassesAndFields();
  fillAssociations();
  fillOptions();
  return jdlObject;
}
62323
def fetch_config
      return @config if @config

      config_path = File.join(File.expand_path("..", screenshot.path), "Framefile.json")
      config_path = File.join(File.expand_path("../..", screenshot.path), "Framefile.json") unless File.exist?(config_path)
      file = ConfigParser.new.load(config_path)
      return {} unless file # no config file at all
      @config = file.fetch_value(screenshot.path)
    end
1190747
def _get_config(config_file):
    ''''''
    parser = ConfigParser.SafeConfigParser()
    if os.path.lexists(config_file):
        try:
            log.info('Reading config: %s', config_file)
            inp = open(config_file)
            parser.readfp(inp)
            return parser
        except (IOError, ConfigParser.ParsingError), err:
            raise ConfigError("Failed to read configuration %s\n%s" % (config_file, err))
    return None
328074
def safe_get(self, section, key):
        
        try:
            #Use full parent function so we can replace it in the class
            # if desired
            return configparser.RawConfigParser.get(self, section, key)
        except (configparser.NoSectionError,
                configparser.NoOptionError):
            return None
616820
def get(section, name):
    
    cfg = ConfigParser.SafeConfigParser({"working_dir": "/tmp", "debug": "0"})
    cfg.read(CONFIG_LOCATIONS)
    val = cfg.get(section, name)
    return val.strip("'").strip('"')
712442
def get_config_object():
    """"""
    global _DEFAULT_CONFIG_WRAPPER
    if _DEFAULT_CONFIG_WRAPPER is not None:
        return _DEFAULT_CONFIG_WRAPPER
    with _DEFAULT_CONFIG_WRAPPER_LOCK:
        if _DEFAULT_CONFIG_WRAPPER is not None:
            return _DEFAULT_CONFIG_WRAPPER
        _DEFAULT_CONFIG_WRAPPER = ConfigWrapper()
        return _DEFAULT_CONFIG_WRAPPER
1117813
def get_config(section, option, allow_empty_option=True, default=""):
    '''
    
    '''
    try:
        value = config.get(section, option)
        if value is None or len(value) == 0:
            if allow_empty_option:
                return ""
            else:
                return default
        else:
            return value
    except ConfigParser.NoSectionError:
        return default
21395
def _config_parser_to_defaultdict(config_parser):
    
    config = defaultdict(defaultdict)
    for section, section_content in config_parser.items():
        if section != 'DEFAULT':
            for option, option_value in section_content.items():
                config[section][option] = option_value
    return config
460412
def get_config_item(self, key):
        
        value = _lxc.Container.get_config_item(self, key)

        if value is False:
            return False
        elif value.endswith("\n"):
            return value.rstrip("\n").split("\n")
        else:
            return value
1077257
def config(self):
        
        if not hasattr(self, '_config'):
            raw_config = configparser.RawConfigParser()
            f = self._open()
            if f:
                raw_config.readfp(f)
                f.close()
            self._config = raw_config
        return self._config
1258049
def _get_config_dict_from_file(config_path=None):
    
    if config_path is None:
        config_path = DEFAULT_CONFIG_PATH

    # Default (empty) content will be used if config file does not exist.
    config_content = {}

    # If the config file exists we use that content.
    if os.path.isfile(config_path):
        with open(config_path) as fh:
            config_content = json.load(fh)

    return config_content
1254508
def read_config(desired_type: Type[ConfigParser], file_object: TextIOBase,
                logger: Logger, *args, **kwargs) -> ConfigParser:
    

    # see https://docs.python.org/3/library/configparser.html for details
    config = ConfigParser()
    config.read_file(file_object)

    return config
1112799
def parser(self):
        ""
        if not hasattr(self, '_conf'):
            cfile = self.config_file
            logger.debug('loading config %s' % cfile)
            if os.path.isfile(cfile):
                conf = self._create_config_parser()
                conf.read(os.path.expanduser(cfile))
            else:
                if self.robust:
                    logger.debug('no default config file %s--skipping' % cfile)
                else:
                    raise IOError('no such file: %s' % cfile)
                conf = None
            self._conf = conf
        return self._conf
428353
async def get_config(self):
        
        config_facade = client.ModelConfigFacade.from_connection(
            self.connection()
        )
        result = await config_facade.ModelGet()
        config = result.config
        for key, value in config.items():
            config[key] = ConfigValue.from_json(value)
        return config