@staticmethod
def _shiftOrientationAction(orientingAction, permutingAction, shamt, modulus):
    """
        Multiply an orientation action by a given amount. Apply the permutation
        by that number of times too.

        :param orientingAction: list. A list of amounts to add to each
            element of the 'orientations' list.
        :param permutingAction: list. A list of cycles to apply.
        :param shamt: int. The amount to shift by.
        :param modulus: int. A modulus to apply after addition.
        :return: list. An orienting action that has been shifted.
        """
    ret = dict()
    if shamt < 0:
        for cycle in permutingAction:
            for i in range(len(cycle)):
                s = 0
                for j in range(abs(shamt)):
                    s -= orientingAction.get(cycle[(i + j + 1) % len(cycle)], 0
                        )
                ret[cycle[i]] = s % modulus
    elif shamt > 0:
        for cycle in permutingAction:
            for i in range(len(cycle)):
                s = 0
                for j in range(abs(shamt)):
                    s -= orientingAction.get(cycle[(i - j) % len(cycle)], 0)
                ret[cycle[i]] = s % modulus
    for k in orientingAction:
        if k not in ret:
            delta = orientingAction[k] * shamt % modulus
            if delta:
                ret[k] = delta
    return ret
