Write a list of strings to file.
168569
def writelines(self, lines):
        """"""
        self.make_dir()
        with open(self.path, "w") as f:
            return f.writelines(lines)
1045785
public static void writeToFile(String str, String fileName, Charset charset) throws Exception {
    OutputStreamWriter writer = null;
    if (null == charset) {
      writer = new OutputStreamWriter(new FileOutputStream(fileName));
    } else {
      writer = new OutputStreamWriter(new FileOutputStream(fileName), charset.name());
    }
    writer.write(str);
    writer.close();
  }
1328023
def write_text(self, name, s):
        """"""
        buf = io.BytesIO(compat.to_bytes(s))
        self.write_file(name, buf)
1098921
def write(file_name, data):
    """"""
    with open(file_name, 'w') as f:
        f.write(encode(data))
410350
def _write_data(data, fp):
    """"""
    fp.write("@data\n")

    def to_str(x):
        if pandas.isnull(x):
            return '?'
        else:
            return str(x)

    data = data.applymap(to_str)
    n_rows = data.shape[0]
    for i in range(n_rows):
        str_values = list(data.iloc[i, :].apply(_check_str_array))
        line = ",".join(str_values)
        fp.write(line)
        fp.write("\n")
642695
def write(self, text):
        """"""
        index = text.find('\n')
        if index == -1:
            self._buffer = self._buffer + text
        else:
            self._buffer = self._buffer + text[:index + 1]
            if self._pattern:
                # pattern already compiled no need to check
                result = re.search(self._pattern, self._buffer)
                if result:
                    for group in result.groups():
                        if group:
                            self._buffer = self._buffer.replace(group, "***")
            self._file.write(self._buffer)
            self._file.flush()
            self._buffer = text[index + 1:]
442141
public static <T> File writeLines(Collection<T> list, String path, String charset, boolean isAppend) throws IORuntimeException {
		return writeLines(list, file(path), charset, isAppend);
	}
954819
protected static void writeList(Output out, List<?> list) {
        if (!list.isEmpty()) {
            int size = list.size();
            // if its a small list, write it as an array
            if (size < 100) {
                out.writeArray(list);
                return;
            }
            // else we should check for lots of null values,
            // if there are over 80% then its probably best to do it as a map
            int nullCount = 0;
            for (int i = 0; i < size; i++) {
                if (list.get(i) == null) {
                    nullCount++;
                }
            }
            if (nullCount > (size * 0.8)) {
                out.writeMap(list);
            } else {
                out.writeArray(list);
            }
        } else {
            out.writeArray(new Object[] {});
        }
    }
647971
def writeList(self, a):
        
        if self.writeReference(a) != -1:
            return

        self.context.addObject(a)

        self.writeType(TYPE_ARRAY)
        self.stream.write_ulong(len(a))

        for data in a:
            self.writeElement(data)
1350926
def _write_iterate(self, values):
        """"""
        result = []
        for key in self.order:
            result.append(self.lines[key].write(values))

        if len(result) > 1:
            return result
        else:
            return result[0]
1284084
def write(self, string: str) -> None:
        """"""
        self.logfile.write('\n'.join(
            f'{self._string}{substring}' if substring else ''
            for substring in string.split('\n')))
602108
def write_to_file(self, f):
        """"""
        for section, values in self._values.iteritems():
            try:
                section_name, subsection_name = section
            except ValueError:
                (section_name, ) = section
                subsection_name = None
            if subsection_name is None:
                f.write("[%s]\n" % section_name)
            else:
                f.write("[%s \"%s\"]\n" % (section_name, subsection_name))
            for key, value in values.iteritems():
                f.write("%s = %s\n" % (key, _escape_value(value)))
1335058
public static <T> File writeLines(Collection<T> list, File file, String charset, boolean isAppend) throws IORuntimeException {
		return FileWriter.create(file, CharsetUtil.charset(charset)).writeLines(list, isAppend);
	}
571307
def WriteRow(stream, values):
  ""
  stream.write(','.join([EncodeForCSV(val) for val in values]))
  stream.write('\n')
1152055
public static void writeList(Collection<?> lines,
                                 OutputStream output) throws IOException {
        writeList(lines, output, Charset.defaultCharset());
    }
1041750
public void writeAll(java.util.List<String[]> allLines) throws IOException {

        openWriter();
        csvWriter.writeAll(allLines);
    }
775916
def wr_txt(self, fout_txt):
        """"""
        with open(fout_txt, 'w') as prt:
            for line in self.ver_list:
                prt.write("{LINE}\n".format(LINE=line))
            self.prt_txt(prt)
            print("  WROTE: {TXT}".format(TXT=fout_txt))