code: def function(self,p):
          
          return np.around(
              0.5 +
              0.5*np.sin(pi*(p.duty_cycle-0.5)) +
              0.5*np.sin(p.frequency*2*pi*self.pattern_y + p.phase))
docs: Return a square-wave grating (alternating black and white bars).