def worker(i, j):
    similarity = calculate_similarity(worker_matrix[i], worker_matrix[j])
return i, j, similarity

def main(matrix):
    size = len(matrix)
result = [([0] * size) for _ in range(size)]
with multiprocessing.Pool(initializer=worker_init, initargs=(matrix,)) as pool:
    for i, j, val in pool.starmap(worker, itertools.combinations(list(range(size)), 2)):
        result[i][j] = result[j][i] = val
return result
if __name__ == '__main__':
    main(t_matrix)
Распараллелить этот вложенный цикл for в python