def color_of_row(i, drow):
    """
    determine the color of the circle for a record.
    * have an error -> red
    * have some OK/display/stream and no empty -> green
    """
    error = drow["code_error"]
    n_ok = drow["code_ok"]
    display = drow["code_display"]
    stream = drow["code_stream"]
    empty = drow["code_empty"]
    if error > 0:
        return "red"
    if n_ok + display + stream > 0 and empty == 0:
        return "green"
    return "blue"