Execute a shell command.

        Purpose: Used to send a shell command to the connected device.
               | This uses the self._shell instance, which should be a
               | paramiko.Channel object, instead of a SSHClient.
               | This is because we cannot send shell commands to the
               | device using a SSHClient.

        @param command: The single command that to retrieve output from the
                      | device.
        @type command: str

        @returns: The reply from the device.
        @rtype: str

def shell_cmd(self, command=""):
        """ Execute a shell command.

        Purpose: Used to send a shell command to the connected device.
               | This uses the self._shell instance, which should be a
               | paramiko.Channel object, instead of a SSHClient.
               | This is because we cannot send shell commands to the
               | device using a SSHClient.

        @param command: The single command that to retrieve output from the
                      | device.
        @type command: str

        @returns: The reply from the device.
        @rtype: str
        """
        if not command:
            raise InvalidCommandError("Parameter 'command' must not be empty.")
        command = command.strip() + '\n'
        self._shell.send(command)
        time.sleep(2)
        out = ''
        while self._shell.recv_ready():
            out += self._shell.recv(999999)
            time.sleep(.75)
        # take off the command being sent and the prompt at the end.
        return '\n'.join(out.split('\n')[1:-1])