docstring code formatter: remove "invalid Python" check #8857
Description
#8811 added a docstring code snippet formatter. As part of the initial implementation, it is actually possible for the reformatter to transform valid Python to invalid Python, usually as a result of corner cases related to triple quoting. Since these are odd cases, for expediency, the initial implementation checks if the reformatted code is valid. If it isn't, then it bails out of reformatting and skips the code snippets entirely.
Ideally, we would be able to have more confidence in our code snippet reformatter to the point that we could remove this check for invalid Python code. Doing this will likely require some refactoring for how nested triple quotes are handled.
Here's a good example from the tests that doesn't work today:
Namely, the code snippet there ought to be formatted, but today, it is skipped because the reformatting currently generates invalid Python code.