endpoint for checking/unchecking any boolean in a sqla model
775406
def checkbox(self, model_view, id_, attr, value):
        """"""
        modelview_to_model = {
            '{}ColumnInlineView'.format(name.capitalize()): source.column_class
            for name, source in ConnectorRegistry.sources.items()
        }
        model = modelview_to_model[model_view]
        col = db.session.query(model).filter_by(id=id_).first()
        checked = value == 'true'
        if col:
            setattr(col, attr, checked)
            if checked:
                metrics = col.get_metrics().values()
                col.datasource.add_missing_metrics(metrics)
            db.session.commit()
        return json_success('OK')
500068
def isbool(*args):
    """"""
    true_or_false = [instructions.lookup(instructions.true_),
                     instructions.lookup(instructions.false_)]
    return all(map(lambda c: isinstance(c, bool) or c in true_or_false, args))
812987
function booleanFalse(validatedObject, errorText) {
  if (!_.isBoolean(validatedObject) || validatedObject) {
    throw new ValidationError(errorText || 'Validated object is not False');
  }
  return validatedObject;
}
265734
@SuppressFBWarnings("NP_BOOLEAN_RETURN_NULL")
    public static Boolean getBoolean(final ResultSet rs, final int columnIndex) throws SQLException
    {
        final boolean res = rs.getBoolean(columnIndex);
        if (rs.wasNull()) {
            return null;
        } else {
            return res;
        }
    }
563798
def _ignore_sql(self, query):
        """"""
        return any([
            re.search(pattern, query.get('sql')) for pattern in QC_SETTINGS['IGNORE_SQL_PATTERNS']
        ])
505866
def boolean(v):
    """"""
    if nodesetp(v):
        return len(v) > 0
    elif numberp(v):
        if v == 0 or v != v:
            return False
        return True
    elif stringp(v):
        return v != ''
    return v
1313272
def _checkBool(inputvalue, description='inputvalue'):
    
    _checkString(description, minlength=1, description='description string')
    if not isinstance(inputvalue, bool):
        raise TypeError('The {0} must be boolean. Given: {1!r}'.format(description, inputvalue))
534386
function fixBools(attrs) {
        var self = this;
        _.each(attrs, function each(value, key) {
            if (schema.tables[self.tableName].hasOwnProperty(key)
                && schema.tables[self.tableName][key].type === 'bool') {
                attrs[key] = value ? true : false;
            }
        });

        return attrs;
    }
816116
def parse_boolean(value):
    

    if value is None:
        return None

    if isinstance(value, bool):
        return value

    if isinstance(value, string_types):
        value = value.lower()
        if value == 'false':
            return False
        if value == 'true':
            return True

    raise ValueError("Could not convert value to boolean: {}".format(value))
218350
def find_equals_true_or_false(node):
    """"""
    return (
        isinstance(node, ast.Compare)
        and len(node.ops) == 1
        and isinstance(node.ops[0], ast.Eq)
        and any(h.is_boolean(n) for n in node.comparators)
    )
439586
def get_bool_value(self, section, option, default=True):
        """"""
        try:
            return self.parser.getboolean(section, option)
        except NoOptionError:
            return bool(default)
1050992
function ensureBoolean(value) {
  if (typeof value === 'boolean') {
    return value;
  }
  if (typeof value === 'string' && value.toLowerCase() === 'true') {
    return true;
  } else if (typeof value === 'string' && value.toLowerCase() === 'false') {
    return false;
  } else if (value === 1) {
    return true;
  } else if (value === 0) {
    return false;
  }
  throw new Error(`Unexpected value for boolean: ${value}`);
}
55991
def validate(self, data, all_data=None):
        '''
        
        '''
        if data is None:
            return True, False
        else:
            return super(BooleanField, self).validate(data, all_data)
1327979
def boolean(value):
    
    if isinstance(value, bool):
        return value

    if value == "":
        return False

    return strtobool(value)
740334
def process_boolean(self, tag):
        """"""
        tag.set_address(self.normal_register.current_bit_address)
        self.normal_register.move_to_next_bit_address()
489676
def boolean_operator_query(boolean_operator):
    """"""
    def _boolean_operator_query(expressions):
        """Apply boolean operator to expressions."""
        def _apply_boolean_operator(query_function, expressions=expressions):
            """Return if expressions with boolean operator are satisfied."""
            compiled_expressions = [compile_query(e) for e in expressions]
            return reduce(
                boolean_operator,
                [e(query_function) for e in compiled_expressions]
            )

        return _apply_boolean_operator
    return _boolean_operator_query
1080760
def selectfalse(table, field, complement=False):
    """"""

    return select(table, field, lambda v: not bool(v),
                  complement=complement)