def ValidateStringLength(name, value, max_len):
 if isinstance(value, unicode):
  value = value.encode('utf-8')
 if (len(value) > max_len):
  raise datastore_errors.BadValueError(('Property %s is %d bytes long; it must be %d or less. Consider Text instead, which can store strings of any length.' % (name, len(value), max_len)))

def ValidateStringLength ( name , value , max_len ) : if isinstance ( value , unicode ) : value = value . encode ( 'utf-8' ) if ( len ( value ) > max_len ) : raise datastore_errors . BadValueError ( ( 'Property %s is %d bytes long; it must be %d or less. Consider Text instead, which can store strings of any length.' % ( name , len ( value ) , max_len ) ) )
raises an exception if the supplied string is too long .