Improve api_generator.parser pyc -> py file name conversion.  It was not dealing with multi-dot file extension pyc files or considering a possible __pycache__/.
Improve api_generator.parser pyc -> py file name conversion.  It was not dealing with
multi-dot file extension pyc files or considering a possible __pycache__/.

PiperOrigin-RevId: 293798039

tensorflow/docs,tensorflow/docs,tensorflow/docs