<s> import collections <EOL> class OrderedClassMembers ( type ) : <EOL> @ classmethod <EOL> def __prepare__ ( self , name , bases ) : <EOL> return collections . OrderedDict ( ) <EOL> def __new__ ( self , name , bases , classdict ) : <EOL> classdict [ '<STR_LIT>' ] = [ key for key in classdict . keys ( ) if key not in ( '<STR_LIT>' , '<STR_LIT>' ) ] <EOL> for each in bases : <EOL> odict = getattr ( each , '<STR_LIT>' , each . __dict__ ) <EOL> classdict [ '<STR_LIT>' ] = [ key for key in odict if key not in ( '<STR_LIT>' , '<STR_LIT>' ) ] + classdict [ '<STR_LIT>' ] <EOL> return type . __new__ ( self , name , bases , classdict ) </s>
