Special processing for a special value.
429005
private boolean headerOutSpecial(String key, String value)
  {
    int length = key.length();
    
    if (length == 0) {
      return false;
    }
    
    int ch = key.charAt(0);
    
    if ('A' <= ch && ch <= 'Z') {
      ch += 'a' - 'A';
    }
    
    int code = (length << 8) + ch;
    
    switch (code) {
    case 0x0d00 + 'c':
      if (CACHE_CONTROL.matchesIgnoreCase(key)) {
        // server/13d9, server/13dg
        if (value.startsWith("max-age")) {
        }
        else if (value.startsWith("s-maxage")) {
        }
        else if (value.equals("x-anonymous")) {
        }
        else {
          //request().setCacheControl(true);
          if (true) throw new UnsupportedOperationException();
        }
      }

      return false;

    case 0x0a00 + 'c':
      if (CONNECTION_CB.matchesIgnoreCase(key)) {
        if ("close".equalsIgnoreCase(value))
          killKeepalive("client connection: close");
        return true;
      }
      else {
        return false;
      }

    case 0x0c00 + 'c':
      if (CONTENT_TYPE_CB.matchesIgnoreCase(key)) {
        headerOutContentType(value);
        
        return true;
      }
      else {
        return false;
      }

    case 0x0e00 + 'c':
      if (CONTENT_LENGTH_CB.matchesIgnoreCase(key)) {
        // server/05a8
        // php/164v
        _contentLengthOut = parseLong(value);
        return true;
      }
      else {
        return false;
      }

    case 0x0400 + 'd':
      if (DATE.matchesIgnoreCase(key)) {
        return true;
      }
      else {
        return false;
      }

    case 0x0600 + 's':
      if (SERVER.matchesIgnoreCase(key)) {
        _serverHeader = value;
        return true;
      }
      else {
        return false;
      }

    default:
      return false;
    }
  }
963369
def alpha(self, value):
        """"""
        if value != self._alpha and \
           isinstance(value, int):
            self._alpha = value
368539
public function process()
    {
        parent::process();

        if ($this->value === null) {
            return;
        }

        $locale = SwatI18NLocale::get($this->locale);
        $format = $locale->getNationalCurrencyFormat();
        $max_decimal_places =
            $this->decimal_places === null
                ? $format->fractional_digits
                : $this->decimal_places;

        $value = $this->getRawValue();

        // Get the number of entered fractional digits places from the raw
        // value. This checks the raw value instead of the processed value
        // because the processed value could have been parsed into a float by
        // this point.
        $decimal_position = mb_strpos(
            (string) $value,
            $format->decimal_separator
        );
        if ($decimal_position === false) {
            $decimal_places = 0;
        } else {
            $fractional_digits = mb_substr(
                rtrim((string) $value, '0'),
                $decimal_position + mb_strlen($format->decimal_separator)
            );

            $decimal_places = preg_match_all('/[0-9]/', $fractional_digits);
        }

        // check if length of the given fractional part is more than the
        // allowed length
        if ($decimal_places > $max_decimal_places) {
            // validation failed so reset value to the raw value
            $this->value = $value;

            if ($this->decimal_places === null) {
                $message = $this->getValidationMessage(
                    'currency-decimal-places'
                );

                $max_decimal_places_formatted = str_replace(
                    '%',
                    '%%',
                    $locale->formatNumber($max_decimal_places)
                );

                // C99 specification includes spacing character, remove it
                $currency_formatted = str_replace(
                    '%',
                    '%%',
                    $locale->getInternationalCurrencySymbol()
                );

                $message->primary_content = sprintf(
                    $message->primary_content,
                    $currency_formatted,
                    $max_decimal_places_formatted
                );
            } else {
                if ($max_decimal_places === 0) {
                    $message = $this->getValidationMessage('no-decimal-places');
                } else {
                    $max_decimal_places_formatted = str_replace(
                        '%',
                        '%%',
                        $locale->formatNumber($max_decimal_places)
                    );

                    // note: not using getValidationMessage() because of
                    // ngettext. We may want to add this ability to that method
                    $message = new SwatMessage(
                        sprintf(
                            Swat::ngettext(
                                'The %%s field has too many decimal places. There ' .
                                    'can be at most one decimal place.',
                                'The %%s field has too many decimal places. There ' .
                                    'can be at most %s decimal places.',
                                $max_decimal_places
                            ),
                            $max_decimal_places_formatted
                        ),
                        'error'
                    );
                }
            }

            $this->addMessage($message);
        }
    }
580136
def special_get_field(self, value, args, kwargs, format_spec=None):
        """"""
        if value in self.chain:
            raise BadOptionFormat("Recursive option", chain=self.chain + [value])
120655
function prepareValueForComparison(value, {keepDiacritics}) {
  value = `${value}` // toString
  if (!keepDiacritics) {
    value = removeAccents(value)
  }
  return value
}
749739
function( value, comparator ) {
			var error;
			if ( value <= parseFloat( comparator ) ) {
				error = {
					"rule": "greater_than",
					"message": "ERROR:provided value [" + value + "] is not greater than " + parseFloat( comparator )
				};
				return [ error ];
			}
			return;
		}
269283
def convert_value(self, value):
        """"""
        if isinstance(value, str):
            value = value.replace(self.separator, '')
            if self.decimal_point not in value:
                return int(value)
            else:
                return float(value.replace(self.decimal_point, '.'))
        elif self.int_to_float:
            return float(value)
        else:
            return value
294106
def valuePasses(self, value):
    ''''''
    return self._conditional_cmp[self.op](value, self.value)
359866
def convert(self, value, param, ctx):
        
        value = super(PositiveInt, self).convert(value, param, ctx)
        if value < 0:
            self.fail('%s is not positive' % value, param, ctx)
        if not self.allow_zero and not value:
            self.fail('%s is not greater than 0' % value, param, ctx)
        return value
1367592
def spread_value(value: Decimal, spread_p: Decimal) -> Tuple[Decimal, Decimal]:
    """"""
    upper = value * (1 + spread_p)
    lower = value / (1 + spread_p)
    return lower, upper
878196
function(value)
	{
		if (value == 'thin')
		{
			value = '2';
		}
		else if (value == 'medium')
		{
			value = '4';
		}
		else if (value == 'thick')
		{
			value = '6';
		}
		
		value = parseFloat(value);
		
		if (isNaN(value))
		{
			value = 0;
		}
		
		return value;
	}
577152
private function formatPriceValues()
    {
        $this->price = (float)number_format(
            $this->price,
            2,
            '.',
            ''
        );

        $this->specialPrice = (float)number_format(
            $this->specialPrice,
            2,
            '.',
            ''
        );
    }
303743
def human(value):
    ""
    if value >= 1073741824000:
        return '{:.1f} T'.format(value / 1099511627776.0)
    if value >= 1048576000:
        return '{:.1f} G'.format(value / 1073741824.0)
    if value >= 1024000:
        return '{:.1f} M'.format(value / 1048576.0)
    if value >= 1000:
        return '{:.1f} K'.format(value / 1024.0)
    return '{}   B'.format(value)
606877
def normalize_value(value):
    
    cast = str
    if six.PY2:
        cast = unicode  # noqa
    return cast(value).lower()
39252
def result(self, value):
        """"""
        if self._process_result:
            self._result = self._process_result(value)

        self._raw_result = value
383484
def process_value(self, value):
        
        # UID -> SuperModel
        if api.is_uid(value):
            return self.to_super_model(value)
        # Content -> SuperModel
        elif api.is_object(value):
            return self.to_super_model(value)
        # String -> Unicode
        elif isinstance(value, basestring):
            return safe_unicode(value).encode("utf-8")
        # DateTime -> DateTime
        elif isinstance(value, DateTime):
            return value
        # Process list values
        elif isinstance(value, (LazyMap, list, tuple)):
            return map(self.process_value, value)
        # Process dict values
        elif isinstance(value, (dict)):
            return {k: self.process_value(v) for k, v in value.iteritems()}
        # Process function
        elif safe_callable(value):
            return self.process_value(value())
        # Always return the unprocessed value last
        return value
370893
def visit_complex_value(self, node):
        """"""
        if node.value.startswith(ComplexValue.EXACT_VALUE_TOKEN):
            value = node.value.strip(ComplexValue.EXACT_VALUE_TOKEN)
            return ExactMatchValue(value)

        elif node.value.startswith(ComplexValue.PARTIAL_VALUE_TOKEN):
            value = node.value.strip(ComplexValue.PARTIAL_VALUE_TOKEN)
            return PartialMatchValue(value, True if ast.GenericValue.WILDCARD_TOKEN in value else False)

        elif node.value.startswith(ComplexValue.REGEX_VALUE_TOKEN):
            return RegexValue(node.value.strip(ComplexValue.REGEX_VALUE_TOKEN))
        else:
            # Covering the case where ComplexValue supports more than ExactMatch, PartialMatch and Regex values.
            msg = self.__class__.__name__ + ': Unrecognized complex value'
            try:
                msg += ' lookahead token: "' + node.value[0] + '"'
            except IndexError:
                msg += ': \"' + repr(node.value) + '"'
            msg += '.\nUsing simple value instead: "' + node.value + '".'
            logger.warn(msg)
            return ast.Value(node.value)