def _extractFirstParagraphOfDocstring(f):
    """Extracts the first paragraph of the docstring of the given
    function.

    Also fixes extraneous whitespace due to indentation.
    """
    firstParagraph = f.__doc__.split("\n\n", 1)[0]
    lines = [line.strip() for line in firstParagraph.split("\n")]
    return " ".join(lines)