@staticmethod
def _shiftCycle(cycle, shamt=1):
    """
        Shift a cycle by a given amount.

        :param cycle: list. A list of ints in 'is replaced by' order.
        :param shamt: int. An amount to shift by. Can be negative or zero.
        :return: list. A cycle that has been shifted.
        """
    if shamt == 0:
        return []
    ret = []
    seen = set()
    while len(seen) < len(cycle):
        i = 0
        while cycle[i] in seen:
            i += 1
            if i == len(cycle):
                raise ValueError('Cannot shift cycle: %s by %d' % (cycle,
                    shamt))
        newCycle = [cycle[i]]
        while True:
            i = (i + shamt) % len(cycle)
            e = cycle[i]
            if e != newCycle[0]:
                newCycle.append(e)
            else:
                break
        seen.update(newCycle)
        if len(newCycle) > 1:
            ret.append(newCycle)
    return ret
