def controlled(
        self,
        num_controls: int | None = None,
        control_values: cv.AbstractControlValues | Sequence[int | Collection[int]] | None = None,
        control_qid_shape: tuple[int, ...] | None = None,
    ) -> raw_types.Gate:
        """Returns a controlled `SWAP` with one additional control.

        The `controlled` method of the `Gate` class, of which this class is a
        child, returns a `ControlledGate` with `sub_gate = self`. This method
        overrides this behavior to return a `ControlledGate` with
        `sub_gate = SWAP`.
        """
        if num_controls == 0:
            return self
        return controlled_gate.ControlledGate(
            controlled_gate.ControlledGate(swap_gates.SWAP, num_controls=1),
            num_controls=num_controls,
            control_values=control_values,
            control_qid_shape=control_qid_shape,
        )
Returns a controlled `SWAP` with one additional control.

        The `controlled` method of the `Gate` class, of which this class is a
        child, returns a `ControlledGate` with `sub_gate = self`. This method
        overrides this behavior to return a `ControlledGate` with
        `sub_gate = SWAP`.
        
cirq-core/cirq/ops/three_qubit_gates.py