def take_docstring_of(chars):
    """
    Take the lines between the first triple-quote and the next,
    such as from \"\"\" to \"\"\", or from \'\'\' to \'\'\'
    but ignore empty lines and ignore leading lines begun with a hash #
    """

    qqq = None

    lines = list()
    for line in chars.splitlines():
        stripped = line.rstrip()

        if qqq is None:

            if not stripped:
                continue

            if stripped.startswith("#"):
                continue

            if stripped.startswith('"""'):
                qqq = '"""'
            elif stripped.startswith("'''"):
                qqq = "'''"
            elif stripped.startswith('r"""'):
                qqq = '"""'
            elif stripped.startswith("r'''"):
                qqq = "'''"

            else:

                break

        elif qqq in stripped:

            qqq_at = stripped.index(qqq)
            lines.append(stripped[:qqq_at] + qqq)
            break

        lines.append(line)

    repr_doc = "\n".join(lines) + "\n"

    return repr_doc