@classmethod
def _join_paragraphs(cls, lines, use_indent=False, leading_blanks=False,
    trailing_blanks=False):
    """Join adjacent lines together into paragraphs using either a blank line or indent as separator."""
    curr_para = []
    paragraphs = []
    for line in lines:
        if use_indent:
            if line.startswith(' '):
                curr_para.append(line.lstrip())
                continue
            elif line == '':
                continue
            else:
                if len(curr_para) > 0:
                    paragraphs.append(cls._join_paragraph(curr_para,
                        leading_blanks, trailing_blanks))
                curr_para = [line.lstrip()]
        elif len(line) != 0:
            curr_para.append(line)
        else:
            paragraphs.append(cls._join_paragraph(curr_para, leading_blanks,
                trailing_blanks))
            curr_para = []
    if len(curr_para) > 0:
        paragraphs.append(cls._join_paragraph(curr_para, leading_blanks,
            trailing_blanks))
    return paragraphs
