def popen(self, *args, **kwargs):
        opts = []
        opts.append('mxexec')
        opts.append('-d')
        if self.inNamespace:
            opts.append('-a')
            opts.append(str(self.pid))
        if self.inMountNamespace:
            opts.append('-b')
            opts.append(str(self.pid))
        if self.inPIDNamespace:
            opts.append('-k')
            opts.append(str(self.pid))
        if self.inUTSNamespace:
            opts.append('-j')
            opts.append(str(self.pid))
        defaults = {'stdout': PIPE, 'stderr': PIPE,
                    'mncmd': opts}
        defaults.update(kwargs)
        if len(args) == 1:
            if isinstance(args[0], list):
                # popen([cmd, arg1, arg2...])
                cmd = args[0]
            elif isinstance(args[0], str):
                # popen("cmd arg1 arg2...")
                cmd = args[0].split()
            else:
                raise Exception('popen() requires a string or list')
        elif len(args) > 0:
            # popen( cmd, arg1, arg2... )
            cmd = list(args)
        # Form the command to hand off
        mncmd = defaults['mncmd']
        del defaults['mncmd']
        cmd = mncmd + cmd
        # Shell requires a string, not a list!
        if defaults.get('shell', False):
            cmd = ' '.join(cmd)
        return Popen(cmd, **defaults)

    # Override on sendInt() to handle PID namespaces
imv src tgt
dataset/ETHPy150Open USC-NSL/miniNExT/mininext/node.py/Node.popen--crossover with--dataset/ETHPy150Open ipython/ipython-py3k/IPython/quarantine/ipy_fsops.py/imv