code: def delete_before_cursor(self, count=1):
          
          assert count >= 0
          deleted = ''
  
          if self.cursor_position > 0:
              deleted = self.text[self.cursor_position - count:self.cursor_position]
  
              new_text = self.text[:self.cursor_position - count] + self.text[self.cursor_position:]
              new_cursor_position = self.cursor_position - len(deleted)
  
              # Set new Document atomically.
              self.document = Document(new_text, new_cursor_position)
  
          return deleted
docs: Delete specified number of characters before cursor and return the
          deleted text.