Fix data types in sample code
test.py: squelch ResourceWarnings