def METHOD_NAME(self, cmd: str, cwd: Optional[str] = None, **kwargs) -> str:
    if cwd is None:
        cwd = self.cwd
    logger.debug("Running command: %s", cmd)
    return subprocess.check_output(
        cmd, shell=True, cwd=cwd, encoding="utf-8", **kwargs
    ).strip()