from textwrap import dedent


def dedent_docstr(s, n=1):
    """Dedent all lines except first n lines

    Args:
        s (type): some text to dedent
        n (int): number of lines to skip, (n == 0 is a normal dedent,
            n == 1 is useful for whole docstrings)
    """
    lines = s.splitlines(keepends=True)
    if lines:
        first_n_lines = "".join([l.lstrip(' \t') for l in lines[:n]])
        dedented = dedent("".join(lines[n:]))
        return first_n_lines + dedented
    else:
        return ""