def _run_process(self, command, *args, **kwargs):
        stdout = kwargs.get('stdout', sys.stdout)
        stderr = kwargs.get('stderr', sys.stderr)

        kwargs.setdefault('cwd', self.path)

        if isinstance(command, basestring):
            command = shlex.split(command)
        command = map(str, command)

        env = os.environ.copy()
        env['PYTHONUNBUFFERED'] = '1'
        if kwargs.get('env'):
            for key, value in kwargs['env'].iteritems():
                env[key] = value

        kwargs['env'] = env
        kwargs['bufsize'] = 0

        self.log.info('Running {}'.format(command))
        try:
            proc = Popen(command, *args, **kwargs)
        except __HOLE__ as exc:
            if not self.whereis(command[0], env):
                msg = 'ERROR: Command not found: {}'.format(command[0])
            else:
                msg = traceback.format_exc()
            raise CommandError(command, 1, stdout=None, stderr=msg)

        return proc
dataset/ETHPy150Open getsentry/freight/freight/utils/workspace.py/Workspace._run_process