Search is not available for this dataset
query
stringlengths
7
355k
document
stringlengths
9
341k
metadata
dict
negatives
listlengths
0
101
negative_scores
listlengths
0
101
document_score
stringlengths
3
10
document_rank
stringclasses
102 values
This function is designed to be inlinable, so please take care when making changes to the function body.
function howMuchToRead(n, state) { if (n <= 0 || state.length === 0 && state.ended) return 0; if (state.objectMode) return 1; if (n !== n) { // Only flow one buffer at a time if (state.flowing && state.length) return state.buffer.head.data.length;else return state.length; } // If we're asking for more...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private internal function m248() {}", "private public function m246() {}", "protected internal function m252() {}", "transient protected internal function m189() {}", "transient private protected internal function m182() {}", "transient private internal function m185() {}", "transient final protected i...
[ "0.68351024", "0.6708617", "0.66855526", "0.6600842", "0.6528807", "0.6307707", "0.630425", "0.6260026", "0.62104523", "0.61227286", "0.6071386", "0.59882206", "0.5980916", "0.5911053", "0.5898686", "0.5881848", "0.58807147", "0.57519734", "0.5730368", "0.5719172", "0.5713398...
0.0
-1
Don't emit readable right away in sync mode, because this can trigger another read() call => stack overflow. This way, it might trigger a nextTick recursion warning, but that's not so bad.
function emitReadable(stream) { var state = stream._readableState; state.needReadable = false; if (!state.emittedReadable) { debug('emitReadable', state.flowing); state.emittedReadable = true; if (state.sync) pna.nextTick(emitReadable_, stream);else emitReadable_(stream); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function emitReadable(stream){var state=stream._readableState;state.needReadable=false;if(!state.emittedReadable){debug(\"emitReadable\",state.flowing);state.emittedReadable=true;if(state.sync)processNextTick(emitReadable_,stream);else emitReadable_(stream)}}", "function emitReadable(stream){var state=stream._re...
[ "0.7172861", "0.7116289", "0.7116289", "0.697928", "0.69336367", "0.6921222", "0.69022626", "0.6896357", "0.6883751", "0.68737733", "0.68737733", "0.68737733", "0.68737733", "0.68737733", "0.68737733", "0.68737733", "0.68737733", "0.68737733", "0.68737733", "0.68737733", "0.6...
0.0
-1
at this point, the user has presumably seen the 'readable' event, and called read() to consume some data. that may have triggered in turn another _read(n) call, in which case reading = true if it's in progress. However, if we're not ended, or reading, and the length < hwm, then go ahead and try to read some more preemp...
function maybeReadMore(stream, state) { if (!state.readingMore) { state.readingMore = true; pna.nextTick(maybeReadMore_, stream, state); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "_read() {\r\n\t\tthis._readingPaused = false\r\n\t\tsetImmediate(this._onReadable.bind(this))\r\n\t}", "_onReadable() {\r\n\t\t// Read all the data until one of two conditions is met\r\n\t\t// 1. there is nothing left to read on the socket\r\n\t\t// 2. reading is paused because the consumer is slow\r\n\t\twhile ...
[ "0.73005724", "0.6976712", "0.6770696", "0.6746147", "0.6746147", "0.674364", "0.674364", "0.6722787", "0.6690585", "0.6664287", "0.6655122", "0.6619583", "0.65676147", "0.65008867", "0.6500177", "0.6500177", "0.64845586", "0.6468972", "0.6466705", "0.63833183", "0.63826555",...
0.0
-1
if the dest has an error, then stop piping into it. however, don't suppress the throwing behavior for this.
function onerror(er) { debug('onerror', er); unpipe(); dest.removeListener('error', onerror); if (EElistenerCount(dest, 'error') === 0) dest.emit('error', er); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function onerror(er){debug(\"onerror\",er);unpipe();dest.removeListener(\"error\",onerror);if(EElistenerCount(dest,\"error\")===0)dest.emit(\"error\",er)}", "function onerror(er){debug('onerror',er);unpipe();dest.removeListener('error',onerror);if(EElistenerCount(dest,'error')===0)dest.emit('error',er);}// Make ...
[ "0.76036406", "0.72073966", "0.72073966", "0.72073966", "0.7148641", "0.7148641", "0.7142781", "0.7125259", "0.7125259", "0.7125259", "0.7125259", "0.7125259", "0.7125259", "0.7125259", "0.7125259", "0.7125259", "0.7125259", "0.7125259", "0.7125259", "0.7125259", "0.7125259",...
0.0
-1
Both close and finish should trigger unpipe, but only once.
function onclose() { dest.removeListener('finish', onfinish); unpipe(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function onclose() {\n\t dest.removeListener('finish', onfinish);\n\t unpipe();\n\t }", "function onclose() {\n\t dest.removeListener('finish', onfinish);\n\t unpipe();\n\t }", "function onclose() {\n\t dest.removeListener('finish', onfinish);\n\t unpipe();\n\t }", "function onclose() {\...
[ "0.7979085", "0.7979085", "0.7979085", "0.7979085", "0.7979085", "0.7979085", "0.7979085", "0.7979085", "0.7979085", "0.7979085", "0.7979085", "0.7979085", "0.7979085", "0.7979085", "0.7979085", "0.7979085", "0.7979085", "0.7979085", "0.7979085", "0.7979085", "0.7979085", "...
0.0
-1
Pluck off n bytes from an array of buffers. Length is the combined lengths of all the buffers in the list. This function is designed to be inlinable, so please take care when making changes to the function body.
function fromList(n, state) { // nothing buffered if (state.length === 0) return null; var ret; if (state.objectMode) ret = state.buffer.shift();else if (!n || n >= state.length) { // read it all, truncate the list if (state.decoder) ret = state.buffer.join('');else if (state.buffer.length === 1) ret =...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function copyFromBuffer(n, list) {\n var ret = Buffer.allocUnsafe(n);\n var p = list.head;\n var c = 1;\n p.data.copy(ret);\n n -= p.data.length;\n\n while (p = p.next) {\n var buf = p.data;\n var nb = n > buf.length ? buf.length : n;\n buf.copy(ret, ret.length - n, 0, nb);\n n -= nb;\n\n if (...
[ "0.65643716", "0.65629953", "0.65629953", "0.65629953", "0.65629953", "0.65629953", "0.65629953", "0.65629953", "0.65629953", "0.65629953", "0.65629953", "0.65629953", "0.65629953", "0.65629953", "0.65629953", "0.65629953", "0.65629953", "0.65629953", "0.65629953", "0.65629953"...
0.0
-1
Extracts only enough buffered data to satisfy the amount requested. This function is designed to be inlinable, so please take care when making changes to the function body.
function fromListPartial(n, list, hasStrings) { var ret; if (n < list.head.data.length) { // slice is the same for buffers and strings ret = list.head.data.slice(0, n); list.head.data = list.head.data.slice(n); } else if (n === list.head.data.length) { // first chunk is a perfect match ret = l...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function _sliceBuffer(amount) {\n var newBuffer = _itemsWaitingToBeRendered.slice(amount, _itemsWaitingToBeRendered.length);\n var returnedObjArray = _itemsWaitingToBeRendered.slice(0, amount);\n _itemsWaitingToBeRendered = newBuffer;\n return returnedObjArray;\n }", "async readWait(length...
[ "0.6209727", "0.6178325", "0.5868428", "0.5805301", "0.5688282", "0.55559313", "0.5507273", "0.5507273", "0.5501371", "0.5501371", "0.54975307", "0.5488677", "0.5455985", "0.5451753", "0.54478174", "0.54478174", "0.54274863", "0.5419269", "0.5419269", "0.5419269", "0.5419269"...
0.0
-1
Copies a specified amount of characters from the list of buffered data chunks. This function is designed to be inlinable, so please take care when making changes to the function body.
function copyFromBufferString(n, list) { var p = list.head; var c = 1; var ret = p.data; n -= ret.length; while (p = p.next) { var str = p.data; var nb = n > str.length ? str.length : n; if (nb === str.length) ret += str;else ret += str.slice(0, n); n -= nb; if (n === 0) { if (nb ===...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function copyFromBufferString(n,list){var p=list.head;var c=1;var ret=p.data;n-=ret.length;while(p=p.next){var str=p.data;var nb=n>str.length?str.length:n;if(nb===str.length)ret+=str;else ret+=str.slice(0,n);n-=nb;if(n===0){if(nb===str.length){++c;if(p.next)list.head=p.next;else list.head=list.tail=null;}else{list...
[ "0.75644034", "0.75644034", "0.75644034", "0.75154185", "0.7506263", "0.6853658", "0.67486465", "0.6715952" ]
0.0
-1
Copies a specified amount of bytes from the list of buffered data chunks. This function is designed to be inlinable, so please take care when making changes to the function body.
function copyFromBuffer(n, list) { var ret = Buffer.allocUnsafe(n); var p = list.head; var c = 1; p.data.copy(ret); n -= p.data.length; while (p = p.next) { var buf = p.data; var nb = n > buf.length ? buf.length : n; buf.copy(ret, ret.length - n, 0, nb); n -= nb; if (n === 0) { if ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function copyFromBufferString(n,list){var p=list.head;var c=1;var ret=p.data;n-=ret.length;while(p=p.next){var str=p.data;var nb=n>str.length?str.length:n;if(nb===str.length)ret+=str;else ret+=str.slice(0,n);n-=nb;if(n===0){if(nb===str.length){++c;if(p.next)list.head=p.next;else list.head=list.tail=null;}else{list...
[ "0.712247", "0.712247", "0.712247", "0.6894647", "0.68698317", "0.63405836", "0.6312499", "0.6309219" ]
0.0
-1
It seems a linked list but it is not there will be only 2 of these for each stream
function CorkedRequest(state) { var _this = this; this.next = null; this.entry = null; this.finish = function () { onCorkedFinish(_this, state); }; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "isStream(){\n return this.iterators.length > 0 && this.iterators[0].streamer && Util.isStreamer(this.iterators[0].streamer);\n }", "prnt() {\n console.log(this.size);\n let current = this.head;\n while (current != null) {\n console.log(current);\n current = current.next;\n ...
[ "0.60570174", "0.5973436", "0.59696585", "0.58955836", "0.5847338", "0.58092487", "0.5804136", "0.57930565", "0.5781443", "0.574302", "0.5742898", "0.5724677", "0.57138026", "0.5713268", "0.5694888", "0.56760454", "0.5663978", "0.5657055", "0.5648596", "0.56441736", "0.562187...
0.0
-1
Checks that a usersupplied chunk is valid, especially for the particular mode the stream is in. Currently this means that `null` is never accepted and undefined/nonstring values are only allowed in object mode.
function validChunk(stream, state, chunk, cb) { var valid = true; var er = false; if (chunk === null) { er = new TypeError('May not write null values to stream'); } else if (typeof chunk !== 'string' && chunk !== undefined && !state.objectMode) { er = new TypeError('Invalid non-string/buffer chunk'); ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function validChunk(stream,state,chunk,cb){var valid=true;var er=false;if(chunk===null){er=new TypeError(\"May not write null values to stream\")}else if(typeof chunk!==\"string\"&&chunk!==undefined&&!state.objectMode){er=new TypeError(\"Invalid non-string/buffer chunk\")}if(er){stream.emit(\"error\",er);processNe...
[ "0.8009824", "0.7968864", "0.79593676", "0.79461837", "0.7909868", "0.79044735", "0.7848438", "0.78329235", "0.78329235", "0.7811855", "0.78056455", "0.7804267", "0.7804267", "0.7804149", "0.7804149", "0.77960306", "0.77960306", "0.77960306", "0.77960306", "0.77960306", "0.77...
0.0
-1
if we're already writing something, then just put this in the queue, and wait our turn. Otherwise, call _write If we return false, then we need a drain event, so set that flag.
function writeOrBuffer(stream, state, isBuf, chunk, encoding, cb) { if (!isBuf) { var newChunk = decodeChunk(state, chunk, encoding); if (chunk !== newChunk) { isBuf = true; encoding = 'buffer'; chunk = newChunk; } } var len = state.objectMode ? 1 : chunk.length; state.length += l...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function onwriteDrain(stream,state){if(state.length===0&&state.needDrain){state.needDrain=false;stream.emit('drain');}}// if there's something in the buffer waiting, then process it", "function onwriteDrain(stream,state){if(state.length===0&&state.needDrain){state.needDrain=false;stream.emit('drain');}}// if the...
[ "0.7145028", "0.7145028", "0.7145028", "0.7145028", "0.69738954", "0.69527036", "0.68903154", "0.68903154", "0.68903154", "0.68903154", "0.68903154", "0.68903154", "0.68903154", "0.68903154", "0.68903154", "0.68903154", "0.68903154", "0.68903154", "0.68903154", "0.68903154", ...
0.0
-1
Must force callback to be called on nextTick, so that we don't emit 'drain' before the write() consumer gets the 'false' return value, and has a chance to attach a 'drain' listener.
function onwriteDrain(stream, state) { if (state.length === 0 && state.needDrain) { state.needDrain = false; stream.emit('drain'); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function onwriteDrain(stream,state){if(state.length===0&&state.needDrain){state.needDrain=false;stream.emit(\"drain\")}}", "onDrain() {\n this.writeBuffer.splice(0, this.prevBufferLen); // setting prevBufferLen = 0 is very important\n // for example, when upgrading, upgrade packet is sent over,\n // and...
[ "0.6865414", "0.6840925", "0.68402886", "0.68402886", "0.68402886", "0.68402886", "0.68185616", "0.6765108", "0.6765108", "0.6756875", "0.6720488", "0.6720488", "0.6720488", "0.6720488", "0.6720488", "0.6720488", "0.6720488", "0.6720488", "0.6720488", "0.6720488", "0.6720488"...
0.0
-1
if there's something in the buffer waiting, then process it
function clearBuffer(stream, state) { state.bufferProcessing = true; var entry = state.bufferedRequest; if (stream._writev && entry && entry.next) { // Fast case, write everything using _writev() var l = state.bufferedRequestCount; var buffer = new Array(l); var holder = state.corkedRequestsFree;...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "processBuffer () {\n this.ready = true\n this._triggerBuffer()\n this.queue.waterfall(() => this.buffer.guardian)\n }", "function drainBuffer(cb) {\n if (!state.buffer.length)\n return cb()\n var done = multicb()\n var wait = false\n state.buffer.forEach(function(entry) {\n if (ha...
[ "0.6989099", "0.6406414", "0.63613397", "0.620778", "0.60211736", "0.59515584", "0.59415096", "0.59415096", "0.59415096", "0.59415096", "0.59035516", "0.5865887", "0.58270913", "0.58201474", "0.58172125", "0.5805252", "0.5790036", "0.5763926", "0.5763926", "0.5763926", "0.576...
0.0
-1
undocumented cb() API, needed for core, not for public API
function destroy(err, cb) { var _this = this; var readableDestroyed = this._readableState && this._readableState.destroyed; var writableDestroyed = this._writableState && this._writableState.destroyed; if (readableDestroyed || writableDestroyed) { if (cb) { cb(err); } else if (err && (!this._wri...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function callback() {}", "function callback() {}", "function callback() {}", "function callback() {}", "function callback() {}", "function callback(){}", "function cb () {\n\t\tcallback();\n\t}", "function callback(cb){\n\n cb(1);\n}", "function callbackDriver() {\n cb();\n }", "function _...
[ "0.7931035", "0.7931035", "0.7931035", "0.7931035", "0.7931035", "0.78800404", "0.77471286", "0.7327083", "0.72358775", "0.7153048", "0.7144767", "0.7144767", "0.7129538", "0.70338434", "0.70277834", "0.70002323", "0.69745857", "0.6934709", "0.6922737", "0.68061507", "0.68061...
0.0
-1
alternative to using Object.keys for old browsers
function copyProps (src, dst) { for (var key in src) { dst[key] = src[key] } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function getKeys(obj) {\n return Object.keys(obj); // Yes it is builtin!\n }", "function Object_keys(obj) {\n\t if (Object.keys) return Object.keys(obj)\n\t else {\n\t var res = [];\n\t for (var key in obj) res.push(key);\n\t return res;\n\t }\n\t}", "function keys(obj){\n return Object....
[ "0.7382736", "0.7311627", "0.723966", "0.7199875", "0.7199875", "0.7199875", "0.7199875", "0.7199875", "0.7199875", "0.7199875", "0.7199875", "0.7199875", "0.7109948", "0.69957906", "0.69584274", "0.6930815", "0.6926222", "0.6915537", "0.6879077", "0.68776375", "0.686874", ...
0.0
-1
Do not cache `Buffer.isEncoding` when checking encoding names as some modules monkeypatch it to support additional encodings
function normalizeEncoding(enc) { var nenc = _normalizeEncoding(enc); if (typeof nenc !== 'string' && (Buffer.isEncoding === isEncoding || !isEncoding(enc))) throw new Error('Unknown encoding: ' + enc); return nenc || enc; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function detectUTF8(txt) {\n if(txt) return txt.match(/([\\xC2-\\xDF][\\x80-\\xBF]|\\xE0[\\xA0-\\xBF][\\x80-\\xBF]|[\\xE1-\\xEF][\\x80-\\xBF][\\x80-\\xBF]|\\xF0[\\x90-\\xBF][\\x80-\\xBF][\\x80-\\xBF]|[\\xF1-\\xF7][\\x80-\\xBF][\\x80-\\xBF][\\x80-\\xBF]|\\xF8[\\x88-\\xBF][\\x80-\\xBF][\\x80-\\xBF][\\x80-\\xBF]|[...
[ "0.6635498", "0.6575846", "0.6535316", "0.6478663", "0.6463564", "0.626706", "0.62654567", "0.6263514", "0.62574494", "0.62082374", "0.61448073", "0.6139909", "0.6109191", "0.6109191", "0.6109191", "0.6109191", "0.6109191", "0.6109191", "0.6109191", "0.6109191", "0.6109191", ...
0.0
-1
Checks the type of a UTF8 byte, whether it's ASCII, a leading byte, or a continuation byte. If an invalid byte is detected, 2 is returned.
function utf8CheckByte(byte) { if (byte <= 0x7F) return 0;else if (byte >> 5 === 0x06) return 2;else if (byte >> 4 === 0x0E) return 3;else if (byte >> 3 === 0x1E) return 4; return byte >> 6 === 0x02 ? -1 : -2; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function utf8CheckByte(_byte) {\n if (_byte <= 0x7F) return 0;else if (_byte >> 5 === 0x06) return 2;else if (_byte >> 4 === 0x0E) return 3;else if (_byte >> 3 === 0x1E) return 4;\n return _byte >> 6 === 0x02 ? -1 : -2;\n} // Checks at most 3 bytes at the end of a Buffer in order to detect an", "function $lrG1...
[ "0.8007454", "0.79413825", "0.7896979", "0.78161865", "0.78161865", "0.77798647", "0.7769451", "0.7756668", "0.7756668", "0.7756668", "0.7756668", "0.7756668", "0.7756668", "0.7756668", "0.7756668", "0.7756668", "0.7756668", "0.7756668", "0.7756668", "0.7756668", "0.7756668",...
0.0
-1
Checks at most 3 bytes at the end of a Buffer in order to detect an incomplete multibyte UTF8 character. The total number of bytes (2, 3, or 4) needed to complete the UTF8 character (if applicable) are returned.
function utf8CheckIncomplete(self, buf, i) { var j = buf.length - 1; if (j < i) return 0; var nb = utf8CheckByte(buf[j]); if (nb >= 0) { if (nb > 0) self.lastNeed = nb - 1; return nb; } if (--j < i || nb === -2) return 0; nb = utf8CheckByte(buf[j]); if (nb >= 0) { if (nb > 0) self.lastNeed =...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function utf8CheckIncomplete(self,buf,i){var j=buf.length-1;if(j<i)return 0;var nb=utf8CheckByte(buf[j]);if(nb>=0){if(nb>0)self.lastNeed=nb-1;return nb;}if(--j<i||nb===-2)return 0;nb=utf8CheckByte(buf[j]);if(nb>=0){if(nb>0)self.lastNeed=nb-2;return nb;}if(--j<i||nb===-2)return 0;nb=utf8CheckByte(buf[j]);if(nb>=0){...
[ "0.8211404", "0.8211404", "0.81329495", "0.81329495", "0.8053923", "0.8053923", "0.80302674", "0.8010894", "0.78463393", "0.7842364", "0.7775618", "0.77502924", "0.77502924", "0.77502924", "0.77502924", "0.77502924", "0.77502924", "0.77502924", "0.77502924", "0.77502924", "0....
0.0
-1
Validates as many continuation bytes for a multibyte UTF8 character as needed or are available. If we see a noncontinuation byte where we expect one, we "replace" the validated continuation bytes we've seen so far with a single UTF8 replacement character ('\ufffd'), to match v8's UTF8 decoding behavior. The continuatio...
function utf8CheckExtraBytes(self, buf, p) { if ((buf[0] & 0xC0) !== 0x80) { self.lastNeed = 0; return '\ufffd'; } if (self.lastNeed > 1 && buf.length > 1) { if ((buf[1] & 0xC0) !== 0x80) { self.lastNeed = 1; return '\ufffd'; } if (self.lastNeed > 2 && buf.length > 2) { if ((...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function utf8CheckIncomplete(self,buf,i){var j=buf.length-1;if(j<i)return 0;var nb=utf8CheckByte(buf[j]);if(nb>=0){if(nb>0)self.lastNeed=nb-1;return nb;}if(--j<i||nb===-2)return 0;nb=utf8CheckByte(buf[j]);if(nb>=0){if(nb>0)self.lastNeed=nb-2;return nb;}if(--j<i||nb===-2)return 0;nb=utf8CheckByte(buf[j]);if(nb>=0){...
[ "0.79382426", "0.79382426", "0.74664605", "0.7310228", "0.7310228", "0.7115068", "0.6710361", "0.6589756", "0.6558428", "0.65455556", "0.6481731", "0.64364624", "0.6386172", "0.6273275", "0.5986588", "0.5986588", "0.5986588", "0.5986588", "0.5986588", "0.5986588", "0.5986588"...
0.0
-1
Attempts to complete a multibyte UTF8 character using bytes from a Buffer.
function utf8FillLast(buf) { var p = this.lastTotal - this.lastNeed; var r = utf8CheckExtraBytes(this, buf, p); if (r !== undefined) return r; if (this.lastNeed <= buf.length) { buf.copy(this.lastChar, p, 0, this.lastNeed); return this.lastChar.toString(this.encoding, 0, this.lastTotal); } buf.copy(...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function utf8CheckExtraBytes(self,buf,p){if((buf[0]&0xC0)!==0x80){self.lastNeed=0;return '\\ufffd';}if(self.lastNeed>1&&buf.length>1){if((buf[1]&0xC0)!==0x80){self.lastNeed=1;return '\\ufffd';}if(self.lastNeed>2&&buf.length>2){if((buf[2]&0xC0)!==0x80){self.lastNeed=2;return '\\ufffd';}}}}// Attempts to complete a ...
[ "0.71285844", "0.701326", "0.678287", "0.67024726", "0.6565176", "0.64727366", "0.64727366", "0.6346288", "0.63428015", "0.63428015", "0.6312178", "0.616763", "0.616763", "0.616763", "0.616763", "0.616763", "0.616763", "0.616763", "0.616763", "0.616763", "0.616763", "0.6167...
0.0
-1
Returns all complete UTF8 characters in a Buffer. If the Buffer ended on a partial character, the character's bytes are buffered until the required number of bytes are available.
function utf8Text(buf, i) { var total = utf8CheckIncomplete(this, buf, i); if (!this.lastNeed) return buf.toString('utf8', i); this.lastTotal = total; var end = buf.length - (total - this.lastNeed); buf.copy(this.lastChar, 0, end); return buf.toString('utf8', i, end); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[]
[]
0.0
-1
For UTF8, a replacement character is added when ending on a partial character.
function utf8End(buf) { var r = buf && buf.length ? this.write(buf) : ''; if (this.lastNeed) return r + '\ufffd'; return r; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function utf8Text(buf,i){var total=utf8CheckIncomplete(this,buf,i);if(!this.lastNeed)return buf.toString('utf8',i);this.lastTotal=total;var end=buf.length-(total-this.lastNeed);buf.copy(this.lastChar,0,end);return buf.toString('utf8',i,end);}// For UTF-8, a replacement character is added when ending on a partial",...
[ "0.6674651", "0.6674651", "0.6231846", "0.6222286", "0.6220972", "0.6220972", "0.58358175", "0.58041847", "0.58041847", "0.58016056", "0.58016056", "0.58016056", "0.58016056", "0.58016056", "0.58016056", "0.58016056", "0.56992626", "0.5691778", "0.5691778", "0.5661822", "0.56...
0.0
-1
UTF16LE typically needs two bytes per character, but even if we have an even number of bytes available, we need to check if we end on a leading/high surrogate. In that case, we need to wait for the next two bytes in order to decode the last character properly.
function utf16Text(buf, i) { if ((buf.length - i) % 2 === 0) { var r = buf.toString('utf16le', i); if (r) { var c = r.charCodeAt(r.length - 1); if (c >= 0xD800 && c <= 0xDBFF) { this.lastNeed = 2; this.lastTotal = 4; this.lastChar[0] = buf[buf.length - 2]; this.last...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function isUTF16 (data) {\n var i = 0\n var len = data && data.length\n var pos = null\n var b1, b2, next, prev\n\n if (len < 2) {\n if (data[0] > 0xFF) {\n return false\n }\n } else {\n b1 = data[0]\n b2 = data[1]\n if (b1 === 0xFF && // BOM (little-endian)\n ...
[ "0.69674027", "0.6922929", "0.6922929", "0.6816788", "0.6747638", "0.6747638", "0.6736556", "0.6736556", "0.6727602", "0.6642357" ]
0.0
-1
For UTF16LE we do not explicitly append special replacement characters if we end on a partial character, we simply let v8 handle that.
function utf16End(buf) { var r = buf && buf.length ? this.write(buf) : ''; if (this.lastNeed) { var end = this.lastTotal - this.lastNeed; return r + this.lastChar.toString('utf16le', 0, end); } return r; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function $lrG1$var$utf16Text(buf, i) {\n if ((buf.length - i) % 2 === 0) {\n var r = buf.toString('utf16le', i);\n\n if (r) {\n var c = r.charCodeAt(r.length - 1);\n\n if (c >= 0xD800 && c <= 0xDBFF) {\n this.lastNeed = 2;\n this.lastTotal = 4;\n this.lastChar[0] = buf[buf.len...
[ "0.61751723", "0.6171606", "0.61674815", "0.61585945", "0.61585945", "0.60820246", "0.60431814", "0.5880185", "0.5880185", "0.5810663", "0.5810663", "0.5810663", "0.5810663", "0.5810663", "0.5810663", "0.5810663", "0.57894856", "0.57894856", "0.57424927", "0.5709051", "0.5700...
0.0
-1
Pass bytes on through for singlebyte encodings (e.g. ascii, latin1, hex)
function simpleWrite(buf) { return buf.toString(this.encoding); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function utf8CheckExtraBytes(self,buf,p){if((buf[0]&0xC0)!==0x80){self.lastNeed=0;return\"\\uFFFD\";}if(self.lastNeed>1&&buf.length>1){if((buf[1]&0xC0)!==0x80){self.lastNeed=1;return\"\\uFFFD\";}if(self.lastNeed>2&&buf.length>2){if((buf[2]&0xC0)!==0x80){self.lastNeed=2;return\"\\uFFFD\";}}}}// Attempts to complete...
[ "0.63480157", "0.63194925", "0.6203319", "0.61778533", "0.6119751", "0.6044178", "0.5955961", "0.5948356", "0.59131217", "0.59131217", "0.59131217", "0.5899713", "0.58946466", "0.5892134", "0.5868687", "0.5868687", "0.5868687", "0.5868687", "0.5787701", "0.57683253", "0.57243...
0.0
-1
alternative to using Object.keys for old browsers
function copyProps (src, dst) { for (var key in src) { dst[key] = src[key] } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function getKeys(obj) {\n return Object.keys(obj); // Yes it is builtin!\n }", "function Object_keys(obj) {\n\t if (Object.keys) return Object.keys(obj)\n\t else {\n\t var res = [];\n\t for (var key in obj) res.push(key);\n\t return res;\n\t }\n\t}", "function keys(obj){\n return Object....
[ "0.7382736", "0.7311627", "0.723966", "0.7199875", "0.7199875", "0.7199875", "0.7199875", "0.7199875", "0.7199875", "0.7199875", "0.7199875", "0.7199875", "0.7109948", "0.69957906", "0.69584274", "0.6930815", "0.6926222", "0.6915537", "0.6879077", "0.68776375", "0.686874", ...
0.0
-1
Currently only WebKitbased Web Inspectors, Firefox >= v31, and the Firebug extension (any Firefox version) are known to support "%c" CSS customizations. TODO: add a `localStorage` variable to explicitly enable/disable colors
function useColors() { // NB: In an Electron preload script, document will be defined but not fully // initialized. Since we know we're in Chrome, we'll just detect this case // explicitly if (typeof window !== 'undefined' && window.process && window.process.type === 'renderer') { return true; } // is ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function useColors(){ // is webkit? http://stackoverflow.com/a/16459606/376773\nreturn 'WebkitAppearance' in document.documentElement.style || // is firebug? http://stackoverflow.com/a/398120/376773\nwindow.console && (console.firebug || console.exception && console.table) || // is firefox >= v31?\n// https://de...
[ "0.6763227", "0.6297334", "0.6297334", "0.6297334", "0.62520415", "0.62520415", "0.62520415", "0.62520415", "0.62520415", "0.62520415", "0.62520415", "0.62520415", "0.62520415", "0.62520415", "0.62520415", "0.62520415", "0.62520415", "0.62520415", "0.62520415", "0.62520415", ...
0.0
-1
Colorize log arguments if enabled.
function formatArgs(args) { var useColors = this.useColors; args[0] = (useColors ? '%c' : '') + this.namespace + (useColors ? ' %c' : ' ') + args[0] + (useColors ? '%c ' : ' ') + '+' + exports.humanize(this.diff); if (!useColors) return; var c = 'color: ' + this.color; args.splice(1, 0,...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "log(...args) {\n console.log(this.getColorOn() + args.join(\" \"));\n }", "function writelnColor(){\n\t\tfor(var i=0; i<arguments.length; i=i+2)\n\t\t\tgrunt.log.write(arguments[i][arguments[i+1]]);\n\t\tgrunt.log.writeln('');\n\t}", "debug(...args) {\n console.debug(this.getColorOn() + args.join(...
[ "0.6760166", "0.6711751", "0.65307504", "0.65290976", "0.65290976", "0.65290976", "0.6475225", "0.64737195", "0.64728016", "0.6462169", "0.645757", "0.6455942", "0.6453729", "0.64420164", "0.64335275", "0.64298606", "0.642863", "0.6418752", "0.6418752", "0.6418752", "0.641875...
0.0
-1
Invokes `console.log()` when available. Noop when `console.log` is not a "function".
function log() { // this hackery is required for IE8/9, where // the `console.log` function doesn't have 'apply' return 'object' === typeof console && console.log && Function.prototype.apply.call(console.log, console, arguments); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function log() {\n if (window.console) console.log.apply(console,arguments);\n}", "function consoleLog() {\n if (typeof(console) == 'object' && typeof(console[\"log\"]) != \"undefined\") {\n console.log.apply(console, arguments);\n }\n}", "function L() {\n if (window.console && console.log) {\n ...
[ "0.77404726", "0.771868", "0.7708154", "0.76106143", "0.756758", "0.756758", "0.7531975", "0.7490411", "0.74152666", "0.73375654", "0.73315173", "0.7329968", "0.7324346", "0.7313081", "0.7309957", "0.7309957", "0.7309957", "0.7309957", "0.7309957", "0.7305471", "0.7305471", ...
0.0
-1
prototype class for hash functions
function Hash (blockSize, finalSize) { this._block = Buffer.alloc(blockSize) this._finalSize = finalSize this._blockSize = blockSize this._len = 0 }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function Hash() {}", "function Hash() {}", "function Hash() {\r\n}", "function Hashers() {\n}", "GetHashCode() {\n\n }", "_generateHash() {\n\n }", "hash() {\n return this.is()\n }", "function Hasher()\n{\n this.truckHash = {};\n}", "calculateHash(){\n return SHA256(this.index + this.pr...
[ "0.8444925", "0.8444925", "0.8012337", "0.7593274", "0.7441991", "0.7378374", "0.73555523", "0.7269683", "0.71957415", "0.718947", "0.7186965", "0.71654564", "0.7144473", "0.71247315", "0.70964617", "0.7088249", "0.70709276", "0.7060434", "0.70601094", "0.7054379", "0.702781"...
0.0
-1
OPERATIONS these get translated in the project function
function translateBoundAggregate(op) { return op; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "operation() {\n let result = 'Iniciando operacion atender cliente \\n';\n result += this.subsystem1.operation1();\n result += this.subsystem2.operation1();\n \n result += '\\nEmpesar a realizar Operacion\\n';\n result += this.subsystem1.operationN();\n result += this...
[ "0.5867488", "0.55932426", "0.55726427", "0.5524329", "0.54566383", "0.5442477", "0.5411206", "0.5386183", "0.5386183", "0.52994597", "0.52931404", "0.5238819", "0.5200407", "0.516576", "0.51300526", "0.5112504", "0.51049435", "0.50881594", "0.5084817", "0.5077785", "0.507409...
0.0
-1
rewrites some of the input sparql object to make use of aggregate variables
function mapAggregates(thingy, aggregates) { if (!thingy) return thingy; if (thingy.type === 'aggregate') { let found = false; let v; for (let key of Object.keys(aggregates)) { if (equal(aggregates[key], thingy)) { v = factory.createTerm(key); ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function executeQuery() {\n\t// query object\n\tvar query = new Object();\n\t// with an array of facets for processing results\n\tquery.facetsA = new Array();\n\t// array of sparql variables\n\tvar variableA = new Array();\n\t// array of triple patterns\n\tvar triplePA = new Array();\n\t\n\t// set the root facet\n...
[ "0.5457542", "0.5409416", "0.53488165", "0.5224199", "0.52094334", "0.5176973", "0.51312214", "0.51291597", "0.5115545", "0.5060833", "0.50093853", "0.4992841", "0.4982337", "0.49466377", "0.49328855", "0.49001765", "0.48960814", "0.48855573", "0.48849192", "0.4883855", "0.48...
0.49233648
15
separate terms from wildcard since we handle them differently
static isTerm(term) { return term.termType !== undefined && term.termType !== 'Wildcard'; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function getTerms(query) {\n\treturn query.split(\" AND \");\n}", "function searchTerms() {\n const searchField = document.querySelector(\".searchbar\");\n const searchTerm = searchField.value;\n const regex = new RegExp(searchTerm, \"gi\");\n const allTerms = Array.from(document.querySelectorAll(\".term\"))...
[ "0.5973073", "0.591387", "0.58291006", "0.581238", "0.57611454", "0.57061577", "0.5689472", "0.5645634", "0.5612856", "0.5612736", "0.55433625", "0.55424714", "0.5523657", "0.5497812", "0.54775155", "0.54737735", "0.54461616", "0.5436962", "0.5427241", "0.54221696", "0.539871...
0.6009688
0
Transforms an RDF term to the internal representation of a term, assuming it is not a variable, which would be an expression (internally).
function transformRDFTermUnsafe(term) { return transformTerm({ term, type: 'expression', expressionType: 'term', }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function RDFMakeTerm(formula,val) {\r\n if (typeof val != 'object') { \r\n\tif (typeof val == 'string') {\r\n\t return new RDFLiteral(val);\r\n\t} else if (typeof val == 'undefined') {\r\n\t return undefined;\r\n\t} else { // @@ add converting of dates and numbers\r\n\t alert(\"Can't make term from...
[ "0.72170454", "0.69588727", "0.61784786", "0.5833627", "0.5665005", "0.5619566", "0.554574", "0.554574", "0.554574", "0.554574", "0.554574", "0.54899955", "0.5456485", "0.54531", "0.526102", "0.5248098", "0.5211595", "0.5211595", "0.5211595", "0.5211595", "0.51960385", "0.5...
0.7914472
0
TODO: Maybe do this with a map? tslint:disablenextline:noany
function transformLiteral(lit) { if (!lit.datatype) { return (lit.language) ? new E.LangStringLiteral(lit.value, lit.language) : new E.StringLiteral(lit.value); } switch (lit.datatype.value) { case null: case undefined: case '': { return (l...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "protected internal function m252() {}", "private internal function m248() {}", "get special() {\n return this.makeMap(\"wxxxcode-style,script,style,view,scroll-view,block\")\n }", "private public function m246() {}", "get inline() {\n return this.makeMap(\"abbr,acronym,applet,b,basefont,bd...
[ "0.60498726", "0.56448126", "0.5587461", "0.550142", "0.54605436", "0.53544724", "0.53176314", "0.5238348", "0.5238348", "0.51730365", "0.51601505", "0.51418924", "0.50725985", "0.5064802", "0.50337255", "0.5013681", "0.49932057", "0.49899572", "0.49782476", "0.4951057", "0.4...
0.0
-1
TODO: Support passing functions to override default behaviour;
function transformNamed(expr) { const funcName = expr.name.value; if (!C.NamedOperators.contains(funcName)) { throw new Err.UnknownNamedOperator(expr.name.value); } // tslint:disable-next-line:no-any const op = expr.name.value; const args = expr.args.map((a) => transformAlgebra(a)); ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "initCustomFunctions() {/*To be overridden in sub class as needed*/}", "function miFuncion (){}", "function normal() {}", "function aOverrides()\n{\n\n}", "function defaultcallback(){\n} // end defaultcallback()", "function miFuncion(){}", "function miFuncion(){}", "function miFuncion(){}", "functio...
[ "0.65640473", "0.6223018", "0.61804396", "0.61385924", "0.6121016", "0.6104895", "0.6104895", "0.6104895", "0.60925806", "0.6088333", "0.6088333", "0.6088333", "0.6073761", "0.60736376", "0.599035", "0.5987722", "0.59589016", "0.59278786", "0.59278786", "0.59278786", "0.59271...
0.0
-1
Put a binding from the result stream in the aggregate state. If any binding evaluation errors, the corresponding aggregate variable should be unbound.
put(bindings) { this.init(bindings); if (this.state) { this.put = this.__put; this.result = this.__result; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "__put(bindings) {\n try {\n const term = this.evaluator.evaluate(bindings);\n this.state = this.aggregator.put(this.state, term);\n }\n catch (err) {\n this.safeThrow(err);\n }\n }", "__put(bindings) {\n try {\n const term = this.e...
[ "0.5638295", "0.5638295", "0.528809", "0.5190085", "0.50082743", "0.50082743", "0.49854213", "0.49854213", "0.49506384", "0.4892834", "0.48367408", "0.47531027", "0.4739131", "0.46903515", "0.46903515", "0.4658349", "0.4658349", "0.46501908", "0.45825547", "0.45825547", "0.45...
0.45379746
22
The actual put method. When the first binding has been given, and the state of the evaluators initialised. The .put API function will be replaced with this function, which implements the behaviour we want.
__put(bindings) { try { const term = this.evaluator.evaluate(bindings); this.state = this.aggregator.put(this.state, term); } catch (err) { this.safeThrow(err); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "put(bindings) {\n this.init(bindings);\n if (this.state) {\n this.put = this.__put;\n this.result = this.__result;\n }\n }", "put(bindings) {\n this.init(bindings);\n if (this.state) {\n this.put = this.__put;\n this.result = this....
[ "0.7401144", "0.7401144", "0.59954566", "0.57723695", "0.5307415", "0.5307415", "0.5212322", "0.5210376", "0.5158129", "0.51185644", "0.5103253", "0.5083296", "0.5054892", "0.5054892", "0.5054892", "0.50178146", "0.4987777", "0.49621984", "0.4958568", "0.4953329", "0.49290887...
0.72787476
3
The actual result method. When the first binding has been given, and the state of the evaluators initialised. The .result API function will be replaced with this function, which implements the behaviour we want.
__result() { return this.aggregator.result(this.state); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "get result() { return this._result; }", "get result() {\n return this._result;\n }", "getResult() {}", "get result() {\n return (0, rxjs_1.firstValueFrom)(output);\n }", "set result(value) {\n this._result = value;\n }", "function useResult() {\n updateFormula(functio...
[ "0.6660257", "0.6460885", "0.6117668", "0.6058842", "0.604198", "0.6038757", "0.59673107", "0.5953809", "0.58620626", "0.5853973", "0.58394945", "0.5823013", "0.5817242", "0.58066916", "0.58042157", "0.56971353", "0.564208", "0.5609982", "0.5609982", "0.5609982", "0.5601438",...
0.627619
2
strValue is mandatory here because toISOString will always add milliseconds, even if they were not present.
constructor(typedValue, strValue) { super(typedValue, C.make(C.TypeURL.XSD_DATE_TIME), strValue); this.typedValue = typedValue; this.strValue = strValue; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "serialize(value) {\n return value.toISOString();\n }", "function isISO8601(value) {\n if(utilities.isNumber(value)){\n value = value + ''; //we make sure that we are working with strings\n }\n\n if(!utilities.isString(value)){\n return false;\n }\n\n return ISO8086_REGEXP.test(value.trim());\...
[ "0.6483032", "0.61046386", "0.5981201", "0.593622", "0.5853335", "0.58221704", "0.58123535", "0.5788937", "0.5739069", "0.5694748", "0.5629899", "0.5629553", "0.56235975", "0.5557524", "0.5416131", "0.54139", "0.53924084", "0.53895205", "0.5359148", "0.53485316", "0.5313973",...
0.5768058
8
We monomorph by checking the map of overloads for keys corresponding to the runtime types. We start by checking for an implementation for the most concrete types (integer, string, date, IRI), if we find none, we consider their term types (literal, blank, IRI), and lastly we consider all arguments as generic terms. Anot...
monomorph(args) { return (false // TODO: Maybe use non primitive types first? || this.overloads.get(Typer.asConcreteTypes(args)) || this.overloads.get(Typer.asTermTypes(args)) || this.overloads.get(Typer.asGenericTerms(args))); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function typed(typeMap){\n return function(...args){\n redo: for(let t of typeMap){\n let [key, func] = t;\n let i = 0;\n for(let k of key){ \n let matched = true;\n if(k instanceof StackedPseudoType)\n match...
[ "0.5596784", "0.5103905", "0.47000283", "0.4601557", "0.45774785", "0.45395377", "0.45304424", "0.44970426", "0.44501454", "0.44290248", "0.43475884", "0.43359515", "0.4317295", "0.43060276", "0.43060276", "0.42992598", "0.42223495", "0.42064142", "0.4204017", "0.4163527", "0...
0.6378128
0
Functions on Dates and Times
function parseDate(dateLit) { return P.parseXSDDateTime(dateLit.str()); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function DateHelper() {}", "function DateUtils() {}", "function TimeUtils() {}", "function getDateAndTime(){\n return new Date()\n}", "function gSdate() {\n\n var object;\n if (arguments.length==1) {\n object = new Date(arguments[0]);\n } else {\n object = new Date();\n }\n\n g...
[ "0.6721292", "0.63995004", "0.6393984", "0.6320884", "0.61098474", "0.6105028", "0.6101698", "0.603021", "0.5987961", "0.5973723", "0.59277374", "0.59072495", "0.5841978", "0.5814872", "0.57963556", "0.5791962", "0.57884437", "0.57884437", "0.57620835", "0.57397085", "0.57227...
0.0
-1
TODO: Not an XPath function TODO: Publish as package
function langMatches(tag, range) { const langTags = tag.split('-'); const rangeTags = range.split('-'); if (!_matchLangTag(rangeTags[0], langTags[0]) && !_isWildCard(langTags[0])) { return false; } let lI = 1; let rI = 1; while (rI < rangeTags.length) { if (_isWildCar...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function zXPath() {\n\n}", "function $x(b,c){if(!c)c=document;var d=function(a){var o=document.createNSResolver(c)(a);\r\nreturn o?o:(document.contentType==\"text/html\")?\"\":\"http://www.w3.org/1999/xhtml\"}\r\nvar b=document.createExpression(b,d);var e=b.evaluate(c,XPathResult.ANY_TYPE,null);\r\nswitch(e.resu...
[ "0.7237341", "0.62484396", "0.60827094", "0.59677726", "0.59652174", "0.5880261", "0.58520323", "0.5729059", "0.56921494", "0.5687685", "0.5669986", "0.5640379", "0.56259483", "0.5616286", "0.5613689", "0.55936205", "0.5580297", "0.55701655", "0.55379844", "0.55253047", "0.55...
0.0
-1
Formats a timezone string into a XML DayTimeDuration TODO: Test Used in fn:timezone
function formatDayTimeDuration(timezone) { if (!timezone) { return undefined; } if (timezone[0] === 'Z') { return 'PT0S'; } else { // Split string const [sign, h1Raw, h2Raw, _, m1Raw, m2Raw] = timezone; // Cut of leading zero, set to empty string if 0, and app...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function timezone (tz) {\n if (isFinite(tz)) {\n return `INTERVAL '${tz} seconds'`;\n }\n return `'${tz}'`;\n}", "function tzParseTimezone(timezoneString, date) {\n var token;\n var absoluteOffset;\n\n // Z\n token = patterns.timezoneZ.exec(timezoneString);\n if (token) {\n return 0\n }\...
[ "0.5620971", "0.5118169", "0.502679", "0.502679", "0.5026603", "0.4987228", "0.4970494", "0.4925392", "0.4901652", "0.48988736", "0.488644", "0.48666376", "0.47948015", "0.47931558", "0.47222635", "0.4714857", "0.4712519", "0.47014266", "0.4672679", "0.46672386", "0.4655354",...
0.66929066
0
TODO: Fix decently Parses float datatypes (double, float). All invalid lexical values return undefined.
function parseXSDFloat(value) { const numb = Number(value); if (isNaN(numb)) { if (value === 'NaN') { return NaN; } if (value === 'INF') { return Infinity; } if (value === '-INF') { return -Infinity; } return undefined; ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function parseF(s) {\n // if (typeof(parseInt(s)) === \"number\"){\n // return parseFloat(s)\n \n // }else{\n // return null\n // }\n \n if ( isNaN(parseFloat(s) )) {\n return null\n } else{\n return parseFloat(s)\n }\n \n \n }"...
[ "0.72205085", "0.68809927", "0.6863686", "0.66477805", "0.6596035", "0.6582489", "0.65747726", "0.6560437", "0.6528845", "0.63463503", "0.63310534", "0.6288162", "0.62704104", "0.62303275", "0.62128985", "0.61991644", "0.6180959", "0.61806446", "0.6145972", "0.6135328", "0.61...
0.67249256
3
Parses decimal datatypes (decimal, int, byte, nonPositiveInteger, etc...). All other values, including NaN, INF, and floating point numbers all return undefined;
function parseXSDDecimal(value) { if (/^(\-|\+)?([0-9]+(\.[0-9]+)?)$/.test(value)) { const numb = Number(value); return (isNaN(numb)) ? undefined : numb; } return undefined; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function parseF(s) {\n // if (typeof(parseInt(s)) === \"number\"){\n // return parseFloat(s)\n \n // }else{\n // return null\n // }\n \n if ( isNaN(parseFloat(s) )) {\n return null\n } else{\n return parseFloat(s)\n }\n \n \n }"...
[ "0.64991283", "0.63037163", "0.62819946", "0.61697614", "0.6121487", "0.607869", "0.6052337", "0.60495883", "0.6027064", "0.6018901", "0.5999643", "0.5972981", "0.5963758", "0.59158677", "0.59135085", "0.5905127", "0.58881044", "0.5878203", "0.58168924", "0.57938516", "0.5774...
0.64487064
1
Parses integer datatypes (decimal, int, byte, nonPositiveInteger, etc...). All other values, including NaN, INF, and floating point numbers all return undefined;
function parseXSDInteger(value) { if (/^(\-|\+)?([0-9]+)$/.test(value)) { const numb = Number(value); return (isNaN(numb)) ? undefined : numb; } return undefined; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function parse_int(value)\n{\n var value_int = parseInt(value);\n if (isNaN(value_int)) \n {\n console.error(\"value must be an integer\");\n }\n return value_int;\n}", "function integer(node) {\n return isCalc(node) ||\n (node.data.type === 'Number' && node.data.value.indexOf('.') === -1);\...
[ "0.6686079", "0.6225178", "0.6151289", "0.609988", "0.6054445", "0.6003211", "0.5996102", "0.5976918", "0.59670305", "0.5940066", "0.59291494", "0.59194905", "0.58923304", "0.58849007", "0.5882968", "0.58773255", "0.5870792", "0.58642155", "0.5859776", "0.5849261", "0.5840804...
0.60999143
3
Parses ISO date or date time strings into it's parts. I found no lib providing this functionality online, but it's needed heavily by the spec (functions on dates), using any form of JS DateTime will lose the original timezone notation. Example strings: "20110110T14:45:13.81505:00" "20110110T14:45:13.815Z" "20110110T14:...
function parseXSDDateTime(value) { const posT = value.indexOf('T'); const date = posT >= 0 ? value.substr(0, posT) : value; const [year, month, day] = date.split('-'); let hours = ''; let minutes = ''; let seconds = ''; let timezone = ''; if (posT >= 0) { const timeAndTimeZone = ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function parseISO8601(str) {\n var parts = str.split('T');\n dateParts = parts[0].split('-');\n timeParts = parts[1].split('Z');\n timeSubParts = timeParts[0].split(':');\n timeSecParts = timeSubParts[2].split('.');\n timeHours = Number(timeSubParts[0]);\n var _date...
[ "0.70841557", "0.6561586", "0.6514017", "0.65131736", "0.65094644", "0.6465232", "0.6451082", "0.64433295", "0.6418629", "0.6414974", "0.6414974", "0.6414974", "0.6414974", "0.6414974", "0.63709456", "0.6313928", "0.6313928", "0.6313928", "0.6313928", "0.63115716", "0.6311571...
0.6136231
52
Checks whether the object is a string
function isString(object) { return typeof object === 'string'; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function isString(object) {\n return typeof object === 'string' || object instanceof String;\n }", "__is_string(value) {\n return typeof value === 'string' || value instanceof String;\n }", "function isString(obj) {\n return Object.prototype.toString.call(obj) === '[object String]'...
[ "0.81335664", "0.8087084", "0.8075263", "0.8057575", "0.8045233", "0.8045233", "0.80265874", "0.80188483", "0.7991323", "0.7971817", "0.7955277", "0.79216075", "0.7915536", "0.790794", "0.78879476", "0.7885841", "0.7880131", "0.78448045", "0.7841318", "0.7840033", "0.78220224...
0.82849884
0
Checks whether the object is a Term
function isTerm(object) { return !!object.termType; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "static isTerm(term) {\n return term.termType !== undefined && term.termType !== 'Wildcard';\n }", "_is(term) {\n return (this._optionsService.options.termName + '').indexOf(term) === 0;\n }", "function isLiteral(term) {\n return !!term && term.termType === 'Literal';\n}", "function isNam...
[ "0.7662763", "0.62043184", "0.596575", "0.5761338", "0.5651524", "0.56481886", "0.563673", "0.55870956", "0.5427635", "0.5407089", "0.54063565", "0.54063565", "0.5338939", "0.5338939", "0.5305886", "0.5300428", "0.53001314", "0.5289609", "0.5253374", "0.5250718", "0.5250718",...
0.86667705
0
Maps the array with the given function, and joins the results using the separator
function mapJoin(array, sep, func, self) { return array.map(func, self).join(isString(sep) ? sep : ' '); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function mapJoin(arr, sep, foo){\n if (foo === undefined){\n foo = sep;\n sep = \"\";\n }\n return $.map(arr, foo).join(sep);\n}", "function join(array, string) {}", "function joined(array) {\n return array.join();\n}", "function join(array, sep) {\r\n\tvar out = '';\r\n\tArray.prototype.forEach.ca...
[ "0.75679696", "0.66495895", "0.66039634", "0.6382993", "0.62879765", "0.62879765", "0.6212825", "0.6207926", "0.619527", "0.61620975", "0.61533844", "0.6127569", "0.610796", "0.610796", "0.60990924", "0.6091231", "0.60859555", "0.6083934", "0.60749835", "0.60742176", "0.60623...
0.8329472
0
Returns a lowercase version of the given string
function lowercase(string) { return string.toLowerCase(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function lowercase(string) {\n\t return string.toLowerCase();\n\t }", "function lowercase (str) {\n return str.toLowerCase();\n}", "function whisper(string){ return string.toLowerCase() }", "function lowercase(input) {}", "function lower_case(str){\n return str.toLowerCase();\n}", "function lower...
[ "0.85692686", "0.83262366", "0.8183374", "0.8178347", "0.81679416", "0.81679416", "0.81076723", "0.80079025", "0.79257834", "0.7904478", "0.7904478", "0.79001784", "0.7877104", "0.782011", "0.77915275", "0.77915275", "0.77915275", "0.7778605", "0.7768338", "0.7752521", "0.771...
0.84532267
2
Appends the item to the array and returns the array
function appendTo(array, item) { return array.push(item), array; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function appendTo(array, item) {\n\t return array.push(item), array;\n\t }", "function appendToArray(item, array) {\n return [...array, item];\n}", "push(item) {\n array.push(item)\n }", "push(item) {\n this._array.push(item)\n }", "push(item) {\r\n this.array[this.a...
[ "0.82403165", "0.7846276", "0.7787438", "0.7548133", "0.7507622", "0.7312515", "0.723647", "0.7234769", "0.7234769", "0.72164035", "0.7148103", "0.7077197", "0.70745903", "0.70717543", "0.70653415", "0.7031181", "0.7014209", "0.6999878", "0.69495475", "0.6849633", "0.67751956...
0.8142365
2
Appends the items to the array and returns the array
function appendAllTo(array, items) { return array.push.apply(array, items), array; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function appendAllTo(array, items) {\n\t return array.push.apply(array, items), array;\n\t }", "function addAllToArray(items,arr){for(var i=0;i<items.length;i++){arr.push(items[i]);}}", "function append (items) {\n\n\t\tif (Array.isArray(items)) return push(items);\n\n\t\treturn push([items]);\n\n\t}", "...
[ "0.7931591", "0.7754413", "0.7522071", "0.749916", "0.7414739", "0.7414739", "0.72915816", "0.7261932", "0.7261932", "0.7261932", "0.7197202", "0.7197202", "0.700477", "0.69857776", "0.6966253", "0.69443744", "0.676373", "0.6689316", "0.6574147", "0.6557016", "0.65500456", ...
0.786394
2
Extends a base object with properties of other objects
function extend(base) { if (!base) base = {}; for (var i = 1, l = arguments.length, arg; i < l && (arg = arguments[i] || {}); i++) for (var name in arg) base[name] = arg[name]; return base; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function extend(base, props) {\n for (let i in props) if (props.hasOwnProperty(i)) base[i] = props[i];\n return base;\n}", "function extend(baseObj, extObj) {\n for (var k in extObj) {\n if (!extObj.hasOwnProperty(k))\n continue;\n assert(!baseObj.hasOwnProperty(k));...
[ "0.7576406", "0.7019875", "0.69388694", "0.6905738", "0.6880568", "0.6832831", "0.6814191", "0.6795859", "0.6785217", "0.6767036", "0.6741747", "0.6741718", "0.6731259", "0.6718046", "0.6681117", "0.66484416", "0.66120726", "0.6609855", "0.660793", "0.66001344", "0.6594577", ...
0.6569915
26
Creates an array that contains all items of the given arrays
function unionAll() { var union = []; for (var i = 0, l = arguments.length; i < l; i++) union = union.concat.apply(union, arguments[i]); return union; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function __spreadArrays() {\n for (var s = 0, i = 0, il = arguments.length; i < il; i++) s += arguments[i].length;\n const r = Array(s);\n var k = 0;\n for (i = 0; i < il; i++) for (let a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++) r[k] = a[j];\n return r;\n }", ...
[ "0.7061279", "0.69532305", "0.693975", "0.68387496", "0.68262625", "0.6790276", "0.6790276", "0.6790276", "0.6790276", "0.6790276", "0.6790276", "0.6790276", "0.6790276", "0.6790276", "0.6790276", "0.6790276", "0.67665535", "0.67665535", "0.67665535", "0.67665535", "0.6766553...
0.0
-1
Resolves an IRI against a base path
function resolveIRI(iri) { // Strip off possible angular brackets if (iri[0] === '<') iri = iri.substring(1, iri.length - 1); // Return absolute IRIs unmodified if (/^[a-z]+:/.test(iri)) return iri; if (!Parser.base) throw new Error('Cannot resolve relative IRI ' + iri + ' because ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function resolveIRI(iri) {\n\t // Strip off possible angular brackets\n\t if (iri[0] === '<') iri = iri.substring(1, iri.length - 1);\n\t // Return absolute IRIs unmodified\n\t if (/^[a-z]+:/.test(iri)) return iri;\n\t if (!Parser.base) throw new Error('Cannot resolve relative IRI ' + iri + ' becaus...
[ "0.7910162", "0.7600061", "0.7593703", "0.7453093", "0.7453093", "0.7057669", "0.67941755", "0.65990627", "0.6586793", "0.6586793", "0.6586793", "0.6586793", "0.63147527", "0.6187218", "0.61550915", "0.6096779", "0.6061193", "0.5927204", "0.58789045", "0.58622575", "0.5739715...
0.7868286
2
If the item is a variable, ensures it starts with a question mark
function toVar(variable) { if (variable) { var first = variable[0]; if (first === '?' || first === '$') return Parser.factory.variable(variable.substr(1)); } return variable; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function isVar(s) {\r\n return s.charAt(0) == '?';\r\n}", "function isVar(t) { return t[0] == '$'; }", "function ensureQuestion(s) {\r\n if (s.includes('?')) return s\r\n else return `${s}?`\r\n}", "function quotewrapIfNeeded(part) {\n if (part[0] === '?') return part;\n if (['true','false','nil'].ind...
[ "0.6801031", "0.5920605", "0.58757555", "0.55784345", "0.5556889", "0.553746", "0.5484389", "0.54339325", "0.5353719", "0.5328108", "0.52496123", "0.5236139", "0.52117556", "0.52097005", "0.52097005", "0.52097005", "0.52097005", "0.5195231", "0.516315", "0.51294196", "0.50959...
0.5356421
8
Creates an operation with the given name and arguments
function operation(operatorName, args) { return { type: 'operation', operator: operatorName, args: args || [] }; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function operation(operatorName, args) {\n\t return { type: 'operation', operator: operatorName, args: args || [] };\n\t }", "function vipsOperationNew (name) {\n return libvips.vips_operation_new(name);\n }", "function op(id, nargs) {\n return function() {\n var r = new Operation(id);\n ...
[ "0.78176534", "0.6737772", "0.6635716", "0.62092316", "0.61689675", "0.60816", "0.5968417", "0.58655906", "0.5838484", "0.5809391", "0.56576836", "0.5590192", "0.5590192", "0.556198", "0.55390364", "0.5511835", "0.550811", "0.550811", "0.54981667", "0.5481683", "0.5481683", ...
0.7971816
1
Creates an expression with the given type and attributes
function expression(expr, attr) { var expression = { expression: expr === '*'? new Wildcard() : expr }; if (attr) for (var a in attr) expression[a] = attr[a]; return expression; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function expression(expr, attr) {\n var expression = { expression: expr };\n if (attr)\n for (var a in attr)\n expression[a] = attr[a];\n return expression;\n }", "function expression(expr, attr) {\n\t var expression = { expression: expr };\n\t if (attr) for (var a in attr) {\n\t ...
[ "0.67717767", "0.65573525", "0.58180404", "0.58104634", "0.5688324", "0.5650085", "0.5488722", "0.5421579", "0.54189205", "0.5395454", "0.5395454", "0.5395454", "0.5395454", "0.5387489", "0.537514", "0.5374428", "0.5374428", "0.5374428", "0.5374428", "0.5374428", "0.5374428",...
0.6320521
2
Creates a path with the given type and items
function path(type, items) { return { type: 'path', pathType: type, items: items }; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function path(type, items) {\n\t return { type: 'path', pathType: type, items: items };\n\t }", "build_paths() {\n return {\n items: {\n list: { // Returns a list of items\n method: \"GET\",\n path: \"[path]\", \n ...
[ "0.84729826", "0.6196831", "0.58023185", "0.5758501", "0.5539217", "0.5506044", "0.5426296", "0.5406177", "0.53970915", "0.5375089", "0.53055865", "0.5305352", "0.5237434", "0.5237434", "0.5237434", "0.5235125", "0.51921844", "0.51524574", "0.514502", "0.5144224", "0.5064369"...
0.85707563
1
Transforms a list of operations types and arguments into a tree of operations
function createOperationTree(initialExpression, operationList) { for (var i = 0, l = operationList.length, item; i < l && (item = operationList[i]); i++) initialExpression = operation(item[0], [initialExpression, item[1]]); return initialExpression; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function createOperationTree(initialExpression, operationList) {\n\t for (var i = 0, l = operationList.length, item; i < l && (item = operationList[i]); i++) {\n\t initialExpression = operation(item[0], [initialExpression, item[1]]);\n\t }return initialExpression;\n\t }", "toIndexedTree() {\r\n ...
[ "0.67890495", "0.55838025", "0.5485589", "0.5461245", "0.5458818", "0.54020786", "0.53660184", "0.5334887", "0.5334573", "0.5303982", "0.53009295", "0.52848494", "0.52685124", "0.5267561", "0.5261234", "0.5255672", "0.52514756", "0.5231287", "0.5230366", "0.5227622", "0.52221...
0.68775815
1
Group datasets by default and named
function groupDatasets(fromClauses, groupName) { var defaults = [], named = [], l = fromClauses.length, fromClause, group = {}; if (!l) return null; for (var i = 0; i < l && (fromClause = fromClauses[i]); i++) (fromClause.named ? named : defaults).push(fromClause.iri); group[groupName || 'fr...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function groupDatasets(fromClauses) {\n\t var defaults = [],\n\t named = [],\n\t l = fromClauses.length,\n\t fromClause;\n\t for (var i = 0; i < l && (fromClause = fromClauses[i]); i++) {\n\t (fromClause.named ? named : defaults).push(fromClause.iri);\n\t }return l ? { from: { de...
[ "0.6508125", "0.6454066", "0.6213973", "0.61990476", "0.60487145", "0.58880484", "0.58799726", "0.5864896", "0.5803347", "0.5686417", "0.5684988", "0.56771433", "0.5672462", "0.5636213", "0.5567661", "0.55518824", "0.5505898", "0.5467452", "0.5441883", "0.54289347", "0.539466...
0.6831472
0
Converts the number to a string
function toInt(string) { return parseInt(string, 10); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function numberToString(num) {\nreturn String(num)\n}", "function numberToString(num) {\n return num.toString();\n }", "function numberToString(num) {\n return num.toString()\n}", "function numberToString(num) {\n return num.toString()\n}", "function numberToString(num) {\n // Return a string of t...
[ "0.8603246", "0.85296386", "0.83971685", "0.83971685", "0.8346059", "0.81931335", "0.8057878", "0.79262704", "0.78966725", "0.78491676", "0.78369", "0.77984285", "0.77378654", "0.76798594", "0.7647431", "0.76357955", "0.7618548", "0.75961536", "0.7578389", "0.75622255", "0.74...
0.0
-1
Transforms a possibly single group into its patterns
function degroupSingle(group) { return group.type === 'group' && group.patterns.length === 1 ? group.patterns[0] : group; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function degroupSingle(group) {\n\t return group.type === 'group' && group.patterns.length === 1 ? group.patterns[0] : group;\n\t }", "function list_to_groups(list) {\r\n\r\n\t// if our list is a single item, just return it\r\n\tif (list.length === 1)\r\n\t\treturn [list];\r\n\r\n // setup our postfix of Xs...
[ "0.6536368", "0.60980725", "0.5691542", "0.56728846", "0.5648782", "0.5588244", "0.545807", "0.542655", "0.5413974", "0.528408", "0.52440226", "0.5198406", "0.5191484", "0.51653326", "0.50905645", "0.5041131", "0.4984435", "0.49617618", "0.49556053", "0.48452917", "0.48407072...
0.64850634
2
Creates a literal with the given value and type
function createTypedLiteral(value, type) { if (type && type.termType !== 'NamedNode'){ type = Parser.factory.namedNode(type); } return Parser.factory.literal(value, type); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function createLiteral(value, type) {\n return '\"' + value + '\"^^' + type;\n }", "function createLiteral(value, type) {\n\t return '\"' + value + '\"^^' + type;\n\t }", "function lit(value) { return new TLiteral(value); }", "function lit(value) { return new TLiteral(value); }", "Literal(value, op...
[ "0.84696716", "0.83906525", "0.77032804", "0.77032804", "0.7477487", "0.73535305", "0.67829716", "0.6745328", "0.6701603", "0.6362743", "0.63339746", "0.6197845", "0.61460984", "0.61460984", "0.6134858", "0.61348015", "0.60540843", "0.6016441", "0.5913648", "0.586695", "0.583...
0.8416168
1
Creates a literal with the given value and language
function createLangLiteral(value, lang) { return Parser.factory.literal(value, lang); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function lit(value) { return new TLiteral(value); }", "function lit(value) { return new TLiteral(value); }", "Literal(value, options = {}) {\r\n return { ...options, kind: exports.LiteralKind, const: value, type: typeof value };\r\n }", "function createLiteral(value, type) {\n\t return '\"' + va...
[ "0.7126923", "0.7126923", "0.6838755", "0.6644983", "0.6638159", "0.6530659", "0.6454081", "0.64077353", "0.6395759", "0.6105201", "0.60845006", "0.6063217", "0.60413796", "0.581784", "0.57117856", "0.56838655", "0.5638771", "0.56205684", "0.5580479", "0.5572661", "0.55521184...
0.84863573
0
Creates a triple with the given subject, predicate, and object
function triple(subject, predicate, object) { var triple = {}; if (subject != null) triple.subject = subject; if (predicate != null) triple.predicate = predicate; if (object != null) triple.object = object; return triple; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function triple(subject, predicate, object) {\n\t var triple = {};\n\t if (subject != null) triple.subject = subject;\n\t if (predicate != null) triple.predicate = predicate;\n\t if (object != null) triple.object = object;\n\t return triple;\n\t }", "function createTriple (object, predicate, subj...
[ "0.8810526", "0.84181154", "0.7546382", "0.6769437", "0.599539", "0.5730296", "0.57281625", "0.5706985", "0.563828", "0.5579048", "0.55548954", "0.554661", "0.5497417", "0.5329667", "0.53027856", "0.52993286", "0.5289036", "0.52838874", "0.52561164", "0.5216415", "0.5195575",...
0.8786889
2
Creates a new blank node
function blank(name) { if (typeof name === 'string') { // Only use name if a name is given if (name.startsWith('e_')) return Parser.factory.blankNode(name); return Parser.factory.blankNode('e_' + name); } return Parser.factory.blankNode('g_' + blankId++); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function blankNode(name) {\n return new BlankNode(name || `n3-${_blankNodeCounter++}`);\n}", "createBlankNode(suggestedName) {\n let name, index;\n // Generate a name based on the suggested name\n if (suggestedName) {\n name = suggestedName = `_:${suggestedName}`, index = 1;\n while (this._id...
[ "0.7696773", "0.7367787", "0.7358847", "0.72089404", "0.70093143", "0.6976044", "0.6949696", "0.6917838", "0.6885926", "0.6885926", "0.6885926", "0.6777837", "0.6777837", "0.6741998", "0.66960716", "0.6633974", "0.656995", "0.656995", "0.656995", "0.6566408", "0.65490615", ...
0.6014239
70
Translates escape codes in the string into their textual equivalent
function unescapeString(string, trimLength) { string = string.substring(trimLength, string.length - trimLength); try { string = string.replace(escapeSequence, function (sequence, unicode4, unicode8, escapedChar) { var charCode; if (unicode4) { charCode = parseInt(unicode4, 16); ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function recodeText (text) {\n\tif(text != null) {\n\t\treturn text.replace(new RegExp('&#39;', 'g'), '\\''); \n\t}\n}", "function interpretEscapes(str) {\n var escapes = {\n b: \"\\b\",\n f: \"\\f\",\n n: \"\\n\",\n r: \"\\r\",\n t: \"\\t\"\n };\n return str.replace(/...
[ "0.67450684", "0.66368014", "0.6524974", "0.64949226", "0.64591414", "0.6447732", "0.6431168", "0.6427182", "0.6305532", "0.6305532", "0.6235177", "0.6235177", "0.6231656", "0.6227858", "0.62104183", "0.6183401", "0.6164018", "0.6136917", "0.6136917", "0.6136917", "0.6117713"...
0.0
-1
Creates a list, collecting its (possibly blank) items and triples associated with those items
function createList(objects) { var list = blank(), head = list, listItems = [], listTriples, triples = []; objects.forEach(function (o) { listItems.push(o.entity); appendAllTo(triples, o.triples); }); // Build an RDF list out of the items for (var i = 0, j = 0, l = listItems.length, listTriples = Array...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function createList(objects) {\n var list = blank(), head = list, listItems = [], listTriples, triples = [];\n objects.forEach(function (o) { listItems.push(o.entity); appendAllTo(triples, o.triples); });\n\n // Build an RDF list out of the items\n for (var i = 0, j = 0, l = listItems.length, listTripl...
[ "0.6387449", "0.6297873", "0.6167607", "0.6010255", "0.57761085", "0.55233175", "0.5503082", "0.5448452", "0.5411532", "0.5409165", "0.5405333", "0.540509", "0.53986704", "0.5396111", "0.5396111", "0.53573567", "0.53522074", "0.53522074", "0.5309212", "0.5258033", "0.52165115...
0.63403463
1
Creates a blank node identifier, collecting triples with that blank node as subject
function createAnonymousObject(propertyList) { var entity = blank(); return { entity: entity, triples: propertyList.map(function (t) { return extend(triple(entity), t); }) }; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "static _resetBlankNodeIds() {\n blankNodePrefix = blankNodeCount = 0;\n }", "createHashToRelated(id, issuer) {\n // 1) Create a hash to related blank nodes map for storing hashes that\n // identify related blank nodes.\n const hashToRelated = new Map();\n\n // 2) Get a reference, quads, to the li...
[ "0.6040948", "0.59955406", "0.58059335", "0.5743537", "0.5708774", "0.563674", "0.5602197", "0.555929", "0.55568784", "0.553526", "0.55325097", "0.55179095", "0.5514776", "0.55124104", "0.55124104", "0.55124104", "0.54528445", "0.5419051", "0.53809136", "0.53703403", "0.53596...
0.0
-1
Collects all (possibly blank) objects, and triples that have them as subject
function objectListToTriples(predicate, objectList, otherTriples) { var objects = [], triples = []; objectList.forEach(function (l) { objects.push(triple(null, predicate, l.entity)); appendAllTo(triples, l.triples); }); return unionAll(objects, otherTriples || [], triples); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "getObjects(subject, predicate, graph) {\n const results = [];\n this.forObjects(o => {\n results.push(o);\n }, subject, predicate, graph);\n return results;\n }", "getSubjects(predicate, object, graph) {\n const results = [];\n this.forSubjects(s => {\n results.push(s);\n }, predi...
[ "0.6565237", "0.6496857", "0.63529944", "0.62599504", "0.5953965", "0.58001006", "0.5779815", "0.5582154", "0.5580006", "0.55744165", "0.5526125", "0.5490252", "0.5476017", "0.54134744", "0.54134744", "0.54134744", "0.54134744", "0.5358681", "0.5340165", "0.531039", "0.529374...
0.46288446
66
Simplifies groups by merging adjacent BGPs
function mergeAdjacentBGPs(groups) { var merged = [], currentBgp; for (var i = 0, group; group = groups[i]; i++) { switch (group.type) { // Add a BGP's triples to the current BGP case 'bgp': if (group.triples.length) { if (!currentBgp) appendTo(merged, c...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function mergeAdjacentBGPs(groups) {\n\t var merged = [],\n\t currentBgp;\n\t for (var i = 0, group; group = groups[i]; i++) {\n\t switch (group.type) {\n\t // Add a BGP's triples to the current BGP\n\t case 'bgp':\n\t if (group.triples.length) {\n\t if (!current...
[ "0.63835156", "0.60604453", "0.5917088", "0.56281096", "0.55835134", "0.55548453", "0.5548565", "0.5548565", "0.5548565", "0.5548565", "0.5548565", "0.55215496", "0.5450193", "0.5417765", "0.5405366", "0.54004586", "0.53973097", "0.5357317", "0.5323703", "0.5305661", "0.51741...
0.6420219
1
oldstyle streams. Note that the pipe method (the only relevant part of this class) is overridden in the Readable class.
function Stream() { EE.call(this); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function pipe(stream) {\n var cache, scope = this;\n if(stream) {\n // add to the pipeline\n this.fuse(stream);\n // ensure return values are also added to the pipeline\n cache = stream.pipe;\n stream.pipe = function(/* dest */) {\n // restore cached method when called\n this.pipe = cach...
[ "0.73908746", "0.71913165", "0.6899017", "0.65345687", "0.64905894", "0.6412076", "0.63113976", "0.6288661", "0.6281867", "0.6281867", "0.62327176", "0.621264", "0.6196437", "0.61819327", "0.61819327", "0.61383355", "0.6125989", "0.6102577", "0.6102577", "0.6085285", "0.60457...
0.0
-1
don't leave dangling pipes when there are errors.
function onerror(er) { cleanup(); if (EE.listenerCount(this, 'error') === 0) { throw er; // Unhandled stream error in pipe. } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function brokenPipe() {\n throw Error('artoo.asyncStore: broken pipe.');\n }", "function onerror(error) {\n cleanup();\n if (!hasListeners(this, 'error'))\n throw error; // Unhandled stream error in pipe.\n }", "function onerror(er){debug(\"onerror\",er);unpipe();dest.removeListener(\"e...
[ "0.69866925", "0.6516497", "0.6399389", "0.6383316", "0.63701004", "0.63701004", "0.63701004", "0.63701004", "0.63701004", "0.6333437", "0.6292604", "0.6285128", "0.6285128", "0.6274714", "0.6233449", "0.62333864", "0.6221305", "0.62146306", "0.62146306", "0.62146306", "0.621...
0.0
-1
remove all the event listeners that were added.
function cleanup() { source.removeListener('data', ondata); dest.removeListener('drain', ondrain); source.removeListener('end', onend); source.removeListener('close', onclose); source.removeListener('error', onerror); dest.removeListener('error', onerror); source.removeListener('end', cle...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "removeListeners() {}", "removeListeners() {}", "removeListeners() {}", "function removeEventListeners(){\n _.forEach(unlistenCallbacks, function(unlisten){\n unlisten();\n });\n unlistenCallbacks = [];\n }", "_clearListeners() {\n for (let liste...
[ "0.8521039", "0.8521039", "0.8521039", "0.8423259", "0.8304111", "0.8296624", "0.8282094", "0.8274838", "0.82720345", "0.8261525", "0.81342524", "0.8060971", "0.8031993", "0.7983937", "0.7970812", "0.7962308", "0.7867754", "0.78554255", "0.7834158", "0.77878404", "0.77458024"...
0.0
-1
Checks if xhr.status is readable and nonzero, indicating no error. Even though the spec says it should be available in readyState 3, accessing it throws an exception in IE8
function statusValid (xhr) { try { var status = xhr.status return (status !== null && status !== 0) } catch (e) { return false } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function statusValid(xhr){try{var status=xhr.status;return status!==null&&status!==0;}catch(e){return false;}}", "function statusValid(xhr) {\n\t try {\n\t var status = xhr.status;\n\t return (status !== null && status !== 0)\n\t } catch (e) {\n\t return false\n\t }\n\t}", "function statusValid(xhr...
[ "0.76937664", "0.76416725", "0.76416725", "0.76416725", "0.76416725", "0.76205087", "0.7597381", "0.75907826", "0.7461493", "0.7454512", "0.7441791", "0.7441791", "0.68336713", "0.68336713", "0.644357", "0.6418898", "0.6388751", "0.6388751", "0.6388751", "0.6388751", "0.63887...
0.757996
52
changes to the function body.
function howMuchToRead(n, state) { if (n <= 0 || state.length === 0 && state.ended) return 0; if (state.objectMode) return 1; if (n !== n) { // Only flow one buffer at a time if (state.flowing && state.length) return state.buffer.head.data.length;else return state.length; } // If we're asking for more ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function funcionPorDefinicion(){\n //Body\n }", "function updateFunction() {\n \tupdatePreview();\n \tupdateHTMLCode();\n }", "function update()\n{\n\n}", "function update() {}", "function update() {\n \n}", "function updateroster() {\n\n}", "update()\n {\n \n }", "updateBodi...
[ "0.59476674", "0.571112", "0.5705222", "0.55671674", "0.5533744", "0.55332184", "0.552779", "0.552636", "0.55096877", "0.55064136", "0.54921454", "0.54918206", "0.5490372", "0.5468623", "0.5458237", "0.5458237", "0.5458237", "0.5458237", "0.5458237", "0.5458237", "0.5458237",...
0.0
-1
another read() call => stack overflow. This way, it might trigger a nextTick recursion warning, but that's not so bad.
function emitReadable(stream) { var state = stream._readableState; debug('emitReadable', state.needReadable, state.emittedReadable); state.needReadable = false; if (!state.emittedReadable) { debug('emitReadable', state.flowing); state.emittedReadable = true; process.nextTick(emitReadable_, stream);...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "_read () {}", "_read () {}", "_read () {}", "function maybeReadMore(stream,state){if(!state.readingMore){state.readingMore=true;processNextTick(maybeReadMore_,stream,state)}}", "function maybeReadMore(stream,state){if(!state.readingMore){state.readingMore=true;processNextTick(maybeReadMore_,stream,state);}...
[ "0.626577", "0.626577", "0.626577", "0.62439185", "0.6200748", "0.6200748", "0.6196876", "0.6192212", "0.6192212", "0.61863726", "0.61101025", "0.60128003", "0.60002357", "0.5995598", "0.5987771", "0.5983474", "0.5958133", "0.5958133", "0.5943919", "0.5939518", "0.5920619", ...
0.0
-1
and called read() to consume some data. that may have triggered in turn another _read(n) call, in which case reading = true if it's in progress. However, if we're not ended, or reading, and the length < hwm, then go ahead and try to read some more preemptively.
function maybeReadMore(stream, state) { if (!state.readingMore) { state.readingMore = true; process.nextTick(maybeReadMore_, stream, state); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function maybeReadMore(stream,state){if(!state.readingMore){state.readingMore=true;processNextTick(maybeReadMore_,stream,state)}}", "function maybeReadMore(stream,state){if(!state.readingMore){state.readingMore=true;processNextTick(maybeReadMore_,stream,state);}}", "function maybeReadMore(stream,state){if(!sta...
[ "0.70706564", "0.7041525", "0.7041525", "0.6816472", "0.6786889", "0.6749987", "0.6749987", "0.6725101", "0.671691", "0.6694657", "0.6694448", "0.6622471", "0.6567824", "0.6545125", "0.6545125", "0.6545125", "0.6545125", "0.6545125", "0.6545125", "0.6545125", "0.6545125", "...
0.0
-1
however, don't suppress the throwing behavior for this.
function onerror(er) { debug('onerror', er); unpipe(); dest.removeListener('error', onerror); if (EElistenerCount(dest, 'error') === 0) errorOrDestroy(dest, er); } // Make sure our error handler is attached before userland ones.
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function thrower(){throw new Error(\"this should not happen!\")}", "function noOp(err) { if (err) { throw err; } }", "function Exception() {\n return;\n}", "function m(a){throw a;}", "unsafelyUnwrap() {\n throw new Error('Tried to `unsafelyUnwrap an Err`');\n }", "function sc_raise(obj) {\n ...
[ "0.71079123", "0.684007", "0.6535454", "0.64002895", "0.6325121", "0.62838155", "0.6281719", "0.6187618", "0.6184551", "0.61353433", "0.6125935", "0.6123132", "0.6119185", "0.61027735", "0.609017", "0.6082322", "0.60812664", "0.6029196", "0.60273534", "0.59627336", "0.5948432...
0.0
-1
Both close and finish should trigger unpipe, but only once.
function onclose() { dest.removeListener('finish', onfinish); unpipe(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function onclose() {\n\t dest.removeListener('finish', onfinish);\n\t unpipe();\n\t }", "function onclose() {\n\t dest.removeListener('finish', onfinish);\n\t unpipe();\n\t }", "function onclose() {\n\t dest.removeListener('finish', onfinish);\n\t unpipe();\n\t }", "function onclose() {\...
[ "0.7979085", "0.7979085", "0.7979085", "0.7979085", "0.7979085", "0.7979085", "0.7979085", "0.7979085", "0.7979085", "0.7979085", "0.7979085", "0.7979085", "0.7979085", "0.7979085", "0.7979085", "0.7979085", "0.7979085", "0.7979085", "0.7979085", "0.7979085", "0.7979085", "...
0.0
-1
Pluck off n bytes from an array of buffers. Length is the combined lengths of all the buffers in the list. This function is designed to be inlinable, so please take care when making changes to the function body.
function fromList(n, state) { // nothing buffered if (state.length === 0) return null; var ret; if (state.objectMode) ret = state.buffer.shift();else if (!n || n >= state.length) { // read it all, truncate the list if (state.decoder) ret = state.buffer.join('');else if (state.buffer.length === 1) ret = ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function copyFromBuffer(n, list) {\n var ret = Buffer.allocUnsafe(n);\n var p = list.head;\n var c = 1;\n p.data.copy(ret);\n n -= p.data.length;\n\n while (p = p.next) {\n var buf = p.data;\n var nb = n > buf.length ? buf.length : n;\n buf.copy(ret, ret.length - n, 0, nb);\n n -= nb;\n\n if (...
[ "0.656465", "0.65632385", "0.65632385", "0.65632385", "0.65632385", "0.65632385", "0.65632385", "0.65632385", "0.65632385", "0.65632385", "0.65632385", "0.65632385", "0.65632385", "0.65632385", "0.65632385", "0.65632385", "0.65632385", "0.65632385", "0.65632385", "0.65632385", ...
0.0
-1
there will be only 2 of these for each stream
function CorkedRequest(state) { var _this = this; this.next = null; this.entry = null; this.finish = function () { onCorkedFinish(_this, state); }; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "extractStream(stream) {\n let cross_reference_length = this.w.reduce((a, b) => a + b, 0);\n // check if the data stream has a valid size\n if (stream.getLength() !== cross_reference_length * this.index.filter((v, i) => i % 2 === 1).reduce((a, b) => a + b, 0))\n throw Error(`Invalid ...
[ "0.61270493", "0.59082323", "0.5899411", "0.58675635", "0.57517487", "0.57407343", "0.5727185", "0.5727185", "0.5710692", "0.57069093", "0.5685656", "0.5685656", "0.5685656", "0.5670098", "0.5661119", "0.5633279", "0.56032485", "0.5597702", "0.5581764", "0.5571581", "0.556822...
0.0
-1
mode the stream is in. Currently this means that `null` is never accepted and undefined/nonstring values are only allowed in object mode.
function validChunk(stream, state, chunk, cb) { var er; if (chunk === null) { er = new ERR_STREAM_NULL_VALUES(); } else if (typeof chunk !== 'string' && !state.objectMode) { er = new ERR_INVALID_ARG_TYPE('chunk', ['string', 'Buffer'], chunk); } if (er) { errorOrDestroy(stream, er); process.n...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "checkMode(mode) {\n if (!mode) {\n mode = this.mode\n }\n return mode;\n }", "function modeReader () {\n streamE.run(readNBytes(1), function(mode) {\n mode = (mode[0] | 0);\n debug(\"Mode is: \" + mode);\n mode_handlers[mode]();\n });\n }", "set mode(val...
[ "0.61187315", "0.610447", "0.60131484", "0.5978206", "0.5962996", "0.5962996", "0.59339756", "0.59339756", "0.59339756", "0.5913275", "0.5913275", "0.5558502", "0.55156463", "0.5499229", "0.5486241", "0.5486241", "0.54750925", "0.54454786", "0.54382133", "0.54129416", "0.5338...
0.0
-1
if we're already writing something, then just put this in the queue, and wait our turn. Otherwise, call _write If we return false, then we need a drain event, so set that flag.
function writeOrBuffer(stream, state, isBuf, chunk, encoding, cb) { if (!isBuf) { var newChunk = decodeChunk(state, chunk, encoding); if (chunk !== newChunk) { isBuf = true; encoding = 'buffer'; chunk = newChunk; } } var len = state.objectMode ? 1 : chunk.length; state.length += ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function onwriteDrain(stream,state){if(state.length===0&&state.needDrain){state.needDrain=false;stream.emit('drain');}}// if there's something in the buffer waiting, then process it", "function onwriteDrain(stream,state){if(state.length===0&&state.needDrain){state.needDrain=false;stream.emit('drain');}}// if the...
[ "0.7145028", "0.7145028", "0.7145028", "0.7145028", "0.69738954", "0.69527036", "0.68903154", "0.68903154", "0.68903154", "0.68903154", "0.68903154", "0.68903154", "0.68903154", "0.68903154", "0.68903154", "0.68903154", "0.68903154", "0.68903154", "0.68903154", "0.68903154", ...
0.0
-1
emit 'drain' before the write() consumer gets the 'false' return value, and has a chance to attach a 'drain' listener.
function onwriteDrain(stream, state) { if (state.length === 0 && state.needDrain) { state.needDrain = false; stream.emit('drain'); } } // if there's something in the buffer waiting, then process it
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "onDrain() {\n this.writeBuffer.splice(0, this.prevBufferLen); // setting prevBufferLen = 0 is very important\n // for example, when upgrading, upgrade packet is sent over,\n // and a nonzero prevBufferLen could cause problems on `drain`\n\n this.prevBufferLen = 0;\n\n if (0 === this.writeBuffer.leng...
[ "0.7870829", "0.77944386", "0.77944386", "0.7785767", "0.7785767", "0.7778292", "0.7778292", "0.7778292", "0.7778292", "0.7758055", "0.7757028", "0.7645214", "0.7610808", "0.7606854", "0.75519705", "0.7536986", "0.7536986", "0.752122", "0.7472442", "0.74645877", "0.74645877",...
0.7626473
72
undocumented cb() API, needed for core, not for public API
function destroy(err, cb) { var _this = this; var readableDestroyed = this._readableState && this._readableState.destroyed; var writableDestroyed = this._writableState && this._writableState.destroyed; if (readableDestroyed || writableDestroyed) { if (cb) { cb(err); } else if (err) { if (!...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function callback() {}", "function callback() {}", "function callback() {}", "function callback() {}", "function callback() {}", "function callback(){}", "function cb () {\n\t\tcallback();\n\t}", "function callback(cb){\n\n cb(1);\n}", "function callbackDriver() {\n cb();\n }", "function _...
[ "0.7930102", "0.7930102", "0.7930102", "0.7930102", "0.7930102", "0.7879179", "0.77457297", "0.7326767", "0.7235456", "0.71511483", "0.71451867", "0.71451867", "0.71291524", "0.7034352", "0.7026779", "0.7000611", "0.69736856", "0.6935611", "0.69217", "0.68071514", "0.68071514...
0.0
-1
create a readable writable stream.
function through (write, end, opts) { write = write || function (data) { this.queue(data) } end = end || function () { this.queue(null) } var ended = false, destroyed = false, buffer = [], _ended = false var stream = new Stream() stream.readable = stream.writable = true stream.paused = false // stream.au...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function createWritableStdioStream (fd) {\n var stream;\n var tty_wrap = process.binding('tty_wrap');\n \n // Note stream._type is used for test-module-load-list.js\n \n switch (tty_wrap.guessHandleType(fd)) {\n case 'TTY':\n stream = new tty.WriteStream(fd);\n st...
[ "0.7064034", "0.7004365", "0.6987831", "0.69810146", "0.69725853", "0.6966904", "0.69605255", "0.6959157", "0.6956378", "0.6956378", "0.6937389", "0.6932869", "0.69327646", "0.69327646", "0.69327646", "0.69325763", "0.693211", "0.693211", "0.693211", "0.693211", "0.693211", ...
0.0
-1
encodes a character, if needed or not.
function encodeCharacter (chr) { var result = '', octets = utf8.encode(chr), octet, index; for (index = 0; index < octets.length; index += 1) { octet = octets.charCodeAt(index); result += '%' + (octet < 0x10 ? '0' : '') + octet.toSt...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function encode(char) {\n if (char == \"(\") {\n return \"%28\";\n }\n else if (char == \")\") {\n return \"%29\";\n }\n else if (char == \"=\") {\n return \"%3D\";\n }\n else {\n return encodeURIComponent(char);\n }\n}", "function encodeChar(ch, prefix) {\n ...
[ "0.72206044", "0.6917028", "0.68541294", "0.6789945", "0.66948766", "0.64860904", "0.62386906", "0.6223529", "0.6223529", "0.6200305", "0.6186669", "0.61793023", "0.61793023", "0.61589646", "0.61100614", "0.6099289", "0.60339355", "0.6031277", "0.6011292", "0.59911376", "0.59...
0.6879677
3
Reads as much as needed from the text, e.g. '%20' or '%C3%B6'. It does not decode!
function pctCharAt(text, startIndex) { var chr = text.charAt(startIndex); if (!isPercentDigitDigit(text, startIndex)) { return chr; } var utf8CharCode = parseHex2(text, startIndex + 1); var numBytes = utf8.numBytes(utf8CharCode); if (numBytes === 0) { ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function readString(){\n var len = readMultibyteInt31();\n checkLen(len);\n var res = buf.slice(pos, pos + len).toString(); //utf8\n pos += len;\n return res;\n }", "function readText(text) {\n return new Promise((resolve, reject) => {\n resolve(text);\n }).then(text => {\n return text;\n...
[ "0.58548105", "0.5651567", "0.5504582", "0.5488007", "0.5483799", "0.5470705", "0.54127985", "0.5410151", "0.54063076", "0.54025966", "0.5402026", "0.52709144", "0.5241499", "0.5238378", "0.52281946", "0.5179154", "0.5132013", "0.50838315", "0.50838315", "0.50838315", "0.5083...
0.0
-1
Returns if an character is an varchar character according 2.3 of rfc 6570
function isVarchar (chr) { return charHelper.isAlpha(chr) || charHelper.isDigit(chr) || chr === '_' || pctEncoder.isPctEncoded(chr); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function isVarchar (chr) {\r\n\t return charHelper.isAlpha(chr) || charHelper.isDigit(chr) || chr === '_' || pctEncoder.isPctEncoded(chr);\r\n\t }", "function isChar(c) {\n return (c >= 0x0001 && c <= 0xD7FF) ||\n (c >= 0xE000 && c <= 0xFFFD) ||\n (c >= 0x10000 && c <= 0x10FFFF);\n}", ...
[ "0.78211176", "0.7196601", "0.7030883", "0.69401455", "0.6810365", "0.65395766", "0.64389265", "0.64167005", "0.64066476", "0.63941777", "0.6385676", "0.63192916", "0.6310767", "0.63078076", "0.62952584", "0.6229425", "0.6228268", "0.6217573", "0.6217086", "0.61456436", "0.61...
0.78092587
2
helper function if JSON is not available
function prettyPrint (value) { return (JSON && JSON.stringify) ? JSON.stringify(value) : value; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function supportsJSON() {\n /*jshint eqnull:true */\n if (cachedJSON === undefined) {\n cachedJSON = (window.JSON != null);\n }\n return cachedJSON;\n }", "function checkJSON(json) {\n var data;\n try {\n data = JSON.parse(json)\n } catch (e) {\n // console.log(e);\n }...
[ "0.7166137", "0.7067795", "0.69499755", "0.6936929", "0.6933679", "0.6913507", "0.69112104", "0.67157066", "0.671492", "0.6662746", "0.66399693", "0.6602628", "0.6590114", "0.65078056", "0.65011543", "0.6477284", "0.6422073", "0.6419794", "0.6413162", "0.63883144", "0.6350348...
0.0
-1
format a parsed object into a url string
function urlFormat(obj) { // ensure it's an object, and not a string url. // If it's an obj, this is a no-op. // this way, you can call url_format() on strings // to clean up potentially wonky urls. if (util.isString(obj)) obj = urlParse(obj); if (!(obj instanceof Url)) return Url.prototype.format.call(obj)...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function urlFormat(obj) {\n\t // ensure it's an object, and not a string url.\n\t // If it's an obj, this is a no-op.\n\t // this way, you can call url_format() on strings\n\t // to clean up potentially wonky urls.\n\t if (util_11(obj)) obj = parse$1({}, obj);\n\t return format(obj);\n\t}", "function urlFo...
[ "0.7634554", "0.7633261", "0.76041514", "0.7599994", "0.75834167", "0.7559971", "0.7553888", "0.7549819", "0.7520917", "0.7520917", "0.74891424", "0.74868375", "0.74493414", "0.74185044", "0.74185044", "0.74185044", "0.74185044", "0.74185044", "0.74185044", "0.74185044", "0.7...
0.0
-1
NOTE: These type checking functions intentionally don't use `instanceof` because it is fragile and can be easily faked with `Object.create()`.
function isArray(ar) { return Array.isArray(ar); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function isOfType(obj, type) {\n obj = Object(obj)\n return typeof type === \"string\"\n ? obj.constructor.name === type\n : obj instanceof type\n}", "function isType(obj, type) {\n return obj instanceof type\n}", "function isObj$1(something) {\n return typeDetect(something) === 'Object';\n}", "functio...
[ "0.6396991", "0.63861895", "0.63591105", "0.63443595", "0.6317676", "0.62964934", "0.62762535", "0.6270167", "0.6231509", "0.62192965", "0.62044406", "0.6203475", "0.6195454", "0.61597985", "0.6112276", "0.6052508", "0.6039141", "0.6038106", "0.60231054", "0.60187584", "0.601...
0.0
-1
Browsercompatible JavaScript MD5 Modification of JavaScript MD5 Copyright 2011, Sebastian Tschan Licensed under the MIT license: Based on A JavaScript implementation of the RSA Data Security, Inc. MD5 Message Digest Algorithm, as defined in RFC 1321. Version 2.2 Copyright (C) Paul Johnston 1999 2009 Other contributors:...
function md5(bytes) { if (typeof bytes == 'string') { var msg = unescape(encodeURIComponent(bytes)); // UTF8 escape bytes = new Array(msg.length); for (var i = 0; i < msg.length; i++) bytes[i] = msg.charCodeAt(i); } return md5ToHexEncodedArray(wordsToMd5(bytesToWords(bytes), bytes.length * 8)); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function md5(inputString) {\n var hc=\"0123456789abcdef\";\n function rh(n) {var j,s=\"\";for(j=0;j<=3;j++) s+=hc.charAt((n>>(j*8+4))&0x0F)+hc.charAt((n>>(j*8))&0x0F);return s;}\n function ad(x,y) {var l=(x&0xFFFF)+(y&0xFFFF);var m=(x>>16)+(y>>16)+(l>>16);return (m<<16)|(l&0xFFFF);}\n function rl(n,c) ...
[ "0.7751405", "0.73933685", "0.73211837", "0.73211837", "0.7314416", "0.727625", "0.7202905", "0.71807706", "0.7162115", "0.7112084", "0.7111277", "0.70852625", "0.70073986", "0.7005038", "0.700414", "0.70024115", "0.6997896", "0.69821227", "0.69797575", "0.6976034", "0.696768...
0.0
-1
Convert an array of littleendian words to an array of bytes
function md5ToHexEncodedArray(input) { var i; var x; var output = []; var length32 = input.length * 32; var hexTab = '0123456789abcdef'; var hex; for (i = 0; i < length32; i += 8) { x = input[i >> 5] >>> i % 32 & 0xff; hex = parseInt(hexTab.charAt(x >>> 4 & 0x0f) + hexTab.charAt(x & 0x0f), 16); ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function wa2ba(wordArray) {\n var byteArray = [];\n for (var i = 0; i < wordArray.length; ++i) {\n var word = wordArray[i];\n for (var j = 3; j >= 0; --j) {\n byteArray.push(word >> 8 * j & 0xFF);\n }\n }\n return byteArray;\n}", "function wordToByteArray(wordArray) {\r\n var byteArray = [],...
[ "0.74311304", "0.7377965", "0.6978904", "0.69652945", "0.68019044", "0.68019044", "0.68019044", "0.68019044", "0.68019044", "0.68019044", "0.66885895", "0.66868466", "0.66868466", "0.66868466", "0.66868466", "0.666767", "0.66198117", "0.65957075", "0.6590385", "0.65828687", "...
0.0
-1
Calculate the MD5 of an array of littleendian words, and a bit length.
function wordsToMd5(x, len) { /* append padding */ x[len >> 5] |= 0x80 << len % 32; x[(len + 64 >>> 9 << 4) + 14] = len; var i; var olda; var oldb; var oldc; var oldd; var a = 1732584193; var b = -271733879; var c = -1732584194; var d = 271733878; for (i = 0; i < x.length; i += 16) { olda...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function binl_md5 (x, len) {\n\t /* append padding */\n\t x[len >> 5] |= 0x80 << (len % 32)\n\t x[(((len + 64) >>> 9) << 4) + 14] = len\n\t\n\t var i\n\t var olda\n\t var oldb\n\t var oldc\n\t var oldd\n\t var a = 1732584193\n\t var b = -271733879\n\t var c = -1732584194\n\t var...
[ "0.77541673", "0.77541673", "0.7711468", "0.7711468", "0.769378", "0.76609445", "0.764113", "0.7627985", "0.7625578", "0.762372", "0.762372", "0.7616212", "0.7613274", "0.7613274", "0.7601431", "0.75948286", "0.7581376", "0.7568087", "0.75637054", "0.7548342", "0.754634", "...
0.7394261
41