It chains (concatenates) two iterable objects. chain  yields the elements of the first iterator until it gets exhausted, and then it yields the elements of the second one. In your code chain puts together the parameters of the two generators so they will be optimized simultaneously. You can read more here: [docs] 257.