def _gen_code(self):
<EOL>self.code = {}<EOL>def match_key(expr):<EOL><INDENT>if type(expr) is dict:<EOL><INDENT>code = {}<EOL>for key in expr.keys():<EOL><INDENT>code[key] = match_key(expr[key])<EOL><DEDENT><DEDENT>else:<EOL><INDENT>arg_list = [e for e in expr.atoms() if e.is_Symbol]<EOL>code = self._expr2code(arg_list, expr)<EOL><DEDENT>return code<EOL><DEDENT>self.code = match_key(self.expressions)<EOL>
Generate code for the list of expressions provided using the common sub-expression eliminator to separate out portions that are computed multiple times.