code: def write(self, filename, header=None):
          
  
          origfile = self._filename
  
          try:
              with open(filename, 'w') as _file:
                  self.writestream(_file, header)
                  self._filename = filename
              return True
  
          except IOError:
              self._filename = origfile
              return False
docs: Writes the AST as a configuration file.
  
              `filename`
                  Filename to save configuration file to.
              `header`
                  Header string to use for the file.
  
              Returns boolean.