def compute_type_raised_semantics(semantics):
    core = semantics
    parent = None
    while isinstance(core, LambdaExpression):
        parent = core
        core = core.term
        
    var = Variable("F")
    while core.free() in var:
        var = unique_variable(pattern=var)
    core = ApplicationExpression(FunctionVariableExpression(var), core)
    
    if parent is not None:
        parent.term = core
    else:
        semantics = core
    
    return LambdaExpression(var, semantics)
dataset/ETHPy150Open nltk/nltk/nltk/ccg/logic.py/compute_type_raised_semantics/swapped operands of `in`