<s> """<STR_LIT>""" <EOL> import warnings <EOL> from . benchmark import * <EOL> @ register_test <EOL> def contains ( func , size ) : <EOL> for val in lists [ size ] [ : : <NUM_LIT:100> ] : <EOL> assert func ( val ) <EOL> @ register_test <EOL> def getitem ( func , size ) : <EOL> for val in lists [ size ] [ : : <NUM_LIT:100> ] : <EOL> assert func ( val ) == - val <EOL> @ register_test <EOL> def setitem ( func , size ) : <EOL> for val in lists [ size ] [ : : <NUM_LIT:100> ] : <EOL> func ( val , - val ) <EOL> @ register_test <EOL> def setitem_existing ( func , size ) : <EOL> for val in lists [ size ] [ : : <NUM_LIT:100> ] : <EOL> func ( val , - val ) <EOL> @ register_test <EOL> def delitem ( func , size ) : <EOL> for val in lists [ size ] [ : : <NUM_LIT:100> ] : <EOL> func ( val ) <EOL> @ register_test <EOL> def iter ( func , size ) : <EOL> assert all ( idx == val for idx , val in enumerate ( func ( ) ) ) <EOL> @ register_test <EOL> def init ( func , size ) : <EOL> func ( ( val , - val ) for val in lists [ size ] ) <EOL> def do_nothing ( obj , size ) : <EOL> pass <EOL> def fill_values ( obj , size ) : <EOL> if hasattr ( obj , '<STR_LIT>' ) : <EOL> obj . update ( { val : - val for val in range ( size ) } ) <EOL> else : <EOL> for val in range ( size ) : <EOL> obj [ val ] = - val <EOL> from . context import sortedcontainers <EOL> from sortedcontainers import SortedDict <EOL> kinds [ '<STR_LIT>' ] = SortedDict <EOL> try : <EOL> from rbtree import rbtree <EOL> kinds [ '<STR_LIT>' ] = rbtree <EOL> except ImportError : <EOL> warnings . warn ( '<STR_LIT>' , ImportWarning ) <EOL> try : <EOL> from blist import sorteddict <EOL> kinds [ '<STR_LIT>' ] = sorteddict <EOL> except ImportError : <EOL> warnings . warn ( '<STR_LIT>' , ImportWarning ) <EOL> try : <EOL> from treap import treap <EOL> kinds [ '<STR_LIT>' ] = treap <EOL> except ImportError : <EOL> warnings . warn ( '<STR_LIT>' , ImportWarning ) <EOL> try : <EOL> from bintrees import FastAVLTree , FastRBTree <EOL> kinds [ '<STR_LIT>' ] = FastAVLTree <EOL> kinds [ '<STR_LIT>' ] = FastRBTree <EOL> except ImportError : <EOL> warnings . warn ( '<STR_LIT>' , ImportWarning ) <EOL> try : <EOL> from skiplistcollections import SkipListDict <EOL> kinds [ '<STR_LIT>' ] = SkipListDict <EOL> except ImportError : <EOL> warnings . warn ( '<STR_LIT>' , ImportWarning ) <EOL> try : <EOL> from banyan import SortedDict as BanyanSortedDict <EOL> kinds [ '<STR_LIT>' ] = BanyanSortedDict <EOL> except ImportError : <EOL> warnings . warn ( '<STR_LIT>' , ImportWarning ) <EOL> for name in tests : <EOL> impls [ name ] = OrderedDict ( ) <EOL> for name , kind in kinds . items ( ) : <EOL> impls [ '<STR_LIT>' ] [ name ] = { <EOL> '<STR_LIT>' : fill_values , <EOL> '<STR_LIT>' : kind , <EOL> '<STR_LIT>' : '<STR_LIT>' , <EOL> '<STR_LIT>' : <NUM_LIT> <EOL> } <EOL> if '<STR_LIT>' in impls [ '<STR_LIT>' ] : <EOL> del impls [ '<STR_LIT>' ] [ '<STR_LIT>' ] <EOL> for name , kind in kinds . items ( ) : <EOL> impls [ '<STR_LIT>' ] [ name ] = { <EOL> '<STR_LIT>' : fill_values , <EOL> '<STR_LIT>' : kind , <EOL> '<STR_LIT>' : '<STR_LIT>' , <EOL> '<STR_LIT>' : <NUM_LIT> <EOL> } <EOL> for name , kind in kinds . items ( ) : <EOL> impls [ '<STR_LIT>' ] [ name ] = { <EOL> '<STR_LIT>' : do_nothing , <EOL> '<STR_LIT>' : kind , <EOL> '<STR_LIT>' : '<STR_LIT>' , <EOL> '<STR_LIT>' : <NUM_LIT> <EOL> } <EOL> for name , kind in kinds . items ( ) : <EOL> impls [ '<STR_LIT>' ] [ name ] = { <EOL> '<STR_LIT>' : fill_values , <EOL> '<STR_LIT>' : kind , <EOL> '<STR_LIT>' : '<STR_LIT>' , <EOL> '<STR_LIT>' : <NUM_LIT> <EOL> } <EOL> for name , kind in kinds . items ( ) : <EOL> impls [ '<STR_LIT>' ] [ name ] = { <EOL> '<STR_LIT>' : fill_values , <EOL> '<STR_LIT>' : kind , <EOL> '<STR_LIT>' : '<STR_LIT>' , <EOL> '<STR_LIT>' : <NUM_LIT> <EOL> } <EOL> for name , kind in kinds . items ( ) : <EOL> impls [ '<STR_LIT>' ] [ name ] = { <EOL> '<STR_LIT>' : fill_values , <EOL> '<STR_LIT>' : kind , <EOL> '<STR_LIT>' : '<STR_LIT>' , <EOL> '<STR_LIT>' : <NUM_LIT> <EOL> } <EOL> for name , kind in kinds . items ( ) : <EOL> impls [ '<STR_LIT>' ] [ name ] = { <EOL> '<STR_LIT>' : do_nothing , <EOL> '<STR_LIT>' : kind , <EOL> '<STR_LIT>' : '<STR_LIT>' , <EOL> '<STR_LIT>' : <NUM_LIT> <EOL> } <EOL> remove ( '<STR_LIT>' , '<STR_LIT>' ) <EOL> remove ( '<STR_LIT>' , '<STR_LIT>' ) <EOL> limit ( '<STR_LIT>' , '<STR_LIT>' , <NUM_LIT> ) <EOL> limit ( '<STR_LIT>' , '<STR_LIT>' , <NUM_LIT> ) <EOL> if __name__ == '<STR_LIT:__main__>' : <EOL> main ( '<STR_LIT>' ) </s>
