can you rewrite the next 22 lines as something like:
```python
fold_scores, n_test, _, parameters = zip(*out[grid_start:grid_start + n_folds])
parameters = parameters[0]
mean_scores = np.average(fold_scores, axis=0, weights=n_test if iid else None)
# all_scores = np.array(fold_scores).T
```