You can just write set(ruptures_gmvs), no need to call .keys() explicitly