Write out an array of lines to the host file. Assumes that they're in the
format that `get` returns.

@param  {Array.<string|Array.<string>>} lines
@param  {function(Error)} cb
506434
function (lines, cb) {
    fs.stat(HOSTS, function (err, stat) {
      if (err) {
        cb(err);
      } else {
        var s = fs.createWriteStream(HOSTS, { mode: stat.mode });
        s.on('close', cb);
        s.on('error', cb);

        lines.forEach(function (line, lineNum) {
          if (Array.isArray(line)) {
            line = line[0] + ' ' + line[1];
          }
          s.write(line + (lineNum === lines.length - 1 ? '' : EOL));
        });
        s.end();
      }
    });
  }
1038786
function(line) {
        var newLine;

        // ex: [foo <- 1,2,3]
        // [        opening array
        //   (.*)   $1 array to concat into
        //   (<-)   $2
        //   (.*)   $3 content to be merged
        // ]        closing array
        var regexArr = /\[(.*)(\<\-)(.*)\]/;

        // ex: {foo <- foo: true, bar: 2}
        // {        opening object
        //   (.*)   $1 obj to merge into
        //   (<-)   $2
        //   (.*)   $3 content to be merged
        // }        closing object
        var regexObj = /\{(.*)(\<\-)(.*)\}/;

        newLine = line.replace(regexArr, function($0, $1, $2, $3) {
            return $1.trim() + '.concat([' + $3 + ']);';
        });

        return newLine.replace(regexObj, function($0, $1, $2, $3) {
            return $1.trim() + '.merge({' + $3 + '});';
        });
    }
771898
function(url, dest, cb) {
      var get = request(url);
      get.on('response',  function (res) {
        res.pipe(fs.createWriteStream(dest));
        res.on('end', function () {
          cb();
        });
        res.on('error', function (err) {
          cb(err);
        });
      });
    }
837432
function readInput(cb, filename) {

    function readFile() {
      fs.readFile(filename, 'utf8', function (err, text) {
        if (err) {
          console.error("[ERROR] couldn't read from '" + filename + "':");
          console.error(err.message);
          return;
        }

        cb(err, text);
      });
    }

    function readStdin() {
      var text = ''
        , stdin = process.stdin
        ;

      stdin.resume();

      stdin.on('data', function (chunk) {
        text += chunk;
      });

      stdin.on('end', function () {
        cb(null, text);
      });
    }

    if (filename) {
      readFile();
    }
    else {
      readStdin();
    }

  }
70951
function writeLogFile(file, line) {
     
    if (file === undefined || file === null) {
        return;
    }
    
    fs.appendFile(file, line + os.EOL, {}, function() {
        //
    });
}
166453
function(line, index, lines) {
        var hasPipe = /^\s*\|\>/;
        var nextLine = lines[index + 1] || '';

        if (line.match(hasPipe)|| !nextLine.match(hasPipe)) {
          return line;
        }
        // handle wrapping returned values
        else if (line.match(/^\s*return/)) { // starts with return
          return line.replace(/^return (.+)/, function($0, $1) {
              return 'return _.chain(' + $1 +')';
          });
        }
        // handle wrapping assignments eg, foo = [1, 2, 3]
        else if (line.match(/^\s*[\w$]+\s+\=\s+/)) { // starts with `foo =`
          return line.replace(/(^\s*[\w$]+\s+\=\s+)(.+)/, function($0, $1, $2) {
              return $1 + '_.chain(' + $2 +')';
          });
        }
        else if (!!line.trim()) {
          return '_.chain(' + line + ')';
        }
        else {
          return line;
        }
    }
207308
function breaklines () {
  return through2.obj(function (chunk, _, cb) {
    String(chunk)
      .split('\n')
      .filter(Boolean)
      .forEach(line => this.push(line))
    cb()
  })
}
769120
function(formats, cb) {
        var unavailable;

        // Output format(s)
        unavailable = self._outputs
          .reduce(function(fmts, output) {
            var format = output.options.find('-f', 1);
            if (format) {
              if (!(format[0] in formats) || !(formats[format[0]].canMux)) {
                fmts.push(format);
              }
            }

            return fmts;
          }, []);

        if (unavailable.length === 1) {
          return cb(new Error('Output format ' + unavailable[0] + ' is not available'));
        } else if (unavailable.length > 1) {
          return cb(new Error('Output formats ' + unavailable.join(', ') + ' are not available'));
        }

        // Input format(s)
        unavailable = self._inputs
          .reduce(function(fmts, input) {
            var format = input.options.find('-f', 1);
            if (format) {
              if (!(format[0] in formats) || !(formats[format[0]].canDemux)) {
                fmts.push(format[0]);
              }
            }

            return fmts;
          }, []);

        if (unavailable.length === 1) {
          return cb(new Error('Input format ' + unavailable[0] + ' is not available'));
        } else if (unavailable.length > 1) {
          return cb(new Error('Input formats ' + unavailable.join(', ') + ' are not available'));
        }

        cb();
      }
1012743
function(lines) {
		let output = [];
		let newlineCount = 0;
		for (let i = 0; i < lines.length; i++) {
			const line = lines[i];
			if (!line.trim()) {
				newlineCount++;
			} else {
				newlineCount = 0;
			}

			if (newlineCount >= 2) continue;

			output.push(line);
		}
		return output;
	}
618175
function updateLines(from, to, newText, selFrom, selTo) {
      if (suppressEdits) return;
      var old = [];
      doc.iter(from.line, to.line + 1, function(line) {
        old.push(newHL(line.text, line.markedSpans));
      });
      if (history) {
        history.addChange(from.line, newText.length, old);
        while (history.done.length > options.undoDepth) history.done.shift();
      }
      var lines = updateMarkedSpans(hlSpans(old[0]), hlSpans(lst(old)), from.ch, to.ch, newText);
      updateLinesNoUndo(from, to, lines, selFrom, selTo);
    }
1223901
def storlines(cmd, file, &block) # :yield: line
      synchronize do
	voidcmd("TYPE A")
	conn = transfercmd(cmd)
	loop do
	  buf = file.gets
	  break if buf == nil
	  if buf[-2, 2] != CRLF
	    buf = buf.chomp + CRLF
	  end
	  conn.write(buf)
	  yield(buf) if block
	end
	conn.close
	voidresp
      end
    end
579995
function(line) {
		var dataArray = [];
		var tempString="";
		var lineLength = line.length;
		var index=0;
		while(index<lineLength) {
			if(line[index]=='"') {
				var index2 = index+1;
				while(line[index2]!='"') {
					tempString+=line[index2];
					index2++;
				}
				dataArray.push(tempString);
				tempString = "";
				index = index2+2;
				continue;
			}
			if(line[index]!=",") {
				tempString += line[index];
				index++; continue;
			} 
			if(line[index]==",") {
				dataArray.push(tempString);
				tempString = "";
				index++;continue;
			}

		}
		dataArray.push(tempString);
		return dataArray;
	}
1215521
def writelines(self, lines):
        '''
            
        '''
        if self.__closed:
            raise OSError()
        for line in lines:
            self.write(line)
393490
function concatString(lines) {
  var output = ''
  for (var i = 0; i < lines.length; i ++) {
    output += lines[i] + '\n'
  }
  return output
}
276767
function(line, index, lines) {
        var newLine;
        if (insideString('|>', line)) return line;
        // line does not have a one liner pipeline
        if (!line.match(/(\=|return)(.*?)(\|\>)/)) return line;
        // if next line has a pipe operator
        if (lines[index] && lines[index + 1].match(/^\s*\|\>/)) return line;

        // http://rubular.com/r/wiBJtf12Vn
        // (^.+?)     $1 value to pipe
        // \s*        optional spaces
        // (\|\>)     $2 |> pipe operator
        // (.*?)$     $3 tail minus first pipe ($2)
        //
        var parts = line.match(/(^.+?)\s*(\|\>)(.*?)$/);
        var head = parts[1]
        var tail = parts[2].concat(parts[3]);

        // process head depending on if it's immuttable or not
        if (head.match('Immutable')) {
            head = head.replace('Immutable', '_.chain(Immutable');
        }
        else if (head.match(/^\s*return/)) {
            head = head.replace('return ', 'return _.chain(');
        }
        else if (head.match(/\s=\s/)) {
            head = head.replace('= ', '= _.chain(');
        }

        tail = tail.replace(/(\s*\|\>\s*)/g, function($0, $1) {
            return ').pipesCall(';
        })

        return head + tail + ').value();'
    }
168569
def writelines(self, lines):
        """"""
        self.make_dir()
        with open(self.path, "w") as f:
            return f.writelines(lines)
936747
def writelines(lines, filename, encoding='utf-8', mode='wb'):
    
    return write(os.linesep.join(lines), filename, encoding, mode)