Access the configuration for a given service and setting. If the
        service is not found, return a default value.
507231
def get_config(self, service, setting):
        
        try:
            return self.get_service(service)[setting]
        except KeyError:
            return getattr(self, setting + '_DEFAULT')
1148965
def get_config_value(self, name, defaultValue):
    
    self.send_get_config_value(name, defaultValue)
    return self.recv_get_config_value()
149940
def service(self, service):
        
        if service is None:
            raise ValueError("Invalid value for `service`, must not be `None`")
        allowed_values = ["lwm2m", "bootstrap"]
        if service not in allowed_values:
            raise ValueError(
                "Invalid value for `service` ({0}), must be one of {1}"
                .format(service, allowed_values)
            )

        self._service = service
1013027
def _get_service_config(self):
        
        key = self._get_or_create_service_key()

        config = {}
        config['service_key'] = [{'name': self.name}]
        config.update(key['entity']['credentials'])

        return config
1246005
def get_service(cls, repository, command):
        '''
        '''
        if not repository:
            config = git_config.GitConfigParser(cls.get_config_path())
        else:
            config = repository.config_reader()
        target = cls.command_map.get(command, command)
        conf_section = list(filter(lambda n: 'gitrepo' in n and target in n, config.sections()))

        http_section = [config._sections[scheme] for scheme in ('http', 'https') if scheme in config.sections()]

        # check configuration constraints
        if len(conf_section) == 0:
            if not target:
                raise ValueError('Service {} unknown'.format(target))
            else:
                config = dict()
        elif len(conf_section) > 1:
            raise ValueError('Too many configurations for service {}'.format(target))
        # get configuration section as a dict
        else:
            config = config._sections[conf_section[0]]

        if target in cls.service_map:
            service = cls.service_map.get(target, cls)
            service.name = target
        else:
            if 'type' not in config:
                raise ValueError('Missing service type for custom service.')
            if config['type'] not in cls.service_map:
                raise ValueError('Service type {} does not exists.'.format(config['type']))
            service = cls.service_map.get(config['type'], cls)

        cls._current = service(repository, config, http_section)
        return cls._current
479157
private static String[] adjustConf(String[] argv, Configuration conf) {
    String[] serviceId = new String[] { "" };
    String[] filteredArgv = DFSUtil.getServiceName(argv, serviceId);
    
    if (!serviceId[0].equals("")) {
      NameNode.checkServiceName(conf, serviceId[0]);
      DFSUtil.setGenericConf(conf, serviceId[0],
          NameNode.NAMESERVICE_SPECIFIC_KEYS);
      NameNode.setupDefaultURI(conf);
    }
    
    // make it avatar aware (manual option)
    if (optionExist(argv, "-one")) {
      updateConfKeys(conf, "1", serviceId[0]);
    } else {
      updateConfKeys(conf, "0", serviceId[0]);
    }
    return filteredArgv;
  }
956324
def property(self, name, default=MISSING):
        

        if name in self.settings:
            return self.settings[name]

        if default is not MISSING:
            return default

        raise ArgumentError("property %s not found for target '%s' and no default given" % (name, self.name))
132208
function defaultService (config) {
  const serviceConfig = _.merge({}, baseServiceConfig);

  // Apply MetaData
  serviceConfig.metadata = objectMetadata({
    name: config.projectName,
    namespace: config.namespace.name
  });

  serviceConfig.spec.selector = {
    project: config.projectName,
    provider: 'nodeshift'
  };

  serviceConfig.spec.ports = [
    {
      protocol: 'TCP',
      port: config.port,
      targetPort: config.port,
      name: 'http'
    }
  ];

  serviceConfig.spec.type = 'ClusterIP';

  return serviceConfig;
}
1012952
def _get_existing_conf(config):
    
    try:
        with open(os.path.join(config, 'local.conf'), 'r') as f:
            lines = [line for line in f.readlines()
                     if not (line.startswith('service_id') or line.startswith('client_secret'))]
    except IOError:
        lines = []
    return lines
1360432
def get_configuration(self):
        
        mapping = {}
        settings = self.get_settings()
        for record in self.context.getAnalyses():
            uid = record.get("service_uid")
            setting = settings.get(uid, {})
            config = {
                "partition": record.get("partition"),
                "hidden": setting.get("hidden", False),
            }
            mapping[uid] = config
        return mapping
138198
def get_context_data(self, **kwargs):
        
        context = super(UserServiceUpdateView, self).get_context_data(**kwargs)
        context['service_name_alone'] = self.object.name.name.rsplit('Service')[1]
        context['service_name'] = self.object.name.name
        context['SERVICES_AUTH'] = settings.SERVICES_AUTH
        context['SERVICES_HOSTED_WITH_AUTH'] = settings.SERVICES_HOSTED_WITH_AUTH
        context['SERVICES_NEUTRAL'] = settings.SERVICES_NEUTRAL

        context['action'] = 'edit'
        return context
754188
def get(self, key: str, default: Any = DEFAULT):
        
        if default is self.DEFAULT:
            try:
                value = self.params.get(key)
            except KeyError:
                raise ConfigurationError("key \"{}\" is required at location \"{}\"".format(key, self.history))
        else:
            value = self.params.get(key, default)
        return self._check_is_dict(key, value)
911482
def is_enabled(self, name):
        
        if self.services and name in self.services:
            return self.services[name]['config'] == 'enabled'
        return False
612200
def get_service(self, name):
        
        self._convert_connected_app()
        if not self.project_config.services or name not in self.project_config.services:
            self._raise_service_not_valid(name)
        if name not in self.services:
            self._raise_service_not_configured(name)

        return self._get_service(name)
179147
def _get_service_port(self, instance):
        
        host = instance.get('host', DEFAULT_HOST)
        port = instance.get('port', DEFAULT_PORT)
        # default port is the name of the service but lookup would fail
        # if the /etc/services file is missing. In that case, fallback to numeric
        try:
            socket.getaddrinfo(host, port)
        except socket.gaierror:
            port = DEFAULT_PORT_NUM

        return port
1089344
def _get_service(name):
    '''
    
    '''
    services = __utils__['mac_utils.available_services']()
    name = name.lower()

    service = _name_in_services(name, services)

    # if we would the service we can return it
    if service:
        return service

    # if we got here our service is not available, now we can check to see if
    # we received a cached batch of services, if not we did a fresh check
    # so we need to raise that the service could not be found.
    try:
        if not __context__['using_cached_services']:
            raise CommandExecutionError('Service not found: {0}'.format(name))
    except KeyError:
        pass

    # we used a cached version to check, a service could have been made
    # between now and then, we should refresh our available services.
    services = __utils__['mac_utils.available_services'](refresh=True)

    # check to see if we found the service we are looking for.
    service = _name_in_services(name, services)

    if not service:
        # Could not find the service after refresh raise.
        raise CommandExecutionError('Service not found: {0}'.format(name))

    # found it :)
    return service
985050
public String get(String key, String defaultValue)
    {
        if( configs.containsKey(key) ){
            return configs.get(key);
        }

        return defaultValue;
    }