<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def _set_cell_attr(self, selection, table, attr):
 """Sets cell attr for key cell and mark grid content as changed Parameters attr: dict \tContains cell attribute keys \tkeys in ["borderwidth_bottom", "borderwidth_right", \t"bordercolor_bottom", "bordercolor_right", \t"bgcolor", "textfont", \t"pointsize", "fontweight", "fontstyle", "textcolor", "underline", \t"strikethrough", "angle", "column-width", "row-height", \t"vertical_align", "justification", "frozen", "merge_area"] """


        # Mark content as changed
        post_command_event(self.main_window, self.ContentChangedMsg)

        if selection is not None:
            self.code_array.cell_attributes.append((selection, table, attr))