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

def dropout(tensor, drop_prob, is_training):
    '''
    Dropout except test.
    '''
    if not is_training:
        return tensor
    return tf.nn.dropout(tensor, 1.0 - drop_prob)