code: def check_length(value, length):
      
      _length = len(value)
      if _length != length:
          raise ValueError("length must be %d, not %d" % \
                           (length, _length))
docs: Checks length of value
  
      @param value: value to check
      @type value: C{str}
  
      @param length: length checking for
      @type length: C{int}
  
      @return: None when check successful
  
      @raise ValueError: check failed