work on python code generation and related tests