def with_probability(self, probability: cirq.TParamVal) -> cirq.Gate:
        """Creates a probabilistic channel with this gate.

        Args:
            probability: floating point value between 0 and 1, giving the
                probability this gate is applied.

        Returns:
            `cirq.RandomGateChannel` that applies `self` with probability
                `probability` and the identity with probability `1-p`.
        """
        if probability == 1:
            return self
        return ops.random_gate_channel.RandomGateChannel(sub_gate=self, probability=probability)
Creates a probabilistic channel with this gate.

        Args:
            probability: floating point value between 0 and 1, giving the
                probability this gate is applied.

        Returns:
            `cirq.RandomGateChannel` that applies `self` with probability
                `probability` and the identity with probability `1-p`.
        
cirq-core/cirq/ops/raw_types.py