call the method optimizer.optimize with 2 arguments operations and migration.app_label, substitute the result for new_operations.
new_operations = optimizer . optimize ( operations , migration . app_label )