Fix syntax error in an example in the ast documentation and sync docstrings (GH-18946)

2 files changed