<s> import sys <EOL> import dis <EOL> __VERSION__ = '<STR_LIT>' <EOL> if sys . version > '<STR_LIT:3>' : <EOL> long = int <EOL> def overrides ( method ) : <EOL> """<STR_LIT>""" <EOL> for super_class in _get_base_classes ( sys . _getframe ( <NUM_LIT:2> ) , method . __globals__ ) : <EOL> if hasattr ( super_class , method . __name__ ) : <EOL> if not method . __doc__ : <EOL> method . __doc__ = getattr ( super_class , method . __name__ ) . __doc__ <EOL> return method <EOL> raise AssertionError ( '<STR_LIT>' % method . __name__ ) <EOL> def _get_base_classes ( frame , namespace ) : <EOL> return [ _get_base_class ( class_name_components , namespace ) for class_name_components in _get_base_class_names ( frame ) ] <EOL> def _get_base_class_names ( frame ) : <EOL> """<STR_LIT>""" <EOL> co , lasti = frame . f_code , frame . f_lasti <EOL> code = co . co_code <EOL> i = <NUM_LIT:0> <EOL> extended_arg = <NUM_LIT:0> <EOL> extends = [ ] <EOL> while i <= lasti : <EOL> c = code [ i ] <EOL> op = ord ( c ) <EOL> i += <NUM_LIT:1> <EOL> if op >= dis . HAVE_ARGUMENT : <EOL> oparg = ord ( code [ i ] ) + ord ( code [ i + <NUM_LIT:1> ] ) * <NUM_LIT> + extended_arg <EOL> extended_arg = <NUM_LIT:0> <EOL> i += <NUM_LIT:2> <EOL> if op == dis . EXTENDED_ARG : <EOL> extended_arg = oparg * long ( <NUM_LIT> ) <EOL> if op in dis . hasconst : <EOL> if type ( co . co_consts [ oparg ] ) == str : <EOL> extends = [ ] <EOL> elif op in dis . hasname : <EOL> if dis . opname [ op ] == '<STR_LIT>' : <EOL> extends . append ( ( '<STR_LIT:name>' , co . co_names [ oparg ] ) ) <EOL> if dis . opname [ op ] == '<STR_LIT>' : <EOL> extends . append ( ( '<STR_LIT>' , co . co_names [ oparg ] ) ) <EOL> items = [ ] <EOL> previous_item = [ ] <EOL> for t , s in extends : <EOL> if t == '<STR_LIT:name>' : <EOL> if previous_item : <EOL> items . append ( previous_item ) <EOL> previous_item = [ s ] <EOL> else : <EOL> previous_item += [ s ] <EOL> if previous_item : <EOL> items . append ( previous_item ) <EOL> return items <EOL> def _get_base_class ( components , namespace ) : <EOL> obj = namespace [ components [ <NUM_LIT:0> ] ] <EOL> for component in components [ <NUM_LIT:1> : ] : <EOL> obj = getattr ( obj , component ) <EOL> return obj </s>
