from typing import Sequence
from typing import Tuple


def transpose(
    index_pairs: Sequence[Tuple[int, int]]
) -> Tuple[Sequence[int], Sequence[int]]:
    """Turns a sequence of index pairs (i,j) into
    a sequence of i indices and a sequence of j indeces.

    :meta private:"""
    i, j = zip(*index_pairs)
    return (i, j)