code: def write(self):
          
          self._assure_writable("write")
          if not self._dirty:
              return
  
          if isinstance(self._file_or_files, (list, tuple)):
              raise AssertionError("Cannot write back if there is not exactly a single file to write to, have %i files"
                                   % len(self._file_or_files))
          # end assert multiple files
  
          if self._has_includes():
              log.debug("Skipping write-back of configuration file as include files were merged in." +
                        "Set merge_includes=False to prevent this.")
              return
          # end
  
          fp = self._file_or_files
  
          # we have a physical file on disk, so get a lock
          is_file_lock = isinstance(fp, string_types + (FileType, ))
          if is_file_lock:
              self._lock._obtain_lock()
          if not hasattr(fp, "seek"):
              with open(self._file_or_files, "wb") as fp:
                  self._write(fp)
          else:
              fp.seek(0)
              # make sure we do not overwrite into an existing file
              if hasattr(fp, 'truncate'):
                  fp.truncate()
              self._write(fp)
docs: Write changes to our file, if there are changes at all
  
          :raise IOError: if this is a read-only writer instance or if we could not obtain
              a file lock