Fine partitionning by labels

Hi,

I’m sorry for the posts in a row…

Today my simple question is about partionner’s. I’m trying to reproduce Scaffold experiment. And they uses this formula below for the similiarity between clients :

We divide this dataset among
N = 100 clients as follows: for s% similar data we allocate
to each client s% i.i.d. data and the remaining (100 − s)%
by sorting according to label

I’m not sure i can do that with on the shelf partitionner’s. Should i use a distribution partitionner and do it manually ?

Best regards,
Mr. Sunshine.