def lines(s):
    """
    Split a string in lines using the following conventions:
    - a line ending \r\n or \n is a separator and yields a new list element
    - empty lines or lines with only white spaces are not returned.
    - returned lines are stripped.

    Because of these constraints "".split() cannot be used directly. We first
    replace things where we want to split with line endings, then we
    splitlines.

    For example:
    >>> t='''This problem is.
    ... It is therefore
    ...
    ...
    ...  However,we
    ... without introducing ..
    ...  However, I have
    ...
    ...
    ... '''
    >>> len([p[1] for p in lines(t)])
    5
    >>> expected = ['This problem is.', 'It is therefore', 'However,we', 'without introducing ..', 'However, I have']
    >>> assert expected == [p for p in lines(t)]
    """
    return [l.strip() for l in s.splitlines() if l.strip()]