def METHOD_NAME(
    times, addrs, deltat=1000, duration=500, size=[240], downsample=[1]
):
    t_start = times[0]
    ts = range(t_start, t_start + duration * deltat, deltat)
    chunks = np.zeros([len(ts)] + size, dtype="int8")
    idx_start = 0
    idx_end = 0
    for i, t in enumerate(ts):
        idx_end += find_first(times[idx_end:], t)
        if idx_end > idx_start:
            ee = addrs[idx_start:idx_end]
            ev = [
                (ee[:, i] // d).astype(np.int)
                for i, d in enumerate(downsample)
            ]
            np.add.at(chunks, tuple([i] + ev), 1)
        idx_start = idx_end
    return chunks