import six


def sanitize_command_output(content):
    """Sanitizes the output got from underlying instances.

    Sanitizes the output by only returning unicode characters,
    any other characters will be ignored, and will also strip
    down the content of unrequired spaces and newlines.
    """
    return six.text_type(content, errors='ignore').strip()