code: def ticks(
              cls, request,
              length: (Ptypes.path, Integer('Duration of the stream, in seconds.')),
              style: (Ptypes.path, String('Tick style.', enum=['compact', 'extended']))
          ) -> [
              (200, 'Ok', TickStream),
              (400, 'Invalid parameters')
          ]:
          '''A streaming Lord Vetinari clock...'''
          try:
              length = int(length)
              style = cls._styles[style]
          except (ValueError, KeyError):
              Respond(400)
          def vetinari_clock():
              start = time()
              while time() - start <= length:
                  sleep(randint(25, 400) / 100)
                  yield strftime(style, localtime())
          Respond(200, vetinari_clock()f ticks(
              cls, request,
              length: (Ptypes.path, Integer('Duration of the stream, in seconds.')),
              style: (Ptypes.path, String('Tick style.', enum=['compact', 'extended']))
          ) -> [
              (200, 'Ok', TickStream),
              (400, 'Invalid parameters')
          ]:
          '''A streaming Lord Vetinari clock...'''
          try:
              length = int(length)
              style = cls._styles[style]
          except (ValueError, KeyError):
              Respond(400)
          def vetinari_clock():
              start = time()
              while time() - start <= length:
                  sleep(randint(25, 400) / 100)
                  yield strftime(style, localtime())
          Respond(200, vetinari_clock())
docs: A streaming Lord Vetinari clock...