def METHOD_NAME(cnarr, segments, is_sig):
    """Splice significant hits (if any) into the given segments."""
    if not is_sig.any():
        # Nothing to do
        return segments
    # NB: residuals() above ensures hits all occur within segments
    cnarr["is_sig"] = is_sig
    chunks = []
    for segment, seghits in cnarr.by_ranges(segments, keep_empty=True):
        if seghits["is_sig"].any():
            # Merge each run of adjacent non-significant bins within this
            # segment, leaving the significant hits as single-bin segments
            levels = seghits["is_sig"].cumsum() * seghits["is_sig"]
            chunks.append(
                seghits.data.assign(_levels=levels)
                .groupby("_levels", sort=False)
                .apply(segfilters.squash_region)
                .reset_index(drop=True)
            )
        else:
            # Keep this segment as-is
            chunks.append(
                pd.DataFrame.from_records([segment], columns=segments.data.columns)
            )
    return cnarr.as_dataframe(pd.concat(chunks, sort=False))