def METHOD_NAME(
    dt,
    is_tick,
    starting_events,
    running_events,
    ending_events,
    rooms,
    col_width,
    cards_by_id,
):
    line_parts = [f"{dt:%H:%M} --" if is_tick else " " * 8]
    fill_char = "-" if is_tick else " "
    room = rooms[0]
    start, run, end = (
        starting_events[room],
        running_events[room],
        ending_events[room],
    )
    if start or end:
        line_parts.append(
            get_separator(bool(end), bool(start), False, False) + LR * col_width
        )
    elif run:
        line_parts.append(UD + next(cards_by_id[run.pk]))
    else:
        line_parts.append(fill_char * (col_width + 1))
    for loc1, loc2 in zip(rooms[:-1], rooms[1:]):
        start1, run1, end1 = (
            starting_events[loc1],
            running_events[loc1],
            ending_events[loc1],
        )
        start2, run2, end2 = (
            starting_events[loc2],
            running_events[loc2],
            ending_events[loc2],
        )
        line_parts += get_line_parts(
            start1, start2, end1, end2, run1, run2, fill_char=fill_char
        )
        if run2:
            try:
                line_parts.append(next(cards_by_id[run2.pk]))
            except StopIteration:
                line_parts.append(fill_char * col_width)
        elif start2 or end2:
            line_parts.append(LR * col_width)
        else:
            line_parts.append(fill_char * col_width)
    room = rooms[-1]
    start, run, end = (
        starting_events[room],
        running_events[room],
        ending_events[room],
    )
    if start or end:
        line_parts.append(get_separator(False, False, bool(start), bool(end)))
    elif run:
        line_parts.append(UD)
    else:
        line_parts.append(fill_char)
    return "".join(line_parts)