Write output to avro files at the given input location.
353508
@CliObjectOption(description = "Write output to Avro files. Specify the output directory as argument.")
  public EmbeddedWikipediaExample avroOutput(String outputPath) {
    this.setConfiguration(ConfigurationKeys.WRITER_BUILDER_CLASS, AvroDataWriterBuilder.class.getName());
    this.setConfiguration(ConfigurationKeys.WRITER_DESTINATION_TYPE_KEY, Destination.DestinationType.HDFS.name());
    this.setConfiguration(ConfigurationKeys.WRITER_OUTPUT_FORMAT_KEY, WriterOutputFormat.AVRO.name());
    this.setConfiguration(ConfigurationKeys.WRITER_PARTITIONER_CLASS, WikipediaPartitioner.class.getName());
    this.setConfiguration(ConfigurationKeys.JOB_DATA_PUBLISHER_TYPE, BaseDataPublisher.class.getName());
    this.setConfiguration(ConfigurationKeys.CONVERTER_CLASSES_KEY, WikipediaConverter.class.getName());
    this.setConfiguration(ConfigurationKeys.DATA_PUBLISHER_FINAL_DIR, outputPath);
    return this;
  }
55821
def save(self, output_file, overwrite=False):

        """"""

        if os.path.exists(output_file) and overwrite is False:

            raise ModelFileExists("The file %s exists already. If you want to overwrite it, use the 'overwrite=True' "
                                  "options as 'model.save(\"%s\", overwrite=True)'. " % (output_file, output_file))

        else:

            data = self.to_dict_with_types()

            # Write it to disk

            try:

                # Get the YAML representation of the data

                representation = my_yaml.dump(data, default_flow_style=False)

                with open(output_file, "w+") as f:

                    # Add a new line at the end of each voice (just for clarity)

                    f.write(representation.replace("\n", "\n\n"))

            except IOError:

                raise CannotWriteModel(os.path.dirname(os.path.abspath(output_file)),
                                       "Could not write model file %s. Check your permissions to write or the "
                                       "report on the free space which follows: " % output_file)
240031
def write(self, out):
        """"""
        out.write_string(self.text, len(self.text))
209339
def write_ioc_to_file(self, output_dir=None, force=False):
        
        return write_ioc(self.root, output_dir, force=force)
984525
def _write_to_log(self, output):
        """"""
        with open(self.log_file, 'a') as log_file:
            log_file.write('\n')
            log_file.write(output)
            log_file.write('\n')
27630
def write_to_local(self, filepath_from, filepath_to, mtime_dt=None):
        """"""

        self.__log.debug("Writing R[%s] -> L[%s]." % (filepath_from, 
                                                      filepath_to))

        with SftpFile(self, filepath_from, 'r') as sf_from:
            with open(filepath_to, 'wb') as file_to:
                while 1:
                    part = sf_from.read(MAX_MIRROR_WRITE_CHUNK_SIZE)
                    file_to.write(part)

                    if len(part) < MAX_MIRROR_WRITE_CHUNK_SIZE:
                        break

        if mtime_dt is None:
            mtime_dt = datetime.now()

        mtime_epoch = mktime(mtime_dt.timetuple())
        utime(filepath_to, (mtime_epoch, mtime_epoch))
979187
public static void writeInput(Configuration conf, Path inputDir) throws IOException {
        FileSystem fs = FileSystem.get(conf);

        if (fs.exists(inputDir)) {
            throw new IOException(String.format("Input directory '%s' exists - please remove and rerun this example", inputDir));
        }

        OutputStreamWriter writer = new OutputStreamWriter(fs.create(new Path(inputDir, "input.txt")));
        for (String name : EXAMPLE_NAMES) {
            writer.write(name);
        }
        IOUtils.closeStream(writer);
    }
637352
def write_dag(self, out=sys.stdout):
        """"""
        for rec in sorted(self.values()):
            print(rec, file=out)
570061
def output_file(self, _container):
        """"""
        p = local.path(_container)
        if p.exists():
            if not ui.ask("Path '{0}' already exists."
                          " Overwrite?".format(p)):
                sys.exit(0)
        CFG["container"]["output"] = str(p)
142407
def to_file(output_file, encoder=EliotJSONEncoder):
    
    Logger._destinations.add(
        FileDestination(file=output_file, encoder=encoder)
    )
130532
function writeFile(input, output, type) {
    var json    = readFile(input),
        content = getContent(json, type);

    fs.writeFile(output, content, function (err) {
        if (err) {
            throw err;
        }

        console.log('The file "' + output + '" was written successfully!');
    });
}
169939
def output_files(self):
        
        for dep in self.subgraph.successors(self.address):
            dep_rule = self.subgraph.node[dep]['target_obj']
            for dep_file in dep_rule.output_files:
                yield self.translate_path(dep_file, dep_rule).lstrip('/')
1372642
def _write(self, session, openFile, replaceParamFile):
        
        # Retrieve output locations
        locations = self.outputLocations

        # Write lines
        openFile.write('%s\n' % self.numLocations)

        for location in locations:
            openFile.write('%s %s\n' % (location.linkOrCellI,
                                        location.nodeOrCellJ))
432891
def write(self, fileobj = sys.stdout, indent = u""):
		
		fileobj.write(self.start_tag(indent))
		fileobj.write(u"\n")
872414
def build_output(self, fout):
        
        fout.write('\n'.join([s for s in self.out]))
179377
def makeOuputDir(outputDir, force):
    
    if outputDir:
        if exists(outputDir):
            if not force:
                print('Will not overwrite pre-existing files. Use --force to '
                      'make me.', file=sys.stderr)
                sys.exit(1)
        else:
            mkdir(outputDir)
    else:
        outputDir = mkdtemp()
        print('Writing output files to %s' % outputDir)

    return outputDir
468100
def write_file(fname, info):
    """"""
    with open(fname, 'w') as outfile:
        # File header
        outfile.write('# Copyright (c) 2018 MetPy Developers.\n')
        outfile.write('# Distributed under the terms of the BSD 3-Clause License.\n')
        outfile.write('# SPDX-License-Identifier: BSD-3-Clause\n\n')
        outfile.write('# flake8: noqa\n')
        outfile.write('# Generated file -- do not modify\n')

        # Variable descriptions
        outfile.write('descriptions = {')
        outdata = ',\n                '.join('"{name}": "{desc}"'.format(
            **i) for i in info if need_desc(i))
        outfile.write(outdata)
        outfile.write('}\n\n')

        # Now the struct format
        outfile.write('fields = [')
        outdata = ',\n          '.join('({fname}, "{fmt}")'.format(
            fname=field_name(i), **i) for i in info)
        outfile.write(outdata)
        outfile.write(']\n')