Assert whether a prop is valid.
972621
function assertProp (
  prop,
  name,
  value,
  vm,
  absent
) {
  if (prop.required && absent) {
    warn(
      'Missing required prop: "' + name + '"',
      vm
    );
    return
  }
  if (value == null && !prop.required) {
    return
  }
  let type = prop.type;
  let valid = !type || type === true;
  const expectedTypes = [];
  if (type) {
    if (!Array.isArray(type)) {
      type = [type];
    }
    for (let i = 0; i < type.length && !valid; i++) {
      const assertedType = assertType(value, type[i]);
      expectedTypes.push(assertedType.expectedType || '');
      valid = assertedType.valid;
    }
  }

  if (!valid) {
    warn(
      getInvalidTypeMessage(name, value, expectedTypes),
      vm
    );
    return
  }
  const validator = prop.validator;
  if (validator) {
    if (!validator(value)) {
      warn(
        'Invalid prop: custom validator check failed for prop "' + name + '".',
        vm
      );
    }
  }
}
724461
function isRequiredWrapper(propType) {
  const isRequired = (props, propName, componentName, ...rest) => {
    if (!props[propName]) {
      return new Error(
        `the property "${propName}" is marked as required for the component ` +
        `"${componentName}" but "${props[propName]}" has been provided`
      );
    }
    return propType(props, propName, componentName, ...rest);
  };
  isRequired[SHAPE] = propType[SHAPE];
  return isRequired;
}
1077321
function isError(val, prop) {
    if (!isValue(val) || !isObject(val))
        return false;
    var type = constant_1.toStr.call(val).toLowerCase();
    return type === '[object error]' || type === '[object domexception]' || !isEmpty(val[prop]);
}
959109
def check_property(prop, name, **kwargs):
    

    checkers = {
        'color': check_color,
        'alpha': check_alpha,
        'size': check_size,
        'thickness': check_thickness,
        'index': check_index,
        'coordinates': check_coordinates,
        'colormap': check_colormap,
        'bins': check_bins,
        'spec': check_spec
    }

    if name in checkers:
        return checkers[name](prop, **kwargs)
    elif isinstance(prop, list) or isinstance(prop, ndarray) or isscalar(prop):
        return check_1d(prop, name)
    else:
        return prop
67411
function checkProps(uri, props) {
  const id = replaceVersion(uri.replace('/meta', ''));

  return db.getMeta(id)
    .then(meta => {
      return Array.isArray(props)
        ? props.every(prop => meta[prop])
        : meta[props] && true;
    })
    .catch(err => {
      throw new Error(err);
    });
}
567202
def _validate(item):
        """"""
        if not isinstance(item, tuple) or len(item) != 2:
            raise ValueError('Linked items must be instance/prop-name tuple')
        if not isinstance(item[0], tuple(LINK_OBSERVERS)):
            raise ValueError('Only {} instances may be linked'.format(
                ', '.join([link_cls.__name__ for link_cls in LINK_OBSERVERS])
            ))
        if not isinstance(item[1], string_types):
            raise ValueError('Properties must be specified as string names')
        if not hasattr(item[0], item[1]):
            raise ValueError('Invalid property {} for {} instance'.format(
                item[1], item[0].__class__.__name__
            ))
355809
def validate_type(prop, value, expected):
    

    # Validate on expected type(s), but ignore None: defaults handled elsewhere
    if value is not None and not isinstance(value, expected):
        _validation_error(prop, type(value).__name__, None, expected)
1358366
public boolean isSet(String propName) {
        if (propName.equals("key")) {
            return isSetKey();
        }
        if (propName.equals("value")) {
            return isSetValue();
        }
        return false;
    }
1056771
def assert_valid(self, instance, value=None):
        """"""
        valid = super(Tuple, self).assert_valid(instance, value)
        if not valid:
            return False
        if value is None:
            value = instance._get(self.name)
            if value is None:
                return True
        if (
                (self.min_length is not None and len(value) < self.min_length)
                or
                (self.max_length is not None and len(value) > self.max_length)
        ):
            self.error(
                instance=instance,
                value=value,
                extra='(Length is {})'.format(len(value)),
            )
        for val in value:
            if not self.prop.assert_valid(instance, val):
                return False
        return True
808960
def valid?
      validations = properties_instances.collect do |property_type|
        if property_type.property.respond_to?(:valid?)
          property_type.property.valid?
        else
          true
        end
      end

      validations.all?
    end
677286
def is_valid(cls, arg):
        """"""
        return isinstance(arg, (int, long)) and (not isinstance(arg, bool))
1147112
def is_valid(cls, arg):
        """"""
        if not isinstance(arg, (int, long)) or isinstance(arg, bool):
            return False
        if (arg < cls._low_limit):
            return False
        if (cls._high_limit is not None) and (arg > cls._high_limit):
            return False
        return True
1360901
def _check_lookup_prop(self, req_id):
        """"""
        if self._lookup_prop:
            if not req_id and self._lookup_prop == "id":
                return False
        else:
            if req_id:
                self._lookup_prop = "id"
            else:
                self._lookup_prop = "name"
        return True
89635
def assert_in(obj, seq, message=None, extra=None):
    """"""
    assert obj in seq, _assert_fail_message(message, obj, seq, "is not in", extra)
388109
def has_prop_attribute(cls, prop_name):  # @NoSelf
        """"""
        return (prop_name in cls.__dict__ and
                not isinstance(cls.__dict__[prop_name], types.FunctionType))
1248982
def matches(self, filter_props):
        """"""
        if filter_props is None:
            return False

        found_one = False
        for key, value in filter_props.items():
            if key in self.properties and value != self.properties[key]:
                return False
            elif key in self.properties and value == self.properties[key]:
                found_one = True

        return found_one
949205
def is_valid(self):
        """"""
        if not all([
            isinstance(self.zoom, int),
            self.zoom >= 0,
            isinstance(self.row, int),
            self.row >= 0,
            isinstance(self.col, int),
            self.col >= 0
        ]):
            raise TypeError("zoom, col and row must be integers >= 0")
        cols = self.tile_pyramid.matrix_width(self.zoom)
        rows = self.tile_pyramid.matrix_height(self.zoom)
        if self.col >= cols:
            raise ValueError("col (%s) exceeds matrix width (%s)" % (self.col, cols))
        if self.row >= rows:
            raise ValueError("row (%s) exceeds matrix height (%s)" % (self.row, rows))
        return True