def presentStimulus(direction):
 win.fps()
 startPhase = num.random.random()
 if (direction == 1):
  frameIndices = num.arange(0, 4)
 else:
  frameIndices = num.arange(3, (-1), (-1))
 for cycles in range(cyclesTime):
  for ii in frameIndices:
   thisStim = stimFrames[ii]
   thisStim.setPhase(startPhase)
   for n in range(nFrames):
    thisStim.draw()
    win.flip()
 win.flip()

def presentStimulus ( direction ) : win . fps ( ) startPhase = num . random . random ( ) if ( direction == 1 ) : frameIndices = num . arange ( 0 , 4 ) else : frameIndices = num . arange ( 3 , ( - 1 ) , ( - 1 ) ) for cycles in range ( cyclesTime ) : for ii in frameIndices : thisStim = stimFrames [ ii ] thisStim . setPhase ( startPhase ) for n in range ( nFrames ) : thisStim . draw ( ) win . flip ( ) win . flip ( )
present stimulus drifting in a given direction where: direction = + 1 or -1 .