Validate and set the strict logical flag.
176786
def strict_logical(self, value):
        """"""
        if value is not None:
            if not isinstance(value, bool):
                raise TypeError(
                    'f90nml: error: strict_logical must be a logical value.')
            else:
                self._strict_logical = value
673551
def check_logical(self):
        """"""
        self.report.increment_logical_line()
        mapping = self.build_tokens_line()

        if not mapping:
            return

        (start_row, start_col) = mapping[0][1]
        start_line = self.lines[start_row - 1]
        self.indent_level = expand_indent(start_line[:start_col])
        if self.blank_before < self.blank_lines:
            self.blank_before = self.blank_lines
        if self.verbose >= 2:
            print(self.logical_line[:80].rstrip())
        for name, check, argument_names in self._logical_checks:
            if self.verbose >= 4:
                print('   ' + name)
            self.init_checker_state(name, argument_names)
            for offset, text in self.run_check(check, argument_names) or ():
                if not isinstance(offset, tuple):
                    for token_offset, pos in mapping:
                        if offset <= token_offset:
                            break
                    offset = (pos[0], pos[1] + offset - token_offset)
                self.report_error(offset[0], offset[1], text, check)
        if self.logical_line:
            self.previous_indent_level = self.indent_level
            self.previous_logical = self.logical_line
            if not self.indent_level:
                self.previous_unindented_logical_line = self.logical_line
        self.blank_lines = 0
        self.tokens = []
195957
def set_boolean(self, option, value):
        
        if not isinstance(value, bool):
            raise TypeError("%s must be a boolean" % option)

        self.options[option] = str(value).lower()
657145
def validate(self, value):
        
        value = super(Boolean, self).validate(value)

        if value is not None:
            value = bool(value)

        return value
1008316
def setFlag(self, flag, state=True):
        
        if state:
            self.setFlags(self.flags() | flag)
        else:
            self.setFlags(self.flags() & ~flag)
868889
def restrict_flags(declarer, *flags)
      copy = restrict(declarer)
      copy.qualify(*flags)
      copy
    end
660180
def check_strict(self, name, original, loc, tokens):
        """"""
        internal_assert(len(tokens) == 1, "invalid " + name + " tokens", tokens)
        if self.strict:
            raise self.make_err(CoconutStyleError, "found " + name, original, loc)
        else:
            return tokens[0]
260163
def set_mode (filename, flags):
    """"""
    try:
        mode = os.lstat(filename).st_mode
    except OSError:
        # ignore
        return
    if not (mode & flags):
        try:
            os.chmod(filename, flags | mode)
        except OSError as msg:
            log_error("could not set mode flags for `%s': %s" % (filename, msg))
1275374
def Validate(self):
    """"""
    self._ValidateReturnedTypes()
    self._ValidatePaths()
    self._ValidateType()
    self._ValidateRequiredAttributes()
    self._ValidateCommandArgs()
671548
def checkValue(self,value,strict=0):
        
        v = self._coerceValue(value,strict)
        return self.checkOneValue(v,strict)
887193
def validate(self, instance, value):
        """"""
        if self.cast:
            value = bool(value)
        if not isinstance(value, BOOLEAN_TYPES):
            self.error(instance, value)
        return value
493674
def set_flag(self, info, code=None):
        """"""
        self.flag = True
        self.flag_info += info
        if code is not None:
            self.flag_code = code
1149562
def validate(self):
        """"""
        validate_marked_location(self.location)
        if not isinstance(self.optional, bool):
            raise TypeError(u'Expected bool optional, got: {} {}'.format(
                type(self.optional).__name__, self.optional))
1364298
public void validate() {
    if (policy == null) {
      if (value == 0) {
        policy = FillPolicy.ZERO;
      } else if (Double.isNaN(value)) {
        policy = FillPolicy.NOT_A_NUMBER;
      } else {
        policy = FillPolicy.SCALAR;
      }
    } else {
      switch (policy) {
      case NONE:
      case NOT_A_NUMBER:
        if (value != 0 && !Double.isNaN(value)) {
          throw new IllegalArgumentException(
              "The value for NONE and NAN must be NaN");
        }
        value = Double.NaN;
        break;
      case ZERO:
        if (value != 0) {
          throw new IllegalArgumentException("The value for ZERO must be 0");
        }
        value = 0;
        break;
      case NULL:
        if (value != 0 && !Double.isNaN(value)) {
          throw new IllegalArgumentException("The value for NULL must be 0");
        }
        value = Double.NaN;
        break;
      case SCALAR: // it CAN be zero
        break;
      }
    }
  }
234849
public function validate() : void
    {
        $this->value = null;
        $value = $this->filter($this->raw_value);
        if (true === $this->checkValidity($value)) {
            $this->is_valid = true;
        } else {
            $this->is_valid = false;
            $this->reportError($this->error_message);
            $error_message = sprintf($this->error_message, $this->field_name);
            $this->the_message = $error_message;
        }
        // If no issues have been found, check the constraints.
        if ($this->is_valid) {
            foreach ($this->constraints as $constraint) {
                if (false === $constraint->check($value)) {
                    $this->is_valid = false;
                    $this->the_message = sprintf($constraint->getErrorMessage(), $this->field_name);
                }
            }
        }
        // Set the value for retrieval
        if ($this->is_valid) {
            $this->value = $value;
        }
    }
434612
public function setCheck($value)
    {
        $check = StringHelper::booleanValue($value);
        $this->check = $check;
        if ($check) {
            $this->flags .= ' --check ';
        } else {
            $this->flags = str_replace(' --check ', '', $this->flags);
        }
    }
110260
def __validate_logical(self, operator, definitions, field, value):
        
        valid_counter = 0
        _errors = errors.ErrorList()

        for i, definition in enumerate(definitions):
            schema = {field: definition.copy()}
            for rule in ('allow_unknown', 'type'):
                if rule not in schema[field] and rule in self.schema[field]:
                    schema[field][rule] = self.schema[field][rule]
            if 'allow_unknown' not in schema[field]:
                schema[field]['allow_unknown'] = self.allow_unknown

            validator = self._get_child_validator(
                schema_crumb=(field, operator, i),
                schema=schema, allow_unknown=True)
            if validator(self.document, update=self.update, normalize=False):
                valid_counter += 1
            else:
                self._drop_nodes_from_errorpaths(validator._errors, [], [3])
                _errors.extend(validator._errors)

        return valid_counter, _errors