How to write and use doctest to write test code in docstrings in Python. https://from-locals.com/python-doctest-example/