<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def _run_module_code(code, init_globals=None, mod_name=None, mod_fname=None, mod_loader=None, pkg_name=None):
 """Helper to run code in new namespace with sys modified"""

    with _ModifiedArgv0(mod_fname):
        with _TempModule(mod_name) as temp_module:
            mod_globals = temp_module.module.__dict__
            _run_code(code, mod_globals, init_globals,
                      mod_name, mod_fname, mod_loader, pkg_name)
    # Copy the globals of the temporary module, as they
    # may be cleared when the temporary module goes away
    return mod_globals.copy()