def _find_scope_defining_line(line_index, file_content):
    """Finds the scope defining line for the line on the specified index.

    The scope defining line is the last line containing `{` that was not closed afterwards.

    If the scope defining line could not be found, returns (`-1`, `None`).

    Args:
        line_index: the index of the line for which to search.
        file_content: the file content, i.e. the list of file lines.

    Returns:
        int: the index of the scope defining line in the file content, or `-1`.
        str: the scope defining line, or `None`.
    """
    preceding_lines = file_content[:line_index]
    closed_bracket_count = 0
    for i, line in enumerate(reversed(preceding_lines)):
        if '}' in line:
            closed_bracket_count += 1
        if '{' in line:
            if closed_bracket_count > 0:
                closed_bracket_count -= 1
            else:
                index = i
                scope_defining_line = line
                return index, scope_defining_line
    return -1, None