<s> class Element ( dict ) : <EOL> fields = { } <EOL> def __init__ ( self , fields = { } , element = None , keys = None ) : <EOL> self . element = element <EOL> dict . __init__ ( self , dict . fromkeys ( self . fields ) ) <EOL> if not keys : <EOL> keys = fields . keys ( ) <EOL> for key in keys : <EOL> if key in fields : <EOL> self [ key ] = fields [ key ] <EOL> def __getattr__ ( self , name ) : <EOL> if hasattr ( self . __dict__ , name ) : <EOL> return getattr ( self . __dict__ , name ) <EOL> elif hasattr ( self . element , name ) : <EOL> return getattr ( self . element , name ) <EOL> else : <EOL> raise AttributeError , "<STR_LIT>" % name </s>
