Check the conformity of +object+ recursively. This method returns either
 false OR true, if +mode+ is :none or :warning, or raises an
 CheckFailed, if +mode+ was :error.
11890
def check(object, mode = @mode)
      checked = {}
      result = true
      errors = CheckFailed.new
      each do |message|
        begin
          message.check(object, checked)
        rescue CheckError => e
          case mode
          when :error
            errors << e
          when :warning
            warn e.to_s
            result = false
          when :none
            result = false
          end
        end
      end
      raise errors unless errors.empty?
      result
    end
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
763932
def check(self, value, namespace):
        
        for i, check in enumerate(self._checks):
            if check(value, namespace):
                return True
        return False
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
1329838
def check(self, check_all=False, do_reload=True):
        """"""

        if not self.enabled and not check_all:
            return

        if check_all or self.check_all:
            modules = list(sys.modules.keys())
        else:
            modules = list(self.modules.keys())

        for modname in modules:

            m = sys.modules.get(modname, None)
            if modname in self.skip_modules:
                continue

            py_filename, pymtime = self.filename_and_mtime(m)
            if py_filename is None:
                continue

            try:
                if pymtime <= self.modules_mtimes[modname]:
                    continue
            except KeyError:
                self.modules_mtimes[modname] = pymtime
                continue
            else:
                if self.failed.get(py_filename, None) == pymtime:
                    continue

            self.modules_mtimes[modname] = pymtime

            # If we've reached this point, we should try to reload the module
            if do_reload:
                try:
                    if self.debug:
                        print("Reloading {}".format(m))
                    superreload(m, reload, self.old_objects)
                    if py_filename in self.failed:
                        del self.failed[py_filename]
                except:
                    print("[autoreload of %s failed: %s]" % (
                        modname, traceback.format_exc(10)))
                    self.failed[py_filename] = pymtime
192014
def check_config(conf):
    ''''''
    if 'fmode' in conf and not isinstance(conf['fmode'], string_types):
        raise TypeError(TAG + ": `fmode` must be a string")

    if 'dmode' in conf and not isinstance(conf['dmode'], string_types):
        raise TypeError(TAG + ": `dmode` must be a string")

    if 'depth' in conf:
        if not isinstance(conf['depth'], int):
            raise TypeError(TAG + ": `depth` must be an int")
        if conf['depth'] < 0:
            raise ValueError(TAG + ": `depth` must be a positive number")

    if 'hash_alg' in conf:
        if not isinstance(conf['hash_alg'], string_types):
            raise TypeError(TAG + ": `hash_alg` must be a string")
        if conf['hash_alg'] not in ACCEPTED_HASH_ALG:
            raise ValueError(TAG + ": `hash_alg` must be one of " + str(ACCEPTED_HASH_ALG))
1154161
def check(mod):
    
    v = Check()
    v.visit(mod)

    for t in v.types:
        if t not in mod.types and not t in builtin_types:
            v.errors += 1
            uses = ", ".join(v.types[t])
            print('Undefined type {}, used in {}'.format(t, uses))
    return not v.errors
754908
def _checkMode(self, ax_args):
        
        mode = ax_args.get('mode')
        if mode != self.mode:
            if not mode:
                raise NotAXMessage()
            else:
                raise AXError(
                    'Expected mode %r; got %r' % (self.mode, mode))
1127937
def check_recursive(paths, reporter=modReporter.Default, settings_path=None, **setting_overrides):
    """"""
    warnings = 0
    for source_path in iter_source_code(paths):
        warnings += check_path(source_path, reporter, settings_path=None, **setting_overrides)
    return warnings
209751
def check_object(object)
      if !object.respond_to?(name)
        raise NotImplementedErrorCheckError.new(self,
            "method '#{name}' not responding in #{object}")
      end
      check_method = object.method(name)
      if arity and (check_arity = check_method.arity) != arity
        raise ArgumentErrorCheckError.new(self,
            "wrong number of arguments for protocol"\
            " in method '#{name}' (#{check_arity} for #{arity}) of #{object}")
      end
      if block_expected?
        if object.singleton_methods(false).map { |m| m.to_s } .include?(name)
          parser = MethodParser.new(object, name, true)
        else
          ancestors = object.class.ancestors
          modul = Utilities.find_method_module(name, ancestors)
          parser = MethodParser.new(modul, name)
        end
        parser.block_arg? or raise BlockCheckError.new(self,
          "expected a block argument for #{object}:#{object.class}")
      end
      if arity and not protocol === object
        object.extend protocol
        wrap_method(class << object ; self ; end)
      end
      true
    end
415343
def check_format(format, subtype=None, endian=None):
    
    try:
        return bool(_format_int(format, subtype, endian))
    except (ValueError, TypeError):
        return False
642508
def if_none_match(self):
        
        for option in self.options:
            if option.number == defines.OptionRegistry.IF_NONE_MATCH.number:
                return True
        return False
782137
def _check_errors(self):
        """"""
        # use this to make sure that sweep, sstart, sstop, and sinterval
        # all have values if one of them has values
        # (P^Q^R^S) OR (-P and -Q and -R and -S)
        # above is the minimal form for this logical statement in DNF
        if not ((self._inn(self.args.sweep) and self._inn(self.args.sstart)
                 and self._inn(self.args.sstop) and self._inn(self.args.sinterval))
                or
                (not self._inn(self.args.sweep) and not self._inn(self.args.sstart) and not
                 self._inn(self.args.sstop) and not self._inn(self.args.sinterval))):
            mutually_inclusive = ["sweep", "sstart", "sstop", "sinterval"]
            print_str = ""
            for each in mutually_inclusive:
                print_str += "    {0}: {1}\n".format(each, getattr(self.args, each))
            raise AssertionError("""You specified one or more of the --sweep,
            --sstart, --stop, or --sinterval arguments but did not specify all of
            them. All of them are required when running the program in sweep mode.
            Do not specify any of these arguments if not running the program in
            sweep mode.\n{0}""".format(print_str))
363693
def is_valid(self, instance):
        

        errors = self.errors(instance)

        if isinstance(errors, list):
            return not any(errors)

        return not bool(errors)
1130739
def has_method(obj, method_name):
    '''
    
    '''
    if method_name in dir(obj):
        return True

    log.error('Method \'%s\' not yet supported!', method_name)
    return False
374556
def verify_any(df, check, *args, **kwargs):
    
    result = check(df, *args, **kwargs)
    try:
        assert np.any(result)
    except AssertionError as e:
        msg = '{} not true for any'.format(check.__name__)
        e.args = (msg, df)
        raise
    return df
1186725
def verify(operations, loud=False):
    
    everything_ok, roll_call = check(operations, loud=loud)
    if not everything_ok:
        raise CheckFailedException(roll_call)
    return roll_call