Otherwise, it might break importing the module in tests, because unit test
libraries often replace the standard streams with proxies having no "fileno"
attribute.
GitOrigin-RevId: 2ce07c4d84703674ddbe00d0a8048d267fd058c7
Otherwise their presense doesn't let us import sphinxcontrib.napoleon
that we need to render docstrings in Numpy/Google Style formats.
It's not enough to remove site-packages/dist-packages from sys.path to
isolate the script from such "malicious" packages, since they are
registered and installed in sys.modules on interpreter startup before
any path modifications happen.
Launching interpreter with -S option prevents it from running these
hooks and also excludes site-packages from sys.path but makes inherited
stdlib modules not available in virtualenv.
What's more, sphinxcontrib.napoleon itself depends on setuptools as it
tries to register itself in a similar fashion in its __init__.py.
We could patch it but that would make future updates of the library
more tedious and error-prone.
I intentionally extracted it to a separate commit, since, otherwise,
git it not able to track that the helper script was renamed
(due to a lot changes in it) and preserve its previous history.