def METHOD_NAME(doc):
    """
    Returns the doc in sanitized form. This involves removing any newlines and
    whitespace blocks at the start or end of lines.
    """
    return ' '.join([line.strip() for line in doc.split('\n')])