def from_noise_model_like(cls, noise: cirq.NOISE_MODEL_LIKE) -> cirq.NoiseModel:
        """Transforms an object into a noise model if unambiguously possible.

        Args:
            noise: `None`, a `cirq.NoiseModel`, or a single qubit operation.

        Returns:
            `cirq.NO_NOISE` when given `None`,
            `cirq.ConstantQubitNoiseModel(gate)` when given a single qubit
            gate, or the given value if it is already a `cirq.NoiseModel`.

        Raises:
            ValueError: If noise is a `cirq.Gate` that acts on more than one
                qubit.
            TypeError: The input is not a ``cirq.NOISE_MODE_LIKE``.
        """
        if noise is None:
            return NO_NOISE
        if isinstance(noise, NoiseModel):
            return noise
        if isinstance(noise, ops.Gate):
            if noise.num_qubits() != 1:
                raise ValueError(
                    'Multi-qubit gates cannot be implicitly wrapped into a '
                    'noise model. Please use a single qubit gate (which will '
                    'be wrapped with `cirq.ConstantQubitNoiseModel`) or '
                    'an instance of `cirq.NoiseModel`.'
                )
            return ConstantQubitNoiseModel(noise)

        raise TypeError(
            'Expected a NOISE_MODEL_LIKE (None, a cirq.NoiseModel, '
            f'or a single qubit gate). Got {noise!r}'
        )
Transforms an object into a noise model if unambiguously possible.

        Args:
            noise: `None`, a `cirq.NoiseModel`, or a single qubit operation.

        Returns:
            `cirq.NO_NOISE` when given `None`,
            `cirq.ConstantQubitNoiseModel(gate)` when given a single qubit
            gate, or the given value if it is already a `cirq.NoiseModel`.

        Raises:
            ValueError: If noise is a `cirq.Gate` that acts on more than one
                qubit.
            TypeError: The input is not a ``cirq.NOISE_MODE_LIKE``.
        
cirq-core/cirq/devices/noise_model.py