Y[:, (i)] = np.linalg.solve(np.dot(X.T, np.dot(np.diag(Wi), X)) + lambda_ *
    np.eye(n_factors), np.dot(X.T, np.dot(np.diag(Wi), Q[:, (i)])))
error = get_error(Q, X, Y, W)
weighted_errors.append(error)
print('{}th iteration is completed'.format(ii))
return
ListOfArgSets = []
for ii in range(n_iterations):
    ListOfArgSets.append({'ii': ii})
ResultList = Library_ParallelLoop.Main(Function=do_the_thing_function,
    ListOfArgSets=ListOfArgSets, Algorithm='pp', PrintExtra=True)
Как распараллелить цикл for в python?