<s> from numba import autojit <EOL> import numpy as np <EOL> @ autojit <EOL> def mandel ( x , y , max_iters ) : <EOL> """<STR_LIT>""" <EOL> i = <NUM_LIT:0> <EOL> c = complex ( x , y ) <EOL> z = <NUM_LIT> <EOL> for i in range ( max_iters ) : <EOL> z = z * z + c <EOL> if ( z . real * z . real + z . imag * z . imag ) >= <NUM_LIT:4> : <EOL> return i <EOL> return <NUM_LIT:255> <EOL> @ autojit <EOL> def create_fractal ( min_x , max_x , min_y , max_y , image , iters ) : <EOL> height = image . shape [ <NUM_LIT:0> ] <EOL> width = image . shape [ <NUM_LIT:1> ] <EOL> pixel_size_x = ( max_x - min_x ) / width <EOL> pixel_size_y = ( max_y - min_y ) / height <EOL> for x in range ( width ) : <EOL> real = min_x + x * pixel_size_x <EOL> for y in range ( height ) : <EOL> imag = min_y + y * pixel_size_y <EOL> color = mandel ( real , imag , iters ) <EOL> image [ y , x ] = color <EOL> return image <EOL> image = np . zeros ( ( <NUM_LIT> , <NUM_LIT> ) , dtype = np . uint8 ) <EOL> create_fractal ( - <NUM_LIT> , <NUM_LIT:1.0> , - <NUM_LIT:1.0> , <NUM_LIT:1.0> , image , <NUM_LIT:20> ) <EOL> print ( "<STR_LIT>" ) </s>
