def sim_timestamps_em_list2(S, max_rate=<NUM_LIT:1>, bg_rate=<NUM_LIT:0>, rs=None, seed=None):
if rs is None:<EOL><INDENT>rs = np.random.RandomState(seed=seed)<EOL><DEDENT>fractions = [<NUM_LIT:5>, <NUM_LIT:2>, <NUM_LIT:8>, <NUM_LIT:4>, <NUM_LIT:9>, <NUM_LIT:1>, <NUM_LIT:7>, <NUM_LIT:3>, <NUM_LIT:6>, <NUM_LIT:9>, <NUM_LIT:0>, <NUM_LIT:5>, <NUM_LIT:2>, <NUM_LIT:8>, <NUM_LIT:4>, <NUM_LIT:9>]<EOL>scale = <NUM_LIT:10><EOL>max_counts = <NUM_LIT:4><EOL>S.all_times_chunks_list = []<EOL>S.all_par_chunks_list = []<EOL>for i_start, i_end in iter_chunk_index(S.n_samples,<EOL>S.emission.chunkshape[<NUM_LIT:1>]):<EOL><INDENT>counts_chunk = sim_timetrace_bg2(S.emission[:, i_start:i_end],<EOL>max_rate, bg_rate, S.t_step, rs=rs)<EOL>index = np.arange(<NUM_LIT:0>, counts_chunk.shape[<NUM_LIT:1>])<EOL>times_chunk_p = []      <EOL>par_index_chunk_p = []  <EOL>for p_i, counts_chunk_p_i in enumerate(counts_chunk.copy()):<EOL><INDENT>times_c_i = [(index[counts_chunk_p_i >= <NUM_LIT:1>] + i_start)*scale]<EOL>for frac, v in zip(fractions, range(<NUM_LIT:2>, max_counts + <NUM_LIT:1>)):<EOL><INDENT>times_c_i.append(<EOL>(index[counts_chunk_p_i >= v] + i_start)*scale + frac<EOL>)<EOL><DEDENT>t = np.hstack(times_c_i)<EOL>times_chunk_p.append(t)<EOL>par_index_chunk_p.append(np.full(t.size, p_i, dtype='<STR_LIT>'))<EOL><DEDENT>times_chunk_s = np.hstack(times_chunk_p)  <EOL>par_index_chunk_s = np.hstack(par_index_chunk_p)  <EOL>index_sort = times_chunk_s.argsort(kind='<STR_LIT>')<EOL>times_chunk_s = times_chunk_s[index_sort]<EOL>par_index_chunk_s = par_index_chunk_s[index_sort]<EOL>S.all_times_chunks_list.append(times_chunk_s)<EOL>S.all_par_chunks_list.append(par_index_chunk_s)<EOL><DEDENT>
Compute timestamps and particles and store results in a list.
    Each element contains timestamps from one chunk of emission.
    Background computed in sim_timetrace_bg2() as last fake particle.