def replace(self, **changes) -> cirq.CircuitOperation:
        """Returns a copy of this operation with the specified changes."""
        kwargs = {
            'circuit': self.circuit,
            'repetitions': self.repetitions,
            'qubit_map': self.qubit_map,
            'measurement_key_map': self.measurement_key_map,
            'param_resolver': self.param_resolver,
            'repetition_ids': self.repetition_ids,
            'parent_path': self.parent_path,
            'extern_keys': self._extern_keys,
            'use_repetition_ids': (
                True if changes.get('repetition_ids') is not None else self.use_repetition_ids
            ),
            'repeat_until': self.repeat_until,
            **changes,
        }
        return CircuitOperation(**kwargs)
Returns a copy of this operation with the specified changes.
cirq-core/cirq/circuits/circuit_operation.py