code: def toggle_white_spaces(self):
          
  
          text_option = self.get_default_text_option()
          if text_option.flags().__int__():
              text_option = QTextOption()
              text_option.setTabStop(self.tabStopWidth())
          else:
              text_option.setFlags(
                  text_option.flags() | QTextOption.ShowTabsAndSpaces | QTextOption.ShowLineAndParagraphSeparators)
          self.set_default_text_option(text_option)
          return True
docs: Toggles document white spaces display.
  
          :return: Method success.
          :rtype: bool