def execute(
        self, cmd: Sequence[str], input: bytes | None = None, use_exec: bool = False
    ) -> int:
        """
        Execute the given cmd as a subprocess inside the poetry managed dev environment
        """

        poetry_env = self._get_poetry_virtualenv()

        if poetry_env:
            from ..virtualenv import Virtualenv

            # Execute the task in the virtualenv from poetry
            venv = Virtualenv(Path(poetry_env))
            return self._execute_cmd(
                (venv.resolve_executable(cmd[0]), *cmd[1:]),
                input=input,
                env=venv.get_env_vars(self.env.to_dict()),
                use_exec=use_exec,
            )

        if self._virtualenv_creation_disabled():
            # There's no poetry env, and there isn't going to be
            cmd = (self._resolve_executable(cmd[0]), *cmd[1:])
            return self._execute_cmd(cmd, input=input, use_exec=use_exec)

        # Run this task with `poetry run`
        return self._execute_cmd(
            (self._poetry_cmd(), "--no-plugins", "run", *cmd),
            input=input,
            use_exec=use_exec,
        )

        Execute the given cmd as a subprocess inside the poetry managed dev environment
        
poethepoet/executor/poetry.py