def get_swapped_indices(length):
    """Returns a list of swapped index pairs. For example, if length = 6, then
    function returns [1, 0, 3, 2, 5, 4], i.e. every index pair is swapped.

    Args:
        length (int): Length of swapped indices.
    """
    return [i + 1 if i % 2 == 0 else i - 1 for i in range(length)]