def _parse_fit_and_predict_result(result):
    """Parse and infer whether fit_and_predict returns y or (y, scores)."""
    if len(result) > 1 and result[1] and not isinstance(result[1], str):
        # Scores object does not resemble a label prediction (always string)
        y = result[0]
        scores = result[1]
    else:
        y = result
        scores = None
    return y, scores