code: def write_text(self, text: str, *, encoding='utf-8', append=True):
          ''' write text into the file. '''
          mode = 'a' if append else 'w'
          return self.write(text, mode=mode, encoding=encodingf write_text(self, text: str, *, encoding='utf-8', append=True):
          ''' write text into the file. '''
          mode = 'a' if append else 'w'
          return self.write(text, mode=mode, encoding=encoding)
docs: write text into the file.