def switchable(a_1, a_2):
    """
    decide if 2 actions can be swapped.
    two actions are independent if they are on opposite faces or on the same
    face but on different layers.
    :param a_1: first action
    :param a_2: second action
    :returns True if switchable, False otherwise
    """
    opposite_faces = a_1.face.value + a_2.face.value == 5
    same_face = a_1.face.value == a_2.face.value
    diff_layers = a_1.layer != a_2.layer
    if opposite_faces:
        return a_1.face.value > a_2.face.value
    elif same_face and diff_layers:
        return a_1.layer > a_2.layer
    else:
        return False
