Validate and set the uppercase flag.
428163
def uppercase(self, value):
        """"""
        if not isinstance(value, bool):
            raise TypeError('uppercase attribute must be a logical type.')
        self._uppercase = value
826558
function( name, upper, lower ) {
		return this.ok( name, upper > lower, this.greaterThan, "\nUpper Value '" + upper + "' is not greater than lower value '" + lower + "'" );
	}
364077
def letter_case_props(self, case, in_group, negate=False):
        """"""

        # Use traditional ASCII upper/lower case unless:
        #    1. The strings fed in are not bytes
        #    2. And the the Unicode flag was used
        if not in_group:
            v = self.posix_props(("^" if negate else "") + ("upper" if case == _UPPER else "lower"), in_group=in_group)
            v[0] = "[%s]" % v[0]
        else:
            v = self.posix_props(("^" if negate else "") + ("upper" if case == _UPPER else "lower"), in_group=in_group)
        return v
933310
static function uppercase($value, &$error, $args)
    {
        $result = mb_strtoupper($value, 'utf-8');
        if ($value != $result){
            $error = new Error('Не все символы в верхнем регистре', 'uppercase');
        }
        return $result;
    }
124231
def _validate(self, value):
        """"""
        if self.values and value not in self.values:
            raise ValueError(
                '{} is not a valid value for {}'.format(value, self.name))
224283
def get_case(flags):
    """"""

    if not bool(flags & CASE_FLAGS):
        case_sensitive = util.is_case_sensitive()
    elif flags & FORCECASE:
        case_sensitive = True
    else:
        case_sensitive = False
    return case_sensitive
262425
function isCapitalized(value) {
  var char = (value.charAt ? value : value[0]).charAt(0)
  return char.toUpperCase() === char
}
1950
def CheckUpperLowerCase(filename, linenumber, clean_lines, errors):
    
    line = clean_lines.lines[linenumber]
    if ContainsCommand(line):
        command = GetCommand(line)
        if IsCommandMixedCase(command):
            return errors(
                    filename,
                    linenumber,
                    'readability/wonkycase',
                    'Do not use mixed case commands')
        if clean_lines.have_seen_uppercase is None:
            clean_lines.have_seen_uppercase = IsCommandUpperCase(command)
        else:
            is_upper = IsCommandUpperCase(command)
            if is_upper != clean_lines.have_seen_uppercase:
                return errors(
                        filename,
                        linenumber,
                        'readability/mixedcase',
                        'Do not mix upper and lower case commands')
1348558
def validate(index)
      unless %w[l ctr r just].include?(@align)
        raise "Shape #{index} (#{@type}) alignment (#{@align}) not in ['l', 'ctr', 'r', 'just']\n"
      end

      unless %w[t ctr b].include?(@valign)
        raise "Shape #{index} (#{@type}) vertical alignment (#{@valign}) not in ['t', 'ctr', 'v']\n"
      end
    end
625743
def acceptable(value, capitalize=False):
    """"""
    name = regexes['punctuation'].sub("", regexes['joins'].sub("_", value))
    # Clean up irregularities in underscores.
    name = regexes['repeated_underscore'].sub("_", name.strip('_'))
    if capitalize:
        # We don't use python's built in capitalize method here because it
        # turns all upper chars into lower chars if not at the start of
        # the string and we only want to change the first character.
        name_parts = []
        for word in name.split('_'):
            name_parts.append(word[0].upper())
            if len(word) > 1:
                name_parts.append(word[1:])
        name = ''.join(name_parts)
    return name
733699
def validate(self, key, value):
    """"""
    if self._validator is not None:
      self._validator(key, value)
537428
public function validate()
    {
        foreach ($this->fieldSet as $name => $field) {
            $field->validate();

            if (!$field->isValid()) {
                $this->valid = false;
            }
        }

        $this->validated = true;
    }
165444
def validate(self, value):
        """"""
        if value is not None and not isinstance(value, str):
            raise ValidationError("field must be a string")

        super().validate(value)
1205385
def validate(self):
        
        super(NumericFilterBase, self).validate()

        self.not_null = False

        if self._value.startswith('+'):
            self._cmp = operator.gt
            self._rt_cmp = 'greater'
            self._value = self._value[1:]
        elif self._value.startswith('-'):
            self._cmp = operator.lt
            self._rt_cmp = 'less'
            self._value = self._value[1:]
        else:
            self._cmp = operator.eq
            self._rt_cmp = 'equal'
598498
def setFlag(self, flag, state=True):
        
        if state:
            self.__flags |= flag
        else:
            self.__flags &= ~flag
225910
def check(self, value, major):
        
        if self._case_insensitive:
            value = value.lower()
            values = self._valid_values_lower
            caseflag = " (case-insensitive)"
        else:
            values = self._valid_values
            caseflag = ""
        if value not in values:
            raise ValueError("Discrete value '%s' is not one of %s%s."
                             % (value, list(self._values), caseflag))
1165450
def validate(self, instance, value):
        """"""
        if isinstance(value, string_types):
            value = COLORS_NAMED.get(value, value)
            if value.upper() == 'RANDOM':
                value = random.choice(COLORS_20)
            value = value.upper().lstrip('#')
            if len(value) == 3:
                value = ''.join(v*2 for v in value)
            if len(value) != 6:
                self.error(instance, value, extra='Color must be known name '
                           'or a hex with 6 digits. e.g. "#FF0000"')
            try:
                value = [
                    int(value[i:i + 6 // 3], 16) for i in range(0, 6, 6 // 3)
                ]
            except ValueError:
                self.error(instance, value,
                           extra='Hex color must be base 16 (0-F)')
        if not isinstance(value, (list, tuple)):
            self.error(instance, value,
                       extra='Color must be a list or tuple of length 3')
        if len(value) != 3:
            self.error(instance, value, extra='Color must be length 3')
        for val in value:
            if not isinstance(val, integer_types) or not 0 <= val <= 255:
                self.error(instance, value,
                           extra='Color values must be ints 0-255.')
        return tuple(value)