if ce.getAttributeSource(..) == "DEFAULT" : return 8 ( or whatever the default is ), return this as hardcoded value if ce.getAttributeSource(..) == "USER" : return value of getObjectAttr(..) ..
You need to convert it to a string first using 'str'
Example:
Souce_Type = ce.getAttributeSource(..)
if str(Souce_Type) == 'DEFAULT' :
return 8
if str(Souce_Type) == "USER" :
return value of getObjectAttr(..)