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
Returns the position of the head as [X,Y,Z]. If headMatrix is not specified, we use the current orientation of the headset.
positionOfHeadMatrix(headMatrix) { console.warn('positionOfHeadMatrix is deprecated. Please use position instead'); const matrix = headMatrix || this.headMatrix; return VrMath.getTranslation(matrix); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "headPos() {\n // FIXME this is way suboptimal as it forces computation\n this.head().getTransformNode().computeWorldMatrix(true);\n var headPos = this.head().getTransformNode().getAbsolutePosition();\n return headPos.clone();\n }", "position() {\n return VrMath.getTranslation(this.headMatrix);\n ...
[ "0.74438447", "0.72550523", "0.6644323", "0.6347168", "0.6166382", "0.5918669", "0.586256", "0.5745006", "0.5705567", "0.55667275", "0.5471313", "0.54461926", "0.53599906", "0.5325453", "0.5246352", "0.5244344", "0.52265346", "0.5221299", "0.51568925", "0.5155132", "0.5102851...
0.70516104
2
Returns the rotation as Euler angles in radians. If headMatrix is not specified, we use the current orientation of the headset. If eulerOrder is not specified, we use `YXZ` order, that is Yaw, Pitch, and Roll.
rotationOfHeadMatrix(headMatrix, eulerOrder) { console.warn( 'rotationOfHeadMatrix is deprecated. Please use rotation, rotationInRadians, ' + 'yawPitchRoll or yawPitchRollInRadians instead' ); const matrix = headMatrix || this.headMatrix; return VrMath.getRotation(matrix, eulerOrder); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "rotationInRadians() {\n return VrMath.getRotation(this.headMatrix);\n }", "rotate(model, axis, degree) {\r\n let axes = [\r\n new Float32Array([1, 0, 0]),\r\n new Float32Array([0, 1, 0]),\r\n new Float32Array([0, 0, 1])\r\n ];\r\n axis = Number(axis);\r\n...
[ "0.7031221", "0.64086646", "0.6407163", "0.62615186", "0.6238468", "0.59771687", "0.5880289", "0.58052707", "0.57487863", "0.5694399", "0.5671779", "0.5597263", "0.5545508", "0.5541369", "0.55211866", "0.54816115", "0.54334927", "0.5427946", "0.54155815", "0.5394738", "0.5389...
0.73739314
0
Return the position of the head as [X,Y,Z].
position() { return VrMath.getTranslation(this.headMatrix); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "headPos() {\n // FIXME this is way suboptimal as it forces computation\n this.head().getTransformNode().computeWorldMatrix(true);\n var headPos = this.head().getTransformNode().getAbsolutePosition();\n return headPos.clone();\n }", "readPosition() {\r\n\t\tconst x = this.data.readFloatLE();\r\n\t\tc...
[ "0.7622396", "0.71226764", "0.68480134", "0.673724", "0.661587", "0.658238", "0.65213454", "0.65039194", "0.6491331", "0.64091134", "0.64036053", "0.6375737", "0.6321431", "0.631328", "0.6288791", "0.6279928", "0.62200207", "0.6219955", "0.6186166", "0.6186166", "0.6186166", ...
0.7437649
1
Returns the rotation as Euler angles in degrees. Returns an array in the form: [rotation about X axis, rotation about Y axis, rotation about Z axis]
rotation() { return this.rotationInRadians().map(VrMath.radToDeg); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function zxyRotationToEuler(R) {\n let phi = math.asin(R.get([1,2]));\n let psi = math.atan2(-R.get([1,0])/math.cos(phi), R.get([1,1])/math.cos(phi));\n let theta = math.atan2(-R.get([0,2])/math.cos(phi), R.get([2,2])/math.cos(phi));\n return [phi, theta, psi];\n}", "euler(node) {\n return node.rotationQu...
[ "0.7524556", "0.68689656", "0.68468046", "0.66210943", "0.6611142", "0.65979797", "0.65485346", "0.651444", "0.6477254", "0.6453545", "0.63110965", "0.62949616", "0.62499964", "0.6243129", "0.62348896", "0.62288684", "0.62170964", "0.6213631", "0.6213583", "0.6212958", "0.616...
0.7036981
1
Returns the rotation as Euler angles in degrees. Returns an array in the form: [rotation about X axis, rotation about Y axis, rotation about Z axis]
rotationInRadians() { return VrMath.getRotation(this.headMatrix); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function zxyRotationToEuler(R) {\n let phi = math.asin(R.get([1,2]));\n let psi = math.atan2(-R.get([1,0])/math.cos(phi), R.get([1,1])/math.cos(phi));\n let theta = math.atan2(-R.get([0,2])/math.cos(phi), R.get([2,2])/math.cos(phi));\n return [phi, theta, psi];\n}", "rotation() {\n return this.rotationInR...
[ "0.752445", "0.7036537", "0.68710226", "0.68477285", "0.66207695", "0.6610884", "0.659936", "0.65154123", "0.6477188", "0.64546186", "0.63086814", "0.629331", "0.6251431", "0.6243432", "0.62364036", "0.6227811", "0.62181264", "0.6215257", "0.62142414", "0.6213805", "0.6163111...
0.65484893
7
Return the rotation in yaw, pitch, roll order in degrees. For those new to 3D graphics and who are not former pilots: Yaw = looking up and down Pitch = looking to the left and right Roll = tilting your head from side to side Returns an array of rotations in the form: [Y axis, X axis, Z axis]
yawPitchRoll() { return this.yawPitchRollInRadians().map(VrMath.radToDeg); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "yawPitchRollInRadians() {\n const rotation = this.rotationInRadians();\n return [rotation[1], rotation[0], rotation[2]];\n }", "rotation() {\n return this.rotationInRadians().map(VrMath.radToDeg);\n }", "setFromAxisRotations(roll, pitch, yaw) {\nvar D2R_BY2, RPY_by2, cp, cr, cy, cycp, cysp, rpy, rpy...
[ "0.8107617", "0.7145033", "0.67586666", "0.66824883", "0.66061467", "0.66023254", "0.64844954", "0.6448643", "0.62913144", "0.61909866", "0.6154456", "0.6152419", "0.60621065", "0.6043346", "0.6024993", "0.59800035", "0.5960865", "0.5929768", "0.592322", "0.592219", "0.591491...
0.7225126
1
Returns the rotation in yaw, pitch, roll order in radians. For those new to 3D graphics and who are not former pilots: Yaw = looking up and down Pitch = looking to the left and right Roll = tilting your head from side to side Returns an array of rotations in the form: [Y axis, X axis, Z axis]
yawPitchRollInRadians() { const rotation = this.rotationInRadians(); return [rotation[1], rotation[0], rotation[2]]; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "yawPitchRoll() {\n return this.yawPitchRollInRadians().map(VrMath.radToDeg);\n }", "rotation() {\n return this.rotationInRadians().map(VrMath.radToDeg);\n }", "setFromAxisRotations(roll, pitch, yaw) {\nvar D2R_BY2, RPY_by2, cp, cr, cy, cycp, cysp, rpy, rpyb2, sp, sr, sy, sycp, sysp;\n//----------------...
[ "0.72931665", "0.7094027", "0.6710684", "0.6695919", "0.6577901", "0.64672667", "0.6460574", "0.6348449", "0.61749446", "0.6135807", "0.61182815", "0.6077189", "0.59678316", "0.5944077", "0.58846945", "0.58628106", "0.58406585", "0.58394516", "0.5807881", "0.58061045", "0.580...
0.8212919
0
Returns the horizontal field of view of the camera in degrees.
horizontalFov() { return this.fov; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "horizontalFovInRadians() {\n return VrMath.degToRad(this.horizontalFov());\n }", "getCamForward()\n {\n return this.game.camera.getWorldDirection();\n /*\n var cam = this.game.camera;\n var vL = new THREE.Vector3(0,0,-1);\n var vW = vL.applyMatrix4(cam.matrixWorld)...
[ "0.72040087", "0.6563071", "0.62339574", "0.61053866", "0.60974777", "0.6009934", "0.57597524", "0.57571054", "0.5724447", "0.57201785", "0.5630722", "0.5627332", "0.56087035", "0.56032383", "0.55515146", "0.5519869", "0.5505591", "0.550329", "0.54610956", "0.5447756", "0.544...
0.70897406
1
Returns the vertical field of view of the camera in degrees.
verticalFov() { return this.fov / this.aspect; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "verticalFovInRadians() {\n return VrMath.degToRad(this.verticalFov());\n }", "horizontalFovInRadians() {\n return VrMath.degToRad(this.horizontalFov());\n }", "rotationInRadians() {\n return VrMath.getRotation(this.headMatrix);\n }", "horizontalFov() {\n return this.fov;\n }", "rotation() {...
[ "0.7542279", "0.63451684", "0.6327923", "0.60679686", "0.60196424", "0.6009486", "0.59839296", "0.59429675", "0.5918022", "0.5910611", "0.5865381", "0.58473706", "0.5746688", "0.57455915", "0.5738012", "0.573544", "0.5714673", "0.5708799", "0.56912714", "0.56612337", "0.56533...
0.7169025
1
Returns the horizontal field of view of the camera in radians.
horizontalFovInRadians() { return VrMath.degToRad(this.horizontalFov()); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "horizontalFov() {\n return this.fov;\n }", "getCamForward()\n {\n return this.game.camera.getWorldDirection();\n /*\n var cam = this.game.camera;\n var vL = new THREE.Vector3(0,0,-1);\n var vW = vL.applyMatrix4(cam.matrixWorld);\n vW.sub(cam.position).norm...
[ "0.6892442", "0.63369507", "0.6205203", "0.61592346", "0.5986239", "0.5974646", "0.5831076", "0.57213116", "0.5667478", "0.5591737", "0.55876875", "0.55862546", "0.5584925", "0.5549804", "0.55480057", "0.5535397", "0.5532", "0.5440248", "0.54386246", "0.5428122", "0.54221296"...
0.7242464
0
Returns the vertical field of view of the camera in radians.
verticalFovInRadians() { return VrMath.degToRad(this.verticalFov()); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "verticalFov() {\n return this.fov / this.aspect;\n }", "rotationInRadians() {\n return VrMath.getRotation(this.headMatrix);\n }", "horizontalFovInRadians() {\n return VrMath.degToRad(this.horizontalFov());\n }", "toRadians() {\n\t\tif (this.y == 0 && this.x == 0) {\n\t\t\treturn 0; //special case...
[ "0.7016517", "0.63740987", "0.6225893", "0.5932018", "0.5879787", "0.5869606", "0.5866264", "0.5861299", "0.5858903", "0.585863", "0.5824645", "0.57651055", "0.57644546", "0.57401574", "0.5730301", "0.572286", "0.57065207", "0.56792134", "0.5652244", "0.5646025", "0.5646025",...
0.75429237
0
Returns the Head matrix as an array of numbers.
getHeadMatrix() { return [...this.headMatrix]; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "static head() {\n console.log(_.head([[2, [3, [4]], 5], 1])); // [2, Array[2], 5]\n }", "getMatrix(){\n const matrix = [];\n while(this.height > 0){\n matrix.push(new Array(this.width).fill(0))//create new row and fill it with zeros\n this.height--;\n }\n ret...
[ "0.5980238", "0.5904563", "0.58766055", "0.57332355", "0.5625631", "0.5565734", "0.5513756", "0.5485681", "0.54836804", "0.54264075", "0.54112035", "0.5399994", "0.5398158", "0.5355724", "0.5347872", "0.53415537", "0.53048164", "0.5284576", "0.52766556", "0.5272406", "0.52345...
0.68612206
0
Returns true if the headset is in use.
getVRStatus() { console.warn('getVRStatus is deprecated. Please use inVR instead'); return this._inVR; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function checkHeadsetConnected () { return !!getVRDisplay(); }", "function checkHeadsetConnected () {\n\t var orientation;\n\t var vrDisplay = controls.getVRDisplay();\n\n\t // If `isConnected` is available, just use that.\n\t if (vrDisplay && 'isConnected' in vrDisplay) { return vrDisplay.isConnected; }\n\n...
[ "0.614194", "0.59576327", "0.5742532", "0.5722579", "0.5667549", "0.5667549", "0.5652778", "0.5652778", "0.56468445", "0.5542796", "0.55239594", "0.54819727", "0.54646903", "0.54323626", "0.54309857", "0.54266024", "0.54230905", "0.54230905", "0.5421578", "0.54047674", "0.536...
0.0
-1
Returns true if the headset is in use, false if viewed outside of VR
inVR() { return this._inVR; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function checkHeadsetConnected () { return !!getVRDisplay(); }", "function checkHeadsetConnected () {\n\t var orientation;\n\t var vrDisplay = controls.getVRDisplay();\n\n\t // If `isConnected` is available, just use that.\n\t if (vrDisplay && 'isConnected' in vrDisplay) { return vrDisplay.isConnected; }\n\n...
[ "0.7397662", "0.6972105", "0.567624", "0.5488396", "0.5395296", "0.53916883", "0.53408766", "0.53266674", "0.5310751", "0.5275287", "0.5274631", "0.5234788", "0.52203315", "0.5217473", "0.5205066", "0.5196566", "0.51422393", "0.51420814", "0.51410806", "0.5096715", "0.5089219...
0.0
-1
This is the NRP client /DATA
function getRandomInt(min, max) { return Math.floor(Math.random() * (max - min + 1)) + min; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "GetData() {}", "function senGuiData()\n{\n\tvar datasend={\n\t\tevent:\"guidata\"\n\t}\n\tqueryDataGet(\"php/api_process.php\",datasend,function(res){\n\t\t//nhan du lieu tu server tra ve\n\t\talert_info(res);\n\t});\n\tqueryDataPost(\"php/api_process_post.php\",datasend,function(res){\n\t\t//nhan du lieu tu ser...
[ "0.6605685", "0.6151747", "0.6119449", "0.60352355", "0.59965557", "0.5900084", "0.5868277", "0.57872576", "0.577988", "0.5772004", "0.57522196", "0.575078", "0.57486117", "0.57486117", "0.5730532", "0.57239705", "0.57087326", "0.5708229", "0.5705027", "0.5699427", "0.5682849...
0.0
-1
reset the userTotal and the computerTotal
function reset(){ var computerTotal = getNumber(); var userTotal = 0; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function resetTotal()\n{\n total = 0;\n}", "function reset() {\n randomNum = Math.floor(Math.random() * (120 - 19) + 19);\n $(\"#computernumber\").text(randomNum);\n\n first = Math.floor(Math.random() * (12 - 1) + 1);\n console.log(first);\n\n second = Math.floor(Math.random...
[ "0.7391564", "0.6898217", "0.6856254", "0.6787386", "0.6769933", "0.6708521", "0.65972996", "0.6561679", "0.6547529", "0.65296566", "0.6493867", "0.6367909", "0.6328879", "0.6319424", "0.631825", "0.63098794", "0.63015723", "0.6273108", "0.625446", "0.62444293", "0.622808", ...
0.8517782
0
get the number for the user to match
function getNumber() { var minNumber = 19; var maxNumber = 120; var randomNumber = Math.floor(Math.random() * (maxNumber + 1) + minNumber); return randomNumber }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function getUserNumberInput() {\n\treturn parseInt(usrInput.value)\n}", "function getUserNumberInput() {\n\treturn parseInt(userInput.value);\n}", "function getguess(){\n var userNum = $('#guess').value;\n}", "function isMatches(window) {\n var userNumber = window.prompt(\"Please enter a number between 1 ...
[ "0.64342535", "0.6417395", "0.63544166", "0.6320198", "0.6287054", "0.62751395", "0.6086795", "0.60477716", "0.60477716", "0.602988", "0.59689075", "0.59543747", "0.5946961", "0.5925866", "0.58960056", "0.5888969", "0.588484", "0.5863884", "0.5862757", "0.5827752", "0.5768424...
0.0
-1
get the number value for each crystal
function crystalNumber() { var minNumber = 1; var maxNumber = 12; var randomNumber = Math.floor(Math.random() * (maxNumber) + minNumber); return randomNumber; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function getCrystalValue() {\n\tvar numbersNeeded=4\n\t \tdo {\t\n\t\t\tnumber=Math.floor(Math.random()*(12-1+1))+1; \n\t\t\ttempIndex=crystalValues.indexOf(number); \n\t\t\tif (tempIndex=== -1) {\n\t\t\t\tcrystalValues.push(number); \n\t\t\t\tnumbersNeeded--; \t\t\t\t\t\n\t\t\t\t};\t\t\t\t\n\t\t } // end of do\n...
[ "0.6863419", "0.6643511", "0.6352359", "0.6321992", "0.6283517", "0.6239248", "0.61987853", "0.61940235", "0.61871517", "0.61529887", "0.6136314", "0.5973271", "0.5909345", "0.5883224", "0.5876509", "0.58598936", "0.58479106", "0.58199126", "0.5809869", "0.5798915", "0.579510...
0.5602287
36
Generates a string of N characters A character can be a lowecase letter, uppercase letter or a number
generateRandomCode(length) { let code = ''; const table = { type: ['lowercase', 'uppercase', 'number'], lowercase: ['a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z'], uppercase: ['A', 'B', 'C', 'D', 'E', 'F', 'G',...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function generateNChar(length, char) {\r\n\tlet lineStr=\"\";\r\n\tfor (let i=0; i < length; i++) {\r\n\t\tlineStr+=char;\r\n\t}\r\n\treturn lineStr;\r\n}", "function repeat(char, n) {\n var str = '';\n for (var i=0; i<n; i++) str += char;\n return str;\n}", "function randomString(len, an){\n an = an&&an...
[ "0.8035122", "0.7494759", "0.7413343", "0.7408824", "0.7295194", "0.7236789", "0.7188605", "0.71884525", "0.71781415", "0.71709895", "0.71532875", "0.7150141", "0.7138704", "0.7100928", "0.70722574", "0.70541584", "0.7053814", "0.7049099", "0.7047835", "0.70418566", "0.703812...
0.0
-1
Get a random integer between a range
getRandomInt(min, max) { min = Math.ceil(min); max = Math.floor(max); return Math.floor(Math.random() * (max - min + 1)) + min; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function randInt(range) {\n return Math.floor(Math.random()* range);\n}", "function randomInt(range) {\n return Math.floor(Math.random() * range);\n}", "function randomInt(range) {\n return Math.floor(Math.random() * range);\n}", "function randomInt(range) {\n return Math.floor(Math.random() * range)...
[ "0.86473906", "0.85196084", "0.85194236", "0.85194236", "0.85194236", "0.85194236", "0.85172075", "0.84786576", "0.84752434", "0.8429517", "0.8427586", "0.8416669", "0.83699465", "0.83655137", "0.836385", "0.82654136", "0.8259182", "0.8235298", "0.82328516", "0.82328516", "0....
0.7980133
50
Generates a random code, check if there is already an URL assigned to it If there is no URL assigned, repeat the script, else return code
async generateUniqueCode() { const code = this.generateRandomCode(8); const urlResult = await this.getUrl(code); const codeExists = urlResult.rows.length > 0; if (codeExists) return await this.generateUniqueCode(); return code; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "async function generateAccessCode() {\n var random = Math.floor(Math.random() * (+65535 - +4369)) + +4369;\n var code = random.toString(16);\n\n var hasDupe = false;\n\n let count = 0;\n try {\n do {\n count = await getCourtByCode(code);\n if (count > 0) {\n ...
[ "0.7254025", "0.7184183", "0.6715925", "0.6535326", "0.63457024", "0.62672913", "0.62389743", "0.6236364", "0.6232808", "0.6211905", "0.6164213", "0.61341083", "0.6110636", "0.6108722", "0.6090396", "0.60767424", "0.60739714", "0.6042346", "0.60368896", "0.60287076", "0.59898...
0.8118578
0
generates a blank node that does not yet occur in the path
generateBlankNode(path, name) { if (!name) { return this.generateBlankNode(path, 'b'); } // path predicates can't contain variables/blank nodes if (path && (path.subject.value === name || path.object.value === name)) { return this.generateBlankNode(path, name + 'b...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "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._ids[name]) name = suggestedName + index++;\n }\n // Generate a generic blank node name\n e...
[ "0.6658433", "0.6538594", "0.6531397", "0.6282681", "0.6220977", "0.59992176", "0.5974757", "0.5967428", "0.5923134", "0.5899315", "0.5857886", "0.5802104", "0.58008695", "0.5793879", "0.5789339", "0.5761115", "0.5751172", "0.5721866", "0.57097375", "0.56867903", "0.56862485"...
0.78119874
0
based on definition in spec returns all nodes visited by infinitely repeating the given predicate, starting from x
async ALPeval(x, predicate, context) { const it = new asynciterator_1.BufferedIterator(); await this.ALP(x, predicate, context, {}, it, { count: 0 }); return it; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "async resolveWhile(predicate) {\n let x = await this.next();\n let shouldContinue = predicate(x.value);\n while ((!x.done) && shouldContinue) {\n x = await this.next();\n shouldContinue = predicate(x.value);\n }\n }", "getNextMatchingNode(searchFn, testFn, sta...
[ "0.5280456", "0.5139605", "0.5080322", "0.5076624", "0.5006858", "0.49838018", "0.49322748", "0.49316686", "0.49037567", "0.48905283", "0.4888433", "0.4833249", "0.48123598", "0.47933337", "0.47749335", "0.4771676", "0.47452372", "0.47297743", "0.47150734", "0.4712444", "0.46...
0.44753692
54
Creates an HTTP request with the given settings
createRequest(settings) { // PERFORMANCE HACK: // Reduce OPTIONS preflight requests by removing the Accept-Datetime header // on requests for resources that are presumed to have been time-negotiated if (this.negotiatedResources[this.removeQuery(settings.url)]) { delete settin...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "static request(method, url, config = {}) {\n return Request.make(method, url, config);\n }", "function makeRequest(request, settings) {\n var url = request.url;\n if (request.cache !== true) {\n // https://developer.mozilla.org/en-US/docs/Web/API/XMLHttpRequest/Using_XMLHttpReq...
[ "0.69079447", "0.6729213", "0.65007514", "0.64750797", "0.63953495", "0.63475287", "0.6310621", "0.6197969", "0.6162611", "0.61591053", "0.61262167", "0.6122455", "0.6075698", "0.60350305", "0.6016171", "0.6006225", "0.6006225", "0.5982626", "0.5960638", "0.59454554", "0.5883...
0.69022113
1
Removes the query string from a URL
removeQuery(url) { return url ? url.replace(/\?.*$/, '') : ''; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function maskQueryStringInURL(url) {\n url = url || '';\n return url.replace(/\\?.*?$/, '');\n}", "function stripUrlParams(url, paramsToStrip){\n var urlSplit = url.match(/^([\\w\\.]*\\??)([\\w\\W]*)$/);\n var urlHead = urlSplit[1];\n var queries = urlSplit[2];\n if (queries === \"\") return urlHead;\n if...
[ "0.7863393", "0.76070356", "0.75628036", "0.74805623", "0.7477056", "0.7455942", "0.74358726", "0.741753", "0.73577935", "0.7343138", "0.7332188", "0.7299149", "0.72973204", "0.72973204", "0.7280072", "0.72637755", "0.71133846", "0.7089026", "0.7089026", "0.7071442", "0.70537...
0.8357213
0
TODO: remove in 2.0.0, this is just here for backwardscompatibility
function evaluateQuery(query, context) { return newEngine().query(query, context); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private public function m246() {}", "private internal function m248() {}", "protected internal function m252() {}", "transient private protected internal function m182() {}", "static final private internal function m106() {}", "transient protected internal function m189() {}", "transient final protecte...
[ "0.67786384", "0.66334057", "0.6586678", "0.6321046", "0.6177691", "0.60712886", "0.60575926", "0.6030867", "0.58501303", "0.5773183", "0.57380706", "0.57246095", "0.5707716", "0.55859256", "0.5578144", "0.5568496", "0.5544227", "0.54633284", "0.54458106", "0.537554", "0.5356...
0.0
-1
Collect the result of the current state. This returns a Bindings per group, and a (possibly empty) Bindings in case the no Bindings have been consumed yet.
collectResults() { // Collect groups let rows = Array.from(this.groups, ([_, group]) => { const { bindings: groupBindings, aggregators } = group; // Collect aggregator bindings // If the aggregate errorred, the result will be undefined const aggBindings = ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function all() {\n if (resetNeeded) reset(), resetNeeded = false;\n return groups;\n }", "function all() {\n\t if (resetNeeded) reset(), resetNeeded = false;\n\t return groups;\n\t }", "function groups() {\n\tvar result = new EventEmitter();\n\tprocess.nextTick(function() ...
[ "0.5465583", "0.54310435", "0.5407141", "0.49611312", "0.4946684", "0.47056872", "0.46893686", "0.46893686", "0.46893686", "0.46893686", "0.46893686", "0.46893686", "0.46893686", "0.46893686", "0.46797425", "0.46633503", "0.46516344", "0.4638873", "0.46246445", "0.4618571", "...
0.69286776
0
This function puts all common values between 2 arrays in a map with `value` : true
getCommonVariables(array1, array2) { return Object.keys(array1.filter((n) => -1 !== array2.indexOf(n)) .reduce((m, key) => { m[key] = true; return m; }, {})); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function haveCommonElements(arr2) {\r\n\tfor (let i = 0; i < arr2.length; i++) {\r\n\t\tif (map[arr2[i]]) return true;\r\n\t}\r\n\treturn false;\r\n}", "function commonItems(arr1, arr2) {\n let map = {};\n for (let ch of arr1) {\n if (!map[ch]) {\n map[ch] = true;\n }\n }\n\n for (let ch of arr2) ...
[ "0.7302696", "0.6924344", "0.68236107", "0.66983575", "0.66937864", "0.6574017", "0.6503942", "0.646787", "0.6353586", "0.63181096", "0.6312362", "0.62862146", "0.62463915", "0.6236389", "0.6214402", "0.61890686", "0.6149507", "0.6124772", "0.6111356", "0.6082038", "0.6080502...
0.6557363
7
Remove descending operator if necessary
extractSortExpression(expr) { const { expressionType, operator } = expr; if (expressionType !== sparqlalgebrajs_1.Algebra.expressionTypes.OPERATOR) { return expr; } return (operator === 'desc') ? expr.args[0] : expr; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "inverseSorting() {\n if (this.get('order') === 'asc') {\n this.set('currentSort', this.get('inverseDasherizerized'));\n } else if (this.get('order') === 'desc') {\n this.set('currentSort', '');\n } else { // if currentSorting is not set to this field\n this.set('currentSort', th...
[ "0.64234006", "0.61569595", "0.5953206", "0.5872854", "0.58069944", "0.5803152", "0.57822603", "0.5741603", "0.5652501", "0.5649498", "0.56195366", "0.55846703", "0.5566318", "0.55354017", "0.5521957", "0.55189407", "0.5509825", "0.55024654", "0.5500728", "0.5491092", "0.5475...
0.57261664
8
Reads the smallest item in the current sorting window
_read(count, done) { let item; let length = this.sorted.length; // Try to read items until we reach the desired window length while (length !== this.windowLength) { item = this.source.read(); if (item === null) { break; } //...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function nextItem() {\n var minId = -1,\n min = Infinity,\n item, i, n;\n for (i=0, n=mergeItems.length; i<n; i++) {\n item = mergeItems[i];\n if (item !== null && item.score < min) {\n min = item.score;\n minId = i;\n }\n }\n if (minId =...
[ "0.6426399", "0.63973457", "0.6312027", "0.62955636", "0.6277659", "0.61951697", "0.6171147", "0.61369264", "0.6109014", "0.59779704", "0.59719473", "0.5926801", "0.58401877", "0.5823704", "0.5787704", "0.57792103", "0.5766609", "0.5716592", "0.57087386", "0.5663429", "0.5641...
0.6717941
0
Flushes remaining data after the source has ended
_flush(done) { let length = this.sorted.length; while (length--) { this._push(this.sorted.pop()); } done(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "_flush() {\n\t\tthis.finished = true;\n\t\tthis._definitelyPush();\n\t}", "_flush() {\n this.push(this.contents);\n this.emit('end')\n }", "function handleFinished() {\n resolve(Buffer.concat(_this.buffers));\n cleanup();\n }", "function flush() {\n timer = null;\n s...
[ "0.67834455", "0.644837", "0.6405885", "0.60804534", "0.6024822", "0.598881", "0.5914057", "0.58950186", "0.58638525", "0.58533895", "0.5841674", "0.58405", "0.5816884", "0.58050406", "0.58023983", "0.57917416", "0.5781862", "0.5781862", "0.5781862", "0.5781862", "0.57758176"...
0.5695844
87
resize the cache when the max changes.
set max (mL) { if (typeof mL !== 'number' || mL < 0) throw new TypeError('max must be a non-negative number') this[MAX] = mL || Infinity trim(this) }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function view_resources_resize() {\n\t\t\n\t}", "shrinkToFit() {\n _instance.shrinkToFit()\n }", "function resize () {\n console.log(\"acc resize\");\n }", "_resize(size){\n const oldSlots = this._hashTable;\n this._capacity = size;\n this.length = 0 // ...
[ "0.64161867", "0.6285606", "0.6149722", "0.6022278", "0.59730697", "0.5964476", "0.59585875", "0.59123194", "0.59057915", "0.59014565", "0.5895057", "0.5883566", "0.5882852", "0.5871442", "0.58522236", "0.5844891", "0.583452", "0.5823686", "0.582094", "0.582053", "0.5803628",...
0.0
-1
resize the cache when the lengthCalculator changes.
set lengthCalculator (lC) { if (typeof lC !== 'function') lC = naiveLength if (lC !== this[LENGTH_CALCULATOR]) { this[LENGTH_CALCULATOR] = lC this[LENGTH] = 0 this[LRU_LIST].forEach(hit => { hit.length = this[LENGTH_CALCULATOR](hit.value, hit.key) this[LENGTH] += hit.len...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "set lengthCalculator(lC) {\n if (typeof lC !== 'function') lC = naiveLength;\n if (lC !== this[LENGTH_CALCULATOR]) {\n this[LENGTH_CALCULATOR] = lC;\n this[LENGTH] = 0;\n this[LRU_LIST].forEach(hit => {\n hit.length = this[LENGTH_CALCULATOR](hit.value, hit.key);\n this[LENGTH] +=...
[ "0.6647197", "0.6579298", "0.6509049", "0.6237357", "0.6237357", "0.62244594", "0.61104995", "0.6004809", "0.5904866", "0.58986837", "0.57879496", "0.57095635", "0.57018435", "0.56909317", "0.56847644", "0.567864", "0.567622", "0.5675203", "0.5669332", "0.5661479", "0.5661282...
0.65963936
14
Slice the stream based on the pattern values
sliceStream(stream, pattern) { const hasLength = !!pattern.length || pattern.length === 0; return stream.range(pattern.start, hasLength ? pattern.start + pattern.length - 1 : Infinity); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "sliceMetadata(output, pattern) {\n const hasLength = !!pattern.length || pattern.length === 0;\n return !output.metadata ? null : () => output.metadata()\n .then((subMetadata) => {\n let totalItems = subMetadata.totalItems;\n if (isFinite(totalItems)) {\n ...
[ "0.5985643", "0.51069266", "0.50922793", "0.50809616", "0.50440645", "0.5004984", "0.49287492", "0.49143106", "0.48984274", "0.48190242", "0.48132408", "0.4765468", "0.4753309", "0.4701428", "0.46767664", "0.4656881", "0.4644487", "0.46436274", "0.462348", "0.4613355", "0.460...
0.78397816
0
If we find metadata, apply slicing on the total number of items
sliceMetadata(output, pattern) { const hasLength = !!pattern.length || pattern.length === 0; return !output.metadata ? null : () => output.metadata() .then((subMetadata) => { let totalItems = subMetadata.totalItems; if (isFinite(totalItems)) { totalIte...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "GetItemCount() {}", "function getMoreProducts(parameters) {\n\n parameters.offset += 20;\n return parameters;\n }", "function figureOutItemsToDisplay() {\n vm.filteredItems = $filter('filter')(vm.images, {\n $: vm.search\n });\n vm.filterLength = vm.filteredItems.length;\n ...
[ "0.5928692", "0.5572321", "0.5559386", "0.5362608", "0.5359976", "0.53261614", "0.531971", "0.53101224", "0.5282717", "0.528043", "0.52491426", "0.517126", "0.51631385", "0.5139488", "0.51294106", "0.5115658", "0.5105616", "0.50949776", "0.5050785", "0.5047028", "0.5047028", ...
0.6106436
0
Execute the given SELECT or CONSTRUCT query against the given endpoint.
executeQuery(endpoint, query, quads, variables) { const stream = new asynciterator_1.BufferedIterator({ autoStart: false, maxBufferSize: Infinity }); const inputStream = quads ? this.endpointFetcher.fetchTriples(endpoint, query) : this.endpointFetcher.fetchBindings(endpoint, quer...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "async execute(opts) {\n if (typeof opts === \"string\") {\n opts = { query: opts };\n }\n\n opts = utils.normalizeKeys(opts);\n opts = utils.defaults(opts, this.consul._defaults);\n\n const req = {\n name: \"query.execute\",\n path: \"/query/{query}/execute\",\n params: { query: ...
[ "0.5885005", "0.5698809", "0.5529239", "0.5489906", "0.548022", "0.54268837", "0.54209673", "0.5363236", "0.53300035", "0.53094405", "0.5293263", "0.5264119", "0.5242464", "0.52045935", "0.51584995", "0.5155489", "0.5140878", "0.51107824", "0.5106384", "0.5098709", "0.509278"...
0.5064573
26
Collect all Hydra page links from the given Hydra properties object.
getLinks(pageUrl, hydraProperties) { return ActorRdfMetadataExtractHydraControls.LINK_TYPES.reduce((metadata, link) => { // First check the correct hydra:next, then the deprecated hydra:nextPage const links = hydraProperties[link] || hydraProperties[link + 'Page']; const link...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function init()\n{\n if(!externalLinksAreReferences(this)) return\n\n if(this.output.name !== 'ebook') return\n\n var pageLinks = Object.keys(this.navigation).map(getLinks, this)\n return setPages(pageLinks);\n}", "function getLinksOnPage() {\n var links = this.evaluate(function () {\n var hrefs = ...
[ "0.5781743", "0.57608646", "0.57491845", "0.5691408", "0.5559716", "0.5510351", "0.5393915", "0.53750145", "0.5369207", "0.5321744", "0.53133863", "0.52729183", "0.52688664", "0.5262164", "0.5257966", "0.5245794", "0.523031", "0.5215794", "0.51984596", "0.51911265", "0.518045...
0.7486597
0
Collect all search forms from the given Hydra properties object.
getSearchForms(hydraProperties) { const searchFormData = hydraProperties.search; const searchForms = []; if (searchFormData) { for (const dataset in searchFormData) { for (const searchFormId of searchFormData[dataset]) { const searchTemplates = (hy...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "_initSearchFields() {\n\t\t\tvar oFields = this._oViewModel.getProperty(\"/fields\");\n\t\t\tvar aSearchFields = Object.entries(oFields)\n\t\t\t\t.filter(([, oField]) => oField.canSearch)\n\t\t\t\t.map(([sKey, oField]) => Object.assign({\n\t\t\t\t\tpath: sKey,\n\t\t\t\t\tsearchSelected: true\n\t\t\t\t}, oField));\...
[ "0.5617675", "0.52885187", "0.52392876", "0.52274823", "0.5162521", "0.5105456", "0.5086486", "0.5076928", "0.5061932", "0.50453174", "0.5028981", "0.4996102", "0.49825594", "0.4979173", "0.4975953", "0.49588388", "0.49489117", "0.49049154", "0.48632798", "0.48585013", "0.484...
0.7504335
0
If we require custom JSONLD handling for the given media type. The JSONLD spec requires JSONLD within script tags to be seen as a single document. As such, we have to buffer all JSONLD until the end of HTML processing, and encapsulate all found contents in an array.
requiresCustomJsonLdHandling(mediaType) { return !this.onlyFirstScript && !this.targetScriptId && mediaType === 'application/ld+json'; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "addJSONLD(post, info, url) {\n return {\n __html: `{\n \"@context\": \"http://schema.org\",\n \"@type\": \"BlogPosting\",\n \"mainEntityOfPage\": {\n \"@type\": \"WebPage\",\n \"@id\": \"${url}\"\n },\n \"headline\": \"${post.og_title[0].text}\",\n \"im...
[ "0.556884", "0.5220599", "0.5064403", "0.49345577", "0.48834547", "0.4858528", "0.48396584", "0.47892094", "0.4750116", "0.47220072", "0.47137785", "0.46893984", "0.46826968", "0.46788445", "0.46540275", "0.46489128", "0.46280617", "0.46167576", "0.46144563", "0.4597552", "0....
0.6309439
0
Construct a JsonLdParser from the given HTTP response. This will throw an error if no valid JSON response is received (application/ld+json, application/json, or something+json). For raw JSON responses, exactly one link header pointing to a JSONLD context is required. This method is not responsible for handling redirect...
static fromHttpResponse(baseIRI, mediaType, headers, options) { let context; // Special cases when receiving something else than the JSON-LD media type if (mediaType !== 'application/ld+json') { // Only accept JSON or JSON extension types if (mediaType !== 'application/js...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "parse(jsonld) {\n return doParse(jsonld, this);\n }", "function load_links_handler(response) {\n\tif (response.status !== 200) {\n\t\tconsole.log(\"loadlinks failed\");\n\t\treturn;\n\t}\n\t\n\tif (response.json === null) {\n\t\tconsole.log(\"loadlinks 200, but null json\");\n\t\treturn;\n\t}\n\t\n\trlictd_p...
[ "0.56502336", "0.5212222", "0.5088287", "0.5037547", "0.5023485", "0.4998601", "0.4924586", "0.48944902", "0.4878844", "0.48682737", "0.4859136", "0.48228174", "0.4786123", "0.47828978", "0.4776548", "0.4755395", "0.4698483", "0.46932936", "0.46661657", "0.46542445", "0.46331...
0.64393044
0
Attach all required listeners to the JSON parser. This should only be called once.
attachJsonParserListeners() { // Listen to json parser events this.jsonParser.onValue = (value) => { const depth = this.jsonParser.stack.length; const keys = (new Array(depth + 1).fill(0)).map((v, i) => { return i === depth ? this.jsonParser.key : this.jsonParser....
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function jsonListener() {\n\tantlr4.tree.ParseTreeListener.call(this);\n\treturn this;\n}", "function initAPIListeners() {\n /*\n * This listens in for whenever a new DJ starts playing.\n */\n API.addEventListener(API.DJ_ADVANCE, djAdvanced);\n\n /*\n * This listens for changes in the waitin...
[ "0.66703457", "0.6053383", "0.59902304", "0.5966184", "0.5879907", "0.58597946", "0.581456", "0.5793278", "0.5761958", "0.57164603", "0.567575", "0.56611544", "0.5591235", "0.5579858", "0.55794424", "0.5539308", "0.5536767", "0.55299664", "0.55048615", "0.5476396", "0.547613"...
0.6894595
0
Shift the stack at the given offset to the given depth. This will override anything in the stack at `depth`, and this will remove anything at `depth + depthOffset`
shiftStack(depth, depthOffset) { // Copy the id stack value up one level so that the next job can access the id. const deeperIdStack = this.idStack[depth + depthOffset]; if (deeperIdStack) { this.idStack[depth] = deeperIdStack; this.emittedStack[depth] = true; ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "restack (){\n this._layers.forEach( (layer, key, index) => {\n layer.setDepth(index);\n //layer.objects.forEach(obj => {\n //if (obj.active)\n //obj.depth = index;\n //});\n });\n }", "function popToNodeStack(nodeStack, idx) {\n\...
[ "0.5101551", "0.49759522", "0.49355006", "0.49110857", "0.49110857", "0.49110857", "0.49110857", "0.49110857", "0.49110857", "0.48967788", "0.48012134", "0.47507587", "0.471699", "0.47014877", "0.47014877", "0.47014877", "0.46943137", "0.46866295", "0.46866295", "0.46866295", ...
0.7566911
0
Check if the given first array (needle) is a prefix of the given second array (haystack).
static isPrefixArray(needle, haystack) { if (needle.length > haystack.length) { return false; } for (let i = 0; i < needle.length; i++) { if (needle[i] !== haystack[i]) { return false; } } return true; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function startsWith(haystack, needle) {\n if (haystack.length < needle.length) {\n return false;\n }\n for (var i = 0; i < needle.length; i++) {\n if (haystack[i] !== needle[i]) {\n return false;\n }\n }\n return true;\n}", "function isPrefixOf(xs, ys){\r\n if(!x...
[ "0.74151313", "0.7394692", "0.7259984", "0.7007427", "0.68905616", "0.68491894", "0.6795697", "0.67316127", "0.66686785", "0.6488117", "0.6396138", "0.63613075", "0.63564175", "0.6354264", "0.63438046", "0.6337698", "0.6321195", "0.62947094", "0.6289656", "0.6279485", "0.6169...
0.80042464
0
If the context defines a propertyscoped context for the given key, that context will be returned. Otherwise, the given context will be returned asis. This should be used for valueToTerm cases that are not objects.
async getContextSelfOrPropertyScoped(context, key) { const contextKeyEntry = context.getContextRaw()[key]; if (contextKeyEntry && typeof contextKeyEntry === 'object' && '@context' in contextKeyEntry) { context = await this.parsingContext.parseContext(contextKeyEntry, context.getContextRaw(),...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function getContext(key) {\n return get_current_component().$$.context.get(key);\n}", "function context(target, propertyKey) {\n target[contextSymbol] = propertyKey;\n}", "_unsetAndRelinkContext(contextKey) {\n const contextKeys = Array.isArray(contextKey) ? contextKey : [contextKey];\n\n c...
[ "0.54510164", "0.5184855", "0.515584", "0.5141153", "0.5077347", "0.5029864", "0.49616855", "0.4921349", "0.4921349", "0.4921349", "0.4921349", "0.48696032", "0.4821397", "0.4818726", "0.4818726", "0.4808261", "0.47885653", "0.46273646", "0.4604562", "0.45809707", "0.45809707...
0.67970383
0
If the given term is null, return an empty array, otherwise return an array with the single given term.
nullableTermToArray(term) { return term ? [term] : []; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function convert_terms_to_array(ont_term_list){\n ont_term_array=ont_term_list.split('\\n')\n //need to add another element to array, since there may not be a new line\n //at the end of the list\n ont_term_array.push('');\n if (ont_term_array=='')\n {\n alert(\"Input a list of terms!\")\n ...
[ "0.5849971", "0.5849971", "0.54339546", "0.5396483", "0.52455497", "0.5244372", "0.5240532", "0.5056312", "0.49589247", "0.49559745", "0.4944645", "0.4914442", "0.4914442", "0.4914442", "0.4914442", "0.4914442", "0.4914442", "0.4914442", "0.4914442", "0.4914442", "0.4914442",...
0.7952961
0
Get the properties depth for retrieving properties. Typically, the properties depth will be identical to the given depth. The following exceptions apply:
async getPropertiesDepth(keys, depth) { let lastValidDepth = depth; for (let i = depth - 1; i > 0; i--) { if (typeof keys[i] !== 'number') { // Skip array keys const parentKey = await this.unaliasKeyword(keys[i], keys, i); if (parentKey === '@reverse') { ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "get depth() {}", "get Depth() {}", "get depth() {\n\t\treturn this._depth;\n\t}", "get depth() {\n return this._depth;\n }", "get depth() {\n return this._depth;\n }", "getDepth(obj, path) {\n return path.split('.').reduce((value, tag) => {\n return value[tag];\n }, obj);\n }", "get...
[ "0.7635279", "0.7252716", "0.6928913", "0.6884494", "0.6884494", "0.6855002", "0.6750505", "0.6371976", "0.61887974", "0.61840624", "0.60102755", "0.5983458", "0.59652716", "0.59435755", "0.5922218", "0.59094197", "0.5836765", "0.578076", "0.5699848", "0.56820744", "0.5672789...
0.8076362
0
Get the key for the current container entry.
async getContainerKey(key, keys, depth) { const keyUnaliased = await this.unaliasKeyword(key, keys, depth); return keyUnaliased === '@none' ? null : keyUnaliased; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "getKey() {\n return container[idx]\n }", "getKey() {\n return this.key;\n }", "function getCurrentEntryID() {\n\t\treturn indexes[currentIndex];\n\t}", "get key() {\n return this._key\n }", "get key()\n\t{\n\t\tvar priv = PRIVATE.get(this);\n\t\treturn priv.key;\n\t}", ...
[ "0.7043394", "0.65013593", "0.6362965", "0.63446265", "0.6336787", "0.62942404", "0.6271787", "0.62167585", "0.6212974", "0.6212974", "0.61166656", "0.611173", "0.611173", "0.611173", "0.611173", "0.61102796", "0.61034125", "0.60741436", "0.6069978", "0.60595834", "0.6042958"...
0.549391
84
Create an graph container index that can be used for identifying a graph term inside the graphContainerTermStack.
static getContainerGraphIndex(containers, depth, keys) { let isSimpleGraphContainer = EntryHandlerContainer.isSimpleGraphContainer(containers); let index = ''; for (let i = depth; i < keys.length; i++) { if (!isSimpleGraphContainer || typeof keys[i] === 'number') { in...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "\n (\n facet_c //:- Facet\n )\n {\n const id_n = this.node_a.length\n facet_c.id__v( id_n )\n this.node_a[id_n] = new Node( facet_c )\n return id_n\n }", "addEdgeIndex(outNode, outPort, outIndex, inNode, inPort, inIndex, metadata = {}) {\n if (!this.getNode(outNode)) { return; }\n if ...
[ "0.5217782", "0.49138662", "0.49045482", "0.48878416", "0.4839004", "0.4828279", "0.4820291", "0.4770127", "0.4770127", "0.4770127", "0.4756035", "0.47152898", "0.47129115", "0.47034907", "0.46958774", "0.46923578", "0.46923578", "0.4667249", "0.46450576", "0.46448785", "0.46...
0.58187175
1
If the given term is a blank node, return a deterministic named node for it based on the source id and the blank node value.
static skolemizeTerm(term, sourceId) { if (term.termType === 'BlankNode') { return new BlankNodeScoped_1.BlankNodeScoped(`bc_${sourceId}_${term.value}`, DataFactory.namedNode(`${FederatedQuadSource.SKOLEM_PREFIX}${sourceId}:${term.value}`)); } return term; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "static deskolemizeTerm(term, sourceId) {\n if (term.termType === 'BlankNode' && 'skolemized' in term) {\n term = term.skolemized;\n }\n if (term.termType === 'NamedNode') {\n if (term.value.startsWith(FederatedQuadSource.SKOLEM_PREFIX)) {\n const colonSepar...
[ "0.7321044", "0.65677255", "0.6441909", "0.6441909", "0.62034166", "0.6156586", "0.6016653", "0.6016653", "0.59945613", "0.5971154", "0.5969764", "0.5927018", "0.58771014", "0.58601594", "0.58601594", "0.58426887", "0.55569404", "0.53822213", "0.5351932", "0.52615535", "0.525...
0.7575013
0
Skolemize all terms in the given quad.
static skolemizeQuad(quad, sourceId) { return rdf_terms_1.mapTerms(quad, (term) => FederatedQuadSource.skolemizeTerm(term, sourceId)); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "_traverse(quad, currentGen) {\n if (!quad.isDivided) {\n currentGen.push(quad);\n } else {\n for (const q of quad.quadrants) {\n this._traverse(q, currentGen);\n };\n };\n }", "set Quad(value) {}", "_setQProd(qr, qa, qb) {\nvar i, k, rc, rd, re, va, vb, wa, wb;\nva = [qa[0], qa[...
[ "0.5505256", "0.5391224", "0.537328", "0.5368469", "0.5346368", "0.5321637", "0.5321637", "0.5321637", "0.5321637", "0.5321637", "0.5321637", "0.5321637", "0.5321637", "0.5321637", "0.50377864", "0.5035642", "0.5035642", "0.50175005", "0.50034314", "0.49835002", "0.49615878",...
0.6999806
0
If a given term was a skolemized named node for the given source id, deskolemize it again to a blank node. If the given term was a skolemized named node for another source, return false. If the given term was not a skolemized named node, return the original term.
static deskolemizeTerm(term, sourceId) { if (term.termType === 'BlankNode' && 'skolemized' in term) { term = term.skolemized; } if (term.termType === 'NamedNode') { if (term.value.startsWith(FederatedQuadSource.SKOLEM_PREFIX)) { const colonSeparator = term...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "static skolemizeTerm(term, sourceId) {\n if (term.termType === 'BlankNode') {\n return new BlankNodeScoped_1.BlankNodeScoped(`bc_${sourceId}_${term.value}`, DataFactory.namedNode(`${FederatedQuadSource.SKOLEM_PREFIX}${sourceId}:${term.value}`));\n }\n return term;\n }", "functi...
[ "0.7825258", "0.5962455", "0.56768906", "0.5360674", "0.5281976", "0.51986456", "0.51986456", "0.49261332", "0.49190524", "0.4899527", "0.4899527", "0.47276646", "0.47182685", "0.47182685", "0.47182685", "0.47182685", "0.47182685", "0.46969303", "0.4600194", "0.45680705", "0....
0.84831303
0
Get the unique, deterministic id for the given source.
getSourceId(source) { let sourceId = this.sourceIds.get(source); if (sourceId === undefined) { sourceId = `${this.sourceIds.size}`; this.sourceIds.set(source, sourceId); } return sourceId; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function generateUniqueId() {\n return \"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx\".replace(/[xy]/g, function (c) {\n var r = crypto.getRandomValues(new Uint8Array(1))[0] % 16 | 0;\n var v = c === \"x\" ? r : (r & 0x3) | 0x8;\n return v.toString(16);\n });\n }", "function _makeI...
[ "0.63537544", "0.6345991", "0.6328861", "0.6314585", "0.6281139", "0.62539995", "0.62530786", "0.62359136", "0.62338525", "0.6194005", "0.61851776", "0.6179411", "0.61591685", "0.6153814", "0.6150229", "0.6149411", "0.61478865", "0.61443543", "0.6142175", "0.6142175", "0.6135...
0.7924811
0
Proxy methods for the (optional) logger that is defined in the context
getDefaultLogData(context, data) { if (!data) { data = {}; } data.actor = this.name; return data; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "interceptLogs() {\n const context = {};\n context.console = console;\n\n context.console.log = this._log.bind(this, 'log');\n context.console.warn = this._log.bind(this, 'warn');\n context.console.error = this._log.bind(this, 'error');\n context.console.info = this._log.bind(this, 'info');\n c...
[ "0.7050135", "0.6571435", "0.6549892", "0.64906037", "0.6405023", "0.63892835", "0.6364046", "0.6304972", "0.6304536", "0.62805307", "0.6213363", "0.6210379", "0.6210379", "0.6210379", "0.6210379", "0.6210379", "0.6210379", "0.6210379", "0.6210379", "0.6210379", "0.6210379", ...
0.0
-1
Reorder the bus based on all present dependencies.
reorderForDependencies() { if (this.dependencyLinks.size > 0) { const actorsAfter = []; // Temporarily remove all actors that have dependencies for (const actorAfter of this.dependencyLinks.keys()) { const dependentPos = this.actors.indexOf(actorAfter); ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function install_reorder() {\n }", "cleanupDeps () {\n let i = this.deps.length\n while (i--) {\n const dep = this.deps[i]\n if (!this.newDepIds.has(dep.id)) {\n dep.removeSub(this)\n }\n }\n let tmp = this.depIds\n this.depIds = this.newDepIds\n this.newDepIds = tmp\n ...
[ "0.58238274", "0.5557144", "0.5543395", "0.55306035", "0.54192424", "0.53953695", "0.5316176", "0.53093916", "0.53093916", "0.53093916", "0.530898", "0.53006685", "0.53006685", "0.53006685", "0.5277379", "0.5276037", "0.526594", "0.526594", "0.526594", "0.526594", "0.526594",...
0.71598905
0
Convert a stringbased logging level to a numerical logging level.
static getLevelOrdinal(level) { return Logger.LEVELS[level]; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "parseLevel(level) {\n return parseInt(level, 10);\n }", "function severityLevelFromString(level) {\n\t return (level === 'warn' ? 'warning' : validSeverityLevels.includes(level) ? level : 'log') ;\n\t}", "function severityLevelFromString(level) {\n return (level === 'warn' ? 'warning' : v...
[ "0.7024566", "0.6757207", "0.67454755", "0.6715677", "0.6458208", "0.6036683", "0.59092414", "0.5846725", "0.57675564", "0.5695069", "0.5627759", "0.56036115", "0.55698735", "0.5567061", "0.5553351", "0.54985106", "0.5445153", "0.54365015", "0.54291797", "0.5424967", "0.53906...
0.5994854
6
Emits the event on the given EventEmitter
function emit(self, eventName) { self.emit(eventName); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function EventEmitter(){}", "function EventEmitter(){}", "$emit(event, ...args) {\n this.emitter.emit(event, ...args)\n }", "function EventEmitter(){}// Shortcuts to improve speed and size", "function EventEmitter() {}", "function EventEmitter() {}", "function EventEmitter() {}", "function EventE...
[ "0.7147474", "0.7147474", "0.7059749", "0.70503026", "0.7048508", "0.7048508", "0.7048508", "0.7048508", "0.7048508", "0.7048508", "0.7048508", "0.7048508", "0.7048508", "0.7048508", "0.7048508", "0.7048508", "0.7048508", "0.7048508", "0.7048508", "0.7048508", "0.7048508", ...
0.7286101
0
Emits new items though `data` events as long as there are `data` listeners
function emitData() { // While there are `data` listeners and items, emit them var item; while (this._hasListeners('data') && (item = this.read()) !== null) this.emit('data', item); // Stop draining the source if there are no more `data` listeners if (!this._hasListeners('data') && !this.done) { this....
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function onNewNotifications(data) {\n\t_.map(Object.keys(data), function(ch) {\n\t\t_.map(data[ch], emitData(ch).bind(this));\n\t}.bind(this));\n}", "onData(data) {\n this.emit(\"data\", data);\n this.onSuccess();\n }", "onData(data) {\n this.emit(\"data\", data);\n this.onSuccess();\n }", "onD...
[ "0.73131144", "0.6529754", "0.6529754", "0.6529754", "0.6517344", "0.6488253", "0.61354494", "0.60686374", "0.60581374", "0.60457146", "0.6039426", "0.60286826", "0.6000183", "0.6000152", "0.5999024", "0.5997098", "0.5960891", "0.5922217", "0.59055394", "0.58985496", "0.58645...
0.7070506
1
Calls the given function with the specified argument as `this` value
function call(func, self) { func.call(self); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function setThisWithCall(fn, thisValue, arg) {\n return fn.call(thisValue, arg);\n}", "function setThisWithCall(fn, thisValue, arg){\n\treturn fn.call(thisValue, arg);\n}", "function DispatchCall(callback, thisArg) { callback.call(thisArg); }", "function setThisWithCall(fn,thisValue,arg){\n // console.log(...
[ "0.7406392", "0.73744583", "0.67870116", "0.67789316", "0.64977366", "0.6447468", "0.6345417", "0.6344449", "0.62912166", "0.62623763", "0.62497085", "0.61719877", "0.61667454", "0.6151983", "0.6144991", "0.6143679", "0.6129534", "0.6093128", "0.608101", "0.608078", "0.605948...
0.7106401
2
Creates a new `EmptyIterator`.
function EmptyIterator() { if (!(this instanceof EmptyIterator)) return new EmptyIterator(); AsyncIterator.call(this); this._changeState(ENDED, true); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function EmptyIterator() {\r\n }", "getIterator()\r\n {\r\n return new NullIterator();\r\n }", "function empty() {\n\treturn Object.create(null);\n}", "function defaultIterator() {\n var self = this;\n return {\n length: function(){ return self.length },\n get: function(i){ return sel...
[ "0.7899459", "0.6441681", "0.5886357", "0.5839843", "0.56169784", "0.56169784", "0.56169784", "0.56169784", "0.56169784", "0.5594409", "0.5594409", "0.5594409", "0.5594409", "0.5594409", "0.5594409", "0.5594409", "0.5594409", "0.5594409", "0.5594409", "0.5594409", "0.5594409"...
0.8391919
0
Tries to transform the item; if the transformation yields no items, pushes the original item
function optionalTransform(self, item, done) { var pushedCount = self._pushedCount; self._transform(item, function () { if (pushedCount === self._pushedCount) self._push(item); done(); }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function transformItem(stream, item) {\n var ret;\n if (isArray(item)) {\n if (isHashArray(item)) {\n ret = transformHashArrayData(stream, item);\n } else {\n ret = transformArrayData(stream, item);\n }\n } else {\n ret = transformHashData(stream, item);\n...
[ "0.63356555", "0.63356555", "0.5764825", "0.55250156", "0.5512707", "0.5478204", "0.547741", "0.54437584", "0.5408601", "0.53693396", "0.53266734", "0.53191125", "0.53036284", "0.52641594", "0.525789", "0.5241244", "0.52364504", "0.5232102", "0.5225134", "0.5222802", "0.52001...
0.77379245
0
Retrieves the property with the given name from the source
function getSourceProperty(clone, source, propertyName, callback) { source.getProperty(propertyName, function (value) { // Only send the source's property if it was not set on the clone in the meantime if (!clone._properties || !(propertyName in clone._properties)) callback(value); }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "getProperty(name) {\n return this._properties[name];\n }", "findPropertyNamed(aName){\n for(let i = 0; i < this._properties.length; i++){\n let prop = this._properties[i];\n if(prop.matchesNameOrAlias(aName)){\n return prop;\n }\n }\n retur...
[ "0.7611924", "0.6871498", "0.68136287", "0.6706008", "0.6636184", "0.6550423", "0.65440434", "0.6539894", "0.6508541", "0.6414675", "0.6368659", "0.6255474", "0.6247415", "0.6220075", "0.61864156", "0.61809117", "0.6164964", "0.61437523", "0.61349964", "0.61224073", "0.612240...
0.6757063
3
Stores the history of a source, so it can be cloned
function HistoryReader(source) { var history = [], clones; // Tries to read the item at the given history position this.readAt = function (pos) { var item = null; // Retrieve an item from history when available if (pos < history.length) item = history[pos]; // Read a new item from the sourc...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "saveInHistory(state) {\n let histName = state.currentHistoryName;\n\n if (histName === null) {\n // New history row\n histName = this.getNewHistoryName(state);\n state.currentHistoryName = histName;\n }\n\n state.history[histName] = {\n name: ...
[ "0.6803006", "0.6625774", "0.6540042", "0.64809877", "0.6305766", "0.6297808", "0.6281711", "0.62359446", "0.62241095", "0.61342496", "0.6102781", "0.60718673", "0.6020121", "0.5909027", "0.58937883", "0.5856871", "0.585672", "0.5842682", "0.5805223", "0.57910836", "0.57817",...
0.6356294
4
Determines whether the given object is a function
function isFunction(object) { return typeof object === 'function'; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function isFunction( obj ){\n return Object.prototype.toString.call( obj ) == \"[object Function]\";\n }", "function isFunction(obj) {\n return typeof obj === 'function';\n}", "function isFunction(obj) {\n return typeof obj === 'function';\n}", "function isFunction(obj) {\n return typeof obj...
[ "0.85061455", "0.82998097", "0.82998097", "0.8298787", "0.82790625", "0.82790625", "0.82395136", "0.8192144", "0.81470084", "0.81470084", "0.8134642", "0.8134642", "0.81097776", "0.8096016", "0.80103755", "0.7954005", "0.7849762", "0.7799168", "0.77844834", "0.77600956", "0.7...
0.86716235
0
base64 is 4/3 + up to two characters of the original data
function byteLength (b64) { var lens = getLens(b64) var validLen = lens[0] var placeHoldersLen = lens[1] return ((validLen + placeHoldersLen) * 3 / 4) - placeHoldersLen }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "getBase64() {\n var s = this.getDump();\n\n var ch =\n \"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=\";\n var c1, c2, c3, e1, e2, e3, e4;\n var l = s.length;\n var i = 0;\n var r = \"\";\n\n do {\n c1 = s.charCodeAt(i);\n e1 = c1 >> 2;\n c2 = s.charCod...
[ "0.7704935", "0.73232865", "0.7285503", "0.72289795", "0.71821845", "0.7121846", "0.71039695", "0.7087322", "0.7060962", "0.6978246", "0.69750506", "0.69333935", "0.68980336", "0.68980336", "0.6893018", "0.68776006", "0.6873852", "0.6873852", "0.68521667", "0.6835299", "0.681...
0.0
-1
Could use `inherits` module, but don't want to move from single file architecture yet.
function inherits (ctor, superCtor) { ctor.super_ = superCtor; var TempCtor = function () {}; TempCtor.prototype = superCtor.prototype; ctor.prototype = new TempCtor(); ctor.prototype.constructor = ctor; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function inherit(){}", "function SuperclassBare() {}", "function SuperclassBare() {}", "function inherited() { }", "function inheritsFrom(child, parent){\nchild.prototype = Object.create(parent.prototype);\n}", "function inheritFrom(subfn,superfn) {\n\tvar r = function () {}\n\tr.prototype = superfn.prot...
[ "0.73977566", "0.72600657", "0.72600657", "0.69314426", "0.66141313", "0.64813936", "0.64593697", "0.63513047", "0.6343339", "0.6343339", "0.6322658", "0.6322658", "0.6122129", "0.6120975", "0.6094837", "0.6072585", "0.60704786", "0.606606", "0.6066017", "0.6063663", "0.60636...
0.0
-1
CooleyTukey algorithm for FFT slightly revisited to rely on looping instead of recursion
function FFTM (x, y) { this.x = x; this.y = y; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function FFTNayuki(n) {\n \n this.n = n;\n this.levels = -1;\n\n for (var i = 0; i < 32; i++) {\n if (1 << i == n) {\n this.levels = i; // Equal to log2(n)\n }\n }\n if (this.levels == -1) {\n throw \"Length is not a power of 2\";\n }\n\n this.cosTable = new...
[ "0.65954375", "0.6168972", "0.6044958", "0.6022759", "0.591924", "0.58853126", "0.5843347", "0.577806", "0.57772064", "0.5703021", "0.562801", "0.55890924", "0.5570078", "0.5464318", "0.54534", "0.5339202", "0.5326124", "0.5318228", "0.53027326", "0.52718914", "0.52644837", ...
0.0
-1
Bias adaptation function as per section 3.4 of RFC 3492.
function adapt(delta, numPoints, firstTime) { var k = 0; delta = firstTime ? floor(delta / damp) : delta >> 1; delta += floor(delta / numPoints); for (/* no initialization */; delta > baseMinusTMin * tMax >> 1; k += base) { delta = floor(delta / baseMinusTMin); } return floor(k + (baseMinusTMin + 1) * de...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function bias(alpha) {\n return function(d) {\n d.x += d.bias * alpha;\n };\n}", "function bias(alpha) {\n return function(d) {\n d.x += d.bias * alpha;\n };\n}", "function bias(alpha) {\n return function(d) {\n d.x += d.bias * alpha;\n };\n}", "function bias(alpha) {\n return function(d) {\n...
[ "0.6332913", "0.6332913", "0.6332913", "0.6332913", "0.6332913", "0.6332913", "0.6332913", "0.6332913", "0.6332913", "0.6332913", "0.6332913", "0.6332913", "0.6332913", "0.6332913", "0.6332913", "0.6332913", "0.6332913", "0.6332913", "0.6332913", "0.6332913", "0.6332913", "...
0.0
-1
The Buffer constructor returns instances of `Uint8Array` that have their prototype changed to `Buffer.prototype`. Furthermore, `Buffer` is a subclass of `Uint8Array`, so the returned instances will have all the node `Buffer` methods and the `Uint8Array` methods. Square bracket notation works as expected it returns a si...
function Buffer (arg, encodingOrOffset, length) { // Common case. if (typeof arg === 'number') { if (typeof encodingOrOffset === 'string') { throw new TypeError( 'The "string" argument must be of type string. Received type number' ) } return allocUnsafe(arg) } return from(arg, en...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function BufferToArrayBuffer () {\n return (new Buffer(this)).buffer\n}", "function BufferToArrayBuffer () {\n return (new Buffer(this)).buffer\n}", "function BufferToArrayBuffer () {\n return (new Buffer(this)).buffer\n}", "function BufferToArrayBuffer () {\n return (new Buffer(this)).buffer\n}", "toB...
[ "0.73533624", "0.73533624", "0.73533624", "0.73533624", "0.697312", "0.6893881", "0.6893881", "0.6847371", "0.6847371", "0.6847371", "0.6847371", "0.6847371", "0.6847371", "0.6847371", "0.6837159", "0.6837159", "0.6837159", "0.6837159", "0.6837159", "0.6837159", "0.6837159", ...
0.0
-1
Finds either the first index of `val` in `buffer` at offset >= `byteOffset`, OR the last index of `val` in `buffer` at offset <= `byteOffset`. Arguments: buffer a Buffer to search val a string, Buffer, or number byteOffset an index into `buffer`; will be clamped to an int32 encoding an optional encoding, relevant is va...
function bidirectionalIndexOf (buffer, val, byteOffset, encoding, dir) { // Empty buffer means no match if (buffer.length === 0) return -1 // Normalize byteOffset if (typeof byteOffset === 'string') { encoding = byteOffset byteOffset = 0 } else if (byteOffset > 0x7fffffff) { byteOffset = 0x7fffff...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function bidirectionalIndexOf(buffer,val,byteOffset,encoding,dir){// Empty buffer means no match\n if(buffer.length===0)return -1;// Normalize byteOffset\n if(typeof byteOffset==='string'){encoding=byteOffset;byteOffset=0;}else if(byteOffset>0x7fffffff){byteOffset=0x7fffffff;}else if(byteOffset<-0x80000000){byte...
[ "0.82827604", "0.8255078", "0.8255078", "0.82535875", "0.82535875", "0.82535875", "0.82535875", "0.82535875", "0.82535875", "0.82535875", "0.82535875", "0.82486016", "0.8246429", "0.82446325", "0.82446325", "0.8228352", "0.82202876", "0.8218917", "0.8218917", "0.8218917", "0....
0.0
-1
Need to make sure that buffer isn't trying to write out of bounds.
function checkOffset (offset, ext, length) { if ((offset % 1) !== 0 || offset < 0) throw new RangeError('offset is not uint') if (offset + ext > length) throw new RangeError('Trying to access beyond buffer length') }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function writeBuffer(buffer, pos, src) {\n src.copy(buffer, pos)\n return src.length\n}", "function writeBuffer(buffer, pos, src) {\n src.copy(buffer, pos)\n return src.length\n}", "ensure(n) {\n let minsize = this.pos + n;\n if (minsize > this.capacity) {\n let cap = this.capacity * 2;\n w...
[ "0.66712785", "0.66712785", "0.6632945", "0.65210676", "0.63827264", "0.62754023", "0.62562263", "0.62335545", "0.62335545", "0.61056054", "0.6035937", "0.6017502", "0.59810936", "0.5959609", "0.5951102", "0.5951102", "0.5951102", "0.5951102", "0.5951102", "0.5951102", "0.595...
0.0
-1
ArrayBuffer or Uint8Array objects from other contexts (i.e. iframes) do not pass the `instanceof` check but they should be treated as of that type. See:
function isInstance (obj, type) { return obj instanceof type || (obj != null && obj.constructor != null && obj.constructor.name != null && obj.constructor.name === type.name) }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function isArrayBuffer (o) { return o instanceof ArrayBuffer }", "function isArrayBuffer (o) { return o instanceof ArrayBuffer }", "function isArrayBuffer(value) {\n return typeof ArrayBuffer !== 'undefined' && value instanceof ArrayBuffer;\n}", "function isArrayBuffer(value) {\n return typeof ArrayBuf...
[ "0.69306934", "0.69306934", "0.6641766", "0.6641766", "0.6641766", "0.6641766", "0.6641766", "0.6641766", "0.6641766", "0.6641766", "0.6641766", "0.6641766", "0.6641766", "0.6641766", "0.6641766", "0.6614989", "0.657236", "0.657236", "0.65622836", "0.6551273", "0.6503643", ...
0.0
-1
Copyright Joyent, Inc. and other Node contributors. Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish...
function isArray(arg) { if (Array.isArray) { return Array.isArray(arg); } return objectToString(arg) === '[object Array]'; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function t(e){return!!e.constructor&&'function'==typeof e.constructor.isBuffer&&e.constructor.isBuffer(e)}", "function n(e){return!!e.constructor&&\"function\"==typeof e.constructor.isBuffer&&e.constructor.isBuffer(e)}", "function t(n){return!!n.constructor&&typeof n.constructor.isBuffer==\"function\"&&n.const...
[ "0.6310498", "0.62241507", "0.62193394", "0.62193394", "0.62193394", "0.6153942", "0.6149915", "0.60841656", "0.60841656", "0.60841656", "0.60841656", "0.60841656", "0.60841656", "0.60841656", "0.60841656", "0.60841656", "0.6049013", "0.6019559", "0.59801257", "0.59801257", "...
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 eslintdisablenextline complexity
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' || window.process.__nwjs)) { ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function formatBrowserArgs(args, config) {\n args[0] = (config.useColors ? '%c' : '') + config.namespace;\n\n if (!config.useColors) {\n return;\n }\n\n var c = 'color: ' + config.color; // The final \"%c\" is somewhat tricky, because there could be other\n // arguments passed either before or after the %c...
[ "0.60764307", "0.6059231", "0.60451484", "0.58659214", "0.5846698", "0.58371514", "0.5759423", "0.57381845", "0.57263654", "0.5663022", "0.5643569", "0.5620089", "0.5582517", "0.55343544", "0.5498034", "0.54834205", "0.5471804", "0.54588556", "0.54568964", "0.54401374", "0.54...
0.0
-1
Colorize log arguments if enabled.
function formatArgs(args) { args[0] = (this.useColors ? '%c' : '') + this.namespace + (this.useColors ? ' %c' : ' ') + args[0] + (this.useColors ? '%c ' : ' ') + '+' + module.exports.humanize(this.diff); if (!this.useColors) { return; } var c = 'color: ' + this.color; args.splice(1, 0, c, 'color: inheri...
{ "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() { var _console; // This hackery is required for IE8/9, where // the `console.log` function doesn't have 'apply' return (typeof console === "undefined" ? "undefined" : _typeof(console)) === 'object' && console.log && (_console = console).log.apply(_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.77411646", "0.7718892", "0.7708851", "0.761099", "0.7568242", "0.7568242", "0.7532574", "0.74909663", "0.7415826", "0.7338115", "0.7331344", "0.7330527", "0.7324998", "0.7313461", "0.7310499", "0.7310499", "0.7310499", "0.7310499", "0.7310499", "0.7306123", "0.7306123", ...
0.0
-1
This is the common logic for both the Node.js and web browser implementations of `debug()`.
function setup(env) { createDebug.debug = createDebug; createDebug.default = createDebug; createDebug.coerce = coerce; createDebug.disable = disable; createDebug.enable = enable; createDebug.enabled = enabled; createDebug.humanize = require('ms'); Object.keys(env).forEach(function (key) { createDebu...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "debug() {}", "function debugMessage() {\n if (debug) console.debug(arguments);\n}", "function devDebug(){\n\n}", "function myDebug(){\n if(window.console) console.info(arguments);\n}", "function debug(v){return false;}", "function debug () {\n if (Retsly.debug) console.log.apply(console, arguments);...
[ "0.7652509", "0.74096084", "0.7318914", "0.7226053", "0.7215856", "0.7162374", "0.7085911", "0.7065271", "0.705507", "0.7048263", "0.69517106", "0.69369656", "0.6883004", "0.6875988", "0.6871241", "0.68694156", "0.6822824", "0.6816359", "0.6787025", "0.67823404", "0.6781866",...
0.0
-1
Add aliases to match BigDecimal method names. P.add = P.plus; P.subtract = P.minus; P.multiply = P.times; P.divide = P.div; P.remainder = P.mod; P.compareTo = P.cmp; P.negate = P.neg; Helper functions for Decimal.prototype (P) and/or Decimal methods, and their callers. / digitsToString P.cubeRoot, P.logarithm, P.square...
function digitsToString(d) { var i, k, ws, indexOfLastWord = d.length - 1, str = '', w = d[0]; if (indexOfLastWord > 0) { str += w; for (i = 1; i < indexOfLastWord; i++) { ws = d[i] + ''; k = LOG_BASE - ws.length; if (k) str += getZeroString(k); str...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function clone(obj) {\r\n var i, p, ps;\r\n\r\n /*\r\n * The Decimal constructor and exported function.\r\n * Return a new Decimal instance.\r\n *\r\n * v {number|string|Decimal} A numeric value.\r\n *\r\n */\r\n function Decimal(v) {\r\n var e, i, t,\r\n x = this;\r\n\...
[ "0.5414985", "0.5414985", "0.5414985", "0.5400911", "0.53822863", "0.52951497", "0.5246445", "0.52406174", "0.523512", "0.52177286", "0.52177286", "0.51495934", "0.5128104", "0.5123307", "0.51074976", "0.51074976", "0.51074976", "0.5102085", "0.50976914", "0.5095758", "0.5095...
0.0
-1
Check 5 rounding digits if `repeating` is null, 4 otherwise. `repeating == null` if caller is `log` or `pow`, `repeating != null` if caller is `naturalLogarithm` or `naturalExponential`.
function checkRoundingDigits(d, i, rm, repeating) { var di, k, r, rd; // Get the length of the first word of the array d. for (k = d[0]; k >= 10; k /= 10) --i; // Is the rounding digit in the first word of d? if (--i < 0) { i += LOG_BASE; di = 0; } else { di = Math.ceil((i + ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function checkRoundingDigits(d, i, rm, repeating) {\r\n var di, k, r, rd;\r\n\r\n // Get the length of the first word of the array d.\r\n for (k = d[0]; k >= 10; k /= 10) --i;\r\n\r\n // Is the rounding digit in the first word of d?\r\n if (--i < 0) {\r\n i += LOG_BASE;\...
[ "0.60972583", "0.60577106", "0.60577106", "0.60577106", "0.60577106", "0.60577106", "0.60577106", "0.6046391", "0.60334164", "0.6028217", "0.52516985", "0.5194561", "0.5151386", "0.49450272", "0.48858893", "0.48308405", "0.47661483", "0.47405264", "0.47080967", "0.47063133", ...
0.6003001
10
Convert string of `baseIn` to an array of numbers of `baseOut`. Eg. convertBase('255', 10, 16) returns [15, 15]. Eg. convertBase('ff', 16, 10) returns [2, 5, 5].
function convertBase(str, baseIn, baseOut) { var j, arr = [0], arrL, i = 0, strL = str.length; for (; i < strL;) { for (arrL = arr.length; arrL--;) arr[arrL] *= baseIn; arr[0] += NUMERALS.indexOf(str.charAt(i++)); for (j = 0; j < arr.length; j++) { if (arr[j] >...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function convertBase(str, baseIn, baseOut) {\n var j,\n arr = [0],\n arrL,\n i = 0,\n strL = str.length;\n\n for (; i < strL;) {\n for (arrL = arr.length; arrL--;) arr[arrL] *= baseIn;\n arr[0] += NUMERALS.indexOf(str.charAt(i++));\n for (j = 0; j < arr.length; j++)...
[ "0.7526895", "0.7525958", "0.75174034", "0.7510832", "0.7510832", "0.7510832", "0.7510832", "0.7510832", "0.7510832", "0.742525", "0.7230662", "0.7230662", "0.7185348", "0.71545106", "0.71510035", "0.71510035", "0.7148414", "0.7148414", "0.71429855", "0.71429855", "0.71429855...
0.75315374
0
cos(x) = 1 x^2/2! + x^4/4! ... |x| < pi/2
function cosine(Ctor, x) { var k, y, len = x.d.length; // Argument reduction: cos(4x) = 8*(cos^4(x) - cos^2(x)) + 1 // i.e. cos(x) = 8*(cos^4(x/4) - cos^2(x/4)) + 1 // Estimate the optimum number of times to use the argument reduction. if (len < 32) { k = Math.ceil(len / 3); y = ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function acos(x) {\n if (x > 1 + 1e-6 || x < -1 - 1e-6) { \n throw Error(\"acos(\" + x + \")\"); \n }\n return Math.acos(x);\n }", "cos() {\n return round(Math.cos((this.angle * pi) / 180), 2);\n }", "function cos(value) {\n return round(Math.cos(RADIANS * value), 10);\n}"...
[ "0.8099079", "0.7860807", "0.7593425", "0.7519578", "0.74841666", "0.72955906", "0.7215628", "0.72110015", "0.71981937", "0.71981937", "0.7154035", "0.7034847", "0.70209324", "0.7012575", "0.6963557", "0.6927853", "0.68948466", "0.68774414", "0.68774414", "0.68774414", "0.687...
0.69494814
15
Assumes nonzero x and k, and hence nonzero result.
function multiplyInteger(x, k, base) { var temp, carry = 0, i = x.length; for (x = x.slice(); i--;) { temp = x[i] * k + carry; x[i] = temp % base | 0; carry = temp / base | 0; } if (carry) x.unshift(carry); return x; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function solution(k) {\n const res = Array.from({ length: k }, () => 0);\n\n // 생성자\n for (let i = 1; i <= k; i++) {\n if (d(i) <= 10000) res[d(i)] = 1;\n }\n\n for (let i = 1; i < k; i++) {\n if (res[i] === 0) console.log(i);\n }\n}", "function inout ( k ) {\n\n\t\tif ( ( k *= 2 ) < 1 ) return 0.5 *...
[ "0.68749666", "0.6700192", "0.659596", "0.6558563", "0.6426495", "0.64071685", "0.632862", "0.6265732", "0.62226695", "0.62187696", "0.6207546", "0.6179355", "0.612393", "0.61071604", "0.6066565", "0.60561115", "0.60393643", "0.59988195", "0.59846526", "0.59846294", "0.598364...
0.0
-1
Round `x` to `sd` significant digits using rounding mode `rm`. Check for over/underflow.
function finalise(x, sd, rm, isTruncated) { var digits, i, j, k, rd, roundUp, w, xd, xdi, Ctor = x.constructor; // Don't round if sd is null or undefined. out: if (sd != null) { xd = x.d; // Infinity/NaN. if (!xd) return x; // rd: the rounding digit, i.e. the digit after the...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function round(x, sd, rm) {\n var i, j, k, n, rd, doRound, w, xdi,\n xd = x.d;\n\n // rd: the rounding digit, i.e. the digit after the digit that may be rounded up.\n // w: the word of xd which contains the rounding digit, a base 1e7 number.\n // xdi: the index of w within xd.\n // n: the numbe...
[ "0.7235597", "0.72286576", "0.69747233", "0.6960606", "0.6960606", "0.6960606", "0.6960606", "0.6960606", "0.6960606", "0.6960606", "0.6960606", "0.6960606", "0.6960606", "0.6960606", "0.6960606", "0.69104195", "0.6906656", "0.6896084", "0.6891273", "0.6878811", "0.6878811", ...
0.6846943
32
Calculate the base 10 exponent from the base 1e7 exponent.
function getBase10Exponent(digits, e) { var w = digits[0]; // Add the number of digits of the first word of the digits array. for ( e *= LOG_BASE; w >= 10; w /= 10) e++; return e; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function getBase10Exponent(digits, e) {\r\n var w = digits[0];\r\n\r\n // Add the number of digits of the first word of the digits array.\r\n for ( e *= LOG_BASE; w >= 10; w /= 10) e++;\r\n return e;\r\n }", "function getBase10Exponent(digits, e) {\r\n var w = digits[0];\r\n\r\n // Add the num...
[ "0.7588247", "0.7588247", "0.7588247", "0.7588247", "0.7588247", "0.7588247", "0.7587742", "0.7582838", "0.75687057", "0.7531755", "0.7527623", "0.7524651", "0.7513687", "0.74582225", "0.7394703", "0.73618066", "0.7000235", "0.69890976", "0.6983505", "0.69689834", "0.69602185...
0.75621396
9
Return a new Decimal whose value is the value of Decimal `x` to the power `n`, where `n` is an integer of type number. Implements 'exponentiation by squaring'. Called by `pow` and `parseOther`.
function intPow(Ctor, x, n, pr) { var isTruncated, r = new Ctor(1), // Max n of 9007199254740991 takes 53 loop iterations. // Maximum digits array length; leaves [28, 34] guard digits. k = Math.ceil(pr / LOG_BASE + 4); external = false; for (;;) { if (n % 2) { r = r....
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function pow(n,x) {\n\t\treturn Math.pow(n,x);\n\t}", "function raiseToPower(n, e) {\nreturn Math.pow(n, e);\n}", "function power(exponent) {\n return Math.pow(this, exponent);\n}", "function pow(x, n){\n if (n == 1){\n return x;\n }else {\n return x * pow(x, n - 1);\n }\n}", "toT...
[ "0.6760652", "0.6607009", "0.6573333", "0.65178484", "0.634966", "0.634966", "0.632661", "0.6319136", "0.62974733", "0.6251526", "0.62451243", "0.62372917", "0.61784667", "0.6175198", "0.6173361", "0.61391777", "0.61331964", "0.6089797", "0.60766304", "0.6059239", "0.6036329"...
0.58449656
51
Handle `max` and `min`. `ltgt` is 'lt' or 'gt'.
function maxOrMin(Ctor, args, ltgt) { var y, x = new Ctor(args[0]), i = 0; for (; ++i < args.length;) { y = new Ctor(args[i]); if (!y.s) { x = y; break; } else if (x[ltgt](y)) { x = y; } } return x; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function range(input,min,max) {\n\t\tif(min > max) { var x = min; min = max; max = x;}\n\t\treturn Math.max(Math.min(input,max),min);\n\t}", "function changeMaxAndMin(minRange, maxRange) {\n var minStorage = document.querySelector('#post-min-range');\n var maxStorage = document.querySelector('#post-max-range')...
[ "0.7548751", "0.7462054", "0.7392292", "0.7392003", "0.72355783", "0.7190105", "0.71074736", "0.7075066", "0.70570815", "0.7054644", "0.7040229", "0.7036163", "0.70084035", "0.69720095", "0.69720095", "0.6952045", "0.69313276", "0.69067955", "0.68912685", "0.6806954", "0.6803...
0.64624053
77
Return a new Decimal whose value is the natural logarithm of `x` rounded to `sd` significant digits. ln(n) = NaN ln(0) = Infinity ln(0) = Infinity ln(1) = 0 ln(Infinity) = Infinity ln(Infinity) = NaN ln(NaN) = NaN ln(n) (n != 1) is nonterminating.
function naturalLogarithm(y, sd) { var c, c0, denominator, e, numerator, rep, sum, t, wpr, x1, x2, n = 1, guard = 10, x = y, xd = x.d, Ctor = x.constructor, rm = Ctor.rounding, pr = Ctor.precision; // Is x negative or Infinity, NaN, 0 or 1? if (x.s < 0 || !xd || !x...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function naturalLogarithm(y, sd) {\r\n var c, c0, denominator, e, numerator, rep, sum, t, wpr, x1, x2,\r\n n = 1,\r\n guard = 10,\r\n x = y,\r\n xd = x.d,\r\n Ctor = x.constructor,\r\n rm = Ctor.rounding,\r\n pr = Ctor.precision;\r\n\r\n // Is x negative or Infinity, NaN, 0...
[ "0.7275113", "0.7275113", "0.7275113", "0.7275113", "0.7275113", "0.7275113", "0.72727597", "0.72707844", "0.72673285", "0.7263192", "0.7252153", "0.7248565", "0.601761", "0.5984584", "0.59247476", "0.59247476", "0.5774144", "0.57237065", "0.56399614", "0.562256", "0.5593401"...
0.72516656
11
Parse the value of a new Decimal `x` from string `str`.
function parseDecimal(x, str) { var e, i, len; // Decimal point? if ((e = str.indexOf('.')) > -1) str = str.replace('.', ''); // Exponential form? if ((i = str.search(/e/i)) > 0) { // Determine exponent. if (e < 0) e = i; e += +str.slice(i + 1); str = str.substring(0, i); ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function parseDecimal(x, str) {\n var e, i, len;\n\n // Decimal point?\n if ((e = str.indexOf('.')) > -1) str = str.replace('.', '');\n\n // Exponential form?\n if ((i = str.search(/e/i)) > 0) {\n\n // Determine exponent.\n if (e < 0) e = i;\n e += +str.slice(i + 1);\n str = str....
[ "0.7485928", "0.74259967", "0.73229516", "0.72879624", "0.7190753", "0.7190753", "0.7190753", "0.7190753", "0.7190753", "0.7190753", "0.71633744", "0.71270543", "0.6898888", "0.6440587", "0.64230853", "0.641967", "0.6403981", "0.6403867", "0.6403867", "0.6403867", "0.6397941"...
0.7285144
4
Parse the value of a new Decimal `x` from a string `str`, which is not a decimal value.
function parseOther(x, str) { var base, Ctor, divisor, i, isFloat, len, p, xd, xe; if (str === 'Infinity' || str === 'NaN') { if (!+str) x.s = NaN; x.e = NaN; x.d = null; return x; } if (isHex.test(str)) { base = 16; str = str.toLowerCase(); } else if (isBinary...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function parseDecimal(x, str) {\n var e, i, len;\n\n // Decimal point?\n if ((e = str.indexOf('.')) > -1) str = str.replace('.', '');\n\n // Exponential form?\n if ((i = str.search(/e/i)) > 0) {\n\n // Determine exponent.\n if (e < 0) e = i;\n e += +str.slice(i + 1);\n str = str....
[ "0.73159313", "0.72510827", "0.7157435", "0.7133286", "0.7129973", "0.7098887", "0.7029861", "0.7029861", "0.7029861", "0.7029861", "0.7029861", "0.7029861", "0.70097023", "0.69340193", "0.64845276", "0.6434023", "0.64008117", "0.6360228", "0.6360228", "0.6360228", "0.6353425...
0.59159654
46
sin(x) = x x^3/3! + x^5/5! ... |x| < pi/2
function sine(Ctor, x) { var k, len = x.d.length; if (len < 3) return taylorSeries(Ctor, 2, x, x); // Argument reduction: sin(5x) = 16*sin^5(x) - 20*sin^3(x) + 5*sin(x) // i.e. sin(x) = 16*sin^5(x/5) - 20*sin^3(x/5) + 5*sin(x/5) // and sin(x) = sin(x/5)(5 + sin^2(x/5)(16sin^2(x/5) - 20)) ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function sinu(x){\n return Math.sin(x);\n}", "function sin(value) {\n return round(Math.sin(RADIANS * value), 10);\n}", "function sin(a) {\n return Math.sin(a/360*Math.PI*2);\n}", "function sinIn(t) {\n return 1 - Math.cos(t * _utils_Math__WEBPACK_IMPORTED_MODULE_0__[\"HALFPI\"]);\n}", "function...
[ "0.8421615", "0.757059", "0.7563146", "0.753626", "0.74548554", "0.7297114", "0.7275929", "0.71769917", "0.7017425", "0.7013544", "0.6953563", "0.6936943", "0.6922343", "0.6897047", "0.6897047", "0.68814516", "0.6779118", "0.6775122", "0.67393804", "0.6719508", "0.66803676", ...
0.6725183
19
Calculate Taylor series for `cos`, `cosh`, `sin` and `sinh`.
function taylorSeries(Ctor, n, x, y, isHyperbolic) { var j, t, u, x2, i = 1, pr = Ctor.precision, k = Math.ceil(pr / LOG_BASE); external = false; x2 = x.times(x); u = new Ctor(y); for (;;) { t = divide(u.times(x2), new Ctor(n++ * n++), pr, 1); u = isHyperbolic ? y.plu...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function taylorSeries(Ctor, n, x, y, isHyperbolic) {\n var j,t,u,x2,\n i = 1,\n pr = Ctor.precision,\n k = Math.ceil(pr / LOG_BASE);\n\n external = false;\n x2 = x.times(x);\n u = new Ctor(y);\n\n for (;;) {\n t = divide(u.times(x2), new Ctor(n++ * n++), pr, 1);\n u = isHyperbolic...
[ "0.66006225", "0.65879047", "0.656365", "0.65513396", "0.653128", "0.653128", "0.653128", "0.653128", "0.653128", "0.653128", "0.65170455", "0.60761553", "0.5957738", "0.5742497", "0.56687254", "0.56633615", "0.5644347", "0.5575663", "0.5571131", "0.55347234", "0.5471643", ...
0.6577103
2
Exponent e must be positive and nonzero.
function tinyPow(b, e) { var n = b; while (--e) n *= b; return n; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function exp(n, e) {\n n = n ? n : 0;\n e = e ? e : 1;\n\n return Math.pow(n, e);\n}", "function bnpExp(e,z) {\n\t if(e > 0xffffffff || e < 1) return BigInteger$4.ONE;\n\t var r = nbi(), r2 = nbi(), g = z.convert(this), i = nbits(e)-1;\n\t g.copyTo(r);\n\t while(--i >= 0) {\n\t z.sqrTo(r,r2);\n\t...
[ "0.7631892", "0.70590985", "0.70584404", "0.70584404", "0.70536923", "0.7053431", "0.70494837", "0.70460826", "0.7044226", "0.7042919", "0.7042919", "0.7042919", "0.7042919", "0.7042919", "0.7042919", "0.7042919", "0.7042919", "0.7042919", "0.7042919", "0.7042919", "0.7042919...
0.0
-1
Return the absolute value of `x` reduced to less than or equal to half pi.
function toLessThanHalfPi(Ctor, x) { var t, isNeg = x.s < 0, pi = getPi(Ctor, Ctor.precision, 1), halfPi = pi.times(0.5); x = x.abs(); if (x.lte(halfPi)) { quadrant = isNeg ? 4 : 1; return x; } t = x.divToInt(pi); if (t.isZero()) { quadrant = isNeg ? 3 : 2...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function toLessThanHalfPi(Ctor, x) {\r\n var t,\r\n isNeg = x.s < 0,\r\n pi = getPi(Ctor, Ctor.precision, 1),\r\n halfPi = pi.times(0.5);\r\n\r\n x = x.abs();\r\n\r\n if (x.lte(halfPi)) {\r\n quadrant = isNeg ? 4 : 1;\r\n return x;\r\n }\r\n\...
[ "0.6725818", "0.6685206", "0.66795826", "0.6649974", "0.6649974", "0.6649974", "0.6649974", "0.6649974", "0.6649974", "0.6608072", "0.63075674", "0.62204844", "0.6031237", "0.59562606", "0.5877479", "0.5850173", "0.5667795", "0.5658012", "0.56423634", "0.5611077", "0.5609667"...
0.6730945
0
Return the value of Decimal `x` as a string in base `baseOut`. If the optional `sd` argument is present include a binary exponent suffix.
function toStringBinary(x, baseOut, sd, rm) { var base, e, i, k, len, roundUp, str, xd, y, Ctor = x.constructor, isExp = sd !== void 0; if (isExp) { checkInt32(sd, 1, MAX_DIGITS); if (rm === void 0) rm = Ctor.rounding; else checkInt32(rm, 0, 8); } else { sd = Ctor.precis...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function toStringBinary(x, baseOut, sd, rm) {\n var base,\n e,\n i,\n k,\n len,\n roundUp,\n str,\n xd,\n y,\n Ctor = x.constructor,\n isExp = sd !== void 0;\n\n if (isExp) {\n checkInt32(sd, 1, MAX_DIGITS);\n if (rm === void 0) ...
[ "0.76368487", "0.76281774", "0.7600409", "0.75991404", "0.75991404", "0.75991404", "0.75991404", "0.75991404", "0.75991404", "0.75431067", "0.6120418", "0.6106281", "0.61010855", "0.61010855", "0.60969895", "0.6095748", "0.60862565", "0.60862565", "0.60862565", "0.60862565", ...
0.7622646
2
Does not strip trailing zeros.
function truncate(arr, len) { if (arr.length > len) { arr.length = len; return true; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function removeTrailingZeroes(value) {\n while (value.charAt(value.length - 1) === '0') {\n value = value.slice(0, -1);\n }\n if (value.charAt(value.length - 1) === '.') {\n value = value.slice(0, -1);\n }\n return value;\n ...
[ "0.8147659", "0.7587199", "0.75309265", "0.74909717", "0.74263084", "0.72597784", "0.7174463", "0.7105141", "0.7071576", "0.6993647", "0.6945248", "0.6941877", "0.68434787", "0.68286467", "0.6805207", "0.6800466", "0.6768127", "0.668407", "0.668407", "0.668407", "0.6673765", ...
0.0
-1
Create and return a Decimal constructor with the same configuration properties as this Decimal constructor.
function clone(obj) { var i, p, ps; /* * The Decimal constructor and exported function. * Return a new Decimal instance. * * v {number|string|Decimal} A numeric value. * */ function Decimal(v) { var e, i, t, x = this; // Decimal called without new. i...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function Decimal(number) {\n if (number === undefined || number === null) {\n throw new TypeError('Decimal constructor() missing arguments');\n }\n if (number.constructor === Decimal) {\n return number;\n }\n if (typeof number !== 'object') {\n number = Decimal.parse(String(number));\n }\n if (numb...
[ "0.68006605", "0.6472053", "0.6269037", "0.6230504", "0.61720544", "0.61720544", "0.61720544", "0.61442107", "0.61359406", "0.61086535", "0.6104921", "0.609371", "0.609371", "0.6061301", "0.57663924", "0.57663924", "0.5472444", "0.53750134", "0.5364202", "0.52738607", "0.5271...
0.6099396
11
Return true if object is a Decimal instance (where Decimal is any Decimal constructor), otherwise return false.
function isDecimalInstance(obj) { return obj instanceof Decimal || obj && obj.name === '[object Decimal]' || false; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function isDecimalInstance(obj) {\r\n return obj instanceof Decimal || obj && obj.name === '[object Decimal]' || false;\r\n}", "function isDecimalInstance(obj) {\r\n return obj instanceof Decimal || obj && obj.name === '[object Decimal]' || false;\r\n }", "function isDecimalInstance(obj) {\r\n return o...
[ "0.8730868", "0.87180686", "0.87180686", "0.87180686", "0.87180686", "0.87180686", "0.81437844", "0.81119776", "0.61806023", "0.59684736", "0.5960679", "0.594405", "0.59098583", "0.58835083", "0.58693916", "0.58693916", "0.58693916", "0.5865683", "0.58542705", "0.58542705", "...
0.8754406
1
Tests whether an element is a tag or not.
function isTag(elem) { return (elem.type === "tag" /* Tag */ || elem.type === "script" /* Script */ || elem.type === "style" /* Style */); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function isTag(elem) {\n return elem.type === ElementType.Tag || elem.type === ElementType.Script || elem.type === ElementType.Style;\n}", "function isTag(elem) {\n return elem.type === ElementType.Tag ||\n elem.type === ElementType.Script ||\n elem.type === ElementType.Style;\n }", "function isTag(...
[ "0.8145723", "0.8123714", "0.8100448", "0.8100448", "0.8100448", "0.8100448", "0.8100448", "0.7997794", "0.7996531", "0.7825027", "0.7378857", "0.73515284", "0.71049786", "0.693353", "0.6900704", "0.6865374", "0.6863823", "0.6818629", "0.6802458", "0.6797553", "0.67960286", ...
0.801183
12
Initiate a new DomHandler.
function DomHandler(callback, options, elementCB) { /** The constructed DOM */ this.dom = []; /** Indicated whether parsing has been completed. */ this._done = false; /** Stack of open tags. */ this._tagStack = []; /** A data node that is still being written to. *...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function DomHandler(callback,options,elementCB){/** The constructed DOM */this.dom=[];/** Indicated whether parsing has been completed. */this._done=false;/** Stack of open tags. */this._tagStack=[];/** A data node that is still being written to. */this._lastNode=null;/** Reference to the parser instance. Used for...
[ "0.6116187", "0.60521954", "0.600688", "0.59824353", "0.577455", "0.5771322", "0.5678111", "0.5646265", "0.56432617", "0.55937535", "0.556512", "0.550748", "0.5492517", "0.547815", "0.54280806", "0.54280806", "0.54280806", "0.54280806", "0.54280806", "0.5420925", "0.5407207",...
0.59726197
4
Compare the position of one node against another node in any other document. The return value is a bitmask with the following values: document order: > There is an ordering, document order, defined on all the nodes in the > document corresponding to the order in which the first character of the > XML representation of ...
function compareDocumentPosition(nodeA, nodeB) { var aParents = []; var bParents = []; if (nodeA === nodeB) { return 0; } var current = tagtypes_1.hasChildren(nodeA) ? nodeA : nodeA.parent; while (current) { aParents.unshift(current); current = current.parent; } c...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function _comparePosition(a,b){return a.compareDocumentPosition?a.compareDocumentPosition(b):a.contains?(a!=b&&a.contains(b)&&16)+(a!=b&&b.contains(a)&&8)+(0<=a.sourceIndex&&0<=b.sourceIndex?(a.sourceIndex<b.sourceIndex&&4)+(a.sourceIndex>b.sourceIndex&&2):1)+0:0}", "function compareDomPosition(a, b) {\n return...
[ "0.70399994", "0.6721058", "0.6611204", "0.6445388", "0.64245707", "0.64024943", "0.6346791", "0.6346791", "0.6346791", "0.6335236", "0.63347685", "0.526015", "0.5212475", "0.52047426", "0.513771", "0.5135421", "0.50332963", "0.5002073", "0.49723363", "0.49609402", "0.4955327...
0.6471266
3
Sort an array of nodes based on their relative position in the document and remove any duplicate nodes. If the array contains nodes that do not belong to the same document, sort order is unspecified.
function uniqueSort(nodes) { nodes = nodes.filter(function (node, i, arr) { return !arr.includes(node, i + 1); }); nodes.sort(function (a, b) { var relative = compareDocumentPosition(a, b); if (relative & 2 /* PRECEDING */) { return -1; } else if (relative & 4 /* FOLL...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function uniqueSort(nodes) {\n nodes = nodes.filter((node, i, arr) => !arr.includes(node, i + 1));\n nodes.sort((a, b) => {\n const relative = compareDocumentPosition(a, b);\n if (relative & DocumentPosition.PRECEDING) {\n return -1;\n }\n else if (relative & DocumentPo...
[ "0.7670655", "0.7644501", "0.7611705", "0.7549138", "0.75144804", "0.6669911", "0.6240617", "0.61276376", "0.59330344", "0.5819653", "0.57869166", "0.5686884", "0.56329244", "0.5632785", "0.5533071", "0.5533071", "0.5459666", "0.5449", "0.5436784", "0.5406527", "0.5406527", ...
0.75831276
7