@staticmethod
def find_subtree(lines: list, init: int) ->tuple:
    """Find limits of a self-consistent subtree to be used by _construct_tree()."""
    n_lines = len(lines)
    start = init
    end = init + 1
    open_brackets = 1
    while open_brackets > 0 and end < n_lines:
        if lines[end].endswith('{'):
            open_brackets += 1
        elif lines[end].endswith('}'):
            open_brackets -= 1
        end += 1
    return start, end
