Resolve "convert-ly rule for tocItem"
This series of 5 commits should fix the issue #6024 (closed) and similar issues with
In addition, it fixes a few issues with Python code in python/convertrules.py (pylint W0101, R1720). It leaves other Python warnings (W0102) and formatting issues (C0103, C0116, C0301, C0326, C0330) untouched to avoid merge conflicts with other ongoing work.
Closes #6024 (closed)