def _get_new_post(self, exponent: float, pre: ops.Gate) -> ops.Gate:
        """Identify the new single-qubit gate that needs to be inserted in the case that both pre
        gates are X or Y.

        Args:
            exponent: The exponent of the CZPowGate that is getting transformed.
            pre: The gate (X or Y) that is inserted on a given qubit.

        Returns:
            The single-qubit gate to insert after the CZPowGate on the same qubit.

        Raises:
            ValueError: If pre is not X or Y.
        """
        if pre == ops.X:
            return ops.PhasedXPowGate(exponent=1, phase_exponent=exponent / 2)
        elif pre == ops.Y:
            return ops.PhasedXZGate.from_zyz_exponents(z0=-exponent, y=1, z1=0)
        else:
            raise ValueError("pre should be cirq.X or cirq.Y")  # pragma: no cover
Identify the new single-qubit gate that needs to be inserted in the case that both pre
        gates are X or Y.

        Args:
            exponent: The exponent of the CZPowGate that is getting transformed.
            pre: The gate (X or Y) that is inserted on a given qubit.

        Returns:
            The single-qubit gate to insert after the CZPowGate on the same qubit.

        Raises:
            ValueError: If pre is not X or Y.
        
cirq-core/cirq/transformers/gauge_compiling/cphase_gauge.py