code: def write_vmware_file(path, pairs):
          
  
          encoding = "utf-8"
          if ".encoding" in pairs:
              file_encoding = pairs[".encoding"]
              try:
                  codecs.lookup(file_encoding)
                  encoding = file_encoding
              except LookupError:
                  log.warning("Invalid file encoding detected in '{}': {}".format(path, file_encoding))
          with open(path, "w", encoding=encoding, errors="ignore") as f:
              for key, value in pairs.items():
                  entry = '{} = "{}"\n'.format(key, value)
                  f.write(entry)
docs: Write a VMware file (excepting VMX file).
  
          :param path: path to the VMware file
          :param pairs: settings to write