def cli(self, command):
if not self.connected:<EOL><INDENT>raise pyPluribus.exceptions.ConnectionError("<STR_LIT>")<EOL><DEDENT>cli_output = '<STR_LIT>'<EOL>ssh_session = self._connection.get_transport().open_session()  <EOL>ssh_session.settimeout(self._timeout)<EOL>ssh_session.exec_command(command)<EOL>ssh_output = '<STR_LIT>'<EOL>err_output = '<STR_LIT>'<EOL>ssh_output_makefile = ssh_session.makefile()<EOL>ssh_error_makefile = ssh_session.makefile_stderr()<EOL>for byte_output in ssh_output_makefile:<EOL><INDENT>ssh_output += byte_output<EOL><DEDENT>for byte_error in ssh_error_makefile:<EOL><INDENT>err_output += byte_error<EOL><DEDENT>if not ssh_output:<EOL><INDENT>if err_output:<EOL><INDENT>raise pyPluribus.exceptions.CommandExecutionError(err_output)<EOL><DEDENT><DEDENT>cli_output = '<STR_LIT:\n>'.join(ssh_output.split(self._ssh_banner)[-<NUM_LIT:1>].splitlines()[<NUM_LIT:1>:])<EOL>if cli_output == '<STR_LIT>':  <EOL><INDENT>self.open()  <EOL>return self.cli(command)<EOL><DEDENT>return cli_output<EOL>
Executes a command and returns raw output from the CLI.

:param command: Command to be executed on the CLI.
:raise pyPluribus.exceptions.TimeoutError: when execution of the command exceeds the timeout
:raise pyPluribus.exceptions.CommandExecutionError: when not able to retrieve the output
:return: Raw output of the command

CLI Example:

.. code-block:: python

    device.cli('switch-poweroff')