def test_for_blank_lines_separating_reference_lines(ref_sect):
    """Test to see if reference lines are separated by blank lines so that
       these can be used to rebuild reference lines.
       @param ref_sect: (list) of strings - the reference section.
       @return: (int) 0 if blank lines do not separate reference lines; 1 if
        they do.
    """
    num_blanks = 0
    num_lines = 0
    blank_line_separators = 0
    multi_nonblanks_found = 0
    x = 0
    max_line = len(ref_sect)
    while x < max_line:
        if not ref_sect[x].isspace():
            num_lines += 1
            x += 1
            while x < len(ref_sect) and not ref_sect[x].isspace():
                multi_nonblanks_found = 1
                x += 1
            x -= 1
        else:
            num_blanks += 1
            x += 1
            while x < len(ref_sect) and ref_sect[x].isspace():
                x += 1
            if x == len(ref_sect):
                num_blanks -= 1
            x -= 1
        x += 1
    if num_lines > 3 and (num_blanks == num_lines or num_blanks == 
        num_lines - 1) and multi_nonblanks_found:
        blank_line_separators = 1
    return blank_line_separators
