<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def merge(self, merge_area, tab):
 """Merges top left cell with all cells until bottom_right"""


        top, left, bottom, right = merge_area

        cursor = self.grid.actions.cursor
        top_left_code = self.code_array((top, left, cursor[2]))

        selection = Selection([(top, left)], [(bottom, right)], [], [], [])

        # Check if the merge area overlaps another merge area

        error_msg = _("Overlapping merge area at {} prevents merge.")

        for row in xrange(top, bottom + 1):
            for col in xrange(left, right + 1):
                key = row, col, tab
                if self.code_array.cell_attributes[key]["merge_area"]:
                    post_command_event(self.main_window, self.StatusBarMsg,
                                       text=error_msg.format(str(key)))
                    return

        self.delete_selection(selection)
        self.set_code((top, left, cursor[2]), top_left_code)

        attr = {"merge_area": merge_area, "locked": True}

        self._set_cell_attr(selection, tab, attr)

        tl_selection = Selection([], [], [], [], [(top, left)])
        attr = {"locked": False}

        self._set_cell_attr(tl_selection, tab, attr)