if value has a length of q
191314
def has_length(self, value, q, strict=False):
        """"""
        value = stringify(value)
        if value is not None:
            if len(value) == q:
                return
        self.shout('Value %r not matching length %r', strict, value, q)
1245697
function ( val1, val2 ) {
            var result = false, isSame = true, val1Length, val2Length;
    
            if ( this.isArray(val1) && this.isArray(val2) ) {
                val1Length = val1.length;
                val2Length = val2.length;
    
                if ( val1Length === val2Length && val1Length ) {
                    for ( var i = 0; i < val1Length; ++i ) {
                        if ( !this.isEqual(val1[i], val2[i]) ) {
                            isSame = false;
                            break;
                        }
                    }
                    result = isSame;
                } else if ( !val1Length && !val2Length ) {
                    result = true;
                } else {
    				result = ( val1 === val2 );
    			}
            } else if ( this.isObject(val1) && this.isObject(val2) ) {
                val1Length = $B.object.length( val1 );
                val2Length = $B.object.length( val2 );
    
                if ( val1Length === val2Length && val1Length ) {
                    for ( var key in val1 ) {
                        if ( !this.isEqual(val1[key], val2[key]) ) {
                            isSame = false;
                            break;
                        }
                    }
                    result = isSame;
    			} else if ( !val1Length && !val2Length ) {
    				result = true;
    			} else {
                    result = ( val1 === val2 );
                }
            } else {
                result = ( val1 === val2 );
            }
    
            return result;
        }
1304554
def count(self, q):
        
        q = "SELECT COUNT(*) %s"%q
        return int(self.quick(q).split("\n")[1])
1234448
def size(self, value):
        """"""
        if self._size != value and \
           isinstance(value, (int, float, long)):
            self._size = value
1235853
def equal_length(*args):
    
    for i, arg in enumerate(args):
        if not isinstance(arg, Sized):
            raise ExpectedTypeError(arg, ["Sized"])
        if i >= 1 and len(arg) != len(args[0]):
            raise DifferentLengthError(args, arg)
1298371
def pad(text, length):
    """"""
    text_length = wcswidth(text)

    if text_length < length:
        return text + ' ' * (length - text_length)

    return text
179479
def cutoff(s, length=120):
    """"""
    if length < 5:
        raise ValueError('length must be >= 5')
    if len(s) <= length:
        return s
    else:
        i = (length - 2) / 2
        j = (length - 3) / 2
        return s[:i] + '...' + s[-j:]
1133300
function maxlength (val, max) {
  if (typeof val === 'string') {
    return isInteger(max, 10) && val.length <= parseInt(max, 10)
  } else if (Array.isArray(val)) {
    return val.length <= parseInt(max, 10)
  } else {
    return false
  }
}
751764
def _check_len(a, b):
    
    if len(a) != len(b):
        msg = "Length must be {}. Got {}".format(len(a), len(b))
        raise ValueError(msg)
1284183
public static function hasValidLength($value)
    {
        // Sanitize
        $value  = (int) $value;
        $length = strlen($value);

        // Validate
        return !($length < 9 || $length > 13);
    }
920655
def _contains_value(self, value):
        """"""
        g = operator.gt if self._lower is self.OPEN else operator.ge
        l = operator.lt if self._upper is self.OPEN else operator.le
        return g(value, self.lower_value) and l(value, self._upper_value)
654931
def check_value(self, value):
        """"""
        #if self.readonly:
        #    raise error.Error(
        #        "'{field_name}' field is readonly".format(
        #            field_name=self.name))
        if value and self.size:
            if not is_string(value):
                raise ValueError("Value supplied has to be a string")
            if len(value) > self.size:
                raise ValueError(
                    "Lenght of the '{0}' is limited to {1}".format(
                        self.name, self.size))
        if not value and self.required:
            raise ValueError("'{0}' field is required".format(self.name))
        return value
1091651
def parse_qvalues(value)
      tmp = []
      if value
        parts = value.split(/,\s*/)
        parts.each {|part|
          if m = %r{^([^\s,]+?)(?:;\s*q=(\d+(?:\.\d+)?))?$}.match(part)
            val = m[1]
            q = (m[2] or 1).to_f
            tmp.push([val, q])
          end
        }
        tmp = tmp.sort_by{|val, q| -q}
        tmp.collect!{|val, q| val}
      end
      return tmp
    end
383772
function isIndex$1(value, length) {
              length = length == null ? MAX_SAFE_INTEGER$1 : length;
              return !!length &&
                (typeof value == 'number' || reIsUint$1.test(value)) &&
                (value > -1 && value % 1 == 0 && value < length);
            }
663735
function checkLengths(k, n) {
  if (k.length !== crypto_secretbox_KEYBYTES) throw new Error('bad key size');
  if (n.length !== crypto_secretbox_NONCEBYTES) throw new Error('bad nonce size');
}
113546
private void appendValueLength(int value, int index) {
    int previousValue = toIntUnsigned(getValue(index));
    int length = toIntUnsigned(getLength(index));
    int offset = value - previousValue;
    if (offset > length) {
      setLength(index, (short) offset);
    }
  }
362615
def limit_value_string_length(value):
    
    if isinstance(value, string_types) and len(value) > constants.MAX_VALUE_LABEL_TEXT_LENGTH:
        value = value[:constants.MAX_VALUE_LABEL_TEXT_LENGTH] + "..."
        final_string = " " + value + " "
    elif isinstance(value, (dict, list)) and len(str(value)) > constants.MAX_VALUE_LABEL_TEXT_LENGTH:
        value_text = str(value)[:constants.MAX_VALUE_LABEL_TEXT_LENGTH] + "..."
        final_string = " " + value_text + " "
    else:
        final_string = " " + str(value) + " "

    return final_string