def breakString(text, width=79, firstLineOffset=0):
    """Break up a string into multiple lines.

    Lines should each be of length no greater than width.
    If externally additional text will be added to the first line,
    such as an ANVL key, use firstLineOffset to reduce the allowed
    width we have available for the line.
    """
    originalWidth = width
    # Use firstLineOffset to adjust width allowed for this line.
    width = width - firstLineOffset
    if len(text) < width + 1:
        # string all fits on one line, so return it as is.
        return text
    index = width
    while index > 0:
        if ' ' == text[index]:
            if not text[index + 1].isspace() and not text[index - 1].isspace():
                stringPart1 = text[0:index]
                stringPart2 = text[index:]
                # Do not pass firstLineOffset.
                return stringPart1 + '\n' + breakString(
                    stringPart2,
                    originalWidth
                )

        index = index - 1
    # There was insufficient whitespace to break the string in a way that keeps
    # all lines under the desired width. Exceed the width.
    return text