Fix api_generator.parser._gen_pairs to work in Python 3.7 (PEP 479)
Fix api_generator.parser._gen_pairs to work in Python 3.7 (PEP 479)

In Python 3.7 recommendation from PEP 479 was enabled. In the new
behavior StopIteration exceptions raised directly or indirectly in coroutines
and generators are transformed into RuntimeError exceptions.

tensorflow/docs,tensorflow/docs,tensorflow/docs