def _replace_pairwise_equality_by_equality(pc):
    """Rewrite pairwise equality constraints to equality constraints.

    Args:
        pc (list): List of dictionaries where each dictionary is a constraint.
            It is assumed that the selectors in constraints were already processed.

    Returns:
        pc (list): List of processed constraints.

    """
    pairwise_constraints = [c for c in pc if c["type"] == "pairwise_equality"]
    pc = [c for c in pc if c["type"] != "pairwise_equality"]
    for constr in pairwise_constraints:
        equality_constraints = []
        for elements in zip(*constr["indices"]):
            equality_constraints.append({"index": list(elements), "type": "equality"})
        pc += equality_constraints

    return pc