def block_position(self, node):

        start_line, start_col = node.lineno, node.col_offset
        temp_node = node

        while 'body' in temp_node.__dict__:
            temp_node = temp_node.body[-1]

        end_line, end_col = temp_node.lineno, temp_node.col_offset

        if start_line == end_line:
            return [start_line, start_col, end_line, -1]

        return [start_line, start_col, end_line, end_col]
Helper function to get the start and end lines of an AST node.
dataset/ETHPy150Open earwig/bitshift/bitshift/parser/python.py/_TreeWalker.block_position