<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def _try_to_squeeze(obj, raise_=False):
 """Attempt to squeeze to 1d Series. Parameters obj : {pd.Series, pd.DataFrame} raise_ : bool, default False """


    if isinstance(obj, pd.Series):
        return obj
    elif isinstance(obj, pd.DataFrame) and obj.shape[-1] == 1:
        return obj.squeeze()
    else:
        if raise_:
            raise ValueError("Input cannot be squeezed.")
        return obj