def eval_func(pdf):
    nonlocal should_return_series
    nonlocal series_name
    nonlocal should_return_scalar
    result_inner = pdf.eval(expr, inplace=inplace)
    if inplace:
        result_inner = pdf
    if isinstance(result_inner, pd.Series):
        should_return_series = True
        series_name = result_inner.name
        result_inner = result_inner.to_frame()
    elif is_scalar(result_inner):
        should_return_scalar = True
        result_inner = pd.Series(result_inner).to_frame()
    return result_inner
def eval_func(pdf):
    nonlocal should_return_series
    nonlocal series_name
    nonlocal should_return_scalar
    result_inner = pdf.eval(expr, inplace=inplace)
    if inplace:
        result_inner = pdf
    if isinstance(result_inner, pd.Series):
        should_return_series = True
        series_name = result_inner.name
        result_inner = result_inner.to_frame()
    elif is_scalar(result_inner):
        should_return_scalar = True
        result_inner = pd.Series(result_inner).to_frame()
    return result_inner