color1_occupations = [1, 0, 1, 2]
color2_occupations = [0, 2, 0, 1]
tmp12 = np.column_stack((tmp1, tmp2))
color_occupations = np.column_stack((color1_occupations, color2_occupations))
out = np.repeat(tmp12, color_occupations.ravel())
using numpy repeat simultaneously on arrays with distinct multiplicities but same dimension