def __init__(
        self,
        sub_operation: cirq.Operation,
        conditions: Sequence[str | cirq.MeasurementKey | cirq.Condition | sympy.Basic],
    ):
        """Initializes a `ClassicallyControlledOperation`.

        Multiple consecutive `ClassicallyControlledOperation` layers are
        squashed when possible, so one should not depend on a specific number
        of layers.

        Args:
            sub_operation: The operation to gate with a classical control
                condition.
            conditions: A sequence of measurement keys, or strings that can be
                parsed into measurement keys.

        Raises:
            ValueError: If an unsupported gate is being classically
                controlled.
        """
        if protocols.measurement_key_objs(sub_operation):
            raise ValueError(
                f'Cannot conditionally run operations with measurements: {sub_operation}'
            )
        conditions = tuple(conditions)
        if isinstance(sub_operation, ClassicallyControlledOperation):
            conditions += sub_operation._conditions
            sub_operation = sub_operation._sub_operation
        conds: list[cirq.Condition] = []
        for c in conditions:
            if isinstance(c, str):
                c = value.MeasurementKey.parse_serialized(c)
            if isinstance(c, value.MeasurementKey):
                c = value.KeyCondition(c)
            if isinstance(c, sympy.Basic):
                c = value.SympyCondition(c)
            conds.append(c)
        self._conditions: tuple[cirq.Condition, ...] = tuple(conds)
        self._sub_operation: cirq.Operation = sub_operation
Initializes a `ClassicallyControlledOperation`.

        Multiple consecutive `ClassicallyControlledOperation` layers are
        squashed when possible, so one should not depend on a specific number
        of layers.

        Args:
            sub_operation: The operation to gate with a classical control
                condition.
            conditions: A sequence of measurement keys, or strings that can be
                parsed into measurement keys.

        Raises:
            ValueError: If an unsupported gate is being classically
                controlled.
        
cirq-core/cirq/ops/classically_controlled_operation.py