code: def _run_module_code(code, init_globals=None,
                      mod_name=None, mod_fname=None,
                      mod_loader=None, pkg_name=None):
      
      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()
docs: Helper to run code in new namespace with sys modified