def validate_dimension(dimension: int) -> None:
        """Raises an exception if `dimension` is not positive.

        Raises:
            ValueError: `dimension` is not positive.
        """
        if dimension < 1:
            raise ValueError(
                f'Wrong qid dimension. Expected a positive integer but got {dimension}.'
            )
Raises an exception if `dimension` is not positive.

        Raises:
            ValueError: `dimension` is not positive.
        
cirq-core/cirq/ops/raw_types.py