serialize the ExmaraldaFile instance and write it to a file.

        Parameters
        ----------
        output_filepath : str
            relative or absolute path to the Exmaralda file to be created
773209
def write(self, output_filepath):
        
        with open(output_filepath, 'w') as out_file:
            out_file.write(self.__str__())
477433
def _export_csv(self, filepath, data, preview_data):
        

        # Get csv info

        csv_info = \
            self.main_window.interfaces.get_csv_export_info(preview_data)

        if csv_info is None:
            return

        try:
            dialect, digest_types, has_header = csv_info
        except TypeError:
            return

        # Export CSV file

        csv_interface = CsvInterface(self.main_window, filepath, dialect,
                                     digest_types, has_header)

        try:
            csv_interface.write(data)

        except IOError, err:
            msg = _("The file {filepath} could not be fully written\n \n"
                    "Error message:\n{msg}")
            msg = msg.format(filepath=filepath, msg=err)
            short_msg = _('Error writing CSV file')
            self.main_window.interfaces.display_warning(msg, short_msg)
905144
public static void writeStreamToFile(InputStream isr, String fileName, String outputFolder) throws IOException {
        logger.entering(new Object[] { isr, fileName, outputFolder });
        FileUtils.copyInputStreamToFile(isr, new File(outputFolder + "/" + fileName));
        logger.exiting();
    }
731291
def outputSaveCallback(self, at_data, **kwargs):
        
        path                = at_data[0]
        d_outputInfo        = at_data[1]
        other.mkdir(self.str_outputDir)
        filesSaved          = 0
        other.mkdir(path)
        if not self.testType:
            str_outfile         = '%s/file-ls.txt'      % path
        else:
            str_outfile         = '%s/file-count.txt'   % path

        with open(str_outfile, 'w') as f:
            self.dp.qprint("saving: %s" % (str_outfile), level = 5)
            if not self.testType:
                f.write('%s`' % self.pp.pformat(d_outputInfo['l_file']))
            else:
                f.write('%d\n' % d_outputInfo['filesAnalyzed'])
        filesSaved += 1
        
        return {
            'status':       True,
            'outputFile':   str_outfile,
            'filesSaved':   filesSaved
        }
291063
def save(self, outfname):
        
        f = BZ2File(outfname, 'w')
        self.doc.writexml(f, addindent='  ', newl='\n')
        f.close()
760520
def write_geoff(discoursegraph, output_file):
    
    if isinstance(output_file, str):
        with open(output_file, 'w') as outfile:
            outfile.write(convert_to_geoff(discoursegraph))
    else:  # output_file is a file object
        output_file.write(convert_to_geoff(discoursegraph))
145001
def _save_pys(self, filepath):
        

        try:
            with Bz2AOpen(filepath, "wb",
                          main_window=self.main_window) as outfile:
                interface = Pys(self.grid.code_array, outfile)
                interface.from_code_array()

        except (IOError, ValueError), err:
            try:
                post_command_event(self.main_window, self.StatusBarMsg,
                                   text=err)
                return
            except TypeError:
                # The main window does not exist any more
                pass

        return not outfile.aborted
1282294
function fileToOutput(output, filePath) {
    var book = output.getBook();
    var readme = book.getReadme();
    var fileReadme = readme.getFile();

    if (
        path.basename(filePath, path.extname(filePath)) == 'README' ||
        (fileReadme.exists() && filePath == fileReadme.getPath())
    ) {
        filePath = path.join(path.dirname(filePath), 'index' + OUTPUT_EXTENSION);
    } else {
        filePath = PathUtils.setExtension(filePath, OUTPUT_EXTENSION);
    }

    return LocationUtils.normalize(filePath);
}
508897
def write_data_to_file(data, filepath):
    '''
    
    '''
    try:
        os.makedirs(os.path.dirname(filepath), 0o700)
    except OSError:
        pass

    write_to_disk(filepath, content=data)
1216097
public static void write2File(String filePath, byte[] byteData) {
        try {
            BufferedOutputStream bufferedOutputStream = new BufferedOutputStream(new FileOutputStream(new File(filePath)));
            bufferedOutputStream.write(byteData);
            bufferedOutputStream.close();
        } catch (FileNotFoundException e) {
            e.printStackTrace();
        } catch (IOException e) {
            e.printStackTrace();
        }
    }
353994
def save_outputs(outputs, output_fpath):
    
    df = pd.DataFrame(outputs)
    with pd.ExcelWriter(output_fpath) as writer:
        df.to_excel(writer)
259199
public static OutputStream toFile(String filepath) throws FileNotFoundException {
		if(Strings.isValid(filepath)) {
			return new FileOutputStream(new File(filepath));
		}
		return null;
	}
694494
def dump(self, content, filepath, indent=4):
        
        with open(filepath, 'w') as fp:
            pyaml.dump(content, dst=fp, indent=indent)
898800
def to_file(self, filepath=None):
        
        if filepath is None and self._filepath is None:
            raise TorrentError('Unable to save torrent to file: no filepath supplied.')

        if filepath is not None:
            self._filepath = filepath

        with open(self._filepath, mode='wb') as f:
            f.write(self.to_string())
456930
def write_file(file_path, gd_data)
      if gd_data && !File.exists?(file_path)
        FileUtils.mkdir_p(File.dirname(file_path))
        File.open(file_path, "wb") do |data|
          data << gd_data
        end
      end
    end
981279
def get_as_csv(self, output_file_path: Optional[str] = None) -> str:
        
        output = StringIO() if not output_file_path else open(output_file_path, 'w')
        try:
            csv_writer = csv.writer(output)

            csv_writer.writerow(self.columns)
            for row in self.rows:
                csv_writer.writerow(row)
            output.seek(0)
            return output.read()
        finally:
            output.close()
576378
def write_output_files(self):
        
        os.mkdir("analysis")
        os.chdir("analysis")
        os.mkdir("hydrogen_bonds")
        os.chdir("hydrogen_bonds")
        for traj in range(len(self.trajectory)):
            with open('hbonds_data_total_'+str(traj)+'.csv', 'wb') as outfile:
                hwriter = csv.writer(outfile, delimiter=' ')
                for time in self.hbonds_by_time[traj]:
                    hwriter.writerow([time[0],time[1]])
            for bond in self.hbonds_by_type[traj]:
                if bond["donor_resnm"]=="LIG" and (bond["acceptor_idx"],bond["donor_idx"]) in [(k[0],k[3]) for k,v in self.hbonds_for_drawing.items()]:
                    with open('hbond_'+bond["acceptor_resnm"]+"_"+str(bond["acceptor_resid"])+"_"+bond["donor_atom"]+"_"+str(traj)+".csv","wb") as outfile:
                        hwriter = csv.writer(outfile, delimiter=' ')
                        for time in self.hbonds_timesteps[traj]:
                            result = [1 if x[0]==time and x["acceptor_idx"]==bond["acceptor_idx"] else 0 for x in self.hbonds[traj]][0]
                            hwriter.writerow([time,result])
                if bond["donor_resnm"]!="LIG" and (bond["donor_idx"],bond["acceptor_idx"]) in [(k[0],k[3]) for k,v in self.hbonds_for_drawing.items()]:
                    with open('hbond_'+bond["donor_resnm"]+"_"+str(bond["donor_resid"])+"_"+bond["acceptor_atom"]+"_"+str(traj)+".csv","wb") as outfile:
                        hwriter = csv.writer(outfile, delimiter=' ')
                        for time in self.hbonds_timesteps[traj]:
                            result = [1 if x[0]==time and x["donor_idx"]==bond["donor_idx"] else 0 for x in self.hbonds[traj]][0]
                            hwriter.writerow([time,result])
        os.chdir("../../")