# Group the weather sample's real clips by condition and light, to pick a test set.
# usage: python pick_weather_clips.py roaddata-weather-library
import json, sys
from collections import defaultdict
d = json.load(open(f"{sys.argv[1]}/labels.json"))
groups = defaultdict(list)
for clip in d["real"]:
    groups[(clip["kind"], clip["light"])].append(clip["id"])
for (kind, light), ids in sorted(groups.items()):
    print(f"{kind:<10} {light:<9} {' '.join(ids)}")
first = d["real"][0]
print("\n", first["id"], "|", first["condition"], "|", first["place"], "|", first["archive"])
