code: def sin_values(period=360):
      
      angles = (2 * pi * i / period for i in range(period))
      for a in cycle(angles):
          yield sin(a)
docs: Provides an infinite source of values representing a sine wave (from -1 to
      +1) which repeats every *period* values. For example, to produce a "siren"
      effect with a couple of LEDs that repeats once a second::
  
          from gpiozero import PWMLED
          from gpiozero.tools import sin_values, scaled, inverted
          from signal import pause
  
          red = PWMLED(2)
          blue = PWMLED(3)
  
          red.source_delay = 0.01
          blue.source_delay = red.source_delay
          red.source = scaled(sin_values(100), 0, 1, -1, 1)
          blue.source = inverted(red)
  
          pause()
  
      If you require a different range than -1 to +1, see :func:`scaled`.