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

def _cast_output_to_type(value, typ):
    '''cast the value depending on the terraform type'''
    if typ == 'b':
        return bool(value)
    if typ == 'i':
        return int(value)
    return value