<s> from __future__ import print_function <EOL> import random <EOL> import tables <EOL> print ( '<STR_LIT>' , tables . __version__ ) <EOL> nrows = <NUM_LIT> - <NUM_LIT:1> <EOL> class Distance ( tables . IsDescription ) : <EOL> frame = tables . Int32Col ( pos = <NUM_LIT:0> ) <EOL> distance = tables . Float64Col ( pos = <NUM_LIT:1> ) <EOL> h5file = tables . open_file ( '<STR_LIT>' , mode = '<STR_LIT:w>' ) <EOL> table = h5file . create_table ( h5file . root , '<STR_LIT>' , Distance , <EOL> '<STR_LIT>' , expectedrows = nrows ) <EOL> row = table . row <EOL> for i in range ( nrows ) : <EOL> row [ '<STR_LIT>' ] = random . randint ( <NUM_LIT:0> , nrows ) <EOL> row [ '<STR_LIT>' ] = float ( i ** <NUM_LIT:2> ) <EOL> row . append ( ) <EOL> table . flush ( ) <EOL> table . cols . frame . create_index ( optlevel = <NUM_LIT:9> , _testmode = True , _verbose = True ) <EOL> results = [ r . nrow for r in table . where ( '<STR_LIT>' ) ] <EOL> print ( "<STR_LIT>" , table . read_coordinates ( results ) ) <EOL> results = [ r . nrow for r in table . where ( '<STR_LIT>' ) ] <EOL> print ( "<STR_LIT>" , results ) <EOL> print ( "<STR_LIT>" , table . read_coordinates ( results ) ) <EOL> h5file . close ( ) </s>
