#NEWLINE# def function_code( self ) : #NEWLINE# #INDENT# decl_code = indent ( self . arg_declaration_code ( ) , 4 ) #NEWLINE# cleanup_code = indent ( self . arg_cleanup_code ( ) , 4 ) #NEWLINE# function_code = indent ( self . code_block , 4 ) #NEWLINE# local_dict_code = indent ( self . arg_local_dict_code ( ) , 4 ) #NEWLINE# dict_code = ( ( 'if(py_local_dict)                                  \n{                                                  \n    py::dict local_dict = py::dict(py_local_dict); \n' + local_dict_code ) + '}                                                  \n' ) #NEWLINE# try_code = ( ( ( ( ( 'try                              \n{                                \n' + decl_code ) + '    /*<function call here>*/     \n' ) + function_code ) + indent ( dict_code , 4 ) ) + '\n}                                \n' ) #NEWLINE# catch_code = ( 'catch(...)                       \n{                                \n' + '    return_val =  py::object();      \n    exception_occurred = 1;       \n}                                \n' ) #NEWLINE# return_code = ( ( '    /*cleanup code*/                     \n' + cleanup_code ) + '    if(!(PyObject*)return_val && !exception_occurred)\n    {\n                                  \n        return_val = Py_None;            \n    }\n                                  \n    return return_val.disown();           \n}                                \n' ) #NEWLINE# all_code = ( ( ( ( self . function_declaration_code ( ) + indent ( self . parse_tuple_code ( ) , 4 ) ) + indent ( try_code , 4 ) ) + indent ( return_code , 4 ) ) + return_code ) #NEWLINE# return all_code