<s> from random import shuffle <EOL> from timeit import Timer <EOL> try : <EOL> import unittest2 as unittest <EOL> except ImportError : <EOL> import unittest <EOL> import six <EOL> from six . moves import range <EOL> import agate <EOL> class TestTableJoin ( unittest . TestCase ) : <EOL> def test_join ( self ) : <EOL> left_rows = [ ( six . text_type ( i ) , i ) for i in range ( <NUM_LIT> ) ] <EOL> right_rows = [ ( six . text_type ( i ) , i ) for i in range ( <NUM_LIT> ) ] <EOL> shuffle ( left_rows ) <EOL> shuffle ( right_rows ) <EOL> column_names = [ '<STR_LIT:text>' , '<STR_LIT>' ] <EOL> column_types = [ agate . Text ( ) , agate . Number ( ) ] <EOL> left = agate . Table ( left_rows , column_names , column_types ) <EOL> right = agate . Table ( right_rows , column_names , column_types ) <EOL> def test ( ) : <EOL> left . join ( right , '<STR_LIT:text>' ) <EOL> results = Timer ( test ) . repeat ( <NUM_LIT:10> , <NUM_LIT:1> ) <EOL> min_time = min ( results ) <EOL> self . assertLess ( min_time , <NUM_LIT:0> ) </s>
