Check if val is considered non-empty.
424079
def meaningful_value(self, val, undefined):
        
        if isinstance(val, fields.files.FieldFile):
            return val.name and not (
                isinstance(undefined, fields.files.FieldFile) and val == undefined)
        return val is not None and val != undefined
747418
function has(val) {
      last.call(this).value = val;
      this.replace(val);
      return last.call(this) && this;
    }
1249811
def is_outside_bounds(self, val):
    """"""
    return ((self.lower_bound is not None and val < self.lower_bound) or
            (self.upper_bound is not None and val > self.upper_bound))
45990
function(val, defValue) {
		if (typeof defValue === "undefined") defValue = true;
		if (typeof val === "undefined") return defValue;
		if (val.toLowerCase() === "true" || val >= 1) return true;

		return false;
	}
501298
def check(ty, val):
    ""
    
    if isinstance(ty, basestring):
        ty = Parser().parse(ty)

    return ty.enforce(val)
49879
function isValueEmpty(value) {
  if (_.isUndefined(value)) {
    return true;
  }
  var canUseIsEmpty = _.isString(value) || _.isArray(value) || (_.isObject(value) && !_.isDate(value)) || false;
  if (canUseIsEmpty) {
    return _.isEmpty(value);
  }
  return (_.isNumber(value) || _.isBoolean(value) || _.isDate(value)) ? false : true;
}
1337804
def is_empty(self):
        """"""
        if len(self.columns) == 0:
            return True

        if len(self.columns) == 1 and self.columns[0].name == 'id':
            return True

        return False
1358391
function isEmpty(val) {
    return (isUndefined(val) ||
        isNull(val) ||
        (isString(val) && val.length === 0) ||
        (isNumber(val) && isNaN(val)) ||
        (isPlainObject(val) && !array_1.keys(val).length) ||
        (isArray(val) && !val.length));
}
891376
public function checkDataIsEmpty()
    {
        if ($this->isDataExists() === false) {
            $this->contextDataEmpty = true;
        }
        elseif (is_object($this->getDataValue())) {
            $this->contextDataEmpty = false;
        }
        elseif (is_array($this->getDataValue())) {
            $this->contextDataEmpty = false;
        }
        elseif (is_string($this->getDataValue())) {
            $this->contextDataEmpty = (bool) (strlen($this->getDataValue()) == 0);
        }
        elseif (is_numeric($this->getDataValue())) {
            $this->contextDataEmpty = false;
        }
        else {
            $this->contextDataEmpty = (bool) $this->checkIsEmpty($this->getDataValue());
        }
    }
585319
def _is_null(self, value):
        """"""
        if isinstance(value, six.string_types):
            if not len(value.strip()):
                return True
        return value is None
674840
function(v) {
		return _.isNil(v) || (_.isString(v) && _.isEmpty(v));
	}
606882
def check(self, val):
        
        # If there is no `type` requirement, everything is allowed
        if self.type is None:
            return True

        is_list = isinstance(val, list)
        # If lists are not allowed, and this is a list --> false
        if not self.listable and is_list:
            return False

        # `is_number` already checks for either list or single value
        if self.type == KEY_TYPES.NUMERIC and not is_number(val):
            return False
        elif (self.type == KEY_TYPES.TIME and
              not is_number(val) and '-' not in val and '/' not in val):
            return False
        elif self.type == KEY_TYPES.STRING:
            # If its a list, check first element
            if is_list:
                if not isinstance(val[0], basestring):
                    return False
            # Otherwise, check it
            elif not isinstance(val, basestring):
                return False
        elif self.type == KEY_TYPES.BOOL:
            if is_list and not isinstance(val[0], bool):
                return False
            elif not isinstance(val, bool):
                return False

        return True
86983
def _check_constant_value_data(self, data):
        """"""

        arrayval = data.flat[0]
        if np.all(data == arrayval):
            return arrayval
        return None
1290827
def _is(self, r, val):
        
        if not is_register(r) or val is None:
            return False

        r = r.lower()
        if is_register(val):
            return self.eq(r, val)

        if is_number(val):
            val = str(valnum(val))
        else:
            val = str(val)

        if val[0] == '(':
            val = self.mem[val[1:-1]]

        return self.regs[r] == val
287361
def isNull(self):
        
        check = self.raw_values.copy()
        scope = check.pop('scope', {})
        return len(check) == 0 and len(scope) == 0
280036
def check(self):
        """"""
        for name, valItem, dtype in self.values:
            val = valItem.text()
            if dtype:
                try:
                    val = dtype(val)
                except:
                    msgBox = QtWidgets.QMessageBox()
                    msgBox.setText(
                        'attribute %s has not the right dtype(%s)' %
                        (name, str(dtype)))
                    msgBox.exec_()
            self.args[name] = val
        self.accept()
587633
def is_unknown(val: str) -> bool:
    
    for char in ('/', 'X'):
        if val == char * len(val):
            return True
    return False