Load config params from the DNS TXT records, only the ones marked as dns
493580
function(next) {
            if (options.noDns || core.noDns) return next();
            core.loadDnsConfig(options, next);
        }
287656
def Convert(self, metadata, config, token=None):
    """"""
    result = ExportedDNSClientConfiguration(
        metadata=metadata,
        dns_servers=" ".join(config.dns_server),
        dns_suffixes=" ".join(config.dns_suffix))
    yield result
1030514
def _load_params(params, logger=logging):
    
    if isinstance(params, str):
        cur_path = os.path.dirname(os.path.realpath(__file__))
        param_file_path = os.path.join(cur_path, params)
        logger.info('Loading params from file %s' % param_file_path)
        save_dict = nd_load(param_file_path)
        arg_params = {}
        aux_params = {}
        for k, v in save_dict.items():
            tp, name = k.split(':', 1)
            if tp == 'arg':
                arg_params[name] = v
            if tp == 'aux':
                aux_params[name] = v
        return arg_params, aux_params
    elif isinstance(params, (tuple, list)) and len(params) == 2:
        return params[0], params[1]
    else:
        raise ValueError('Unsupported params provided. Must be either a path to the param file or'
                         ' a pair of dictionaries representing arg_params and aux_params')
999522
def get_recordInfo(self, headers, zoneID, zone, records):
        """"""
        if 'None' in records: #If ['None'] in record argument, query all.
            recordQueryEnpoint = '/' + zoneID + '/dns_records&per_page=100'
            recordUrl = self.BASE_URL + recordQueryEnpoint
            recordRequest = requests.get(recordUrl, headers=headers)
            recordResponse = recordRequest.json()['result']
            dev = []
            num = 0
            for value in recordResponse:
                recordName = recordResponse[num]['name']
                dev.append(recordName)
                num = num + 1
            records = dev
        updateRecords = []
        for record in records:
            if zone in record:
                recordFullname = record
            else:
                recordFullname = record + '.' + zone
            recordQuery = '/' + zoneID + '/dns_records?name=' + recordFullname
            recordUrl = self.BASE_URL + recordQuery
            recordInfoRequest = requests.get(recordUrl, headers=headers)
            recordInfoResponse = recordInfoRequest.json()['result'][0]
            recordID = recordInfoResponse['id']
            recordType = recordInfoResponse['type']
            recordProxy = str(recordInfoResponse['proxied'])
            recordContent = recordInfoResponse['content']
            if recordProxy == 'True':
                recordProxied = True
            else:
                recordProxied = False
            updateRecords.append([recordID, recordFullname, recordType,
                recordContent, recordProxied])
        return updateRecords
601211
private void loadAnnotateParameters() {
    annotateParser.addArgument("-m", "--model").required(true)
        .help("Pass the model to do the tagging as a parameter.\n");
    annotateParser.addArgument("--clearFeatures").required(false)
        .choices("yes", "no", "docstart").setDefault(Flags.DEFAULT_FEATURE_FLAG)
        .help(
            "Reset the adaptive features every sentence; defaults to 'no'; if -DOCSTART- marks"
                + " are present, choose 'docstart'.\n");
    annotateParser.addArgument("-l", "--language").required(false)
        .choices("ca", "de", "en", "es", "eu", "fr", "gl", "it", "nl", "pt",
            "ru")
        .help(
            "Choose language; it defaults to the language value in incoming NAF file.\n");
    annotateParser.addArgument("-o", "--outputFormat").required(false)
        .choices("conll03", "conll02", "naf", "opennlp")
        .setDefault(Flags.DEFAULT_OUTPUT_FORMAT)
        .help("Choose output format; it defaults to NAF.\n");
    annotateParser.addArgument("--lexer").choices("numeric")
        .setDefault(Flags.DEFAULT_LEXER).required(false)
        .help("Use lexer rules for NERC tagging; it defaults to false.\n");
    annotateParser.addArgument("--dictTag").required(false)
        .choices("tag", "post").setDefault(Flags.DEFAULT_DICT_OPTION).help(
            "Choose to directly tag entities by dictionary look-up; if the 'tag' option is chosen, "
                + "only tags entities found in the dictionary; if 'post' option is chosen, it will "
                + "post-process the results of the statistical model.\n");
    annotateParser.addArgument("--dictPath").required(false)
        .setDefault(Flags.DEFAULT_DICT_PATH).help(
            "Provide the path to the dictionaries for direct dictionary tagging; it ONLY WORKS if --dictTag "
                + "option is activated.\n");
  }
1225666
def parse_hosted_zones(self, hosted_zone, params):
        
        # When resuming upon throttling error, skip if already fetched
        hosted_zone_id = hosted_zone.pop('Id')
        hosted_zone['name'] = hosted_zone.pop('Name')
        api_client = params['api_client']
        record_sets = handle_truncated_response(api_client.list_resource_record_sets, {'HostedZoneId': hosted_zone_id}, ['ResourceRecordSets'])
        hosted_zone.update(record_sets)
        #print(str(record_sets))
        #record_sets = api_client.list_resource_record_sets()
        #hosted_zone['RecordSets'] = record_sets['Resourc']
        self.hosted_zones[hosted_zone_id] = hosted_zone
368547
def __load_list(self, config_filename, file_names):
        
        self._read_configuration_file(config_filename)
        self.connect()
        self.find_source_files_from_list(file_names)
        self._get_column_type()
        self.__read_stored_routine_metadata()
        self.__get_constants()
        self._get_old_stored_routine_info()
        self._get_correct_sql_mode()
        self.__load_stored_routines()
        self.__write_stored_routine_metadata()
        self.disconnect()
1223994
def load_params(self, params):
        
        logger.debug("Alignak parameters:")
        for key, value in sorted(self.clean_params(params).items()):
            update_attribute = None

            # Maybe it's a variable as $USER$ or $ANOTHERVARIABLE$
            # so look at the first character. If it's a $, it is a macro variable
            # if it ends with $ too
            if key[0] == '$' and key[-1] == '$':
                key = key[1:-1]
                # Update the macros list
                if key not in self.__class__.macros:
                    logger.debug("New macro %s: %s - %s", self, key, value)
                self.__class__.macros[key] = '$%s$' % key
                key = '$%s$' % key

                logger.debug("- macro %s", key)
                update_attribute = value
                # Create a new property to store the macro value
                if isinstance(value, list):
                    self.__class__.properties[key] = ListProp(default=value)
                else:
                    self.__class__.properties[key] = StringProp(default=value)
            elif key in self.properties:
                update_attribute = self.properties[key].pythonize(value)
            elif key in self.running_properties:
                logger.warning("using a the running property %s in a config file", key)
                update_attribute = self.running_properties[key].pythonize(value)
            elif key.startswith('$') or key in ['cfg_file', 'cfg_dir']:
                # it's a macro or a useless now param, we don't touch this
                update_attribute = value
            else:
                logger.debug("Guessing the property '%s' type because it "
                             "is not in %s object properties", key, self.__class__.__name__)
                update_attribute = ToGuessProp().pythonize(value)

            if update_attribute is not None:
                setattr(self, key, update_attribute)
                logger.debug("- update %s = %s", key, update_attribute)

        # Change Nagios2 names to Nagios3 ones (before using them)
        self.old_properties_names_to_new()

        # Fill default for myself - new properties entry becomes a self attribute
        self.fill_default()
799617
def records(self, domain, params=None):
        ''' 
        '''
        params = update_params(params, {'domain': domain})
        return self.request('/v1/dns/records', params, 'GET')
1366908
def extract_params(env)
      result = env.fetch(QUERY_HASH, {})
      result.merge!(env.fetch(FORM_HASH, {}))
      result.merge!(Utils::Hash.deep_stringify(env.fetch(ROUTER_PARAMS, {})))
      result
    end
624643
def _parse_parameters(self, resource, params):
        '''
        '''
        # remove params from resource URI (needed for paginated stuff)
        parsed_uri = urlparse(resource)
        qs = parsed_uri.query
        resource = urlunparse(parsed_uri._replace(query=''))
        prms = {}
        for tup in parse_qsl(qs):
            prms[tup[0]] = tup[1]

        # params supplied to self.get() override parsed params
        for key in params:
            prms[key] = params[key]
        return resource, prms
53451
protected final void loadQueryString(Map<String, String[]> params) {
        for (Map.Entry<String, String[]> param : params.entrySet()) {
            loadKeys(param.getKey(), param.getValue());
        }
    }
839758
def cli(env, zone_id, by_record, by_id, data, ttl):
    """"""
    manager = SoftLayer.DNSManager(env.client)
    zone_id = helpers.resolve_id(manager.resolve_ids, zone_id, name='zone')

    results = manager.get_records(zone_id, host=by_record)

    for result in results:
        if by_id and str(result['id']) != by_id:
            continue
        result['data'] = data or result['data']
        result['ttl'] = ttl or result['ttl']
        manager.edit_record(result)
1374100
def load_params(opts = {})
      Dotenv.load if opts[:use_dotenv]
      manifest.each do |p|
        env_name = p[:name].to_s
        if p[:const]
          # const
          @params[p[:name]] = p[:default]
        elsif p[:required]
          # required configurable
          @params[p[:name]] = ENV[env_name] if ENV.key?(env_name)
        else
          # optional configurable
          @params[p[:name]] = ENV.key?(env_name) ? ENV[env_name] : p[:default]
        end
      end
      @params
    end
1202866
def _connect_params_dict(self):
        """"""
        conn_dict = {
            "hostname": self.host,
            "port": self.port,
            "username": self.username,
            "password": self.password,
            "look_for_keys": self.use_keys,
            "allow_agent": self.allow_agent,
            "key_filename": self.key_file,
            "pkey": self.pkey,
            "passphrase": self.passphrase,
            "timeout": self.timeout,
            "auth_timeout": self.auth_timeout,
        }

        # Check if using SSH 'config' file mainly for SSH proxy support
        if self.ssh_config_file:
            conn_dict = self._use_ssh_config(conn_dict)
        return conn_dict
1357985
def get_record(self, dns_type, name):
        
        try:
            record = [record for record in self.dns_records
                      if record['type'] == dns_type and record['name'] == name][0]
        except IndexError:
            raise RecordNotFound(
                'Cannot find the specified dns record in domain {domain}'
                .format(domain=name))
        return record
591999
def _parse_network_settings(opts, current):
    '''
    
    '''
    # Normalize keys
    opts = dict((k.lower(), v) for (k, v) in six.iteritems(opts))
    current = dict((k.lower(), v) for (k, v) in six.iteritems(current))

    # Check for supported parameters
    retain_settings = opts.get('retain_settings', False)
    result = current if retain_settings else {}

    # Default quote type is an empty string, which will not quote values
    quote_type = ''

    valid = _CONFIG_TRUE + _CONFIG_FALSE
    if 'enabled' not in opts:
        try:
            opts['networking'] = current['networking']
            # If networking option is quoted, use its quote type
            quote_type = salt.utils.stringutils.is_quoted(opts['networking'])
            _log_default_network('networking', current['networking'])
        except ValueError:
            _raise_error_network('networking', valid)
    else:
        opts['networking'] = opts['enabled']

    true_val = '{0}yes{0}'.format(quote_type)
    false_val = '{0}no{0}'.format(quote_type)

    networking = salt.utils.stringutils.dequote(opts['networking'])
    if networking in valid:
        if networking in _CONFIG_TRUE:
            result['networking'] = true_val
        elif networking in _CONFIG_FALSE:
            result['networking'] = false_val
    else:
        _raise_error_network('networking', valid)

    if 'hostname' not in opts:
        try:
            opts['hostname'] = current['hostname']
            _log_default_network('hostname', current['hostname'])
        except Exception:
            _raise_error_network('hostname', ['server1.example.com'])

    if opts['hostname']:
        result['hostname'] = '{1}{0}{1}'.format(
            salt.utils.stringutils.dequote(opts['hostname']), quote_type)
    else:
        _raise_error_network('hostname', ['server1.example.com'])

    if 'nozeroconf' in opts:
        nozeroconf = salt.utils.stringutils.dequote(opts['nozeroconf'])
        if nozeroconf in valid:
            if nozeroconf in _CONFIG_TRUE:
                result['nozeroconf'] = true_val
            elif nozeroconf in _CONFIG_FALSE:
                result['nozeroconf'] = false_val
        else:
            _raise_error_network('nozeroconf', valid)

    for opt in opts:
        if opt not in ['networking', 'hostname', 'nozeroconf']:
            result[opt] = '{1}{0}{1}'.format(
                salt.utils.stringutils.dequote(opts[opt]), quote_type)
    return result