def pick_color(user_profile: UserProfile, subs: Iterable[Subscription]) -> str:
    used_colors = [sub.color for sub in subs if sub.active]
    available_colors = [s for s in STREAM_ASSIGNMENT_COLORS if (s not in used_colors)]
    if available_colors:
        return available_colors[0]
    else:
        return STREAM_ASSIGNMENT_COLORS[(len(used_colors) % len(STREAM_ASSIGNMENT_COLORS))]
def pick_color(user_profile: UserProfile, subs: Iterable[Subscription]) -> str:
    used_colors = [sub.color for sub in subs if sub.active]
    available_colors = [s for s in STREAM_ASSIGNMENT_COLORS if (s not in used_colors)]
    if available_colors:
        return available_colors[0]
    else:
        return STREAM_ASSIGNMENT_COLORS[(len(used_colors) % len(STREAM_ASSIGNMENT_COLORS))]