def simple_resample(particles, weights):
    N = len(particles)
    cumulative_sum = np.cumsum(weights)
    cumulative_sum[(- 1)] = 1.0
    indexes = np.searchsorted(cumulative_sum, np.random.rand(N))
    particles[:] = particles[indexes]
    weights.fill((1.0 / N))
    return (particles, weights)
def simple_resample(particles, weights):
    N = len(particles)
    cumulative_sum = np.cumsum(weights)
    cumulative_sum[(- 1)] = 1.0
    indexes = np.searchsorted(cumulative_sum, np.random.rand(N))
    particles[:] = particles[indexes]
    weights.fill((1.0 / N))
    return (particles, weights)