Returns a `gocd.Server` configured by the `settings`
    object.

    Args:
      settings: a `gocd_cli.settings.Settings` object.
        Default: if falsey calls `get_settings`.

    Returns:
      gocd.Server: a configured gocd.Server instance
971837
def get_go_server(settings=None):
    
    if not settings:
        settings = get_settings()

    return gocd.Server(
        settings.get('server'),
        user=settings.get('user'),
        password=settings.get('password'),
    )
984044
private static ThriftServerConfig getServerConfig(Configuration conf) {
    ThriftServerConfig serverConfig = new ThriftServerConfig();
    serverConfig.setPort(conf.getInt(StorageServiceConfigKeys.PROXY_THRIFT_PORT_KEY,
        StorageServiceConfigKeys.PROXY_THRIFT_PORT_DEFAULT));
    return serverConfig;
  }
609333
def config(self, settings):
        
        self.debug("()")
        # TODO synchronize access to vars
        try:
            self._device_id = settings['device_id']

            self._packet_timeout = settings.get(
                'packet_wait_timeout',
                self._packet_timeout
            )
            self._server_ip = settings.get('server_ip', self._server_ip)
            self._server_port = settings.get('server_port', self._server_port)
        except KeyError:
            raise SensorUpdateException("Key not in settings")

        if callable(self.on_config):
            try:
                self.on_config(settings)
            except:
                self.exception("Failed to update remote config")
                raise SensorUpdateException("Remote config failed")
564633
def _get_client(self, server):
        
        return Client(
            server=server[0],
            authport=server[1],
            secret=server[2],
            dict=self._get_dictionary(),
        )
328486
def global_config(cls, key, *args):
        '''  '''
        if args:
            cls.settings[key] = args[0]
        else:
            return cls.settings[key]
527588
def getclient():
        '''
        
        '''
        if not Configuration.client_initialized:
            Configuration._initconf()
            Configuration.client_settings = Configuration.settings['client']
            Configuration.client_initialized = True
        return Configuration.client_settings
1040114
def get_configuration(self):
        
        mapping = {}
        settings = self.get_settings()
        for service in self.context.getService():
            uid = api.get_uid(service)
            setting = settings.get(uid, {})
            config = {
                "hidden": setting.get("hidden", False),
            }
            mapping[uid] = config
        return mapping
1291756
def _redis_connection_settings(self):
        
        return {config.HOST: self.settings.get(config.HOST, self._REDIS_HOST),
                config.PORT: self.settings.get(config.PORT, self._REDIS_PORT),
                'selected_db': self.settings.get(config.DB, self._REDIS_DB)}
884218
def get_network_settings():
    '''
    
    '''
    skip_etc_default_networking = (
        __grains__['osfullname'] == 'Ubuntu' and
        int(__grains__['osrelease'].split('.')[0]) >= 12)

    if skip_etc_default_networking:
        settings = {}
        if __salt__['service.available']('networking'):
            if __salt__['service.status']('networking'):
                settings['networking'] = "yes"
            else:
                settings['networking'] = "no"
        else:
            settings['networking'] = "no"

        hostname = _parse_hostname()
        domainname = _parse_domainname()
        searchdomain = _parse_searchdomain()

        settings['hostname'] = hostname
        settings['domainname'] = domainname
        settings['searchdomain'] = searchdomain

    else:
        settings = _parse_current_network_settings()

    try:
        template = JINJA.get_template('display-network.jinja')
    except jinja2.exceptions.TemplateNotFound:
        log.error('Could not load template display-network.jinja')
        return ''

    network = template.render(settings)
    return _read_temp(network)
507231
def get_config(self, service, setting):
        
        try:
            return self.get_service(service)[setting]
        except KeyError:
            return getattr(self, setting + '_DEFAULT')
1015473
def get_settings(self):
    '''
    '''
    config = self._load_config_user()
    if self.name in config:
        return config[self.name]
590895
def server(self):
        
        from indico_chat.plugin import ChatPlugin

        return self.custom_server or ChatPlugin.settings.get('muc_server')
184934
def _user_settings(self):
        
        user_settings = getattr(settings, self._name, {})
        if not user_settings and self._required:
            raise ImproperlyConfigured("Settings file is missing dict options with name {}".format(self._name))
        keys = frozenset(user_settings.keys())

        required = self._required - keys
        if required:
            raise ImproperlyConfigured("Following options for {} are missing from settings file: {}".format(self._name, ', '.join(sorted(required))))

        removed = keys & self._removed
        if removed:
            raise ImproperlyConfigured("Following options for {} have been removed: {}".format(self._name, ', '.join(sorted(removed))))

        return user_settings
1307188
def get_settings(self):
        
        settings = {}
        for name in REMOTE_SETTINGS:
            settings[name] = self.get_option(name)

        # dataframe_format is stored without percent sign in config
        # to avoid interference with ConfigParser's interpolation
        name = 'dataframe_format'
        settings[name] = '%{0}'.format(self.get_option(name))
        return settings
869856
def _settings(self) -> Settings:
        
        if self.__dict__['__settings'] is None:
            self.__dict__['__settings'] = Settings()
            for file_path in self._get_files():
                if file_path:
                    # noinspection PyProtectedMember
                    self.__dict__['__settings']._load(file_path)
        return self.__dict__['__settings']
845554
def update(self, settings):
        
        settings = self.clean(settings)

        # Update internal dict
        self._settings.update(settings)

        # Push every setting items as class object attributes
        self.set_settings(settings)

        return self._settings
484323
def get_instance(in_memory=False, config_path=None, config_name=None):
  
  global __conf

  if __conf is None:
    __conf = Configuration(in_memory=in_memory, custom_cfg_path=config_path, config_name=config_name)

  return __conf