Combine the CherryPy configuration with the rest_cherrypy config values
        pulled from the master config and return the CherryPy configuration
777743
def get_conf(self):
        '''
        
        '''
        conf = {
            'global': {
                'server.socket_host': self.apiopts.get('host', '0.0.0.0'),
                'server.socket_port': self.apiopts.get('port', 8000),
                'server.thread_pool': self.apiopts.get('thread_pool', 100),
                'server.socket_queue_size': self.apiopts.get('queue_size', 30),
                'max_request_body_size': self.apiopts.get(
                    'max_request_body_size', 1048576),
                'debug': self.apiopts.get('debug', False),
                'log.access_file': self.apiopts.get('log_access_file', ''),
                'log.error_file': self.apiopts.get('log_error_file', ''),
            },
            '/': {
                'request.dispatch': cherrypy.dispatch.MethodDispatcher(),

                'tools.trailing_slash.on': True,
                'tools.gzip.on': True,

                'tools.html_override.on': True,
                'tools.cors_tool.on': True,
            },
        }

        if salt.utils.versions.version_cmp(cherrypy.__version__, '12.0.0') < 0:
            # CherryPy >= 12.0 no longer supports "timeout_monitor", only set
            # this config option when using an older version of CherryPy.
            # See Issue #44601 for more information.
            conf['global']['engine.timeout_monitor.on'] = self.apiopts.get(
                'expire_responses', True
            )

        if cpstats and self.apiopts.get('collect_stats', False):
            conf['/']['tools.cpstats.on'] = True

        if 'favicon' in self.apiopts:
            conf['/favicon.ico'] = {
                'tools.staticfile.on': True,
                'tools.staticfile.filename': self.apiopts['favicon'],
            }

        if self.apiopts.get('debug', False) is False:
            conf['global']['environment'] = 'production'

        # Serve static media if the directory has been set in the configuration
        if 'static' in self.apiopts:
            conf[self.apiopts.get('static_path', '/static')] = {
                'tools.staticdir.on': True,
                'tools.staticdir.dir': self.apiopts['static'],
            }

        # Add to global config
        cherrypy.config.update(conf['global'])

        return conf
844686
def merge_rest_api_config(configs):
    
    bind = None
    connect = None
    timeout = None
    opentsdb_url = None
    opentsdb_db = None
    opentsdb_username = None
    opentsdb_password = None
    client_max_size = None

    for config in reversed(configs):
        if config.bind is not None:
            bind = config.bind
        if config.connect is not None:
            connect = config.connect
        if config.timeout is not None:
            timeout = config.timeout
        if config.opentsdb_url is not None:
            opentsdb_url = config.opentsdb_url
        if config.opentsdb_db is not None:
            opentsdb_db = config.opentsdb_db
        if config.opentsdb_username is not None:
            opentsdb_username = config.opentsdb_username
        if config.opentsdb_password is not None:
            opentsdb_password = config.opentsdb_password
        if config.client_max_size is not None:
            client_max_size = config.client_max_size

    return RestApiConfig(
        bind=bind,
        connect=connect,
        timeout=timeout,
        opentsdb_url=opentsdb_url,
        opentsdb_db=opentsdb_db,
        opentsdb_username=opentsdb_username,
        opentsdb_password=opentsdb_password,
        client_max_size=client_max_size)
201214
def merge_config(self, user_config):
        '''
        
        '''

        # provisioanlly update the default configurations with the user preferences
        temp_data_config = copy.deepcopy(self.data_config).update(user_config)
        temp_model_config = copy.deepcopy(self.model_config).update(user_config)
        temp_conversation_config = copy.deepcopy(self.conversation_config).update(user_config)

        # if the new configurations validate, apply them
        if validate_data_config(temp_data_config):
            self.data_config = temp_data_config
        if validate_model_config(temp_model_config):
            self.model_config = temp_model_config
        if validate_conversation_config(temp_conversation_config):
            self.conversation_config = temp_conversation_config
1321126
def _merge_system_configs(host_config, container_config, out_file=None):
    
    out = copy.deepcopy(container_config)
    for k, v in host_config.items():
        if k in set(["galaxy_config"]):
            out[k] = v
        elif k == "resources":
            for pname, resources in v.items():
                if not isinstance(resources, dict) and pname not in out[k]:
                    out[k][pname] = resources
                else:
                    for rname, rval in resources.items():
                        if (rname in set(["cores", "jvm_opts", "memory"])
                              or pname in set(["gatk", "mutect"])):
                            if pname not in out[k]:
                                out[k][pname] = {}
                            out[k][pname][rname] = rval
    # Ensure final file is relocatable by mapping back to reference directory
    if "bcbio_system" in out and ("galaxy_config" not in out or not os.path.isabs(out["galaxy_config"])):
        out["galaxy_config"] = os.path.normpath(os.path.join(os.path.dirname(out["bcbio_system"]),
                                                             os.pardir, "galaxy",
                                                             "universe_wsgi.ini"))
    if out_file:
        with open(out_file, "w") as out_handle:
            yaml.safe_dump(out, out_handle, default_flow_style=False, allow_unicode=False)
    return out
950789
def merge_setting(request_setting, session_setting, dict_class=OrderedDict):
    

    if session_setting is None:
        return request_setting

    if request_setting is None:
        return session_setting

    # Bypass if not a dictionary (e.g. verify)
    if not (
            isinstance(session_setting, Mapping) and
            isinstance(request_setting, Mapping)
    ):
        return request_setting

    merged_setting = dict_class(to_key_val_list(session_setting))
    merged_setting.update(to_key_val_list(request_setting))

    # Remove keys that are set to None.
    for (k, v) in request_setting.items():
        if v is None:
            del merged_setting[k]

    merged_setting = dict((k, v) for (k, v) in merged_setting.items() if v is not None)

    return merged_setting
1149675
def to_api_repr(self):
        
        config = copy.deepcopy(self._properties)
        if self.options is not None:
            r = self.options.to_api_repr()
            if r != {}:
                config[self.options._RESOURCE_NAME] = r
        return config
785089
def getConfig(option, serverEndpoint=ServerEndpoint, verbose=Verbose, tikaServerJar=TikaServerJar, responseMimeType='application/json',
              services={'mime-types': '/mime-types', 'detectors': '/detectors', 'parsers': '/parsers/details'}):
    '''
    
    '''
    if option not in services:
        die('config option must be one of mime-types, detectors, or parsers')
    service = services[option]
    status, response = callServer('get', serverEndpoint, service, None, {'Accept': responseMimeType}, verbose, tikaServerJar)
    return (status, response)
219257
def conf_merger(user_dict, variable):
    
    if variable not in globals().keys():
        raise NameError("Unknown variable '%s'." % variable)

    if variable not in user_dict:
        return globals()[variable]

    return globals()[variable] and user_dict[variable]
1243304
def config():
    # type: () -> dict[str, Any]
    
    out = shell.run(
        'git config --list',
        capture=True,
        never_pretend=True
    ).stdout.strip()

    result = {}
    for line in out.splitlines():
        name, value = line.split('=', 1)
        result[name.strip()] = value.strip()

    return result
428595
def configuration(configuration_file=nil)
      return @configuration if @configuration
      logger.debug "getting repo_manager configuration"
      app_options = {}
      app_options[:config] = configuration_file || options[:config]
      @configuration = ::RepoManager::Settings.new(nil, app_options)
    end
362696
def join_configs(configs):

    """"""

    joined_config = {}

    for config in configs:
        joined_config.update(yaml.load(config))

    return joined_config
787229
def config(config_dict: typing.Mapping) -> Config:
    
    logger.debug(f"Updating with {config_dict}")
    _cfg.update(config_dict)
    return _cfg
1163176
def merge_configs(a, b, copy_trees=False):
        
        for key, value in b.items():
            # if key is in both a and b and both values are dictionary then merge it otherwise override it
            if key in a and isinstance(a[key], ConfigTree) and isinstance(b[key], ConfigTree):
                if copy_trees:
                    a[key] = a[key].copy()
                ConfigTree.merge_configs(a[key], b[key], copy_trees=copy_trees)
            else:
                if isinstance(value, ConfigValues):
                    value.parent = a
                    value.key = key
                    if key in a:
                        value.overriden_value = a[key]
                a[key] = value
                if a.root:
                    if b.root:
                        a.history[key] = a.history.get(key, []) + b.history.get(key, [value])
                    else:
                        a.history[key] = a.history.get(key, []) + [value]

        return a
1133411
def config(param_map, mastercode=DEFAULT_MASTERCODE):
    """"""
    pmap = {Config.mastercode: mastercode}
    pmap.update(param_map)
    processed_params = dict(_process_params(pmap))
    return processed_params
549899
def merge(value,
          default='',
          omit_opts=False,
          omit_master=False,
          omit_pillar=False):
    '''
    
    '''
    ret = None
    if not omit_opts:
        if value in __opts__:
            ret = __opts__[value]
            if isinstance(ret, six.string_types):
                return ret
    if not omit_master:
        if value in __pillar__.get('master', {}):
            tmp = __pillar__['master'][value]
            if ret is None:
                ret = tmp
                if isinstance(ret, six.string_types):
                    return ret
            elif isinstance(ret, dict) and isinstance(tmp, dict):
                tmp.update(ret)
                ret = tmp
            elif (isinstance(ret, (list, tuple)) and
                    isinstance(tmp, (list, tuple))):
                ret = list(ret) + list(tmp)
    if not omit_pillar:
        if value in __pillar__:
            tmp = __pillar__[value]
            if ret is None:
                ret = tmp
                if isinstance(ret, six.string_types):
                    return ret
            elif isinstance(ret, dict) and isinstance(tmp, dict):
                tmp.update(ret)
                ret = tmp
            elif (isinstance(ret, (list, tuple)) and
                    isinstance(tmp, (list, tuple))):
                ret = list(ret) + list(tmp)
    if ret is None and value in DEFAULTS:
        return DEFAULTS[value]
    return ret or default
560232
function enrichConfigWithGitParams( config ) {
    const
        ORIGIN = "origin",
        ORIGIN_LENGTH = ORIGIN.length,
        FETCH = " (fetch)",
        FETCH_LENGTH = FETCH.length;

    if ( !config.repository || !config.repository.url ) {
        const remotes = ChildProcess.execSync( "git remote -v" ).toString();
        let origin = '';
        remotes.split( "\n" ).forEach( function forEachRemote( remote ) {
            if ( remote.substr( 0, ORIGIN_LENGTH ) === ORIGIN ) {
                const restOfLine = remote.substr( ORIGIN_LENGTH );
                if ( restOfLine.substr( -FETCH_LENGTH ) === FETCH ) {
                    origin = restOfLine.substr( 0, restOfLine.length - FETCH_LENGTH ).trim();
                }
            }
        } );
        config.repository = {
            type: "git",
            url: origin
        };
    }
}
668867
def bootstrap_app():
    '''
    
    '''
    from salt.netapi.rest_cherrypy import app
    import salt.config

    __opts__ = salt.config.client_config(
            os.environ.get('SALT_MASTER_CONFIG', '/etc/salt/master'))
    return app.get_app(__opts__)