Retrieve client settings from the possible config file locations.

        :param \\*\\*kwargs: Arguments that are passed into the client instance
502102
def get_client_settings_config_file(**kwargs):  # pylint: disable=inconsistent-return-statements
    
    config_files = ['/etc/softlayer.conf', '~/.softlayer']
    if kwargs.get('config_file'):
        config_files.append(kwargs.get('config_file'))
    config_files = [os.path.expanduser(f) for f in config_files]
    config = utils.configparser.RawConfigParser({
        'username': '',
        'api_key': '',
        'endpoint_url': '',
        'timeout': '0',
        'proxy': '',
    })
    config.read(config_files)

    if config.has_section('softlayer'):
        return {
            'endpoint_url': config.get('softlayer', 'endpoint_url'),
            'timeout': config.getfloat('softlayer', 'timeout'),
            'proxy': config.get('softlayer', 'proxy'),
            'username': config.get('softlayer', 'username'),
            'api_key': config.get('softlayer', 'api_key'),
        }
1356719
def _head(self, client_kwargs):
        
        with _handle_azure_exception():
            # File
            if 'file_name' in client_kwargs:
                result = self.client.get_file_properties(**client_kwargs)

            # Directory
            elif 'directory_name' in client_kwargs:
                result = self.client.get_directory_properties(**client_kwargs)

            # Share
            else:
                result = self.client.get_share_properties(**client_kwargs)

        return self._model_to_dict(result)
393879
def load_config_from_cli_arguments(self, *args, **kwargs):
        
        self._load_config_from_cli_argument(key='handlers_package', **kwargs)
        self._load_config_from_cli_argument(key='auth', **kwargs)
        self._load_config_from_cli_argument(key='user_stream', **kwargs)
        self._load_config_from_cli_argument(key='min_seconds_between_errors', **kwargs)
        self._load_config_from_cli_argument(key='sleep_seconds_on_consecutive_errors', **kwargs)
1119923
def getConf(cls, settings, options):
        ""
        ports = ['http_port', 'https_port', 'cache_port']
        for port_name in ports:
            port = getattr(settings, port_name.upper(), None)
            # only use the settings ports if the defaults were left unchanged
            default = getattr(defaults, port_name.upper())
            if port and options.get(port_name) == default:
                options[port_name] = port

        _opts = [
            ('key', 'hx_private_key'),
            ('cert', 'hx_certficate'),
            ('wsgi', 'wsgi_application')
        ]
        for opt_name, settings_name in _opts:
            opt = getattr(settings, settings_name.upper(), None)
            if opt:
                options[opt_name] = opt

        if not options['settings']:
            options['settings'] = environ['DJANGO_SETTINGS_MODULE']
        return options
144721
def get_s3_client():
    
    session_kwargs = {}
    if hasattr(settings, 'AWS_ACCESS_KEY_ID'):
        session_kwargs['aws_access_key_id'] = settings.AWS_ACCESS_KEY_ID

    if hasattr(settings, 'AWS_SECRET_ACCESS_KEY'):
        session_kwargs['aws_secret_access_key'] = settings.AWS_SECRET_ACCESS_KEY
    boto3.setup_default_session(**session_kwargs)

    s3_kwargs = {}
    if hasattr(settings, 'AWS_S3_ENDPOINT'):
        s3_kwargs['endpoint_url'] = settings.AWS_S3_ENDPOINT
    elif hasattr(settings, 'AWS_S3_HOST'):
        if hasattr(settings, 'AWS_S3_USE_SSL') and settings.AWS_S3_USE_SSL is False:
            protocol = "http://"
        else:
            protocol = "https://"
        s3_kwargs['endpoint_url'] = "{}{}".format(
            protocol,
            settings.AWS_S3_HOST
        )
    if hasattr(settings, "AWS_REGION"):
        s3_kwargs['region_name'] = settings.AWS_REGION
    s3_client = boto3.client('s3', **s3_kwargs)
    s3_resource = boto3.resource('s3', **s3_kwargs)
    return s3_client, s3_resource
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
297312
def get_registered_configs(self, instances=None):
        
        configs = self.state.get('config_files', {})
        if instances is not None:
            for config_file, config in configs.items():
                if config['instance_name'] not in instances:
                    configs.pop(config_file)
        return configs
39982
def setup(self, **kwargs):
        

        for key in kwargs:
            if key not in self.config.keys():
                raise error.GrabMisuseError('Unknown option: %s' % key)

        if 'url' in kwargs:
            if self.config.get('url'):
                kwargs['url'] = self.make_url_absolute(kwargs['url'])
        self.config.update(kwargs)
506290
def get_config(cli_args=None, config_path=None):
    
    config = Config(app_name="MYAPP",
                    cli_args=cli_args,
                    config_path=config_path)
    config_dict = config.get_config()
    return config_dict
1323021
def retrieve_config_file(self):
        
        try:
            if self.args["configfile"]:
                return self.args["configfile"]
        except KeyError:
            pass
        return os.path.expanduser('~/.config/greg/greg.conf')
68644
def get_settings_from_client(client):
    
    settings = {
        'username': '',
        'api_key': '',
        'timeout': '',
        'endpoint_url': '',
    }
    try:
        settings['username'] = client.auth.username
        settings['api_key'] = client.auth.api_key
    except AttributeError:
        pass

    transport = _resolve_transport(client.transport)
    try:
        settings['timeout'] = transport.timeout
        settings['endpoint_url'] = transport.endpoint_url
    except AttributeError:
        pass

    return settings
772612
def _settings_from_file(self):
        """"""
        settings = load_source(
            'settings', text_type(self.user_dir.joinpath('settings.py')))
        return {key: getattr(settings, key)
                for key in const.DEFAULT_SETTINGS.keys()
                if hasattr(settings, key)}
278929
def get_kwargs(self):
        
        return {
            'host': self.host,
            'port': self.port,
            'channel': self.channel,
            'password': self.password
        }
309391
def get_conn(client_type):
    '''
    
    '''
    conn_kwargs = {}

    conn_kwargs['subscription_id'] = salt.utils.stringutils.to_str(
        config.get_cloud_config_value(
            'subscription_id',
            get_configured_provider(), __opts__, search_global=False
        )
    )

    cloud_env = config.get_cloud_config_value(
        'cloud_environment',
        get_configured_provider(), __opts__, search_global=False
    )

    if cloud_env is not None:
        conn_kwargs['cloud_environment'] = cloud_env

    tenant = config.get_cloud_config_value(
        'tenant',
        get_configured_provider(), __opts__, search_global=False
    )

    if tenant is not None:
        client_id = config.get_cloud_config_value(
            'client_id',
            get_configured_provider(), __opts__, search_global=False
        )
        secret = config.get_cloud_config_value(
            'secret',
            get_configured_provider(), __opts__, search_global=False
        )
        conn_kwargs.update({'client_id': client_id, 'secret': secret,
                            'tenant': tenant})

    username = config.get_cloud_config_value(
        'username',
        get_configured_provider(), __opts__, search_global=False
    )

    if username is not None:
        password = config.get_cloud_config_value(
            'password',
            get_configured_provider(), __opts__, search_global=False
        )
        conn_kwargs.update({'username': username, 'password': password})

    client = __utils__['azurearm.get_client'](
        client_type=client_type, **conn_kwargs
    )

    return client
1343417
def get_configfile_user():
    '''
    '''
    from helpme.defaults import HELPME_CLIENT_SECRETS

    # The inital file has a funny username

    if not os.path.exists(HELPME_CLIENT_SECRETS):
        bot.debug('Generating settings file at %s' % HELPME_CLIENT_SECRETS)
        config_dir = os.path.dirname(HELPME_CLIENT_SECRETS)

        # The configuration directory might be needed for different clients
        if not os.path.exists(config_dir):
            mkdir_p(config_dir)

        name = RobotNamer().generate()

        # Generate the user config

        config = configparser.ConfigParser()
        config['DEFAULT'] = {'Alias': name }
        write_config(HELPME_CLIENT_SECRETS, config)

    return HELPME_CLIENT_SECRETS
402651
def get_settings(options = {}, request_options = {})
      options['getVersion'] = 2 if !options[:getVersion] && !options['getVersion']
      client.get(Protocol.settings_uri(name, options).to_s, :read, request_options)
    end
108651
def get_form_kwargs(self):
        
        kwargs = {"initial": self.get_initial()}
        if self.request.method == "GET":
            kwargs.update({"data": self.request.GET})
        kwargs.update({"searchqueryset": self.get_query_set()})
        return kwargs