def popen_module_load(command, **kwargs):
if command[<NUM_LIT:0>:<NUM_LIT:3>] != [Module.MODULECMD, '<STR_LIT>', '<STR_LIT>']:<EOL><INDENT>raise Exception("<STR_LIT>")<EOL><DEDENT>module = command[<NUM_LIT:3>]<EOL>env_var = EnvBenchmark.MODULE_TO_VAR_RE.sub('<STR_LIT:_>', module)<EOL>python_code = '<STR_LIT>'.format(env_var)<EOL>class _popen:<EOL><INDENT>def communicate(self):<EOL><INDENT>return python_code, None<EOL><DEDENT><DEDENT>return _popen()<EOL>
Override Popen for every commands starting with
        modulecmd python load

        >>> p = Popen(['modulecmd', 'python', 'load', 'foo/bar'])
        >>> p.communicate()
        ('os.environ["foo_bar"]="loaded"', '')
        >>>