Python test code