def execute(self, command, timeout=default_timeout, check_exit_code=True, background=False,
                as_root=False, strip_colors=True, **kwargs):
        self._check_ready()
        try:
            if background:
                if as_root and self.username != 'root':
                    raise DeviceError('Cannot execute in background with as_root=True unless user is root.')
                return self.shell.background(command)
            else:
                # If we're already the root user, don't bother with sudo
                if self._is_root_user:
                    as_root = False
                return self.shell.execute(command, timeout, check_exit_code, as_root, strip_colors)
        except CalledProcessError as e:
            raise DeviceError(e)
Test for hard-coded passwords.
dataset/ETHPy150Open ARM-software/workload-automation/wlauto/common/linux/device.py/LinuxDevice.execute--crossover with--dataset/ETHPy150Open openstack/bandit/tests/functional/test_functional.py/FunctionalTests.test_hardcoded_passwords