You can build your own sampler, where you have a permutation of the data from the class with higher frequency while over sampling from the class with lower frequency:
for example:
class_vector = [0,0,0,0,0,0,0,1,1,1]
class count = {0: 6 1: 3}
build a permutation of 0-6 with
np.random.permutation(6) and a over-sampling vector of class 1:
np.random.randint(7,9,6) # generates 6 integer numbers from 7,8,9
If you do not want data to repeat you can do a Stratified sampling: