/* Handle a vinyl entry with buffer contents.
346611
function buffer(vinyl, opts, callback) {
  var name = opts.name
  var vfile = convert(vinyl)
  var config = xtend(opts, {
    streamOut: new PassThrough(),
    files: [vfile]
  })

  engine(config, oncomplete)

  function oncomplete(err, status) {
    var contents

    if (err || status) {
      return callback(new PluginError(name, err || 'Unsuccessful running'))
    }

    contents = vfile.contents

    /* istanbul ignore else - There aren’t any unified compilers
     * that output buffers, but this logic is here to keep allow them
     * (and binary files) to pass through untouched. */
    if (typeof contents === 'string') {
      contents = Buffer.from(contents, 'utf8')
    }

    vinyl.contents = contents

    callback(null, vinyl)
  }
}
1123636
protected void handleDeadSlop(SlopStorageEngine slopStorageEngine,
                                  Pair<ByteArray, Versioned<Slop>> keyAndVal) {
        Versioned<Slop> versioned = keyAndVal.getSecond();
        // If configured to delete the dead slop
        if(voldemortConfig.getAutoPurgeDeadSlops()) {
            slopStorageEngine.delete(keyAndVal.getFirst(), versioned.getVersion());

            if(getLogger().isDebugEnabled()) {
                getLogger().debug("Auto purging dead slop :" + versioned.getValue());
            }
        } else {
            // Keep ignoring the dead slops
            if(getLogger().isDebugEnabled()) {
                getLogger().debug("Ignoring dead slop :" + versioned.getValue());
            }
        }
    }
129293
private static void handleLastChar(final StringBuilder buffer, final int escapeCounter, final char curChar) {
        if (curChar == ESCAPE_CHAR) {
            writeUnescapedEscapeChars(escapeCounter + 1, buffer);
        } else {
            handleLiteralChar(buffer, escapeCounter, curChar);
        }
    }
176981
function handleDocumentMousemove(e) {
  let svg = overlay.parentNode.querySelector('svg.annotationLayer');
  let rect = svg.getBoundingClientRect();

  if (originX + (e.clientX - originX) < rect.right) {
    overlay.style.width = `${e.clientX - originX}px`;
  }

  if (originY + (e.clientY - originY) < rect.bottom) {
    overlay.style.height = `${e.clientY - originY}px`;
  }
}
983618
function handleUncompressed(res, _write, _end, callback) {
  let buffer = new BufferHelper();
  // Rewrite response method and get the content.
  res.write = data => buffer.concat(data);

  res.end = () => {
    let body;
    try {
      body = JSON.parse(buffer.toBuffer().toString());
    } catch (e) {
      body = buffer.toBuffer().toString();
      console.log('JSON.parse error:', e);
    }

    // Custom modified logic
    if (typeof callback === 'function') {
      body = callback(body);
    }

    let finish = _body => {
      // Converts the JSON to buffer.
      let body = new Buffer(JSON.stringify(_body));

      // Call the response method
      _write.call(res, body);
      _end.call(res);
    };

    if (body && body.then) {
      body.then(finish);
    } else {
      finish(body);
    }
  };
}
239048
def return_buffer_contents(self, frame, force_unescaped=False):
        """"""
        if not force_unescaped:
            if frame.eval_ctx.volatile:
                self.writeline('if context.eval_ctx.autoescape:')
                self.indent()
                self.writeline('return Markup(concat(%s))' % frame.buffer)
                self.outdent()
                self.writeline('else:')
                self.indent()
                self.writeline('return concat(%s)' % frame.buffer)
                self.outdent()
                return
            elif frame.eval_ctx.autoescape:
                self.writeline('return Markup(concat(%s))' % frame.buffer)
                return
        self.writeline('return concat(%s)' % frame.buffer)
1031925
def emit(self, record):
        """"""
        if self.triggerLevelNo is not None and record.levelno>=self.triggerLevelNo:
            self.triggered = True
        logging.handlers.BufferingHandler.emit(self,record)
891372
function (callback) {
					const str = files[file].contents.toString();
					if (!handlebarsMatcher.test(str)) {
						return callback();
					}

					render(str, metadata, function (err, res) {
						if (err) return callback(err);
						files[file].contents = Buffer.from(res);
						callback();
					});
				}
770579
function handleEntryPoints(opts, io, nextHandler) {
  var entries = opts.entries
    , bundlerOpts

  bundlerOpts = opts.bundler

  if(!bundlerOpts || !bundlerOpts.legacy) {
    return nextHandler
  }

  if(!opts.entries || !opts.bundler) {
    return nextHandler
  }

  return handle

  function handle(server, req, resp, parsed) {
    if(!(parsed.pathname in entries) && !('browserify' in parsed.query)) {
      return nextHandler(server, req, resp, parsed)
    }

    var entryPath = entries[parsed.pathname]
      , args = bundlerOpts.flags.slice()
      , bundler
      , output

    if(entryPath) {
      args.unshift(entryPath)
    }

    args.unshift(bundlerOpts.command)
    parsed.loggedPathname = ansicolors.magenta(
        parsed.pathname + ' -> ' + args.map(toLocal).join(' ')
    )
    args.shift()

    bundler = spawn(bundlerOpts.command, args)
    bundler.stderr.pipe(accumError(io.error, resp))
    resp.setHeader('content-type', 'text/javascript')
    bundler.stdout.pipe(resp)
  }

  function toLocal(file) {
    return file.replace(opts.cwd, '.')
  }
}
1296983
void parseDocument(
            final char[] buffer, final int offset, final int len,
            final IMarkupHandler handler, final ParseStatus status)
            throws ParseException {


        final long parsingStartTimeNanos = System.nanoTime();

        try {

            handler.handleDocumentStart(parsingStartTimeNanos, 1, 1);

            status.offset = -1;
            status.line = 1;
            status.col = 1;
            status.inStructure = false;
            status.parsingDisabled = true;
            status.parsingDisabledLimitSequence = null;
            status.autoCloseRequired = null;
            status.autoCloseLimits = null;

            parseBuffer(buffer, offset, len, handler, status);

            // First parse done, now it's time to clean up in case we still have some text to be notified

            int lastLine = status.line;
            int lastCol = status.col;

            final int lastStart = status.offset;
            final int lastLen = (offset + len) - lastStart;

            if (lastLen > 0) {

                if (status.inStructure) {
                    throw new ParseException(
                            "Incomplete structure: \"" + new String(buffer, lastStart, lastLen) + "\"", status.line, status.col);
                }

                handler.handleText(buffer, lastStart, lastLen, status.line, status.col);

                // As we have produced an additional text event, we need to fast-forward the
                // lastLine and lastCol position to include the last text structure.
                for (int i = lastStart; i < (lastStart + lastLen); i++) {
                    final char c = buffer[i];
                    if (c == '\n') {
                        lastLine++;
                        lastCol = 1;
                    } else {
                        lastCol++;
                    }

                }

            }

            final long parsingEndTimeNanos = System.nanoTime();
            handler.handleDocumentEnd(parsingEndTimeNanos, (parsingEndTimeNanos - parsingStartTimeNanos), lastLine, lastCol);

        } catch (final ParseException e) {
            throw e;
        } catch (final Exception e) {
            throw new ParseException(e);
        }

    }
1371177
function bufferReviver(k, v) {
    if (
        v !== null &&
        typeof v === 'object' &&
        'type' in v &&
        v.type === 'Buffer' &&
        'data' in v &&
        Array.isArray(v.data)) {
        return new Buffer(v.data);
    }
    return v;
}
22748
function consoleHandler(entry) {
  if (typeof console === 'undefined' || !console) {
    return;
  }

  var timestamp = new Date(entry.timestamp);
  var msg =
      '[' + timestamp.getUTCFullYear() + '-' +
      pad(timestamp.getUTCMonth() + 1) + '-' +
      pad(timestamp.getUTCDate()) + 'T' +
      pad(timestamp.getUTCHours()) + ':' +
      pad(timestamp.getUTCMinutes()) + ':' +
      pad(timestamp.getUTCSeconds()) + 'Z] ' +
      '[' + entry.level.name + '] ' +
      entry.message;

  var level = entry.level.value;
  if (level >= Level.SEVERE.value) {
    console.error(msg);
  } else if (level >= Level.WARNING.value) {
    console.warn(msg);
  } else {
    console.log(msg);
  }
}
123550
function wlCheck(wl, record, value) {
  if (!value) value = 'allow';

  let wlItem = _.get(wl, record);

  if (_.isArray(wlItem)) return wlItem.indexOf(value) !== -1;

  return wlItem === value;
}
789750
def accept_line(event):
    "  "
    b = event.current_buffer
    b.accept_action.validate_and_handle(event.cli, b)
184832
function _storeMarginLeft()
    {
        $record  = 0x0026;                   // Record identifier
        $length  = 0x0008;                   // Bytes to follow

        $margin  = $this->_margin_left;       // Margin in inches

        $header    = pack("vv",  $record, $length);
        $data      = pack("d",   $margin);
        if ($this->_byte_order) { // if it's Big Endian
            $data = strrev($data);
        }

        $this->_prepend($header . $data);
    }
1103599
function consoleOutput(param, record) {
  {
    const outKey = record.level >= Level.ERROR ? 'stderr' : 'stdout';
    process[outKey].write(`${param}\n`);
  }
}
543540
function cleanContent() {
    function transform(file, cb) {
        file.contents = new Buffer((function (src) {
            var lines = src.replace('_.mixin({\n','').split('\n'),
                last = lines.pop();
            // handle empty lines at the end of the file
            while(last===''){
                last = lines.pop();
            }
            return lines.join('\n');
        })(String(file.contents)));
        cb(null, file);
    }

    return require('event-stream').map(transform);
}