def circular_shifts(iterable, steps=1):
"""Return a list of circular rotations of *iterable*.
>>> circular_shifts(range(4))
[(0, 1, 2, 3), (1, 2, 3, 0), (2, 3, 0, 1), (3, 0, 1, 2)]
Set *steps* to the number of places to rotate to the left
(or to the right if negative). Defaults to 1.
"""
buffer = deque(iterable)
if steps == 0:
raise ValueError('Steps should be a non-zero integer')
buffer.rotate(steps)
steps = -steps
n = len(buffer)
n //= math.gcd(n, steps)
return [buffer.rotate(steps) or tuple(buffer) for _ in repeat(None, n)]