def color_for_thread(thread_id):
if thread_id not in seen_thread_colors:<EOL><INDENT>seen_thread_colors[thread_id] = next(thread_colors)<EOL><DEDENT>return seen_thread_colors[thread_id]<EOL>
Associates the thread ID with the next color in the `thread_colors` cycle,
so that thread-specific parts of a log have a consistent separate color.