docs: def send_and_get_output(self,
  	                        send,
  	                        timeout=None,
  	                        retry=3,
  	                        strip=True,
  	                        preserve_newline=False,
  	                        note=None,
  	                        record_command=True,
  	                        echo=None,
  	                        fail_on_empty_before=True,
  	                        check_sudo=True,
  	                        nonewline=False,
  	                        ignore_background=False,
  	                        filter_backspaces=True,
  	                        loglevel=logging.INFO):
  		"""Returns the output of a command run. send() is called, and exit is not checked.
  
  		@param send:     See send()
  		@param retry:    Number of times to retry command (default 3)
  		@param strip:    Whether to strip output (defaults to True). Strips whitespace
  		                 and ansi terminal codes
  		@param note:     See send()
  		@param echo:     See send()
  
  		@type retry:     integer
  		@type strip:     boolean
  		"""
  		shutit = self.shutit
  		shutit.handle_note(note, command=str(send))
  		shutit.log('Retrieving output from command: ' + send, level=loglevel)
  		# Don't check exit, as that will pollute the output. Also, it's quite likely the submitted command is intended to fail.
  		echo = shutit.get_echo_override(echo)
  		send = shutit.get_send_command(send)
  		self.send(ShutItSendSpec(self,
  		                         send=send,
  		                         check_exit=False,
  		                         retry=retry,
  		                         echo=echo,
  		                         timeout=timeout,
  		                         record_command=record_command,
  		                         fail_on_empty_before=fail_on_empty_before,
  		                         check_sudo=check_sudo,
  		                         nonewline=nonewline,
  		                         loglevel=loglevel,
  		                         ignore_background=ignore_background))
  		before = self.pexpect_child.before
  
  		if before:
  			preserve_newline = bool(preserve_newline and before[-1] == '\n')
  		# CORNER CASE: if the terminal is eg a kubernetes one, it seems to use
  		# backspaces (\x08)s to manage newlines. So remove any line from before
  		# if it has backspaces in the output
  		if filter_backspaces:
  			lines = before.split('\n')
  			lines = filter(lambda x: x.find('\x08') == -1, lines)
  			before = '\n'.join(lines)
  		# Remove the command we ran in from the output.
  		# First, strip whitespace from the start of 'before', and the send:
  		before = before.strip()
  		send = send.strip()
  		shutit.log('send_and_get_output "before": ' + before + ', send_and_get_output send was: ' + send, level=logging.DEBUG)
  		if strip:
  			# cf: http://stackoverflow.com/questions/14693701/how-can-i-remove-the-ansi-escape-sequences-from-a-string-in-python
  			ansi_escape = re.compile(r'(\x9B|\x1B\[)[0-?]*[ -\/]*[@-~]')
  			string_with_termcodes = before.strip()
  			string_without_termcodes = ansi_escape.sub('', string_with_termcodes)
  			#string_without_termcodes_stripped = string_without_termcodes.strip()
  
  			# Occasionally we see ' \r' without a following \n. Remove these. This could be optional.
  			string_without_termcodes_stripped_no_cr = string_without_termcodes.replace(' \r','')
  			# Strip out \rs to make it output the same as a typical CL. This could be optional.
  			string_without_termcodes_stripped_no_cr = string_without_termcodes.replace('\r','')
  			if preserve_newline:
  				before = string_without_termcodes_stripped_no_cr + '\n'
  			else:
  				before = string_without_termcodes_stripped_no_cr
  		else:
  			before = before
  		if before.startswith(send):
  			before = before[len(send):]
  			# Strip whitespace again
  			before = before.strip()
  		shutit.log('send_and_get_output "before" after startswith check: ' + before, level=logging.DEBUG)
  		# Too chatty, but kept here in case useful for debugging
  		shutit.log('send_and_get_output got: ' + before, level=logging.DEBUG)
  		# Leave this debug in in case there are any strange characters to consider.
  		if shutit_global.shutit_global_object.ispy3:
  			shutit.log('send_and_get_output returning in base64:\n' + str(base64.b64encode(bytes(before,shutit_global.shutit_global_object.default_encoding))), level=logging.DEBUGV)
  		else:
  			shutit.log('send_and_get_output returning in base64:\n' + base64.b64encode(before), level=logging.DEBUGV)
  		## In rare cases a bell has been seen - can't see why we'd want a bell so simply remove them all.
  		before = before.replace('\x07','')
  		# If there happens to be an escape character in there, it's likely a
  		# problem - see IWT-4812.
  		before = before.split('\x1b')[0].strip()
  		if shutit_global.shutit_global_object.ispy3:
  			shutit.log('send_and_get_output returning in base64: ' + str(base64.b64encode(bytes(before,shutit_global.shutit_global_object.default_encoding))), level=logging.DEBUGV)
  		else:
  			shutit.log('send_and_get_output returning in base64: ' + base64.b64encode(bytes(before)), level=logging.DEBUGV)
  		shutit.handle_note_after(note=note)
  		return before