<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:

def if_then_else(cls,
            condition: 'TensorFluent',
            true_case: 'TensorFluent',
            false_case: 'TensorFluent') -> 'TensorFluent':
        '''Returns a TensorFluent for the control op if-then-else.

        Args:
            condition: Boolean fluent for the if condition.
            true_case: Fluent returned in the true clause.
            false_case: Fluent returned in the false clause.

        Returns:
            A TensorFluent wrapping the if-then-else control statement.

        Raises:
            ValueError: If cases don't have same shape.
        '''
        true = TensorFluent.constant(True, tf.bool)
        false = TensorFluent.constant(False, tf.bool)
        ite = (condition == true) * true_case + (condition == false) * false_case
        if true_case.dtype == tf.bool and false_case.dtype == tf.bool:
            ite = ite.cast(tf.bool)
        return ite