code: def permute_data(arrays, random_state=None):
    
    if any(len(a) != len(arrays[0]) for a in arrays):
      raise ValueError('All arrays must be the same length.')
    if not random_state:
      random_state = np.random
    order = random_state.permutation(len(arrays[0]))
    return [a[order] for a in arrays]
docs: Permute multiple numpy arrays with the same order.