<s> class roproperty ( object ) : <EOL> def __init__ ( self , getter ) : <EOL> self . getter = getter <EOL> def __get__ ( self , obj , cls = None ) : <EOL> if obj is None : <EOL> return self <EOL> else : <EOL> return self . getter ( obj ) <EOL> class InstanceMethod ( object ) : <EOL> "<STR_LIT>" <EOL> def __init__ ( self , im_func , im_self , im_class ) : <EOL> self . im_func = im_func <EOL> self . im_self = im_self <EOL> self . im_class = im_class <EOL> def __call__ ( self , * args , ** kwds ) : <EOL> firstarg = self . im_self <EOL> if firstarg is None : <EOL> if not args or not isinstance ( args [ <NUM_LIT:0> ] , self . im_class ) : <EOL> raise TypeError ( <EOL> "<STR_LIT>" % ( <EOL> self . im_class , ) ) <EOL> firstarg = args [ <NUM_LIT:0> ] <EOL> args = args [ <NUM_LIT:1> : ] <EOL> return self . im_func ( firstarg , * args , ** kwds ) <EOL> def __eq__ ( self , other ) : <EOL> return isinstance ( other , InstanceMethod ) and ( <EOL> self . im_func == other . im_func and <EOL> self . im_self == other . im_self ) <EOL> def __ne__ ( self , other ) : <EOL> return not self . __eq__ ( other ) <EOL> def __hash__ ( self ) : <EOL> return hash ( ( self . im_func , self . im_self ) ) </s>
