Trying to run the python sample code from the datasheet to read the buttons. It looks like a lot of the formatting doesn't carry through the PDF into my Python editor. i.e. line breaks don't appear correct; etc. Since I'm not a pro at Python, could someone point me at a corrected / formatted version of this code?

4DPI-24 display hat.

Page 17.