<s> """<STR_LIT>""" <EOL> from __future__ import absolute_import , print_function <EOL> import scipy . weave as weave <EOL> from scipy . weave import converters <EOL> import numpy <EOL> def create_array ( ) : <EOL> """<STR_LIT>""" <EOL> rows , cols , depth = <NUM_LIT:2> , <NUM_LIT:3> , <NUM_LIT:4> <EOL> arr = numpy . zeros ( ( rows , cols , depth ) , '<STR_LIT:i>' ) <EOL> count = <NUM_LIT:0> <EOL> for i in range ( rows ) : <EOL> for j in range ( cols ) : <EOL> for k in range ( depth ) : <EOL> arr [ i , j , k ] = count <EOL> count += <NUM_LIT:1> <EOL> return arr <EOL> def pure_inline ( arr ) : <EOL> """<STR_LIT>""" <EOL> code = """<STR_LIT>""" <EOL> weave . inline ( code , [ '<STR_LIT>' ] ) <EOL> def blitz_inline ( arr ) : <EOL> """<STR_LIT>""" <EOL> code = """<STR_LIT>""" <EOL> weave . inline ( code , [ '<STR_LIT>' ] , type_converters = converters . blitz ) <EOL> def main ( ) : <EOL> arr = create_array ( ) <EOL> print ( "<STR_LIT>" ) <EOL> print ( arr ) <EOL> print ( "<STR_LIT>" ) <EOL> pure_inline ( arr ) <EOL> print ( "<STR_LIT>" ) <EOL> blitz_inline ( arr ) <EOL> if __name__ == '<STR_LIT:__main__>' : <EOL> main ( ) </s>
