Sure, I deliberately aped the code for build_shards_by_node here. Imitation is the sincerest form of flattery and all that.