def key_to_qubits(target: METRIC_KEY) -> tuple[cirq.GridQubit, ...]:
        """Returns a tuple of qubits from a metric key.

        Raises:
           ValueError: If the metric key is a tuple of strings.
        """
        if (
            target
            and isinstance(target, tuple)
            and all(isinstance(q, cirq.GridQubit) for q in target)
        ):
            return target  # type: ignore
        raise ValueError(f'The metric target {target} was not a tuple of grid qubits.')
Returns a tuple of qubits from a metric key.

        Raises:
           ValueError: If the metric key is a tuple of strings.
        
cirq-google/cirq_google/engine/calibration.py