Determines if value character length equal self.length.
        Keyword arguments:
        value str -- the value of the associated field to compare
160071
def run(self, value):
        
        if self.pass_ and not value.strip():
            return True

        if len((value.strip() if self.strip else value)) != self.length:
            self.error = self.error.format(value, self.length)
            return False
        return True
661029
def _validate_minlength(self, min_length, field, value):
        
        if isinstance(value, Iterable) and len(value) < min_length:
            self._error(field, errors.MIN_LENGTH, len(value))
739016
def data(self, value):
        
        if value is not None and not isinstance(value, unicode):
            value = value.decode('utf-8')
        self._data = value
650477
def size(self,value):
        '''
        
        '''
        if not self.params:
            self.params = dict(size=value)
            return self
        self.params['size'] = value
        return self
74719
def match_string(self, string, word=0, offset=0):
        
        if word:
            return self.get_string(offset) == string
        return self.get_length(len(string), offset) == string
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)
1236553
def is_str(string):
    
    if sys.version_info[:2] >= (3, 0):
        return isinstance(string, str)

    return isinstance(string, basestring)
164455
function padValue(value, length) {
  assert.strictEqual(typeof value, 'string');
  assert.strictEqual(typeof length, 'number');

  var result = value;

  while (result.length < length) {
    result = '0' + result;
  }

  return result;
}
1108700
function getValueLength(value, constructed) {
  var lenValue = 0;
  
  if (constructed) {
    for (var i = 0; i < value.length; i++) {
      lenValue = lenValue + value[i].byteLength;
    }
  } else {
    lenValue = value.length;
  }    
  
  return lenValue;
}
664081
def write_fixed_str(self, value, length):
        
        towrite = value.encode('utf-8')
        slen = len(towrite)
        if slen > length:
            raise SDKException(ErrorCode.param_err('string longer than fixed length: %s' % length))
        self.write_bytes(towrite)
        diff = length - slen

        while diff > 0:
            self.write_byte(0)
            diff -= 1
1229654
def p_stringValueList(p):
    
    if len(p) == 2:
        p[0] = _fixStringValue(p[1], p)
    else:
        p[0] = p[1] + _fixStringValue(p[2], p)
1266031
def is_length(property_name, *, min_length=1, max_length=None, present_optional=False):
    """"""
    def check(val):
      """Checks that a value matches a scope-enclosed set of length parameters."""
      if not val:
        return present_optional
      else:
        if len(val) >= min_length:
          if max_length is None:
            return True
          else:
            return len(val) <= max_length
        else:
          return False

    if max_length:
      message = "must be at least {0} characters long".format(min_length)
    else:
      message = "must be between {0} and {1} characters long".format(min_length, max_length)

    return Validation(check, property_name, message)
1185496
def _normalize(value):
        
        if hasattr(value, 'value'):
            value = value.value
        if value is not None:
            value = long(value)
        return value
1253758
static boolean isCOctetStringValid(String value, int maxLength) {
        if (value == null)
            return true;
        if (value.length() >= maxLength)
            return false;
        return true;

    }
1099951
def __one_equals_true(value):
        '''
        
        '''
        if isinstance(value, six.integer_types) and value == 1:
            return True
        elif (isinstance(value, six.string_types) and
              re.match(r'\d+', value, flags=re.IGNORECASE + re.UNICODE) is not None and
              six.text_type(value) == '1'):
            return True
        return False
511551
def _is_null_value(self, value):
        
        if value is None:
            return True

        if IS_PY3:
            # Python 3.X
            if isinstance(value, str) and len(value) == 0:
                return True
        else:
            # Python 2.X
            if isinstance(value, basestring) and len(value) == 0:  # NOQA: F821
                return True

        # TODO: This should probably be removed when solved in core Solr level?
        return False
625936
def valid_str(x: str) -> bool:
    
    if isinstance(x, str) and x.strip():
        return True
    else:
        return False