Get data from configs which store boolean records
431806
def getboolean_config(section, option, default=False):
    '''
    
    '''
    try:
        return config.getboolean(section, option) or default
    except ConfigParser.NoSectionError:
        return default
457423
def _attach_config(mfg_event, record):
  """"""
  if 'config' not in record.metadata:
    return
  attachment = mfg_event.attachment.add()
  attachment.name = 'config'
  attachment.value_binary = _convert_object_to_json(record.metadata['config'])
  attachment.type = test_runs_pb2.TEXT_UTF8
996217
def get_records(cls, ids, with_deleted=False):
        
        with db.session.no_autoflush:
            query = RecordMetadata.query.filter(RecordMetadata.id.in_(ids))
            if not with_deleted:
                query = query.filter(RecordMetadata.json != None)  # noqa

            return [cls(obj.json, model=obj) for obj in query.all()]
1352263
def boolean(name=None):
    

    if name is None:
        name = 'Boolean Field'

    # Basic field
    field = pp.Regex('[YN]')

    # Parse action
    field.setParseAction(lambda b: _to_boolean(b[0]))

    # Name
    field.setName(name)

    return field
1332108
def get_values():
    

    # First load a mapping between config name and default value
    default_initial = ((name, options[0])
                       for name, options in settings.CONFIG.items())
    # Then update the mapping with actually values from the backend
    initial = dict(default_initial, **dict(config._backend.mget(settings.CONFIG)))

    return initial
378451
function (cb) {

                var db  = linz.mongoose.connection.db,
                    configKeys = Object.keys(req.linz.configs),
                    filter = { _id: { $in: configKeys } };

                db.collection(linz.get('configs collection name'), function (err, collection) {

                    // find documents matching each of the available config schema name
                    collection.find(filter).toArray(function(err, items) {

                        if (err) {
                            return cb(err);
                        }

                        if (items.length === 0) {
                            // return error to skip the next asyn function that inspect the records since none is found.
                            return cb(new Error('No record found.'), items) ;
                        }

                        return cb(null, items);

                    });
                });

			}
1358636
def boolean_or_list(config_name, args, configs, alternative_names=[]):
    """"""

    # when argument flag present, set to wildcard regex
    for key in alternative_names + [config_name]:
        if hasattr(args, key) and getattr(args, key):
            setattr(args, config_name, ['.*'])
            return

    setattr(args, config_name, [])

    option = None
    alternative_names.insert(0, config_name)
    for key in alternative_names:
        if configs.has_option('settings', key):
            option = configs.get('settings', key)
            break

    if option is not None:
        if option.strip().lower() == 'true':
            setattr(args, config_name, ['.*'])
        elif option.strip().lower() != 'false':
            for pattern in option.split("\n"):
                if pattern.strip() != '':
                    getattr(args, config_name).append(pattern)
1063591
def get_kbd_values_by_def(confdict, searchwith=""):
    
    from invenio_search.api import Query

    # get the configuration so that we see what the field is
    if not confdict:
        return []
    if 'field' not in confdict:
        return []
    field = confdict['field']
    expression = confdict['expression']
    collection = ""
    if 'collection' in confdict:
        collection = confdict['collection']
    if searchwith and expression:
        if (expression.count('%') > 0):
            expression = expression.replace("%", searchwith)
            response = Query(expression).search(collection=collection)
        else:
            # no %.. just make a combination
            expression = expression + " and " + searchwith
            response = Query(expression).search(collection=collection)
    else:  # either no expr or no searchwith.. but never mind about searchwith
        if expression:  # in this case: only expression
            response = Query(expression).search(collection=collection)
        else:
            # make a fake expression so that only records that have this field
            # will be returned
            fake_exp = "/.*/"
            if searchwith:
                fake_exp = searchwith
            response = Query("{0}:{1}".format(field, fake_exp)).search(
                collection=collection
            )

    # TODO wait for new search API for pagination
    response.body["size"] = 9999999
    values = []
    for record in response.records():
        value = record.get(field)
        if value:
            values.append(value)
    return values
526946
def get_value(self):
        """"""

        if self.data_type == self.BOOLEAN_TYPE:
            return self.value_boolean
        elif self.data_type == self.NUMBER_TYPE:
            return self.value_number
        elif self.data_type == self.SSH_KEY_TYPE:
            return self.value_ssh_key.private_key_file._get_path()
        else:
            return self.value
1073217
def generate_configurations(*, guided=False, fresh_start=False, save=False):
    

    if fresh_start:
        purge_configs()

    loaded_status, loaded_data = get_config()
    if loaded_status != CONFIG_VALID:
        if save:
            make_config_file(guided=guided)
            status, config_data = get_config()
        else:
            config_data = make_config_data(guided=guided)
    else:
        config_data = loaded_data

    return config_data
1159277
function(records,config) {
    
    //the hell is this doing here
    this.id = new Date();

    if ( records instanceof Array ) {
        this.records = records;
    } else {
        var dataField = records.data;
        var data = records.datasource;
        this.records =  data[dataField];
    }
    this.config = config;
    if ( this.config ) {
        this.propertyConfigMap = {};
        this.config.cols.forEach( col => {
            this.propertyConfigMap[col.property] = col;
        });
    }

    //indexRecords.call(this);
}
875117
def _get_record_fields(d):
    
    if isinstance(d, dict):
        if "fields" in d:
            return d["fields"]
        else:
            for v in d.values():
                fields = _get_record_fields(v)
                if fields:
                    return fields
757628
public function getRecords()
    {
        $ids = $this->getRecordIDList();

        if ($ids) {
            $class = $this->gridField->list->dataClass;

            return DataList::create($class)->byIDs($ids);
        } else {
            return false;
        }
    }
592353
def list_records_for_build_config_set(id, page_size=200, page_index=0, sort="", q=""):
    
    data = list_records_for_build_config_set_raw(id, page_size, page_index, sort, q)
    if data:
        return utils.format_json_list(data)
1025725
def get_database_configuration():
    """"""
    db_config = get_database_config_file()
    if db_config is None:
        return None
    with open(db_config, 'r') as ymlfile:
        cfg = yaml.load(ymlfile)
    return cfg
283115
def get_connections(self, data=False):
        
        if data:
            return self._connections
        return list(self._connections.keys())
335898
protected function _get_boolean_value( $key ) {
		if ( ! isset( $this->types[ $key ] ) || 'boolean' !== $this->types[ $key ] ) {
			return null;
		}

		$default = array_key_exists( $key, $this->defaults ) ? $this->defaults[ $key ] : true;

		// Values are stored as yes/no strings.
		return filter_var( $this->store->get( $key, $default ), FILTER_VALIDATE_BOOLEAN );
	}