Do recursive validity checking
7979
def recursive_valid?(target, context, state)
      valid = state
      target.each do |key, prop|
        if prop.is_a?(Array)
          prop.each do |item|
            if item.validatable?
              valid = recursive_valid?(item, context, valid) && valid
            end
          end
        elsif prop.validatable?
          valid = recursive_valid?(prop, context, valid) && valid
        end
      end
      target._run_validate_callbacks do
        target.class.validators.execute(context, target) && valid
      end
    end
75948
def recursive_like?(other, data = @data)
      raise "Can't compare with object type: #{other.class}! Must respond_to :each" unless other.respond_to?(:each)
      other.each do |key, val|
        return false unless data && data.respond_to?(:[])
        if val.is_a?(Hash)
          return false unless data.class == Hash && recursive_like?(val, data[key.to_s])
        elsif val.is_a?(Array) && val.first.is_a?(Hash)
          data_array = data[key.to_s] || data[key.to_sym]
          return false unless data_array.is_a?(Array)
          val.each do |other_item|
            return false unless data_array.find { |data_item| recursive_like?(other_item, data_item) }
          end
        elsif val.to_s != data[key.to_s].to_s && val.to_s != data[key.to_sym].to_s
          return false
        end
      end
      true
    end
816881
def _verify_validates(self, spec, path):
        """"""
        validates = spec['validates']

        if isinstance(validates, list):
            for validator in validates:
                self._verify_validator(validator, path)
        else:
            self._verify_validator(validates, path)
530005
function (value, pattern) {
        try {
            checkSubtree(value, pattern);
            return true;
        } catch (e) {
            if (e instanceof Match.Error)
                return false;
            // Rethrow other errors.
            throw e;
        }
    }
735390
def _check_descendant(self, item):
        """"""
        children = self.get_children(item)
        for iid in children:
            self.change_state(iid, "checked")
            self._check_descendant(iid)
177815
def assert_valid(self, instance, value=None):
        """"""
        valid = super(Instance, self).assert_valid(instance, value)
        if not valid:
            return False
        if value is None:
            value = instance._get(self.name)
        if isinstance(value, HasProperties):
            value.validate()
        return True
879639
def _check_for_single_nested(target, items_by_key, input_order):
    
    out = utils.deepish_copy(items_by_key)
    for (k, t) in input_order.items():
        if t == "var":
            v = items_by_key[tuple(k.split("__"))]
            if _is_nested_single(v, target):
                out[tuple(k.split("__"))] = v[0]
    return out
856194
def valid? *indexes
      indexes.all? { |i| to_a.include?(i) || (i.is_a?(Numeric) && i < size) }
    end
668428
def valid(*things):
	''''''
	for thing in things:
		if type(thing) is str and not os.path.exists(thing):
			return False
		if thing.valid is None:
			return False
	return True
515112
def check_validity_for_dict(keys, dict):
    
    for key in keys:
        if key not in dict or dict[key] is '' or dict[key] is None:
            return False
    return True
1083272
def _check_valid(key, val, valid):
    """"""
    if val not in valid:
        raise ValueError('%s must be one of %s, not "%s"'
                         % (key, valid, val))
1333888
def _recursive_matches(self, nodes, count):
        """"""
        assert self.content is not None
        if count >= self.min:
            yield 0, {}
        if count < self.max:
            for alt in self.content:
                for c0, r0 in generate_matches(alt, nodes):
                    for c1, r1 in self._recursive_matches(nodes[c0:], count+1):
                        r = {}
                        r.update(r0)
                        r.update(r1)
                        yield c0 + c1, r
89577
def _validate(self, inst: "InstanceNode", scope: ValidationScope,
                  ctype: ContentType) -> None:
        """"""
        if isinstance(inst, ArrayEntry):
            super()._validate(inst, scope, ctype)
        else:
            if scope.value & ValidationScope.semantics.value:
                self._check_list_props(inst)
                self._check_cardinality(inst)
            for e in inst:
                super()._validate(e, scope, ctype)
1224349
def _valid_folder(self, base, name):
        """"""

        valid = True
        fullpath = os.path.join(base, name)
        if (
            not self.recursive or
            (
                self.folder_exclude_check is not None and
                not self.compare_directory(fullpath[self._base_len:] if self.dir_pathname else name)
            )
        ):
            valid = False
        if valid and (not self.show_hidden and util.is_hidden(fullpath)):
            valid = False
        return self.on_validate_directory(base, name) if valid else valid
1158528
def is_valid(self):
        ''''''
        return (self.is_primitive and self.name) \
            or (self.is_complex and self.name) \
            or (self.is_list and self.nested) \
            or (self.is_map and self.nested) \
            or (self.is_model and self.nested)
643160
def Validate(self):
    """"""
    if not self.check_id:
      raise DefinitionError("Check has missing check_id value")
    cls_name = self.check_id
    if not self.method:
      raise DefinitionError("Check %s has no methods" % cls_name)
    ValidateMultiple(self.method,
                     "Check %s has invalid method definitions" % cls_name)
974365
def validate(self):
        ''' 

        '''
        for r in self.roots:
            refs = r.references()
            check_integrity(refs)