def __init__(self, user=None, cleanup_temp_dir=True, additional_cgroup_subsystems=[],
                 *args, **kwargs):
        """
        Create an instance of of RunExecutor.
        @param user None or an OS user as which the benchmarked process should be executed (via sudo).
        @param cleanup_temp_dir Whether to remove the temporary directories created for the run.
        @param additional_cgroup_subsystems List of additional cgroup subsystems that should be required and used for runs.
        """
        super(RunExecutor, self).__init__(*args, **kwargs)
        self._termination_reason = None
        self._user = user
        self._should_cleanup_temp_dir = cleanup_temp_dir
        self._cgroup_subsystems = additional_cgroup_subsystems

        if user is not None:
            # Check if we are allowed to execute 'kill' with dummy signal.
            sudo_check = self._build_cmdline(['kill', '-0', '0'])
            logging.debug('Checking for capability to run with sudo as user %s.', user)
            p = subprocess.Popen(sudo_check, stdout=subprocess.PIPE, stderr=subprocess.PIPE)
            try:
                if p.wait():
                    logging.error(
                        'Calling "%s" failed with error code %s and the following output: %s\n%s',
                        ' '.join(sudo_check),
                        p.returncode,
                        p.stdout.read().decode().strip(),
                        p.stderr.read().decode().strip())
                    sys.exit('Cannot execute benchmark as user "{0}", please fix your sudo setup.'.format(user))
            finally:
                p.stdout.close()
                p.stderr.close()

            # Check home directory of user
            try:
                self._home_dir = _get_user_account_info(user).pw_dir
            except (KeyError, ValueError) as e:
                sys.exit('Unknown user {}: {}'.format(user, e))
            try:
                self._home_dir_content = set(self._listdir(self._home_dir))
            except (subprocess.CalledProcessError, __HOLE__):
                # Probably directory does not exist
                self._home_dir_content = []
            if self._home_dir_content:
                logging.warning(
                    'Home directory %s of user %s contains files and/or directories, it is '
                    'recommended to do benchmarks with empty home to prevent undesired influences.',
                    self._home_dir, user)

        self._init_cgroups()
dataset/ETHPy150Open sosy-lab/benchexec/benchexec/runexecutor.py/RunExecutor.__init__