<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def select_whole_line(self, line=None, apply_selection=True):
 """ Selects an entire line. :param line: Line to select. If None, the current line will be selected :param apply_selection: True to apply selection on the text editor widget, False to just return the text cursor without setting it on the editor. :return: QTextCursor """

        if line is None:
            line = self.current_line_nbr()
        return self.select_lines(line, line, apply_selection=apply_selection)