def METHOD_NAME(self, cmd_name, cmd_arguments, user, errors, env=None):
    def _err(msg):
        errors.append(msg)
        if self.settings.print_error:
            print(msg, file=sys.stderr)
    kwargs = {}
    if env:
        kwargs["env"] = env
    def _execute(commands):
        process = Popen(commands, stdout=PIPE, stderr=STDOUT, **kwargs)
        stdout, _ = process.communicate()
        if process.returncode != 0:
            msg = "command failed:\n%s" % stdout
            _err(msg)
            return False
        if self.settings.print_output:
            print(stdout.strip())
        return True
    if not os.path.isfile(cmd_name):
        cmd_full_path = which(cmd_name)
    else:
        cmd_full_path = cmd_name
    if not cmd_full_path:
        msg = "%s: command not found" % cmd_name
        _err(msg)
        return False
    cmds = [cmd_full_path] + (cmd_arguments or [])
    if user == 'root':
        cmds = ['sudo'] + cmds
        return _execute(cmds)
    elif user and user != getpass.getuser():
        raise NotImplementedError  # TODO
    else:
        return _execute(cmds)