Interesting, that kind of "smelled" like the right answer.
So, help me out here - "You're using a language where you can put the data in an appropriate structure used by high-order code." I don't understand that statement? I don't know what "the data" or "high-order code" is?
The entity definition files are the data. Higher-order code is code that operates on code. I need a slightly more concrete example from you to get any more concrete here, but I'm imagining that the C# code generator has a set of rules for mapping entities to 1) C# classes and 2) fields in a database, and the generated C# classes automatically do database queries upon method/attribute accesses. In Python, you might override attribute lookup on your "DatabaseObject" class to hit the database, or you could have some code that processes an entity definition file and adds appropriate functions to Python classes at runtime. The advantage is that you don't have reams of code to muddle through and compile.
While your Python advice seems sound (as far as I can tell in my ignorance), it's obviously not true that "code generation with dynamically-typed languages is dead". These two things are orthogonal. Dynamic languages can be, and are, compiled.
It's true that in less powerful languages, you need code generation to do what more powerful languages can do with higher-order functions and reflection. But it's also true that code generation (along with other techniques from compiler and language development) remain quite useful for writing shorter, clearer programs in environments that support this.
THIS
Don't ever generate boilerplate Python code (especially 'fill in the blanks' crap). You're using a language where you can put the data in an appropriate structure used by high-order code.
You don't even have to make a new data structure if the information is already present. For instance, I wrote a python library that when called as an executable, looks up 'tool verb' style commands by looking at the methods on the available classes, gets the help from __doc__, and the extra optargs from attributes on the methods (added via a decorator).