Writes `string` with a trailing newline to `processStreamName`.

@private
@static
@param {string} processStreamName The name of the writable process stream (e.g., `stout`, `stderr`).
@param {string} string The string to print.
504617
function writeToProcessStream(processStreamName, string) {
  var writableStream = process[processStreamName]
  if (writableStream) {
    writableStream.write(string + '\n')
  } else {
    throw new Error('Unrecognized process stream: ' + exports.stylize(processStreamName))
  }
}
833978
function write(buffer) {

    // first, trim trailing whitespace for fast searching
    buffer = buffer.replace(/[ \t]+$/gm, '')

    // compact lines if emptyLines != -1
    if (_elines >= 0)
      buffer = trimBuffer(buffer)

    if (!buffer) return

    // finished the surrounding lines, now the inners
    if (!_elines) {
      // remove empty lines and change eols in one unique operation
      buffer = buffer.replace(/\n{2,}/g, _to)
    }
    else {
      // keep max n empty lines (n+1 sucesive eols), -1 keep all
      if (_elines > 0)
        buffer = buffer.replace(_re, '$1')

      // change line terminator if not unix
      if (_to !== '\n') buffer = buffer.replace(/\n/g, _to)
    }

    // apply indentation, regex `^.` with `/m` matches non-empty lines
    if (_indent)
      buffer = buffer.replace(/^./mg, _indent + '$&')

    _lastch = buffer.slice(-1)
    // istanbul ignore else
    if (output)
      output.emit('data', buffer)
  }
550934
function processLine(cm, line, state) {
    var mode = cm.doc.mode;
    var stream = new StringStream(line.text, cm.options.tabSize);
    if (line.text == "" && mode.blankLine) mode.blankLine(state);
    while (!stream.eol() && stream.pos <= cm.options.maxHighlightLength) {
      mode.token(stream, state);
      stream.start = stream.pos;
    }
  }
248633
function streamResultsPromise (command, args, options, cb) {
    var output = ''
    var stderr = ''
    var child = spawn(command, args, options)
    child.stdout.setEncoding('utf8')
    child.stderr.setEncoding('utf8')
    child.stdout.on('data', stdoutHandler)
    child.stderr.on('data', stderrHandler)
    child.on('close', closeHandler)

    function stdoutHandler (data) {
      output += data
    }

    function stderrHandler (data) {
      stderr += data
    }

    function closeHandler (code) {
      if (code !== 0) {
        var ex = new Error('pdf-text-extract command failed: ' + stderr)
        throw ex
      }
      cb(output)
    }
  }
949367
def Write(self, string):
    
    if sys.version_info[0] < 3:
      super(StdoutOutputWriter, self).Write(string)
    else:
      # sys.stdout.write() on Python 3 by default will error if string is
      # of type bytes.
      sys.stdout.write(string)
609227
public void write(String[] nextLine) {
    if (nextLine == null) return;
    StringBuilder sb = new StringBuilder(INITIAL_STRING_SIZE);
    for (int i = 0; i < nextLine.length; i++) {
      if (i != 0) {
        sb.append(format.defaultSeparator());
      }

      String nextElement = nextLine[i];
      if (nextElement == null) continue;
      if (!format.isDelimiter(NO_QUOTE_CHARACTER)) sb.append(format.getDelimiter());

      sb.append(stringContainsSpecialCharacters(nextElement) ? processLine(nextElement) : nextElement);

      if (!format.isDelimiter(NO_QUOTE_CHARACTER)) sb.append(format.getDelimiter());
    }
    sb.append(lineEnd);
    pw.write(sb.toString());

  }
1069099
def Write(self, string):
    
    try:
      # Note that encode() will first convert string into a Unicode string
      # if necessary.
      encoded_string = codecs.encode(string, self._encoding, self._errors)
    except UnicodeEncodeError:
      if self._errors == 'strict':
        logger.error(
            'Unable to properly write output due to encoding error. '
            'Switching to error tolerant encoding which can result in '
            'non Basic Latin (C0) characters to be replaced with "?" or '
            '"\\ufffd".')
        self._errors = 'replace'

      encoded_string = codecs.encode(string, self._encoding, self._errors)

    self._file_object.write(encoded_string)
910881
function WriteStream(path, options, flush) {
  // Not exposed so we can avoid the case where someone doesn't use `new`

  if (typeof options === 'function') {
    flush = options;
    options = null;
  }

  options = options || {};

  Writable.call(this, options);

  this.flush = flush;
  this.path = path;

  this.mode = options.mode || constants.DEFAULT_FILE_MODE;
  this.flags = options.flags || 'w';

  // Used by node's `fs.WriteStream`
  this.fd = null;
  this.start = null;

  this.open();

  // Dispose on finish.
  this.once('finish', this.close);
}
922176
def write(self, msg, style_func=None, ending=None, stream=None):
        
        if stream is None:
            stream = self.stdout
        if OutputWrapper is None:
            ending = "\n" if ending is None else ending
            msg += ending
            stream.write(msg)
        else:
            stream.write(msg, style_func=style_func, ending=ending)
418540
function stringToStream(string) {
    let s = new stream.Readable();
    s.push(string);
    s.push(null);
    return s;
}
586344
function writeStream(filename, st) {
    var d = Promise.defer();

    var wstream = fs.createWriteStream(filename);
    var cleanup = function() {
        destroy(wstream);
        wstream.removeAllListeners();
    };

    wstream.on('finish', function () {
        cleanup();
        d.resolve();
    });
    wstream.on('error', function (err) {
        cleanup();
        d.reject(err);
    });

    st.on('error', function(err) {
        cleanup();
        d.reject(err);
    });

    st.pipe(wstream);

    return d.promise;
}
1051589
private String processName(String name) {
        String prefix = "";

        if (this.type != null) {
            prefix = this.type.getName() + ".";
        }

        return prefix + name;
    }
239139
public void formatLine(String line, PrintWriter writer)
    {
        processingState.setLine(line);
        processingState.pwriter = writer;
        processingState = processingState.formatState.formatPartialLine(processingState);
        while (!processingState.isDoneWithLine())
        {
            processingState = processingState.formatState.formatPartialLine(processingState);
        }
    }
745004
function pidOf( procName, callback ){
    if ( isString( procName )){
        var pids = [];

        procStat( procName, function( err, processes ){
            processes.object.forEach( function( proc ){
                pids.push( proc.pid )
            });

            callback( err, pids )
        })
    } else callback( new Error( 'A non-string process name was supplied' ), null, null )
}
1313226
function createServer(serverName) {
        console.log("creating server", serverName)
        var server = servers[serverName] = net.createServer(handleConnection)
        ports.service(serverName, listen)

        function handleConnection(connection) {
            console.log("got incoming connection", connection)
            var stream = proxy.connect(serverName)
                , buffer = PauseStream().pause()
                , intermediate = through(stringer)

            connection.pipe(buffer)

            process.nextTick(pipe)

            function pipe() {
                buffer.pipe(intermediate)
                    .pipe(stream).pipe(connection)

                buffer.resume()
            }
        }

        function listen(port, ready) {
            server.listen(port, ready)
        }
    }
829177
function _write (chunk, encoding, callback) {
  /* istanbul ignore else */
  if (Array.isArray(this.options.input.buffer)) {
    /* istanbul ignore else */
    if (is.buffer(chunk)) {
      if (this.options.input.buffer.length === 0) {
        const that = this;
        this.on('finish', function () {
          that.streamInFinished = true;
        });
      }
      this.options.input.buffer.push(chunk);
      callback();
    } else {
      callback(new Error('Non-Buffer data on Writable Stream'));
    }
  } else {
    callback(new Error('Unexpected data on Writable Stream'));
  }
}
482590
function toStr(next) {
          var stream = new Writable();
          var str = "";
          stream.write = function(chunk) {
              str += (chunk);
          };
          stream.end = function() {
              next(str);
          };
          return stream;
        }