Writes pairs to the VMware VMX file corresponding to this VM.
760502
def _write_vmx_file(self):
        

        try:
            self.manager.write_vmx_file(self._vmx_path, self._vmx_pairs)
        except OSError as e:
            raise VMwareError('Could not write VMware VMX file "{}": {}'.format(self._vmx_path, e))
1182208
public void write(FsSettings settings) throws IOException {
        writeFile(settings.getName(), SETTINGS_YAML, FsSettingsParser.toYaml(settings));
    }
514181
def _write(self, session, openFile, replaceParamFile):
        
        # Write lines
        for line in self.lines:
            openFile.write(line.contents)
524324
def write_mps(filename)
      # Make a new model and ensure everything is added
      old_ptr = @ptr
      @ptr = new_model
      parent_update

      Cbc.Cbc_writeMps @ptr, filename.chomp('.mps')
      contents = Zlib::GzipReader.open(filename + '.gz').read
      File.delete(filename + '.gz')
      File.open(filename, 'w').write contents

      # Reset to the original model
      @ptr = old_ptr
      reset_model
    end
57622
private void writeServiceFiles(
            Map<String, List<String>> serviceImplementations)
            throws MojoExecutionException {
        // TODO give the user an option to write them to the source folder or
        // any other folder?
        File parentFolder = new File(getClassFolder(), "META-INF" + File.separator + "services");
        if (!parentFolder.exists()) {
            parentFolder.mkdirs();
        }
        for (Entry<String, List<String>> interfaceClassName : serviceImplementations.entrySet()) {
            File serviceFile = new File(parentFolder, interfaceClassName.getKey());
            getLog().info("Generating service file " + serviceFile.getAbsolutePath());
            FileWriter writer = null;
            try {
                writer = new FileWriter(serviceFile);
                for (String implementationClassName : interfaceClassName.getValue()) {
                    getLog().info("  + " + implementationClassName);
                    writer.write(implementationClassName);
                    writer.write('\n');
                }
                buildContext.refresh(serviceFile);
            } catch (IOException e) {
                throw new MojoExecutionException("Error creating file " + serviceFile, e);
            } finally {
                if (writer != null) {
                    try {
                        writer.close();
                    } catch (IOException e) {
                        getLog().error(e);
                    }
                }
            }
        }
    }
1285418
def write_to_files_rec(instances, tokenizer, max_seq_length,
                       max_predictions_per_seq, output_files):
    """"""
    writers = []
    for output_file in output_files:
        writers.append(
            mx.recordio.MXIndexedRecordIO(
                os.path.splitext(output_file)[0] + '.idx', output_file, 'w'))

    writer_index = 0
    total_written = 0
    for (inst_index, instance) in enumerate(instances):
        features = transform(instance, tokenizer, max_seq_length, max_predictions_per_seq)
        example = features

        writers[writer_index].write_idx(inst_index, json.dumps(example).encode('UTF-8'))
        writer_index = (writer_index + 1) % len(writers)
        total_written += 1

    for writer in writers:
        writer.close()

    logging.info('Wrote %d total instances', total_written)
771909
def saveVirtualOutputs(self,outdict):
        
        if not self.inmemory:
            return
        for outname in outdict:
            self.virtualOutputs[outname] = outdict[outname]
185852
def _writeConnections(self, connections, fileObject):
        
        for connection in connections:
            fileObject.write('CONNECT  %s  %s  %s\n' % (
                connection.slinkNumber,
                connection.upSjuncNumber,
                connection.downSjuncNumber))
372922
def write(models, out=None, base=None, propertybase=None, shorteners=None, logger=logging):
    '''
    
    '''
    assert out is not None #Output stream required
    if not isinstance(models, list): models = [models]
    shorteners = shorteners or {}

    all_propertybase = [propertybase] if propertybase else []
    all_propertybase.append(VERSA_BASEIRI)

    if any((base, propertybase, shorteners)):
        out.write('# @docheader\n\n* @iri:\n')
    if base:
        out.write('    * @base: {0}'.format(base))
    #for k, v in shorteners:
    #    out.write('    * @base: {0}'.format(base))

    out.write('\n\n')

    origin_space = set()
    #base_out = models[0].base
    for m in models:
        origin_space.update(all_origins(m))

    for o in origin_space:
        out.write('# {0}\n\n'.format(o))
        for o_, r, t, a in m.match(o):
            abbr_r = abbreviate(r, all_propertybase)
            value_format(t)
            out.write('* {0}: {1}\n'.format(abbr_r, value_format(t)))
            for k, v in a.items():
                abbr_k = abbreviate(k, all_propertybase)
                out.write('    * {0}: {1}\n'.format(k, value_format(v)))

        out.write('\n')
    return
845389
public void write(ObjectWriter out, PersistedValueData vd) throws IOException
   {
      out.writeInt(SerializationConstants.PERSISTED_VALUE_DATA);
      out.writeInt(vd.getOrderNumber());

      boolean isByteArray = vd.isByteArray();
      out.writeBoolean(isByteArray);

      if (isByteArray)
      {
         byte[] data = vd.getAsByteArray();
         out.writeInt(data.length);
         out.write(data);
      }
      else
      {
         // write file content
         FilePersistedValueData streamed = (FilePersistedValueData)vd;

         InputStream in = null;

         if (streamed.getFile() == null && vd instanceof StreamPersistedValueData)
         {
            if (((StreamPersistedValueData)vd).getTempFile() != null)
            {
               in = PrivilegedFileHelper.fileInputStream(((StreamPersistedValueData)vd).getTempFile());
            }
         }
         else
         {
            in = streamed.getAsStream();
         }

         if (streamed.getFile() instanceof SerializationSpoolFile)
         {
            SerializationSpoolFile ssf = (SerializationSpoolFile)streamed.getFile();
            out.writeString(ssf.getId());
            out.writeLong(0);
         }
         else
         {
            // write property id - used for reread data optimization
            String id = IdGenerator.generate();
            out.writeString(id);

            if (in == null)
            {
               // Deleted state usecase
               out.writeLong(SerializationConstants.NULL_FILE);
            }
            else
            {
               out.writeLong(vd.getLength());
               try
               {
                  byte[] buf = new byte[SerializationConstants.INTERNAL_BUFFER_SIZE];
                  int l = 0;
                  while ((l = in.read(buf)) >= 0)
                  {
                     out.write(buf, 0, l);
                  }
               }
               finally
               {
                  in.close();
               }
            }
         }
      }
   }
543781
public static void writeGen(JavaFileObject fileObject, JsonModelModel model)
			throws IOException {
		MvelTemplate.writeGen(fileObject, model);
	}
720313
def write_multi(self, frames, encoded_frames=None):
    """"""
    if encoded_frames is None:
      # Infinite iterator.
      encoded_frames = iter(lambda: None, 1)
    for (frame, encoded_frame) in zip(frames, encoded_frames):
      self.write(frame, encoded_frame)
844092
def write(filename, jobject):
    
    if isinstance(jobject, JavaObject):
        jobject = jobject.jobject
    javabridge.static_call(
        "Lweka/core/SerializationHelper;", "write",
        "(Ljava/lang/String;Ljava/lang/Object;)V",
        filename, jobject)
1201402
def write_networking_file(version, pairs):
    

    vmnets = OrderedDict(sorted(pairs.items(), key=lambda t: t[0]))
    try:
        with open(VMWARE_NETWORKING_FILE, "w", encoding="utf-8") as f:
            f.write(version)
            for key, value in vmnets.items():
                f.write("answer {} {}\n".format(key, value))
    except OSError as e:
        raise SystemExit("Cannot open {}: {}".format(VMWARE_NETWORKING_FILE, e))

    # restart VMware networking service
    if sys.platform.startswith("darwin"):
        if not os.path.exists("/Applications/VMware Fusion.app/Contents/Library/vmnet-cli"):
            raise SystemExit("VMware Fusion is not installed in Applications")
        os.system(r"/Applications/VMware\ Fusion.app/Contents/Library/vmnet-cli --configure")
        os.system(r"/Applications/VMware\ Fusion.app/Contents/Library/vmnet-cli --stop")
        os.system(r"/Applications/VMware\ Fusion.app/Contents/Library/vmnet-cli --start")
    else:
        os.system("vmware-networks --stop")
        os.system("vmware-networks --start")
461636
public static void writeInstances( File targetFile, Collection<Instance> rootInstances ) throws IOException {

		FileDefinition def = new FromInstances().buildFileDefinition( rootInstances, targetFile, false, true );
		ParsingModelIo.saveRelationsFile( def, false, "\n" );
	}
587528
def write_service_double_file(target_root, service_name, rendered):
    """"""
    target_path = os.path.join(
        target_root,
        'snapstore_schemas', 'service_doubles', '%s.py' % service_name
    )
    with open(target_path, 'w') as target_file:
        target_file.write(rendered)
134149
def write_data(X, dir='sim/test', append=False, header='',
               varNames={}, Adj=np.array([]), Coupl=np.array([]),
               boolRules={}, model='', modelType='', invTimeStep=1):
    
    # check if output directory exists
    if not os.path.exists(dir):
        os.makedirs(dir)
    # update file with sample ids
    filename = dir+'/id.txt'
    if os.path.exists(filename):
        f = open(filename,'r')
        id = int(f.read()) + (0 if append else 1)
        f.close()
    else:
        id = 0
    f = open(filename,'w')
    id = '{:0>6}'.format(id)
    f.write(str(id))
    f.close()
    # dimension
    dim = X.shape[1]
    # write files with adjacancy and coupling matrices
    if not append:
        if False:
            if Adj.size > 0:
                # due to 'update formulation' of model, there
                # is always a diagonal dependence
                Adj = np.copy(Adj)
                if 'hill' in model:
                    for i in range(Adj.shape[0]):
                        Adj[i,i] = 1
                np.savetxt(dir+'/adj_'+id+'.txt',Adj,
                           header=header,
                           fmt='%d')
            if Coupl.size > 0:
                np.savetxt(dir+'/coupl_'+id+'.txt',Coupl,
                           header=header,
                           fmt='%10.6f')
        # write model file
        if varNames and Coupl.size > 0:
            f = open(dir+'/model_'+id+'.txt','w')
            f.write('# For each "variable = ", there must be a right hand side: \n')
            f.write('# either an empty string or a python-style logical expression \n')
            f.write('# involving variable names, "or", "and", "(", ")". \n')
            f.write('# The order of equations matters! \n')
            f.write('# \n')
            f.write('# modelType = ' + modelType + '\n')
            f.write('# invTimeStep = '+ str(invTimeStep) + '\n')
            f.write('# \n')
            f.write('# boolean update rules: \n')
            for rule in boolRules.items():
                f.write(rule[0] + ' = ' + rule[1] + '\n')
            # write coupling via names
            f.write('# coupling list: \n')
            names = list(varNames.keys())
            for gp in range(dim):
                for g in range(dim):
                    if np.abs(Coupl[gp,g]) > 1e-10:
                        f.write('{:10} '.format(names[gp])
                                + '{:10} '.format(names[g])
                                + '{:10.3} '.format(Coupl[gp,g]) + '\n')
            f.close()
    # write simulated data
    # the binary mode option in the following line is a fix for python 3
    # variable names
    if varNames:
        header += '{:>2} '.format('it')
        for v in varNames.keys():
            header += '{:>7} '.format(v)
    f = open(dir+'/sim_'+id+'.txt','ab' if append else 'wb')
    np.savetxt(f,np.c_[np.arange(0,X.shape[0]),X],header=('' if append else header),
               fmt=['%4.f']+['%7.4f' for i in range(dim)])
    f.close()