transform function is function argument herenot preset global variable notice that message is fetched as module attribute this timeinstead of by running its name as code stringas this showsthere is often more than one way to accomplish the same goals with different api calls running functions in modules like this is simple way to structure embeddingcode in the module file can be changed arbitrarily without having to recompile the program that runs it it also provides direct communication modelinputs and outputs to python code can take the form of function arguments and return values running strings in dictionaries when we used pyrun_string earlier to run expressions with resultscode was executed in the namespace of an existing python module sometimesthoughit' more convenient to create brand-new namespace for running code strings that is independent of any existing module files the file in example - shows howthe new namespace is created as new python dictionary objectand handful of new api calls are employed in the processpydict_new makes new empty dictionary object pydict_setitemstring assigns to dictionary' key pydict_getitemstring fetches (indexesa dictionary value by key pyrun_string runs code string in namespacesas before pyeval_getbuiltins gets the built-in scope' module the main trick here is the new dictionary inputs and outputs for the embedded code strings are mapped to this dictionary by passing it as the code' namespace dictionaries in the pyrun_string call the net effect is that the program in example - works just like this python coded { [' ' exec(' 'ddexec(' 'ddprint( [' '] but hereeach python operation is replaced by api call python/ integration