def CheckPropertyValue(name, value, max_length):
 num_values = ((((((value.has_int64value() + value.has_stringvalue()) + value.has_booleanvalue()) + value.has_doublevalue()) + value.has_pointvalue()) + value.has_uservalue()) + value.has_referencevalue())
 Check((num_values <= 1), (('PropertyValue for ' + name) + ' has multiple value fields set'))
 if value.has_stringvalue():
  s16 = value.stringvalue().decode('utf-8', 'replace').encode('utf-16')
  Check((((len(s16) - 2) / 2) <= max_length), ('Property %s is too long. Maximum length is %d.' % (name, max_length)))

def CheckPropertyValue ( name , value , max_length ) : num_values = ( ( ( ( ( ( value . has_int64value ( ) + value . has_stringvalue ( ) ) + value . has_booleanvalue ( ) ) + value . has_doublevalue ( ) ) + value . has_pointvalue ( ) ) + value . has_uservalue ( ) ) + value . has_referencevalue ( ) ) Check ( ( num_values <= 1 ) , ( ( 'PropertyValue for ' + name ) + ' has multiple value fields set' ) ) if value . has_stringvalue ( ) : s16 = value . stringvalue ( ) . decode ( 'utf-8' , 'replace' ) . encode ( 'utf-16' ) Check ( ( ( ( len ( s16 ) - 2 ) / 2 ) <= max_length ) , ( 'Property %s is too long. Maximum length is %d.' % ( name , max_length ) ) )
check if this property value can be stored .