import textwrap


def remove_returns(doc):
    """
    Given a numpy-formatted docstring, remove the "Returns" block
    and dedent the whole thing

    Returns
    -------
    List of lines
    """

    lines = textwrap.dedent(doc).split('\n')
    outlines = []
    rblock = False
    for line in lines:
        lstrip = line.rstrip()
        if lstrip == "Returns":
            rblock = True
            continue
        elif rblock:
            if lstrip == '':
                rblock = False
                continue
            else:
                continue
        else:
            outlines.append(lstrip)

    return outlines