Replace generate block if-elif-else in python to switch based on python dict.
Hi, 
Perhaps a good optimization solution for Python would be to replace the if-elif-else construction with a switch-case based on python dict: 
https://jaxenter.com/implement-switch-case-statement-python-138315.html

Currently, in the worst case, the value must be compared with all the conditions up to the last one, which takes a lot of time.

This approach can be used for switch-case on enum type field.