Load options from CONFIG if it exists
1405
def load_config
      (symbolise = lambda do |h|
        h.is_a?(Hash) ? Hash[h.map { |k, v| [k.intern, symbolise[v]] }] : h
      end)[YAML.load_file CONFIG] if File.readable? CONFIG
    rescue => e
      warn "Failed to load #{ CONFIG }: #{ e }"
    end
1171754
def get(dir = Dir.pwd, type = :local, options = {})
      conffile = config_file(dir, type, options)
      res = {}
      res = load_config( conffile ) if File.exist?( conffile )
      res
    end
1067203
def load_config(self):
        
        for key in self.settings:
            value = self.config(key)
            # Parse true/false
            if value == '' or value is None:
                continue  # Not set by user, go on
            if value.lower() == 'true':
                value = True
            elif value.lower() == 'false':
                value = False
            elif value:
                pass  # A user-defined string, store the value later

            self.settings[key] = value
1061192
def config():
    ''''''
    if hasattr(current_app, 'settings_file'):
        log.info('Loaded configuration from %s', current_app.settings_file)

    log.info(white('Current configuration'))
    for key in sorted(current_app.config):
        if key.startswith('__') or not key.isupper():
            continue
        echo('{0}: {1}'.format(white(key), current_app.config[key]))
740687
private function loadOptionValues(): void
	{
		$this->optionValues = array_merge(
			Option::getDefaults($this->moduleId),
			Option::getForModule($this->moduleId)
		);
	}
50650
def load_or_create_config(self, filename, config=None):
        """"""
        os.makedirs(os.path.dirname(os.path.expanduser(filename)), exist_ok=True)
        if os.path.exists(filename):
            return self.load(filename)

        if(config == None):
            config = self.random_config()

        self.save(filename, config)
        return config
260171
def options_from_file(args):
    
    logger.debug("updating options from config files")
    updated_from_file = []
    for config_file in CONFIG_FILES:
        logger.debug("updating from: %s", config_file)
        parser = ConfigParser()
        parser.read(config_file)
        try:
            items = parser.items('fades')
        except NoSectionError:
            continue

        for config_key, config_value in items:
            if config_value in ['true', 'false']:
                config_value = config_value == 'true'
            if config_key in MERGEABLE_CONFIGS:
                current_value = getattr(args, config_key, [])
                if current_value is None:
                    current_value = []
                current_value.append(config_value)
                setattr(args, config_key, current_value)
            if not getattr(args, config_key, False) or config_key in updated_from_file:
                # By default all 'store-true' arguments are False. So we only
                # override them if they are False. If they are True means that the
                # user is setting those on the CLI.
                setattr(args, config_key, config_value)
                updated_from_file.append(config_key)
                logger.debug("updating %s to %s from file settings", config_key, config_value)

    return args
141138
def load_config(cls, opts, path=None, profile=None):
        """"""
        if path and os.path.exists(path):
            if os.path.isdir(path):
                cls.config_searchpath.insert(0, path)
            else:
                cls.config_files.insert(0, path)

        config = cls.read_config()
        values = config.get("default", {})
        cls._load_values_into_opts(opts, values)

        if profile and profile != "default":
            values = config.get("profile:%s" % profile, {})
            cls._load_values_into_opts(opts, values)

        return values
955406
def load_config(options):
    '''  '''
    global opts, pform
    opts = options
    pform = options.pform
    global_ns = globals()

    # get colors
    if pform.hicolor:
        global_ns['dim_templ'] = ansi.dim8t
        global_ns['swap_clr_templ'] = ansi.csi8_blk % ansi.blu8
    else:
        global_ns['dim_templ'] = ansi.dim4t
        global_ns['swap_clr_templ'] = ansi.fbblue

    # load icons into module namespace
    for varname in dir(pform):
        if varname.startswith('_') and varname.endswith('ico'):
            global_ns[varname] = getattr(pform, varname)
1176075
def _load_config(self):
        
        if not os.path.exists(self._path):
            sys.exit("Config path %s does not exist" % self._path)
        # create empty config object
        self._config_dict = {}
        # read file and marshal yaml
        with open(self._path, 'r') as f:
            self._raw = f.read()
            self._config_dict = yaml.load(self._raw)
609737
def load(self, config):
        """"""
        self.config = config
        
        if 'start' not in self.config:
            raise ParseError('missing start entry')
        if 'states' not in self.config:
            raise ParseError('missing states entry')
        if 'transitions' not in self.config:
            raise ParseError('missing transitions entry')

        for state, val in self.config['states'].iteritems():
            state = State(state)
            state.entering = Action.load(val.get('entering'))
            state.leaving = Action.load(val.get('leaving'))
            
            self.states.add(state)
            
        self.start = self.states[self.config['start']]
        
        for transition, val in self.config['transitions'].iteritems():
            if '->' in transition:
                # from->to
                lft, rgt = transition.split('->')
                if lft == '*':
                    sfroms = self.states.keys()
                else:
                    sfroms = lft.split(',')
                if rgt == '*':
                    stos = self.states.keys()
                else:
                    stos = rgt.split(',')
                pairs = ((f, t) for f in sfroms for t in stos)
            else:
                # self transition 'from1,from2' = from1->from1, from2->from2
                if transition == '*':
                    ss = self.states.keys()
                else:
                    ss = transition.split(',')
                pairs = ((x, x) for x in ss)
                
            for sfrom, sto in pairs:
                if sfrom not in self.states:
                    raise ParseError("Could find state %r" % sfrom)
                if sto not in self.states:
                    raise ParseError("Could find state %r" % sto)

                s_from = self.states[sfrom]
                s_to = self.states[sto]
                
                if not isinstance(val, list):
                    val = [val]
                for v in val:
                    when = v['when']
                    actions = Action.load(v.get('actions'))
                    transition = Transition(s_from, s_to, Condition(when), actions)
                    s_from.transitions.append(transition)
1019173
def loads(self, config_str, as_defaults=False):
        
        self._rw.load_config_from_string(self._config, config_str, as_defaults=as_defaults)
638952
def load(self, _from):
        """"""

        def load_rec(inode, config):
            """Recursive part of loading."""
            for k in config:
                if isinstance(config[k], dict) and \
                   k not in ['value', 'default']:
                    if k in inode:
                        load_rec(inode[k], config[k])
                    else:
                        LOG.debug("+ config element: '%s'", k)
                else:
                    inode[k] = config[k]

        with open(_from, 'r') as infile:
            obj = yaml.load(infile, Loader=ConfigLoader)
            upgrade(obj)
            load_rec(self.node, obj)
            self['config_file'] = os.path.abspath(_from)
358821
def get_or_create_config(path, config):
    """"""
    if os.path.isfile(path):
        with open(path) as fh:
            _LOG.debug("loading config from %s", os.path.abspath(path))
            config._inflate(toml.load(fh))
    else:
        try:
            os.makedirs(os.path.dirname(path))
        except OSError:
            pass
        with open(path, "w") as fh:
            toml.dump(config._deflate(), fh)
1158653
def load_config(args, config_path=".inlineplz.yml"):
    """"""
    config = {}
    try:
        with open(config_path) as configfile:
            config = yaml.safe_load(configfile) or {}
            if config:
                print("Loaded config from {}".format(config_path))
                pprint.pprint(config)
    except (IOError, OSError, yaml.parser.ParserError):
        traceback.print_exc()
    args = update_from_config(args, config)
    args.ignore_paths = args.__dict__.get("ignore_paths") or [
        "node_modules",
        ".git",
        ".tox",
        "godeps",
        "vendor",
        "site-packages",
        "venv",
        ".env",
        "spec",
        "migrate",
        "bin",
        "fixtures",
        "cassettes",
        ".cache",
        ".idea",
        ".pytest_cache",
        "__pycache__",
        "dist",
    ]
    if config_path != ".inlineplz.yml":
        return args

    # fall back to config_dir inlineplz yaml if we didn't find one locally
    if args.config_dir and not config:
        new_config_path = os.path.join(args.config_dir, config_path)
        if os.path.exists(new_config_path):
            return load_config(args, new_config_path)

    return args
191634
protected function loadOptions(): void
    {
        $options = [];

        if ($this->preset == 'custom') {
            $optionsFile = null;
        } else {
            $optionsFile = __DIR__ . '/presets/' . $this->preset . '.php';
        }

        if ($optionsFile !== null) {
            if (!is_file($optionsFile)) {
                throw new InvalidConfigException('The CKEditor options file can not be loaded.');
            }
            $options = require($optionsFile);
        }

        $this->clientOptions = ArrayHelper::merge(
            $options,
            $this->clientOptions
        );
    }
1054561
def load_config(path=None):
    """"""
    if not path or not op.exists(path):
        return Config()
    path = op.realpath(path)
    dirpath, filename = op.split(path)
    file_ext = op.splitext(path)[1]
    logger.debug("Load config file `%s`.", path)
    if file_ext == '.py':
        config = PyFileConfigLoader(filename, dirpath,
                                    log=logger).load_config()
    elif file_ext == '.json':
        config = JSONFileConfigLoader(filename, dirpath,
                                      log=logger).load_config()
    return config