profile.runctx(command, globals, locals, filename=None)
This function is similar to run(), with added arguments to supply the globals and locals dictionaries for the command string. This routine executes:
exec(command, globals, locals)
and gathers profiling statistics as in the run() function above.