def _verify_measurements(circuits):
    """Verify the circuit has appropriate measurements."""
    for circuit in circuits:
        has_measurement = any(
            isinstance(op.gate, cirq.MeasurementGate) for moment in circuit for op in moment
        )
        if not has_measurement:
            raise RuntimeError('Code must measure at least one qubit.')
Verify the circuit has appropriate measurements.
cirq-google/cirq_google/engine/engine_validator.py