Check if all objects in the Threshold Instance report .valid?
429361
def valid?
      begin
        self.each do |threshold|
          if threshold.respond_to?(:valid?)
            return false unless threshold.valid?
          else
            raise InvalidThresholdsObject, "Container object has unknown objects"
          end
        end
        return true
      rescue InvalidThresholdsObject
        return false
      end
    end
69359
def _checkObjectsToLearn(self, objects):
    
    for objectName, sensationList in objects.iteritems():
      if objectName not in self.objects:
        raise ValueError(
          "Invalid object name \"{}\" sent to experiment".format(objectName)
        )

      for sensations in sensationList:
        if set(sensations.keys()) != set(range(self.numColumns)):
          raise ValueError(
            "Invalid number of cortical column sensations sent to experiment"
          )
        for pair in sensations.values():
          if not isinstance(pair, tuple) or len(pair) != 2 or \
                  not isinstance(pair[0], set) or \
                  not isinstance(pair[1], set):
            raise ValueError("Invalid SDR's sent to experiment")
1101903
def is_active(self, instance, conditions):
        
        return_value = None
        for name, field in self.fields.iteritems():
            field_conditions = conditions.get(self.get_namespace(), {}).get(name)
            if field_conditions:
                value = self.get_field_value(instance, name)
                for status, condition in field_conditions:
                    exclude = status == EXCLUDE
                    if field.is_active(condition, value):
                        if exclude:
                            return False
                        return_value = True
                    else:
                        if exclude:
                            return_value = True
        return return_value
47893
def is_valid(self):
        
        valid = np.any((self.points - self.points[0]) != 0)
        return valid
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
1280601
def __verify_ready(self, creating=False):
        '''
        '''

        if len(self._value_ranges) == 0:
            self._logger.log(
                'crit',
                'Attribute value_ranges must have at least one value'
            )
            raise RuntimeWarning(
                'Attribute value_ranges must have at least one value'
            )
        if len(self._employers) == 0 and creating is False:
            self._logger.log('crit', 'Need to create employers')
            raise RuntimeWarning('Need to create employers')
1005526
def is_valid_shape(value):
    """"""
    if is_int_positive(value):
        return True, value
    elif isinstance(value, tuple) or isinstance(value, list):
        for v in value:
            if not is_int_positive(v):
                return False, value
        return True, value
    else:
        return False, value
633568
def check(self, value, namespace):
        
        if (not issubclass(type(value), self._cls) or
            len(value) != len(self._cls._fields)):
            return False
        for i, check in enumerate(self._checks):
            if not check(value[i], namespace):
                return False
        return True
281168
def is_instance_collection(c, cls):
    
    if not (hasattr(c, '__iter__') and len(c) > 0):
        # make sure it's iterable and not empty
        return False

    cls = make_list(cls)
    for i in get_collection_values(c):
        instance = False
        for cl in cls:
            if isinstance(i, cl):
                instance = True
                break
        if not instance:
            return False

    return True
802894
def check_global_valid(self):
        
        serverless_cnt = len(list(filter(lambda x: x._serverless_type, self._data['resources'])))
        if serverless_cnt > 0:
            return False
        return True
1059004
def _validate(self, obj):
        
        report = ValidationReport()
        if not self.validator.is_valid(obj):
            for v in self.validator.iter_errors(obj):
                report.add_error("[%s] %s" % ('.'.join(str(vv) for vv in v.path), v.message))
        return report
868865
def are_valid_values(values):
    
    try:
        int_values = map(int, values)
        for v in int_values:
            if (v >= 0) and (v <= 255):
                continue
            else:
                return False
    except Exception as ex:
        # print(ex)
        return False
    return True
646547
def _check_list_props(self, inst: "InstanceNode") -> None:
        """"""
        if self.keys:
            self._check_keys(inst)
        for u in self.unique:
            self._check_unique(u, inst)
767966
def validate(self, value):
        
        # check object type
        if not isinstance(value, list):
            raise tldap.exceptions.ValidationError(
                "is not a list and max_instances is %s" %
                self._max_instances)
        # check maximum instances
        if (self._max_instances is not None and
                len(value) > self._max_instances):
            raise tldap.exceptions.ValidationError(
                "exceeds max_instances of %d" %
                self._max_instances)
        # check this required value is given
        if self._required:
            if len(value) == 0:
                raise tldap.exceptions.ValidationError(
                    "is required")
        # validate the value
        for i, v in enumerate(value):
            self.value_validate(v)
1010126
def check_all(self, all_entries, *args, **kwargs):
        
        all_overlaps = 0
        while True:
            try:
                user_entries = all_entries.next()
            except StopIteration:
                return all_overlaps
            else:
                user_total_overlaps = self.check_entry(
                    user_entries, *args, **kwargs)
                all_overlaps += user_total_overlaps
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__
            ))
1338155
function isQualified (instance) {
  const name = classify(instance.name || getInstanceName(instance)).toLowerCase()
  return name.indexOf(filter) > -1
}