@_convert_f_to_seqs(<NUM_LIT:2>)<EOL>def floyd(seqs, f=None, start=None, key=lambda x: x):
tortise, hare = seqs<EOL>yield hare.next()<EOL>tortise_value = tortise.next()<EOL>hare_value = hare.next()<EOL>while hare_value != tortise_value:<EOL><INDENT>yield hare_value<EOL>yield hare.next()<EOL>hare_value = hare.next()<EOL>tortise_value = tortise.next()<EOL><DEDENT>if f is None:<EOL><INDENT>raise CycleDetected()<EOL><DEDENT>hare_value = f(hare_value)<EOL>first = <NUM_LIT:0><EOL>tortise_value = start<EOL>while key(tortise_value) != key(hare_value):<EOL><INDENT>tortise_value = f(tortise_value)<EOL>hare_value = f(hare_value)<EOL>first += <NUM_LIT:1><EOL><DEDENT>period = <NUM_LIT:1><EOL>hare_value = f(tortise_value)<EOL>while key(tortise_value) != key(hare_value):<EOL><INDENT>hare_value = f(hare_value)<EOL>period += <NUM_LIT:1><EOL><DEDENT>raise CycleDetected(period=period, first=first)<EOL>
Floyd's Cycle Detector.

    See help(cycle_detector) for more context.

    Args:

      *args: Two iterators issueing the exact same sequence:
      -or-
      f, start: Function and starting state for finite state machine

    Yields: 

      Values yielded by sequence_a if it terminates, undefined if a
      cycle is found.

    Raises:

      CycleFound if exception is found; if called with f and `start`,
      the parametres `first` and `period` will be defined indicating
      the offset of start of the cycle and the cycle's period.