If I understand your use case correctly, you have e.g.:
dataset1 = ...
dataset2 = ...

print(len(dataset1)) 
> 10
print(len(dataset2))
> 100

Now you would like to create a “parent dataset” containing both and use some weighted sampling to e.g. oversample dataset1 and create balanced batches from both datasets?