def _send_command(self, command):
try:<EOL><INDENT>if isinstance(command, list):<EOL><INDENT>for cmd in command:<EOL><INDENT>output = self.device.send_command(cmd)<EOL>if "<STR_LIT>" not in output:<EOL><INDENT>break<EOL><DEDENT><DEDENT><DEDENT>else:<EOL><INDENT>output = self.device.send_command(command)<EOL><DEDENT>return self._send_command_postprocess(output)<EOL><DEDENT>except (socket.error, EOFError) as e:<EOL><INDENT>raise ConnectionClosedException(str(e))<EOL><DEDENT>
Wrapper for self.device.send.command().

        If command is a list will iterate through commands until valid command.