def METHOD_NAME(records, hits, new_recs,
                      left_extension=2, right_extension=15):
    if not len(records):
        return
    samples_per_record = len(records[0]['data'])
    previous_record, next_record = record_links(records)
    for hit_i, h in enumerate(hits):
        rec_i = h['record_i']
        r = records[rec_i]
        # Indices to keep, with 0 at the start of this record
        start_keep = h['left'] - left_extension
        end_keep = h['right'] + right_extension
        # Indices of samples to keep in this record
        (a, b), _ = strax.overlap_indices(0, r['length'],
                                          start_keep, end_keep - start_keep)
        new_recs[rec_i]['data'][a:b] = records[rec_i]['data'][a:b]
        # Keep samples in previous record, if there was one
        if start_keep < 0:
            prev_ri = previous_record[rec_i]
            if prev_ri != NO_RECORD_LINK:
                # Note start_keep is negative, so this keeps the
                # last few samples of the previous record
                a_prev = start_keep
                new_recs[prev_ri]['data'][a_prev:] = \
                    records[prev_ri]['data'][a_prev:]
        # Same for the next record, if there is one
        if end_keep > samples_per_record:
            next_ri = next_record[rec_i]
            if next_ri != NO_RECORD_LINK:
                b_next = end_keep - samples_per_record
                new_recs[next_ri]['data'][:b_next] = \
                    records[next_ri]['data'][:b_next]