def function(self,p):
int_index=int(len(p.generators)*wrap(<NUM_LIT:0>,<NUM_LIT:1.0>,p.index))<EOL>pg=p.generators[int_index]<EOL>image_array = pg(xdensity=p.xdensity,ydensity=p.ydensity,bounds=p.bounds,<EOL>x=p.x+p.size*(pg.x*np.cos(p.orientation)-pg.y*np.sin(p.orientation)),<EOL>y=p.y+p.size*(pg.x*np.sin(p.orientation)+pg.y*np.cos(p.orientation)),<EOL>orientation=pg.orientation+p.orientation,size=pg.size*p.size,<EOL>scale=pg.scale*p.scale,offset=pg.offset+p.offset)<EOL>return image_array<EOL>
Selects and returns one of the patterns in the list.