def get_next_permutation(starts_with_zero, zeros, ones):
    np.random.shuffle(zeros)
np.random.shuffle(ones)
if starts_with_zero:
    all_ = itertools.zip_longest(zeros, ones, fillvalue=np.array([]))
else:
    all_ = itertools.zip_longest(ones, zeros, fillvalue=np.array([]))
all_ = [e for p in all_ for e in p]
x_tag = np.concatenate(all_)
return x_tag
Create a permutation with same autocorrelation