code: def set_code(self, key, code):
          
  
          old_code = self.grid.code_array(key)
  
          try:
              old_code = unicode(old_code, encoding="utf-8")
  
          except TypeError:
              pass
  
          if code == old_code:
              return
  
          if not (old_code is None and not code) and code != old_code:
              # Mark content as changed
              post_command_event(self.main_window, self.ContentChangedMsg)
  
          # Set cell code
          self.grid.code_array.__setitem__(key, code)
docs: Sets code of cell key, marks grid as changed