#NEWLINE# def __call__( cls , * args , **kwargs ) : #NEWLINE# #INDENT# instance = object . __new__ ( cls ) #NEWLINE# if args : #NEWLINE# #INDENT# raise RuntimeError ( 'Please pass all arguments as named arguments. Un-named arguments are not supported' ) #NEWLINE# #UNINDENT# for key in kwargs . keys ( ) : #NEWLINE# #INDENT# if ( key == 'name' ) : #NEWLINE# #INDENT# instance . __item_name__ = kwargs . pop ( key ) #NEWLINE# continue #NEWLINE# #UNINDENT# if ( key not in instance . _attributes ) : #NEWLINE# #INDENT# instance . _attributes . append ( key ) #NEWLINE# #UNINDENT# #UNINDENT# instance . __init__ ( * args , ** kwargs ) #NEWLINE# for base in reversed ( inspect . getmro ( cls ) ) : #NEWLINE# #INDENT# validate_attributes = getattr ( base , '__validate_attributes__' , None ) #NEWLINE# if validate_attributes : #NEWLINE# #INDENT# if ( instance . __validate_attributes__ . __func__ . __code__ is not cls . __code__ ) : #NEWLINE# #INDENT# base . __validate_attributes__ ( instance ) #NEWLINE# #UNINDENT# #UNINDENT# #UNINDENT# instance . __validate_attributes__ ( ) #NEWLINE# return instance