#NEWLINE# def coerce_property( x ) : #NEWLINE# #INDENT# if isinstance ( x , ( tuple , list , set , frozenset ) ) : #NEWLINE# #INDENT# collection = [ ] #NEWLINE# cls = None #NEWLINE# for item in x : #NEWLINE# #INDENT# item = coerce_atomic_property ( item ) #NEWLINE# t = type ( item ) #NEWLINE# if ( cls is None ) : #NEWLINE# #INDENT# cls = t #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# if ( t != cls ) : #NEWLINE# #INDENT# raise TypeError ( ( 'List properties must be homogenous (found %s in list of %s)' % ( t . __name__ , cls . __name__ ) ) ) #NEWLINE# #UNINDENT# #UNINDENT# collection . append ( item ) #NEWLINE# #UNINDENT# return x . __class__ ( collection ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# return coerce_atomic_property ( x )