parameters: (self, data, encoding=None, errors=None)
docstring: Open the file in text mode, write to it, and close the file.
docstring_summary: Open the file in text mode, write to it, and close the file.
docstring_tokens: Open the file in text mode write to it and close the file .
function: def write_text(self, data, encoding=None, errors=None):
          """
          Open the file in text mode, write to it, and close the file.
          """
          if not isinstance(data, str):
              raise TypeError('data must be str, not %s' %
                              data.__class__.__name__)
          with self.open(mode='w', encoding=encoding, errors=errors) as f:
              return f.write(data)
function_tokens: def write_text ( self , data , encoding = None , errors = None ) : if not isinstance ( data , str ) : raise TypeError ( 'data must be str, not %s' % data . __class__ . __name__ ) with self . open ( mode = 'w' , encoding = encoding , errors = errors ) as f : return f . write ( data )