code: def cycles(seq):
      """Yields cyclic permutations of the given sequence.
  
      For example::
  
          >>> list(cycles("abc"))
          [('a', 'b', 'c'), ('b', 'c', 'a'), ('c', 'a', 'b')]
  
      """
      n = len(seq)
      cycled_seq = cycle(seq)
      for x in seq:
          yield tuple(islice(cycled_seq, n))
          next(cycled_seq)
  
file_path: networkx/networkx/algorithms/tests/test_chains.py
imports: from itertools import cycle, islice
  import pytest
  import networkx
label_desc: Use image node_id 1 for calling a global function with example usage: cycles(seq) without return types