Write a Component Mapping box to file.
514548
def write(self, fptr):
        
        length = 8 + 4 * len(self.component_index)
        write_buffer = struct.pack('>I4s', length, b'cmap')
        fptr.write(write_buffer)

        for j in range(len(self.component_index)):
            write_buffer = struct.pack('>HBB',
                                       self.component_index[j],
                                       self.mapping_type[j],
                                       self.palette_index[j])
            fptr.write(write_buffer)
1216408
def write_input_to_file(self, fname='ace_input.txt'):
        """"""
        self._write_columns(fname, self.x, self.y)
817845
def write_to_buffer(self, buf):
        """"""
        doc = self.to_dict()

        if config.rxt_as_yaml:
            content = dump_yaml(doc)
        else:
            content = json.dumps(doc, indent=4, separators=(",", ": "))

        buf.write(content)
198502
private void writeMap(String fieldName, Object value) throws IOException
   {
      @SuppressWarnings("unchecked")
      Map<String, Object> map = (Map<String, Object>) value;
      m_writer.writeStartObject(fieldName);
      for (Map.Entry<String, Object> entry : map.entrySet())
      {
         Object entryValue = entry.getValue();
         if (entryValue != null)
         {
            DataType type = TYPE_MAP.get(entryValue.getClass().getName());
            if (type == null)
            {
               type = DataType.STRING;
               entryValue = entryValue.toString();
            }
            writeField(entry.getKey(), type, entryValue);
         }
      }
      m_writer.writeEndObject();
   }
815257
private void writeObject(ObjectOutputStream out) throws IOException {
		out.writeUTF(hadoopOutputFormatName);
		jobConf.write(out);
		out.writeObject(converter);
		out.writeObject(fileOutputCommitterWrapper);
	}
1076312
def write_data(self, write_finished_cb):
        """"""
        self._write_finished_cb = write_finished_cb
        data = bytearray()

        for poly4D in self.poly4Ds:
            data += struct.pack('<ffffffff', *poly4D.x.values)
            data += struct.pack('<ffffffff', *poly4D.y.values)
            data += struct.pack('<ffffffff', *poly4D.z.values)
            data += struct.pack('<ffffffff', *poly4D.yaw.values)
            data += struct.pack('<f', poly4D.duration)

        self.mem_handler.write(self, 0x00, data, flush_queue=True)
301330
public void writeStartComponent(String componentName) throws IOException {
		if (generator == null) {
			init();
		}

		componentEnded = false;

		if (!stack.isEmpty()) {
			Info parent = stack.getLast();
			if (!parent.wroteEndPropertiesArray) {
				generator.writeEndArray();
				parent.wroteEndPropertiesArray = true;
			}
			if (!parent.wroteStartSubComponentsArray) {
				generator.writeStartArray();
				parent.wroteStartSubComponentsArray = true;
			}
		}

		generator.writeStartArray();
		generator.writeString(componentName);
		generator.writeStartArray(); //start properties array

		stack.add(new Info());
	}
856628
def write(self, outfile):
        """"""

        hdu_pri = fits.PrimaryHDU()

        hdu_exp = self._create_exp_hdu(self.data)
        hdu_exp.name = 'EXPOSURE'
        hdu_exp_wt = self._create_exp_hdu(self._data_wt)
        hdu_exp_wt.name = 'WEIGHTED_EXPOSURE'

        cols = [Column(name='CTHETA_MIN', dtype='f4',
                       data=self.costh_edges[:-1][::-1]),
                Column(name='CTHETA_MAX',  dtype='f4',
                       data=self.costh_edges[1:][::-1]), ]
        hdu_bnds = fits.table_to_hdu(Table(cols))
        hdu_bnds.name = 'CTHETABOUNDS'

        hdu_gti = fits.table_to_hdu(self._tab_gti)
        hdu_gti.name = 'GTI'

        hdus = [hdu_pri, hdu_exp, hdu_exp_wt,
                hdu_bnds, hdu_gti]

        for hdu in hdus:
            hdu.header['TSTART'] = self.tstart
            hdu.header['TSTOP'] = self.tstop

        with fits.HDUList(hdus) as hdulist:
            hdulist.writeto(outfile, clobber=True)
1246398
def _dump(f, mesh):
    '''
    
    '''
    dae = mesh_to_collada(mesh)
    dae.write(f.name)
243641
def write(self):
        """"""
        with open(storage.config_file, 'w') as cfg:
            yaml.dump(self.as_dict(), cfg, default_flow_style=False)

        storage.refresh()
192707
def write_files(template, destination='./dxf'):
    
    os.makedirs(destination)
    for key, value in template.items():
        with open(os.path.join(destination, key), 'w') as f:
            f.write(replace_whitespace(value, insert=False))
1332729
function bundle(entry, output, name) {
  rollup.rollup({
    input: path.resolve(process.cwd(), entry),
    plugins: plugins
  }).then((bundle) => {
    return bundle.generate({
      format: format(),
      name: name,
      sourcemap: true
    })
  }).then(({ code, map}) => {
    return write(path.resolve(process.cwd(), output), code)
  }).then(() => {
    var source = fs.readFileSync(path.resolve(process.cwd(), output), 'utf-8', (err) => { throw err })
    var compilerFlags = {
      jsCode: [{ src: source }],
      compilationLevel: 'ADVANCED',
      languageOut: 'ECMASCRIPT5',
      createSourceMap: true
    }
    var result = compiler(compilerFlags)
    var minPath = 'bundle/' + output.split('/').pop().split('.')[0] + '.min.js'
    var sourcePath = minPath + '.map'
    // write min.js and min.js.map
    fs.writeFileSync(minPath, result.compiledCode, 'utf-8', (err) => { throw err })
    fs.writeFileSync(sourcePath, result.sourceMap, 'utf-8', (err) => { throw err })
    console.info(chalk.red(minPath) + ' ' + chalk.green(getSize(result.compiledCode)))
  }).catch((err) => {
    console.error(err)
  })
}
376378
function copyComponentFiles( name, files ) {
		grunt.verbose.writeln( 'BowerMap::copyComponentFiles - ' + name );
		//get map of files to copy
		var componentMap = getComponentMapping( name, files );

		//copy files
		for ( var k in componentMap ) {
			if ( componentMap.hasOwnProperty( k ) ) {
				//console.log( path.fix( k ) );
				//console.log( path.fix( componentMap[ k ] ) );
				//grunt.file.copy( path.fix( k ), path.fix( componentMap[ k ] ) );
				var replacements = replace ? replace[ name ] || false : false;

                if (  componentMap[ k ] !== false){
                    copyReplace( path.fix( k ), path.fix( componentMap[ k ] ), replacements );
                }
			}
		}

	}
451923
public void writeFileMakeViews()
    {
        if (this.readThisMethod("makeScreen"))
        {
            this.writeThisMethod(CodeType.THICK);
            return;     // if no views specified, use default methods
        }
        
        if (true)
        {
            ClassInfo recClassInfo = (ClassInfo)this.getMainRecord();
            ClassFields recClassFields = new ClassFields(this);
            recClassFields.addListener(new SubFileFilter(ClassFields.CLASS_INFO_CLASS_NAME_KEY, recClassInfo.getField(ClassInfo.CLASS_NAME)));   // Only read through the class fields
            recClassFields.close();
            try {
                boolean firstTime = true;
                while (recClassFields.hasNext())
                {
                    recClassFields.next();
                    String strClassFieldType = recClassFields.getField(ClassFields.CLASS_FIELDS_TYPE).toString();
                    if (strClassFieldType.equalsIgnoreCase(ClassFieldsTypeField.SCREEN_CLASS_NAME))
                    {
                        if (firstTime)
                        {
                            this.writeMethodInterface(null, "makeScreen", "ScreenParent", "ScreenLoc itsLocation, ComponentParent parentScreen, int iDocMode, Map<String,Object> properties", "", "Make a default screen.", null);
                            m_StreamOut.writeit("\tScreenParent screen = null;\n");
                        }
                        String screenMode = recClassFields.getField(ClassFields.CLASS_FIELD_INITIAL_VALUE).toString();
                        if ((screenMode == null) || (screenMode.length() == 0))
                            screenMode = "MAINT_MODE";
                        if (!screenMode.contains("."))
                            screenMode = "ScreenConstants." + screenMode;
                        String fieldName = recClassFields.getField(ClassFields.CLASS_FIELD_NAME).toString();
                        if (firstTime)
                            m_StreamOut.writeit("\t");
                        else
                            m_StreamOut.writeit("\telse ");
                        m_StreamOut.write("if ((iDocMode & " + screenMode + ") == " + screenMode + ")\n");
                        m_StreamOut.writeit("\t\tscreen = Record.makeNewScreen(" + fieldName + ", itsLocation, parentScreen, iDocMode | ScreenConstants.DONT_DISPLAY_FIELD_DESC, properties, this, true);\n");
                        firstTime = false;
                    }
                }
                if (!firstTime)
                {
                    m_StreamOut.writeit("\telse\n");
                    m_StreamOut.writeit("\t\tscreen = super.makeScreen(itsLocation, parentScreen, iDocMode, properties);\n");
                    m_StreamOut.writeit("\treturn screen;\n}\n");                    
                }
            } catch (DBException e) {
                e.printStackTrace();
            }
        }
    }
665252
private void mapAndSetOffset() {
        try {
            final RandomAccessFile backingFile = new RandomAccessFile(this.file, "rw");
            backingFile.setLength(this.size);
            final FileChannel ch = backingFile.getChannel();
            this.addr = (Long) mmap.invoke(ch, 1, 0L, this.size);

            ch.close();
            backingFile.close();
        } catch (Exception e) {
            throw new RuntimeException(e);
        }
    }
446446
def _write_build_file(self):
        
        self.write(destination=self._base_output_directory,
                   filename="pom.xml",
                   template_name="pom.xml.tpl",
                   version=self.api_version,
                   product_accronym=self._product_accronym,
                   class_prefix=self._class_prefix,
                   root_api=self.api_root,
                   api_prefix=self.api_prefix,
                   product_name=self._product_name,
                   name=self._name,
                   header=self.header_content,
                   version_string=self._api_version_string,
                   package_prefix=self._package_prefix,
                   library_version=self.library_version)
490165
function writeVendorFileThenBundle () {
    const vendorDestPath = path.join(opts.rootDir, outputOpts.dir, outputOpts.vendor)
    const outStream = fs.createWriteStream(vendorDestPath)

    var b = getBrowserifyInstance({
      inc: opts.inc,
      cacheFile: opts.cacheFile
    })

    // add vendor files to the bundle
    b.require(opts.vendor)

    const startTime = Date.now()
    const bStream = b.bundle()

    multistream(vendorFiles.map(createReadStream).concat(bStream))
      .pipe(outStream)
      .on('error', (err) => console.error(err))
      .on('close', function () {
        const endTime = Date.now()
        const delta = endTime - startTime

        console.error(
          '[vendor] written to %s (%s seconds)',
          vendorDestPath, (delta / 1000).toFixed(2)
        )

        bundle()
      })
  }