Updated generator for better python support

Updated the generator to parse out the params into required and optional for use in the python twig template. It was generating them with inappropriate python syntax where it was mixing the order of required and optional args.