I am nor quite sure what you mean by that. But my get_sample_weights(dataset_instance) takes the instance of my dataset class where labels is an attribute. Furthermore labels is a dictionary with an id as a key and the label 0 or 1 as the corresponding value.