def function(self,p):
pg = p.generator<EOL>motion_orientation=p.orientation+pi/<NUM_LIT><EOL>new_x = p.x+p.size*pg.x<EOL>new_y = p.y+p.size*pg.y<EOL>image_array = pg(xdensity=p.xdensity,ydensity=p.ydensity,bounds=p.bounds,<EOL>x=new_x + p.speed*p.step*np.cos(motion_orientation),<EOL>y=new_y + p.speed*p.step*np.sin(motion_orientation),<EOL>orientation=p.orientation,<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.