def METHOD_NAME(segarr):
    """Merge segments by confidence interval (overlapping 0).
    Segments with lower CI above 0 are kept as gains, upper CI below 0 as
    losses, and the rest with CI overlapping zero are collapsed as neutral.
    """
    levels = np.zeros(len(segarr))
    # if len(segarr) < 10:
    #     logging.warning("* segarr :=\n%s", segarr)
    #     logging.warning("* segarr['ci_lo'] :=\n%s", segarr['ci_lo'])
    #     logging.warning("* segarr['ci_lo']>0 :=\n%s", segarr['ci_lo'] > 0)
    levels[segarr["ci_lo"].values > 0] = 1
    levels[segarr["ci_hi"].values < 0] = -1
    return squash_by_groups(segarr, pd.Series(levels))