query
stringlengths
9
34k
document
stringlengths
8
5.39M
negatives
listlengths
19
20
metadata
dict
Find all the layers in this document which has the given name.
getLayersNamed(layerName) { // search all pages let filteredArray = NSArray.array() const loopPages = this._object.pages().objectEnumerator() let page = loopPages.nextObject() const predicate = NSPredicate.predicateWithFormat('name == %@', layerName) while (page) { const scope = page.child...
[ "function findLayerByName(_document, _name){\r \r var layers = _document.layers;\r for (var i = 0; i < layers.length; i++) {\r if (layers[i].name === _name) {\r return layers[i];\r }\r }\r}", "function getLayerByName(_name) {\n\treturn layers.find(function(element) {\n\t\tretu...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
renderCursorAt When we are using textLayout to render editor, create a cursor that adjusts it's size
renderCursorAt(position, textType) { let adjH = 0; let adjY = 0; if (!this.updatedMetrics) { this._calculateBlockIndex(); } const group = this.context.openGroup(); group.id = 'inlineCursor'; const h = this.fontSize; if (this.blocks.length <= position || position < 0) { svgHel...
[ "renderCursorAt(position, textType) {\n let adjH = 0;\n let adjY = 0;\n if (!this.updatedMetrics) {\n this._calculateBlockIndex();\n }\n const group = this.context.getContext().openGroup();\n group.id = 'inlineCursor';\n const h = this.fontSize;\n i...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
we have joined a party
function party_joined(party, reason, pc){ //log.error("party_joined for "+this.tsid); this.party = party; var m = party.get_members(); //this.sendActivity('MSG:party_join'); this.apiSendMsg({ type : 'party_join', members : m }); if (reason == 'invite_accepted'){ this.party_activity(utils.escape(pc.la...
[ "function join() {\n\t\t// Other player should see that I have joined the game...\n\t\t//COM.publish({cmd:\"join\", who:params.player});\n\t\tCOM.publish(new CMD.Join(params.player));\n\t}", "function party_now_leader(){\n\n\tthis.party_activity('now leader of party');\n}", "function party_is_in(){\n\n\treturn ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Render a list of builds as a list of jobs with expandable build sections.
function renderJobs(parent, clusterId) { if (parent.children.length > 0) { return; // already done } var counts = clustered.makeCounts(clusterId); var jobs = {}; for (let build of clustered.buildsForClusterById(clusterId)) { let job = build.job; if (!jobs[job]) { jobs[job] = new Set(); ...
[ "function renderJobs(jobs){\n const html = jobs.map(function(job, jobId) {\n // job is our object, it is iterating over an array and it is rendering the data from the keys that belong on the object\n return `\n <li class='job-item'> \n <h2 id=\"${jobId}\">${job.company}</...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
the appendPageLinks function receives an array of students as a parameter if pagination links already exist in the DOM, this calls to dropPageLinks() to remove them then the function reconstructs the appropriate number of pagination links based on the array passed to it it then adds an event handler on unordered list h...
function appendPageLinks(paramList) { if (document.querySelector('div.pagination') != undefined) { dropPageLinks(); // calls the dropPage Links function so new pagination links can be created from scratch } //1. Determine the number of pages that are need for the list by dividing the list items by the max n...
[ "function appendPageLinks(students) {\n\tlet pages = Math.ceil(students.length/10); \n\n\tif($('.pagination').length===0){\n\t\t$('.page').append('<div class=\"pagination\"></div>');\n\t} \n\t\n\tif (pages > 1)\n\t{\t\n\t\t$('.pagination').append('<ul></ul>');\n\t\tfor (let i=1;i<=pages;i=i+1)\n\t\t{\n\t\t\tif (i...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Botones generales de las vistas que involucran productos///////////////////////// Carga la funcionalidad de los botones que se presentan con cada producto.
function CargarBotonesProducto() { $('.btnVerDetalles').click(function (e) { e.preventDefault(); const iIdProducto = $(this).siblings('#iIdProducto').val(); const cUrl = '/Producto/VerDetalles?iIdProducto=' + iIdProducto; AbrirModal(cUrl, CargarBotonesModal); }); $('.btnAg...
[ "function instanciarProductos() {\n const producto_uno = new Producto(\"Zapatillas\", 9000, \"img/zapatillas.png\", 450, \"Calzado\");\n const producto_dos = new Producto(\"Remeras\", 1500, \"img/remeras.png\", 650, \"Indumentaria\");\n const producto_tres = new Producto(\"Gorras\", 500, \"img/gorras.png\"...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
joins selector path from `beginningPath` with every selector path in `addPaths` array `replacedElement` contains element that is being replaced by `addPath` returns array with all concatenated paths
function addAllReplacementsIntoPath( beginningPath, addPaths, replacedElement, originalSelector, result) { var j; for (j = 0; j < beginningPath.length; j++) { var newSelectorPath = addReplacementIntoPath(beginningPath[j], addPaths, replacedElement, originalSelector); result.push(...
[ "function addAllReplacementsIntoPath(beginningPath, addPaths, replacedElement, originalSelector, result) {\n var j;\n\n for (j = 0; j < beginningPath.length; j++) {\n var newSelectorPath = addReplacementIntoPath(beginningPath[j], addPaths, replacedElement, originalSelector);\n ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Returns true if two names are equal (normalizes them)
equalSLName(slname1, slname2) { return normalize_slname(slname1).toLowerCase() === normalize_slname(slname2).toLowerCase(); }
[ "function has_same_characters(name1, name2) {\n while (name1) {\n var character = name1[0];\n if (!name2.includes(character)) {\n return false;\n }\n name1 = name1.replace(character, \"\");\n name2 = name2.replace(character, \"\");\n }\n return true;\n}", "fu...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
default to 20s Sends an asynchronous XMLHttpRequest. onSuccess:function(req) Function to be fired on completion. onFail : function(req) Function to be fired on failure or timeout. Note the req parameter may be null. timeout: milliseconds Request will be aborted if it hasn't completed within the timeout period. If not s...
function httpRequest(url, onSuccess, onFail, postData, timeout) { // Prepare a new XMLHttpRequest instance var req = createXMLHttpRequest(); var method = postData ? 'POST' : 'GET'; req.open(method, url, true); req.setRequestHeader('User-Agent', 'XMLHTTP/1.0'); if (postData) { req.setRequestHeader...
[ "function sendAsyncReq(url, parameters, callback, errorHandler, timeoutHandler)\n{\n\tPORTAL_IS.AJAX_MGR.sendAsyncReq(url, parameters, callback, errorHandler, timeoutHandler)\n}", "function oota_request_async(url, parameters, handler)\n{\n\t// Send the HTTP request.\n\tif (window.XMLHttpRequest) \n\t{\n\t\tvar re...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Randomize student array order inplace using Durstenfeld shuffle algorithm
function shuffleStudents(){ for (var i = students.length - 1; i > 0; i--) { var j = Math.floor(Math.random() * (i + 1)); var temp = students[i]; students[i] = students[j]; students[j] = temp; } }
[ "shuffleStudents(studentArray) {\n // -> Fisher–Yates shuffle algorithm\n let m = studentArray.length, t, i;\n // While there remain elements to shuffle\n while (m) {\n // Pick a remaining element…\n i = Math.floor(Math.random() * m--);\n // And swap it with the current elem...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Right shift val 16 bits. For a chunk beg/end value, this gives the virtual file offset address.
function rshift16 (val) { return Math.floor(val / Math.pow(2, 16)); }
[ "function seek(bv, offset) {\n bv.index = offset.lo;\n if (offset.hi >= 0) {\n var hi = offset.hi;\n var max = Math.pow(2,32);\n while (hi > 0) {\n bv.index += max;\n hi--;\n }\n }\n }", "load16(offset) {\n ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
function to clear filtered layers previously loaded
function clearLayers() { for (let i = 0; i < layerList.length; i++) { if (map.hasLayer(layerList[i])) { map.removeLayer(layerList[i]); // console.log("Removed layer") } } }
[ "clear () {\n this.layers.forEach(layer => layer.clear())\n }", "function removeAllLayers() {\n currentLayer = \"none\";\n map.removeLayer(otherLayer);\n map.removeLayer(todoLayer);\n map.removeLayer(foodLayer);\n m...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
respuesta valor devuelto desde el servidor true > si se insertaron los datos exportados false > si no se insertaron los datos exportados
function doneExportar(respuesta) { var oJson, msj; oJson = $.parseJSON(respuesta); if (oJson.br) { dbEjecutar("assets/sql/update.exportaciones.pendientes.sql",function(json){ msj = oJson.sr; msj+= " <br> Los datos fueron enviados correctamente."; $("#div-export...
[ "function validarRegistroExistente(valor)\n{\n\tvar datos = new FormData();\n\n\tdatos.append(\"registroPais\", valor);\n\n\t$.ajax({\n\t\turl:rutaOculta+\"ajax/registroAdmin.ajax.php\",\n\t\tmethod:\"POST\",\n\t\tdata: datos, \n\t\tcache: false,\n\t\tcontentType: false,\n\t\tprocessData: false,\n\t\tasync:false,\n...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Gets and formats the stats for EtherSecurityLookup.html
getStats() { var objTwitterWhitelist = this.getWhitelistStructure(); var objEslTools = new EslTools(); if(document.getElementById("ext-ethersecuritylookup-twitter_whitelist_checkbox")) { document.getElementById("ext-ethersecuritylookup-twitter_whitelist_checkbox").checked = objT...
[ "getStats()\n {\n var objMetaMaskList = this.getListStructure();\n var objEslTools = new EslTools();\n\n if(document.getElementById(\"ext-ethersecuritylookup-domain_verification_checkbox\")) {\n document.getElementById(\"ext-ethersecuritylookup-domain_verification_checkbox\").chec...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Set the default value of reconnection time. The reconnection time is an internal slot of `EventSource` object. It's a useragentdefined value.
function setDefaultReconnectionTime(value) { if (!Number.isFinite(value) || value <= 0) { throw new Error(`reconnection time must be a positive number.`); } defaultReconnectionTime = value; }
[ "function resetTimerRepToDefault() {\r\n timerRep.value = {\r\n time: '00:00:00',\r\n state: 'stopped',\r\n milliseconds: 0,\r\n timestamp: 0,\r\n teamFinishTimes: {},\r\n };\r\n nodecg.log.debug('[Timer] Replicant restored to default');\r\n}", "function resetTimerRepTo...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Converts a mobile local database tweet to the format expected by the app frontend
function savedTweetToWeb(tweet) { // Convert stored epoch timestamp to JS date object // Stored timestamp is in second-epoch, but Date takes millisecond-epoch var convertedTimestamp = new Date(tweet.tweetTimestamp * 1000).toISOString(); return { text: tweet.tweetText, created_at: convertedTimestamp, ...
[ "function savedTweetToWeb(tweet) {\n\treturn {\n\t\ttext: tweet.tweetText,\n\t\tcreated_at: tweet.tweetTimestamp,\n\t\tuser: { screen_name: tweet.userName},\n\t\tid_str: tweet.tweetId\n\t};\n}", "function processTweet(tweet) {\n const timeDateList = tweet.created_at.split(' ');\n return {\n id: tweet...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Gets theme's font family
function getThemeFont(theme) { if (!theme) theme = currentTheme; var themeObj = themes[theme] || customThemes[theme]; return themeObj.font || ''; }
[ "get fontFamily() {\n return this._fontFamily;\n }", "get font() {}", "get fontFamily() {\n return this._fontFamily;\n }", "get fontTTFName() {}", "get fontStyle() {}", "function fontSelected() {\n var node = this.selection.getNode();\n return Element.getStyle(node, 'fontFamily');\n }...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
removes the waypoint at the given index.
function removeWaypoint(index) { if (index) { waypointsSet.splice(index, 1); requestCounterWaypoints.splice(index, 1); } }
[ "function removeWaypoint(index) {\n if (index >= 0) {\n waypointsSet.splice(index, 1);\n requestCounterWaypoints.splice(index, 1);\n }\n }", "removeWaypoint(index) {\n let removed = null;\n\n if (this.originAirfield && index === 0) {\n removed = this.originA...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Used to display a saved grid function setData save_grid Dictionary to display a grid.
function setData(save_grid) { var j; for(j=0;j<64;j++) { key = "#g"+j; var key1 = "g"+j+"_"+"type"; var key2 = "g"+j+"_"+"style"; var key3 = "g"+j+"_"+"readonly"; var key4 = "g"+j+"_"+"src"; var key5 = "g"+j+"_"+"value"; ...
[ "function saveGrids() {\n\t\t\t\tconsole.log(gridArray);\n\t\t\t\twriteGridToFile(gridArray);\n\t\t}", "function saveGrid(localGridColor, localColumnCount, localColumnWidth, localGutterWidth) {\n\n localStorage.alignerGridColor = localGridColor;\n localStorage.alignerColumnCount = localColum...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
436 / Function: MV_ServiceVoc Starts playback of the waiting buffer and mixes the next one. static int backcolor = 1;
function MV_ServiceVoc() { var voice; var next; // Toggle which buffer we'll mix next MV_MixPage++; if ( MV_MixPage >= MV_NumberOfBuffers ) { MV_MixPage -= MV_NumberOfBuffers; } { ClearBuffer_DW( MV_FooBuffer, 0, (8 / 4 * MV_BufferSize / MV_SampleSize * MV_Channels) | ...
[ "function prepareBackBuffer() {\n var zCurrentBuffer = jsvideo.getCurrentFrameBuffer();\n var zPrevBuffer = jsvideo.getPreviousFrameBuffer();\n if (residualColorBuffer == null)\n residualColorBuffer = new Array(zCurrentBuffer.length); //maybe a better way to set it\n var zWidt...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
sends joke to channel
async function callJoke(msg) { try { var j = await jokeReceived(); console.log(j); msg.channel.send('```' + j.joke + '```'); } catch (error) { console.log(error) } }
[ "function chuckJoke() {\n axios.get('https://api.icndb.com/jokes/random').then(res => {\n const joke = res.data.value.joke;\n //send to channel\n const params = {\n icon_emoji: ':laughing:'\n };\n\n bot.postMessageToChannel(\n 'general', `Chuck Norris: ${joke}`,\n params);\n});\n}", ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Unchecks siblings (when "checkMode" is 'radioButton').
_uncheckSiblings(item) { for (let i = 0; i < item.parentElement.childElementCount; i++) { const currentItem = item.parentElement.children[i]; if (currentItem !== item && currentItem.checked) { currentItem.set('checked', false); this.$.fireEvent('itemCheck...
[ "_uncheckSiblings(item, siblings) {\n for (let i = 0; i < siblings.length; i++) {\n const currentItem = siblings[i];\n\n if (currentItem !== item && currentItem.checked) {\n currentItem.set('checked', false);\n currentItem.removeAttribute('aria-checked');\n...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Mark single instance of a placeable in string
function markPlaceable(string, regex, title, replacement) { replacement = replacement || '$&'; return string.replace(regex, getPlaceableMarkup(title, replacement)); }
[ "markPlace(pos, mark){\n this.gameBoard[pos] = mark\n }", "function placeAMarker(position, flag){\n\tvar lab;\n\tif(flag == 1){\n\t\tlab = \"u\";\n\t}else{\n\t\tlab = \"s\";\n\t}\n\tmarker = new google.maps.Marker({\n\t\tposition: position,\n\t\tlabel: lab,\n\t\tmap: map,\n\t});\n}", "function getPlac...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
This function places an image at the specified coordinates on a canvas parameters: path, x coordinate, y coordinates
function place(path,x,y) { game.canvas[1].drawImage(getImage(path),x ,y); }
[ "function drawImg(src, x, y) {}", "function drawImage(source,xPos, yPos, wDim, hDim)//<- () is called parameters\r\n{\r\n let canvas = document.getElementById(\"myCanvas\");\r\n let ctx = canvas.getContext(\"2d\");//do every time, standard way of getting 2d tools\r\n\r\n ctx.drawImage(source, xPos, yPos,...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
4. Odds and Evens. Create a program that changes a given array by adding 1 to each odd integer and subtracting 1 from each even integer. Examples:
function oddsAndEvens(arr) { for (let i = 0; i < arr.length; i++) { (arr[i] % 2 === 0) ? (arr[i]--) : (arr[i]++); } return arr; }
[ "function oddUpEvenDown(array){\n\n var newArray = [];\n\n for(var index = 0; index < array.length; index++){\n if(array[index] % 2){\n array[index]++;\n newArray.push(array[index]);\n } else {\n array[index]--;\n newArray.push(array[index]);\n }\n }\n return newArray;\n}", "funct...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
external probab_prime: t > int > int Provides: ml_z_probab_prime const Requires: bigInt
function ml_z_probab_prime(z, i) { if (bigInt(z).isProbablePrime(i)) { return 1; } else { return 0; } }
[ "function ml_z_probab_prime(z1, z2) {\n\n}", "function bnIsProbablePrime(t){\nvar i,x=this.abs();\nif(x.t==1&&x[0]<=lowprimes[lowprimes.length-1]){\nfor(i=0;i<lowprimes.length;++i){\nif(x[0]==lowprimes[i])return true;}\nreturn false;\n}\nif(x.isEven())return false;\ni=1;\nwhile(i<lowprimes.length){\nvar m=lowprim...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Gets Sqljs entity manager from connection name. "default" connection is used, when no name is specified. Only works when Sqljs driver is used.
function getSqljsManager(connectionName) { if (connectionName === void 0) { connectionName = "default"; } return getConnectionManager().get(connectionName).manager; }
[ "function getManager(connectionName) {\n if (connectionName === void 0) { connectionName = \"default\"; }\n return getConnectionManager().get(connectionName).manager;\n}", "function getManager(connectionName) {\n if (connectionName === void 0) { connectionName = \"default\"; }\n return getConn...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
generates coordinates for the gun texture
function genGunCoords(){ var coords = { vertices: [ new vec4(-1, -1, 0, 1), new vec4(-1, 1, 0, 1), new vec4(1, 1, 0, 1), new vec4(-1, -1, 0, 1), new vec4(1, 1, 0, 1), new vec4(1, -1, 0, 1) ], textureCoords: [ new vec2(0, 0), new vec2(0, 1), new vec2(1, 1), new vec2(0, 0), new vec2(1, 1), new ...
[ "function generateTextureCoordinates() {\n\n\t\t// BEGIN exercise Sphere-Earth-Texture\n\n\t\t// As there is not exactly one texture coordinate per vertex,\n\t\t// we have to install a different mapping as used for polygonVertices to vertices.\n\t\t// For texture coordinate system use openGL standard, where origin ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Test API V1 Main page
testMainPage(mainPageApiUrl) { describe ('Main page', () => { it('Main page content', (done) => { chai.request(this._app) .get(mainPageApiUrl) .end((err, res) => { res.should.have.status(200); don...
[ "function applicationsTests({ apiGET, apiPOST }) {}", "testApi ()\n {\n var bodyData = {}\n this.sendTestApiCall('http://127.0.0.1:8080/api/v1/test',bodyData);\n }", "apiRestTest(){}", "function tgTestAPI(){\n // Create a test API user\n var toggl = new TogglClient({ apiToken: config...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Check that the genus field value and the genus from the species name are the same.
function validGenus() { // console.log("isValidGenus = ", tP.recrd[tP.fieldAry[1]] === tP.genusParent); return tP.recrd[tP.fieldAry[1]] === tP.genusParent; }
[ "duplicateGeneSetNames() {\n let geneSetGroupIds =\n AutoForm.getFieldValue(\"gene_set_group_ids\", this.autoformId);\n\n // if there's no gene set groups selected, return false\n if (!geneSetGroupIds) { return false; }\n\n // count all gene set names and all unique gene set names\n let allNam...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Number Number > String Retrieves the tile at a position Only returns if the tile is traversable or not given: x and y with a WALL_CHAR at the location expected: 'wall'
getTile(x, y) { // subtract one from tilesWide and tilesHigh to account for zero based // indexing if (x < 0 || y < 0 || x > this.tilesWide - 1 || y > this.tilesHigh - 1 || this.maze[x + (y * this.tilesWide)] === WALL_CHAR) { return "wall"; } else { ...
[ "function tile_name(x, y) {\n x -= size[3];\n y -= size[0];\n return (y >= 0 ? y + 1 + \"s\" : -y + \"n\") + (x >= 0 ? x + 1 + \"e\" : -x + \"w\");\n }", "findTile() {\n this._tile = -1;\n var tile = this._grid.getTile(this._gridLoc.x, this._gridLoc.y);\n for (var ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
$scope.news_list = new Array();
function getNewsList() { var url = "index.php?r=News/getAllNews"; $http.get(url).success(function (data) { $scope.news_list = new NgTableParams({ count: 100, sorting: { createDate: 'desc' // initial sorting } ...
[ "function getAllNews () {\n return newsList;\n}", "function mainCtrl($scope) {\n\n $scope.activities = [];\n\n $scope.addNewActivity = function(activity) {\n console.log(\">AddNewActivity: called\")\n //put this in a factory\n $scope.activities.push({\n title: activity.title...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
establecer un valor a cada casilla basado en el valor del board
function establecer(casillas, board) { //console.log(board) casillas[0][0].innerText = board[0][0]; casillas[0][1].innerText = board[0][1]; casillas[0][2].innerText = board[0][2]; casillas[1][0].innerText = board[1][0]; casillas[1][1].innerText = board[1][1]; casillas[1][2].innerText = board...
[ "getBoardValue() {\n let totalValue = 0;\n //go through each square on board\n for (let column of this.grid) {\n for (let piece of column) {\n if (!piece) {\n continue;\n }\n //if square contains piece, get value\n ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
MultiString purpose: Provide an object that can be used in place of a string, in that it returns a string value, but actually stores multiple perlanguage versions of the string and can be reconfigured as to which different language version gets returned. see: features: Expects langpath values which are colondelimted li...
function MultiString() { var i; if (arguments.length == 0) { this.set_val_lang() } else { i = -1; while (typeof(arguments[i+=1]) != 'undefined') { // an empty string is a legal name // process value/lang pairs this.set_val_lang(arguments[i] || '', arguments[i+=1]); } } Object.defin...
[ "function MultiLocalizationHelper(...stringBundleNames) {\n let instances = stringBundleNames.map(bundle => {\n return new LocalizationHelper(bundle);\n });\n\n // Get all function members of the LocalizationHelper class, making sure we're\n // not executing any potential getters while doing so, and wrap all...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
InputValueDefinition : Description? Name : Type DefaultValue? Directives[Const]?
parseInputValueDef() { const start = this._lexer.token; const description = this.parseDescription(); const name = this.parseName(); this.expectToken(TokenKind.COLON); const type = this.parseTypeReference(); let defaultValue; if (this.expectOptionalToken(TokenKind.EQUALS)) { defaultVal...
[ "parseInputValueDef() {\n const start = this._lexer.token;\n const description = this.parseDescription();\n const name = this.parseName();\n this.expectToken(_tokenKind.TokenKind.COLON);\n const type = this.parseTypeReference();\n let defaultValue;\n if (this.expectOptionalToken(_tokenKind.Toke...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Clear zone of all records
clearZone(zone) { return this.zone[zone].clearRecords() }
[ "function clear()\r\n {\r\n pZones = new Array();\r\n }", "function clear() {\n records = {};\n }", "clear() {\r\n\tif (this.zoneLen != 0) {\r\n\t this.a_zone.length = this.zoneLen = 0;\r\n\t}\r\n }", "function clearAll() {\r\n clearDetails();\r\n intTable.innerHTML = \"\";\r\n ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Function that propagates the final promise when loaded_objects is modified. Needed for run custom_functions
function runFunctionOnAllObjects(func_to_run, external_parameter){ //func_to_run - any function from custom_functions.js //object_array = [loaded_objects] try{ final_promise=final_promise.then(function(object_array){ if (external_parameter!=null){ object_array=func_...
[ "function checkLoad() {\r\n\t loadedObjects++;\r\n\t \r\n\t if (loadedObjects === totalObjectsToLoad && callback) {\r\n\t callback();\r\n\t }\r\n\t }", "setObjectLoaded (state, flag) {\n state.objectLoaded = flag\n }", "function checkLoad() {\n\t loadedObjects++...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Retrieve an uuid array with the asset path and type
getUuidArray(path, type, out_urls) { path = url.normalize(path); if (path[path.length - 1] === '/') { path = path.slice(0, -1); } let path2uuid = this._pathToUuid; let uuids = []; let _foundAtlasUrl; for (let p in path2uuid) { ...
[ "static get assetGUIDs() {}", "getUuid(path, type) {\n path = url.normalize(path);\n let item = this._pathToUuid[path];\n\n if (item) {\n if (Array.isArray(item)) {\n if (type) {\n for (let i = 0; i < item.length; i++) {\n let entr...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
2. Create pokemon image on map 3. Add pokemon counter down refresh.
function refresh_pokemon_layer() { // 1、Prepare new layer var layer = new Microsoft.Maps.Layer(); var pushpins = []; for (var i in map_manager.map_items) { var map_item = map_manager.map_items[i]; var icon_url = 'https://raw.githubusercontent.com/longshootzb/firstproject/master/pokemon/' +...
[ "function preloadagain (){\n let mapColor = color(255, 255, 255);\n // Randomly generate a number between 1 and 802 to append to URL so that we get a random pokemon each time\n let num = Math.floor(Math.random() * 801) + 1;\n // Put URL + random number into url variable to then use in loadJSON to get one ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Special support for jQuery here because it's so commonly used. Many jQuery plugins (including jquery.tmpl) store data using jQuery's equivalent of domData so notify it to tear down any resources associated with the node & descendants here.
function cleanjQueryData (node) { var jQueryCleanNodeFn = jQueryInstance ? jQueryInstance.cleanData : null; if (jQueryCleanNodeFn) { jQueryCleanNodeFn([node]); } }
[ "function cleanjQueryData(node) {\n var jQueryCleanNodeFn = jQueryInstance\n ? jQueryInstance.cleanData : null;\n\n if (jQueryCleanNodeFn) {\n jQueryCleanNodeFn([node]);\n }\n }", "_syncChildren() {\n var dataChildren = this._children || [];\n var dataLength = dataChild...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Helper function: Get defined predecessor for a node based on the API name.
function getDefinedPredecessor(node) { let index = 0; let foundIndex = -1; orderedItemsToDelete.forEach(itemDefinition => { let ancestorArray = splitAncestors(itemDefinition.item); let len = getValidatedAncestorsLength(ancestorArray); if (no(len)) return null; let child = ancestorArray[len - 1]; if (node....
[ "predecessors(v){var predsV=this.#preds[v];if(predsV){return Object.keys(predsV)}}", "function hc_nodegetprevioussibling() {\n var success;\n if(checkInitialization(builder, \"hc_nodegetprevioussibling\") != null) return;\n var doc;\n var elementList;\n var nameNode;\n var psNode;\n va...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Determine whether the given properties match those of a `DeploymentProperty`
function CfnDeploymentGroup_DeploymentPropertyValidator(properties) { if (!cdk.canInspect(properties)) { return cdk.VALIDATION_SUCCESS; } const errors = new cdk.ValidationResults(); if (typeof properties !== 'object') { errors.collect(new cdk.ValidationResult('Expected an object, but rec...
[ "function CfnStackSet_DeploymentTargetsPropertyValidator(properties) {\n if (!cdk.canInspect(properties)) {\n return cdk.VALIDATION_SUCCESS;\n }\n const errors = new cdk.ValidationResults();\n if (typeof properties !== 'object') {\n errors.collect(new cdk.ValidationResult('Expected an obje...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Show an invitation at the top
function Display_showInviteUser(_name) { if(!this.inviteVisible) { this.inviteVisible = true; var displayContent = document.getElementById("displayContent"); // Create information box var divInviteBox = document.createElementNS(this.xhtmlns, "div"); divInviteBox.setAttribute("id", "divInviteBox"); displayC...
[ "function showInvites(invites) {\n if(invites.length > 0 ){\n var invitationsContainer = el('div.invitationContainer')\n var new_Invitations = el('a.newInvitation', {href : \"/invitations.html\"},invites.length + \" \" )\n invitationsContainer.appendChild(new_Invitations)\n ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
The parent node for the _userTemplate.
get _itemsParent() { return (0, _polymerDom.dom)((0, _polymerDom.dom)(this._userTemplate).parentNode); }
[ "get _itemsParent() {\n return Polymer.dom(Polymer.dom(this._userTemplate).parentNode);\n }", "get _itemsParent(){return dom(dom(this._userTemplate).parentNode)}", "get _itemsParent(){return dom(dom(this._userTemplate).parentNode);}", "get _itemsParent(){return(0,_polymerDom.dom)((0,_polymerDom.dom)(t...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Reset the modal, removes the message displayed on success
function resetModal() { modalBody.style.display = "block"; successMsg.style.display = "none"; }
[ "function resetModal() {\n self.description.empty();\n self.temporary.empty();\n self.validation_info.empty()\n self.severity.empty();\n self.timestamps.empty();\n }", "function resetModal() {\n if (coreData.currEle) {\n coreData.currEle.popover('hide');\n }\n\n ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Send an XML request (Ajax) Ask to the server to execute the move (i, j)
function sendMoveRequest(i, j) { var url = ""; var params = "playerId=" + escape(player_id) + "&i=" + escape(i) + "&j=" + escape(j); xmlRequest = new XMLHttpRequest(); xmlRequest.open("GET", url + "move?" + params, true); xmlRequest.onreadystatechange = function(){ update(xmlRequest); } xmlReque...
[ "function requestMove()\n{\n var request = \"q=request_move&board=\" + urlEncode(board.toFEN());\n return sendAJAX(request, handleResponseNoFollowup);\n}", "function sendMove(url,coords, turn, pass, cb, setupCall) {\n $.post({\n url: url,\n dataType: \"json\",\n data: JSON.s...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Prefix numbers with up to 20 leading zeros This is so we can have some kind of natural comparison on the regex below
function prefixer(match, p1, offset, string) { return ('00000000000000000000'+match).substr(-20); }
[ "fixStartwithMultiZero(number) {\n if (number === \"00\") return \"0\";\n return number;\n }", "function prefixZeroes(num) {\n\t\tif (num < 10) {return \"00\" + num;}\n\t\tif (num < 100) {return \"0\" + num;}\n\t\treturn num;\n\t}", "function leadingZeros(a,b){return(1e15+a+\"\").slice(-b)}", "function...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Checking whether a variable is a DOM document
function isDocument(v) { return v instanceof HTMLDocument || v instanceof XMLDocument; }
[ "isDOM(a) {\n if (typeof a === 'object' && a.nodeType !== undefined) {\n return true;\n }\n\n return false;\n }", "function documentElementCheck() {\n // todo: correct?\n if (!document || !document.documentElement) {\n return false;\n }\n const docNode = document.documentElement.nodeName;\n ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Map the RSSI value to a value between 1 and 100.
function mapBeaconRSSI(rssi) { if (rssi >= 0) return 1; // Unknown RSSI maps to 1. if (rssi < -100) return 100; // Max RSSI return 100 + rssi; }
[ "function mapBeaconRSSI(rssi) {\n if (rssi >= 0) return 1; // Unknown RSSI maps to 1.\n if (rssi < -100) return 100; // Max RSSI\n return 100 + rssi;\n}", "function mapBeaconRSSI(rssi) {\n if (rssi >= 0)\n return 1; // Unknown RSSI maps to 1.\n if (rssi < -100)\n return 100; // Max RS...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Habilita las opciones para editar la informacion de un horario Funciona tanto para grupos como para horarios
function camposEdicionHorarioDeGrupo(horarioId, horario) { var esMateria = true; if (horario['rol_id'] == 1) esMateria = false; // Vaciamos los elementos de la fila y añadimos las opciones $("#horario" + horarioId + ", #dia" + horarioId) .children("p") .hide(); if (esMateria) { ...
[ "function editarHorario(id) {\n LoadingOn(\"Cargando Paraemtros...\");\n fechaArrHorarioGLOBAL = fechaArr();\n IdHorarioGLOBAL = id;\n $(ListaHorariosJSON).each(function (key, value) {\n if (value.IdHorario === id) {\n horarioCuerpoJSON = [];\n horarioParamsConfigJSON = {\n ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
validates a spoon value, which should be a digit between 0 and 4
function validateSpoon(spoon) { const int = parseInt(spoon); if (isNaN(int)) { return false; } else if (int >= 0 && int <= 4) { return int; } else { return false; } }
[ "laneNumberValidator(v) {\n if (v === \"\") { return true; }\n let valid = true;\n if (! Number.isInteger(v)) {\n valid = /^[1-8]$/.test(trimmed(v));\n }\n return valid;\n }", "static validatePhoneNumber(value){\n if(!/(03|05|07|08|09|01[2|6|8|9])+([0-9]{8})...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
functia pt validare custom theValue valorea din input
function custom(theValue) { //+ - 1 sau mai multe // 0 sau mai multe //? sursa : https://stackoverflow.com/questions/19715303/regex-that-accepts-only-numbers-0-9-and-no-characters //?sursa pt nr cu , : https://stackoverflow.com/questions/12643009/regular-e...
[ "function customValidation(input){\n \n}", "function customValidation(input) {\n\n}", "function customValidation(input) {}", "function customValidation(input) { \n}", "validate(value){\n if(value.length === 0){\n return 'Por favor ingrese un valor';\n }\n ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Handles any mouse movement. Updates bow and target accordingly.
function handleMouseMove(evt) { var mousePos = getMousePos(evt); if (gameState == PLACING_BOW) { bowLocation[0] = mousePos.x; bowLocation[1] = mousePos.y; } // placing target with mouse before or after shot else { targetLocation[0] = mousePos.x; targetLocation[1] = mo...
[ "function handleMove(evt){\n\n g_mouseX = evt.clientX - g_canvas.offsetLeft; \n g_mouseY = evt.clientY - g_canvas.offsetTop;\n\n //Tower follows the mouse\n if(tower != null){\n\n if (g_mouseX < Arena.WIDTH){\n var pos = Arena.posToIndex(g_mouseX,g_mouseY)\n var newPos = Arena.indexTo...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Remove Role Token with checking tenant token_string:role token string tenant:tenant name result:true/false
function rawRemoveRoleTokenByPath(token_string, tenant) { if(!apiutil.isSafeStrings(token_string, tenant)){ r3logger.elog('token_string(' + JSON.stringify(token_string) + ') or tenant(' + JSON.stringify(tenant) + ') parameter is something wrong.'); return false; } // // Keys // var keys = r3keys(null, tena...
[ "function rawRemoveScopedUserToken(token)\n{\n\tif(!apiutil.isSafeString(token)){\n\t\tr3logger.elog('parameter is wrong : token=' + JSON.stringify(token));\n\t\treturn false;\n\t}\n\n\t//\n\t// Check token\n\t//\n\tif(0 === token.indexOf('R=')){\n\t\tr3logger.elog('token(' + JSON.stringify(token) + ') is role toke...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
when on onClick event occurs on .public, dispath the publicRecipie action, then the fetchRecipieDetails action
publicRecipie(id) { this.props.dispatch(publicRecipie(this.props.id)); this.props.dispatch(fetchRecipieDetails(this.props.id)); }
[ "privateRecipie(id) {\n\t\tthis.props.dispatch(privateRecipie(this.props.id));\n\t\tthis.props.dispatch(fetchRecipieDetails(this.props.id));\n\t}", "function mostrarPublicacion(){\n $('.publicacion').on('click', function () {\n var id = $('#IDHidden', this).val();\n location.href = '../model/publ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
search cell by cardid
_findCellByCardID(cardid) { return this.cells.reduce((ret, cell)=>(cell.cardid==cardid)?cell:ret, null); }
[ "function findCardById(column, id) {\n var c = null\n column.cards.forEach(function(card) {\n if (card.id == id) c = card;\n });\n\n return c;\n }", "function get_card_at( row, cell ){\n\n return document.getElementById( \"row-\" + row ).children[ cell ];\n\n}", "findCardInField(playerId, c...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
given a string, say A: if its valid B: if there's more in the radix valid not valid more 'more' 'more' no more object false
function radixHas (input) { if (input[0] === '"') { if (input.length > 1 && input[input.length - 1] === '"' && input[input.length - 2] !== '\\') { return { value: input .substr(1, input.length - 2) .replace(/\\"/g, '"'), valid: true, type: 'STRING', ...
[ "function ABCheck(str) {\nreturn str.match(/a...b|b...a/) ? true : false;\n}", "function ABCheck(str) {\n\n // First, we declare two regex expressions to match if a and b ever occur three characters apart.\n // Note that . is a \"wildcard\" metacharacterin regex that matches almost any character.\n var t...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
The protocol used for the Microsoft Office document.
function getMicrosoftProtocol(href) { var ext = href.substring(href.lastIndexOf('.') + 1).toLowerCase(); switch (ext) { case "ppt": case "pptx": case "ppsx": case "pot": case "potx": case "pptm": return "ms-powerpoint"; case "doc": cas...
[ "get protocol() {\r\n return this._ws ? this._ws.protocol : '';\r\n }", "getProtocol() {\r\n return this._protocol;\r\n }", "getProtocol(contentTypeStr) {\n return EnigmailMime.getParameter(contentTypeStr, \"protocol\");\n }", "getProtocol() {\n return super.getAsString(\"protoc...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
check whether the disatce between two points is bigger than a threshold
checkDist ( point1, point2 ) { let dist = (point1.x - point2.x) * (point1.x - point2.x) + (point1.y - point2.y) * (point1.y - point2.y); let th = this.params.distMerge * this.params.distMerge; return (dist > th); }
[ "function deviated(p1, p0, threshold) {\n if (threshold == 0) return false;\n return p1.gt(BN(1000).plus(threshold).div(1000).times(p0)) || p1.lt(BN(1000).minus(threshold).div(1000).times(p0));\n}", "function pointIsWithinThreshold(dx, x) {\n return dx > x - THRESHOLD && dx < x + THRESHOLD;\n}", "function ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
attribute unsigned long biffState;
get biffState() { return true; }
[ "parseImageStateForm() {\n this.reader.skip(8);\n this.currentForm.mipMapLevel = this.reader.getFloat32();\n }", "parseImageStateForm() {\n\n\t\t\tthis.reader.skip( 8 ); // unknown\n\n\t\t\tthis.currentForm.mipMapLevel = this.reader.getFloat32();\n\n\t\t}", "function InstructionState() { }", "function ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Constructs a new RequestSpotLaunchSpecification. Describes the launch specification for an instance.
function RequestSpotLaunchSpecification() { _classCallCheck(this, RequestSpotLaunchSpecification); RequestSpotLaunchSpecification.initialize(this); }
[ "function SpotFleetLaunchSpecification() {\n _classCallCheck(this, SpotFleetLaunchSpecification);\n\n SpotFleetLaunchSpecification.initialize(this);\n }", "function LaunchTemplateSpotMarketOptionsRequest() {\n _classCallCheck(this, LaunchTemplateSpotMarketOptionsRequest);\n\n LaunchTemplateSpotMarket...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Get current user favorite stories from server and update favorite list
async function updatefavoriteList() { let result = await getUser() try { const favoriteStories = result.favorites favoriteStories.forEach(elem => { let favStory = generateStoryMarkup(elem) favStory[0].children[0].children[0].style.display = 'none' favStory[0].children[0].children[2].sty...
[ "function updateFavorites(){\n if(Context.user == null)return;\n let $target = getActiveContextView();\n $target.find(\"a.favorite\").addClass(\"not\"); \n //The favorites are Story object instances\n $(Context.user.favorites).each((index, story) => {\n let $el = $target.find(`li#${story.storyId}`);\n i...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Create a "Lobby" button and add it to the page, allowing the user to leave to lobby
function addLobbyButton(){ var button = '<button type="button" class="btn btn-primary" id="lobbyButton" onclick="loadLobby()"> Lobby <div id="lobbytimer"></div> </button>'; $("#statusChangeDiv").append(button); }
[ "function lobbyButton() {\n if (user.uid === activity.hostId) {\n return;\n } else {\n return activity[user.uid] !== true ? (\n <button className=\"view__button-join\" onClick={() => joinLobbyHandler(activity)} disabled={joining}>\n Join Lobby\n </button>\n ) : (\n ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Renders the rsvp button for the party.
renderRsvp(){ if(this.props.party.host.email == this.props.currentUser.email){ return( <div></div>) } if(this.props.party.attending.map((guest, key) => { return guest.email}).indexOf(this.props.currentUser.email) == -1) { return ( <div> <p><span className=...
[ "function createVRButton() {\n const vrButton = document.createElement('button');\n vrButton.classList.add('vr-toggle');\n vrButton.id = 'vr-toggle';\n vrButton.textContent = 'Enter VR';\n vrButton.addEventListener('click', () => {\n if (XR.session) {\n XR.session.end();\n }\n xrOnRequestSession(...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
draws a marker for an itinerary item
function drawOne (attraction) { attraction.drawMarker().drawItineraryItem(); }
[ "function drawMarker() {\n push();\n fill(20, 20, 20, 20);\n rect(marker, height / 2, 10, height, );\n pop();\n}", "function drawItems(){\n drawMarker();\n drawCircle();\n}", "function drawItems(x, y, id, name){\r\n//Gets the icon of the relevent item from the Runescape website based its ID.\r\n ic...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
add parameters to friendlocation
function AddParametersFriendLocation(){ var i =0 for (i = 0; i < friendLocation.length; i++) { friendLocation[i].dist = distance(homeLocation[0].lat,homeLocation[0].lon,friendLocation[i].lat,friendLocation[i].lon, "K"); friendLocation[i].data = vectorOfPoints(homeLocation[0].lat,homeLocation[0].lon,friendLocatio...
[ "function addLocation() {\n var newLocation = {\n \"name\":vm.locationName,\n \"userId\":vm.userId,\n \"lat\":vm.lat,\n \"lon\":vm.lon,\n \"webcamURL\":vm.webcamURL,\n \"status\":vm.status,\n \"commen...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Utility method to get the state of the GRPC stream
function getStreamState(self) { let state = -1; if(self._stream && self._stream.call && self._stream.call.channel_) { state = self._stream.call.channel_.getConnectivityState(); } return state; }
[ "get state() {\n return this._stream && this._stream.active ? \"started\" : \"stopped\";\n }", "function getStreamInfo(cb) {\n tryInfo()\n\n function tryInfo() {\n cmd('info', (err, response) => {\n if (!err && response.toString().includes('--[ Stream')) {\n return cb(null, response...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Function to process the services data
function processServices(data, parentEl) { // Get all the items in order, and the assets const items = data.items.reverse(); const assets = data.includes.Asset; // Iterate all the items items.forEach((item) => { // Create the service card element let cardEl = document.createElement(...
[ "function loadDataFromServices() {\n getReleases(projectId);\n getStatuses();\n\tgetUsersInProject();\n}", "_processServices(answers) {\n if (answers.services) {\n if (!(\"server\" in this.options.bluemix)) {\n this.options.bluemix[\"server\"] = [];\n }\n let services = [];\n t...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Check if cell is a layer
function isLayer(cell) { if (cell.attributes.type === TypeEnum.LAYER) return true; }
[ "function map_layer_check(map, layer)\n{\n\t\tif(!_.isUndefined(_.find(map.getLayers().getArray(), function(d){return d == layer;})))\n\t\t{return true;}\n\t\telse{return false;}\n}", "function hasRectBoundLayer(obj) {\n if (obj.artLayers == null || obj.artLayers.length == 0) {\n return false;\n }\n ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Functions event handler function the event parameter is refering to the event listener let index we made a variable for the target() playerChoices[0] = turn % 2 ? "O" : "X"; changing the value in the array then call the render function to "mark" x or o once a winner is found invoke the renderMessage function if we reac...
function handleClick(evt) { let index = evt.target.id; if (playerChoices[index] || checkWin()) return; playerChoices[index] = turn % 2 ? "O" : "X"; render(evt.target); if (checkWin()) { renderMessage(); } else if (turn + 1 === MAXGUESS) { gameBoardEl.removeEventListener("click", handleClick); do...
[ "function playerTurn(e) {\n\n if(winner !== \"true\") {\n clicked = e.target;\n if(clicked.value !==\"O\" && clicked.value !==\"X\") {\n\n if (player===2) {\n clicked.value = circle;\n symbol = circle;\n player = 1;\n amount++;\n }\n...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
search by SKU number
function searchSKUVariant(data) { robot.keyTap('tab', 'alt'); robot.keyTap('f', 'control'); robot.typeString(data); robot.keyTap('enter'); }
[ "function locateProduct(skuToFind) { //dun hav 2 use \"inventory\" argument cuz sexToysInventory is global\n var itemNoToFind;\n for (i = 0; i < sexToysInventory.length; i++) {\n if (sexToysInventory[i]['sku'] === skuToFind) {\n itemNoToFind = i;\n break;\n }\n }\n return itemNoToFind;\n}", "f...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
funzione per il calcolo dell'equazione del tempo fine funzione per il calcolo dell'equazione del tempo inizio
function eq_tempo_data2(anno,njd){ // funzione per il calcolo dell'equazione del tempo. // by Salvatore Ruiu Irgoli-Sardegna (Italy) gennaio 2012. // algoritmo di MEEUS. njd=jdHO(njd); // riporta il g.g. all'ora H0(zero) del giorno. ...
[ "function eq_tempo(){\n\n // by Salvatore Ruiu Irgoli-Sardegna (Italy) ottobre 2011.\n // funzione per il calcolo del valore dell'equazione del tempo per la data odierna.\n // algoritmo di P.D. SMITH.\n \nvar njd=calcola_jd(); // giorno giuliano...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Punctuation Escaping / Escape likely falsepositives of sentencefinal periods. Escaping is performed by wrapping a character's ASCII equivalent in double curly brackets, which is then reversed (deencodcoded) after delimiting.
function encodePunctuation(text) { return text /* Escape the following Latin abbreviations and English titles: e.g., i.e., Mr., Mrs., Ms., Dr., Prof., Esq., Sr., and Jr. */ .replace(regExp.abbreviations, function (match) { return match.replace(/\./g, '{{46}}'); }) /* Escape inner-word (non...
[ "function decodePunctuation(text) {\n return text.replace(/{{(\\d{1,3})}}/g, function (fullMatch, subMatch) {\n return String.fromCharCode(subMatch);\n });\n}", "function punctuation(w, ind) {\n let punct = [',', '.', '?', '(', ')', '!', ':', ';', \"\\'\", \"\\\"\"];\n for (let i = 0; i < w.len...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Fetches value of textbox for summoner name
function getSummonerName(){ var name = $('#summoner-name-input').val(); return cleanName(name); }
[ "function getPlayerName(){\n return $(\"#fullname\").val();\n }", "function getIdFromName(app) {\n app.ask(`Your summoner ID is: ${app.data.summoner.id}`);\n}", "function getUserInput() {\n const summonerName = document.querySelector(\".summoner-name-input\").value.toLowerCase();\n const summoner...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
various helper methods Iterates over keys and values in ObjectExpression. The keys are turned into strings, but values are left as is for further processing.
function each_pair_in_object_expression(ast, func) { if (! (ast && ast["type"] == "ObjectExpression")) { return; } return _.each(ast["properties"], function(p) { isFn(key_value(p["key"]), p["value"], p); }); }
[ "function forKeysInObject(o,instrs){\tlet res=[];\r\n\tfor(k in o){\t\tres.push(instrs(k,o));\t}\r\n\tseelog('for k('+res.length+')'+res.join());\r\n\t\t\t\t\t\t\treturn res;\r\n}", "function forKeysInObject(o,instrs){\r\n\tlet res=[];\r\n\tfor(k in o){\r\n\t\tres.push(instrs(k,o));\r\n\t}\r\n\tconsole.log('for k...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
set the message on the progress bar
function set_progress_message(msg) { $("#progress-message").text(msg); }
[ "function showProgress(message) {\n progressText.textContent = message;\n progressBar.style.display = 'block';\n progressText.style.display = 'block';\n}", "function message( theMessage ) {\n\t\t\n\t\t/* make a note of the new message in the console log */\n\tconsole.log( \"setting window message to '\" + theM...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Initialize Sentry (reports to sentry.io)
function initSentry() { if (process.env.REACT_APP_SENTRY_DSN) { let environment = ''; if (window.location.hostname === 'cv19assist.com') { environment = 'production'; } else if (/cv19assist-(.*)\.web.app/g.test(window.location.hostname)) { [, environment] = /cv19assist-(.*)\.web.app/g.exec( ...
[ "configureSentry() {\n this.sentryClient = new BrowserClient(window['sentryConfig']);\n this.sentryHub = new Hub(this.sentryClient);\n }", "function initSentry() {\n let betaCheck = (window.location.pathname.split('/')[1] === 'beta' ? ' Beta' : '');\n\n Sentry.init({\n dsn: API_KEY,\n e...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Legge le impostazioni dal file e le carica su `this.data`. Se non esiste il file lo crea con le impostazioni attuali.
readData() { // Se non esiste, lo crea, con le impostazioni di default if (!fs.existsSync(this.filepath)) { logger.debug('Creato nuovo file di impostazioni.'); this.writeData(); return; } try { const text = fs.readFileSync(this.filepath, 'utf8'); // file YAML => {} const data = yaml.safeLoad(...
[ "updatePuFile() {}", "load(){\n let file= Gio.file_new_for_path(this._filePath);\n \n /** checks if containing directory exists, if not, creates it */\n if(!file.get_parent().query_exists(null)){\n file.get_parent().make_directory_with_parents(null);\n }\n \n /** ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Checks shortcode editor provider field and hides/shows the appropriate subtab for that provider.
function check_provider() { debugger; var $provider = $('#pum-shortcode-editor-pum_sub_form #provider'), provider = $provider.val() !== '' && $provider.val() !== 'none' ? $provider.val() : pum_admin_vars.default_provider, $provider_tabs = $('.pum-modal-content .tabs .tab a[href^...
[ "function showHidePreviewSection()\n{\n if (PREVIEW_FIRSTSTEP_REGION)\n {\n if(PREVIEW_FIRSTSTEP_REGION.style.display == \"none\")\n {\n PREVIEW_FIRSTSTEP_REGION.style.display = 'block';\n ADV_DATA_SEL_REGION.style.display = 'block';\n _chooseContainerCtrl.className = \"browserElementNormal\"...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Function to change country names
function changeCountryAbbr(filterItem) { // Define countries to use countries = [{ name: "USA", abbr: "us" }, { name: "united states", abbr: "us" }, { name: "canada", abbr: "ca" }]; var abbr = ""; // Function to filter country data if (filterItem.length > 2) { function abbreviation(country...
[ "function set_ICON_country_names(country_name){\n\n switch (country_name){\n case \"Armenia\" : country_name = \"Armenia (Republic)\"; break;\n case \"Bosnia and Herzegovina\" : country_name = \"Bosnia and Hercegovina\"; break;\n case \"Myanmar\" : country_name = \"Burma\"; break;\n case \"Ta...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Execution trace generated by a probabilistic program. Tracks the random choices made and accumulates probabilities.
function RandomExecutionTrace(computation, init) { init = (init == undefined ? "rejection" : init) this.computation = computation this.vars = {} this.varlist = [] this.currVarIndex = 0 this.logprob = 0.0 this.newlogprob = 0.0 this.oldlogprob = 0.0 this.loopcounters = {} this.conditionsSatisfied = false this....
[ "function gerarProbabilidade() {\r\n return Math.random();\r\n}", "function gerarProbabilidade() {\n return Math.random();\n}", "function drawProb() {\n return getRandomInt(1, 100) / 100.0;\n}", "function rejectionSample(computation)\n{\n\tvar tr = trace.newTrace(computation)\n\twhile (Math.log(Math.rand...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
This is a function for addonLinkersLinkerKeyValuesDelete_0
addonLinkersLinkerKeyValuesDelete_0(incomingOptions, cb) { const Bitbucket = require('./dist'); let defaultClient = Bitbucket.ApiClient.instance; // Configure API key authorization: api_key let api_key = defaultClient.authentications['api_key']; api_key.apiKey = incomingOptions.apiKey; // Uncomm...
[ "addonLinkersLinkerKeyValuesDelete(incomingOptions, cb) {\n const Bitbucket = require('./dist');\n let defaultClient = Bitbucket.ApiClient.instance;\n // Configure API key authorization: api_key\n let api_key = defaultClient.authentications['api_key'];\n api_key.apiKey = incomingOptions.apiKey;\n ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
GENERATED XML IS HERE:
function generateXML() { var XML = '<?xml version="1.0" encoding="iso-8859-1"?>\n'+ '<!DOCTYPE workspaceElements PUBLIC "-//CPN//DTD CPNXML 1.0//EN" "http://cpntools.org/DTD/6/cpn.dtd">\n'+ '<workspaceElements>\n'+ '<generator tool="CPN Tools" version="4.0.0" format="6"/>\n'+ ' <cpnet>\n'+ ' ...
[ "generateOutputXML() {\n const options = {compact: true, ignoreComment: true, spaces: 4};\n let xmlString = '<?xml version=\"1.0\" encoding=\"utf-8\"?>\\n';\n xmlString += convert.json2xml(this.inputObjs, options);\n fs.writeFile(this.outputFileName, xmlString, (err) => {\n if (err) throw err;\n ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Capture originator/trigger/from/to element information (if available) and the parent container for the dialog; defaults to the $rootElement unless overridden in the options.parent
function captureParentAndFromToElements(options) { options.origin = angular.extend({ element: null, bounds: null, focus: angular.noop }, options.origin || {}); options.parent = getDomElement(options.parent, $rootElement); options.closeTo = ...
[ "function captureParentAndFromToElements(options) {\n options.origin = angular.extend({\n element: null,\n bounds: null,\n focus: angular.noop\n }, options.origin || {});\n\n options.parent = getDomElement(options.parent, $rootElement);\n option...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Add nodes to the side of the map, because their lat/lon is not known baseLataLon tells where to put the first off map location. Others are placed in a line down from there.
function addOffMapLocation(projection, idx, baseLatLon, name, port, svg, depot_id) { pair = [baseLatLon[0]-idx*.3, baseLatLon[1]-idx] //the idx*.3 straigthens out the line node = addMapLocation(projection, name, port, pair, svg, depot_id) node.append("text") .attr("dx", function(d){return 10}) ...
[ "function addBaseMap() {\n var basemap = trySetting('_tileProvider', 'CartoDB.Positron');\n L.tileLayer.provider(basemap, {\n maxZoom: 17,\n\t\t\tnoWrap:true,\n }).addTo(map);\n L.control.attribution({\n position: trySetting('_mapAttribution', 'bottomright')\n }).addTo(map);\n }", "funct...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
function from d3, get subticks
function d3_svg_axisSubdivide(scale, ticks, m) { var subticks = []; if (m && ticks.length > 1) { var extent = d3_scaleExtent(scale.domain()), i = -1, n = ticks.length, d = (ticks[1] - ticks[0]) / ++m, j, v; while (++i < n) { for (j = m; --j > 0;) { if ((v = +ticks...
[ "getTicks() {\n const { scale, tickSize, tickValues, interval } = this.props;\n const dimension = this.getDimension();\n const ticks = getTicks(scale, tickSize, tickValues, dimension, interval);\n const adjustedScale = this.getAdjustedScale();\n const format = this.getLabelFormat(...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
qtrans takes hue varying from 0 to 1!
function qtrans(q1, q2, hue) { if (hue > 1) hue -= 1; if (hue < 0) hue += 1; if (hue < 1/6) return q1 + (q2 - q1) * (hue * 6); else if (hue < 1/2) return q2; else if (hue < 2/3) return q1 + (q2 - q1) * (2/3 - hue) * 6; else return q1; }
[ "function qtrans(q1, q2, hue)\n{\n hue = _if(hue.gt(1), hue.sub(1), hue);\n hue = _if(hue.lt(0), hue.add(1), hue);\n return _if(hue.lt(1/6), q1.add(q2.sub(q1).mul(hue.mul(6))),\n _if(hue.lt(1/2), q2,\n _if(hue.lt(2/3), q1.add(q2.sub(q1).mul(Shade.make(2/3)\n ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
delete a jenkins informations
function deleteJenkinsUrl(jenkins_id){ var db = getDatabase(); db.transaction(function(tx) { var rs = tx.executeSql('DELETE FROM jenkins_data WHERE id =?;',[jenkins_id]); } ); }
[ "delete() {\n // Query API to delete repo, this will trigger sadness in the dashboard too\n }", "function del_master(id) {\n for (var i = 0; i < DB.length; i++) {\n if (DB[i].id === id) {\n for (var j = 1; j <= 3; j++) {\n let port_id = \"port\"+j;\n\n if (fs.existsSync(DB[i][port...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
RankingHandler Carga la vista principal
function RankingHandler (request, reply) { db.query("SELECT *, j_avg(promedio_comida, promedio_servicio, promedio_extras) as promedio_general FROM (SELECT *, j_avg(puntuacion.comida) as promedio_comida, j_avg(puntuacion.servicio) as promedio_servicio, j_avg(puntuacion.extras) as promedio_extras FROM ( SELECT *, inE...
[ "function handleReturnRanked(res){\n data.ranked=res.data;\n }", "function handleRankedSuccess(res){\n // console.log(res);\n }", "function displayRanking() {\n\t\t// Display an error message if error code is not 410 or 200 (okay)\n\t\tif (this.status != 200 && this.status != 410) {\n\t\t\tdisplayError(...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Send a receipt message using the Send API.
function sendReceiptMessage(recipientId) { // Generate a random receipt ID as the API requires a unique ID var receiptId = "order" + Math.floor(Math.random()*1000); var messageData = { recipient: { id: recipientId }, message:{ attachment: { type: "template", payload: { ...
[ "function sendReceiptMessage(recipientId){// Generate a random receipt ID as the API requires a unique ID\nvar receiptId=\"order\"+Math.floor(Math.random()*1000);var messageData={recipient:{id:recipientId},message:{attachment:{type:\"template\",payload:{template_type:\"receipt\",recipient_name:\"Peter Chang\",order...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Delete Product From Checkout Products list
deleteProduct(e) { var _this = e.data.context, item_name = $(this).parents('.item').attr('data-name'); _this.products.splice(_this.findIndex(item_name), 1); $(this).parents('.item').remove(); _this.handleCheckoutSubmit(); _this.setCheckoutTotals(); }
[ "function deleteProduct() {\n var url = [refstackApiUrl, '/products/', ctrl.id].join('');\n $http.delete(url).success(function () {\n $window.location.href = '/';\n }).error(function (error) {\n raiseAlert('danger', 'Error: ', error.detail);\n ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Maptimize.Proxy.GoogleMapgetLng(placemark) > Number placemark (Object): object representing Google Map placemark (get by calling getPlacemarks) Returns longitude of a placemark.
function getLng(placemark) { return placemark.Point.coordinates[0]; }
[ "function YGps_get_longitude()\n {\n var res; // string;\n if (this._cacheExpiration <= YAPI.GetTickCount()) {\n if (this.load(YAPI.defaultCacheValidity) != YAPI_SUCCESS) {\n return Y_LONGITUDE_INVALID;\n }\n }\n res = this._long...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Increments the scanListIndex which is the index for the scans in schedule.JSON file checks if it completely itterated through the list and stops if it has
function incrementScanIndex() { if (scanListIndex < scheduleJSON.scans.length - 1) { logger.debug('Processing next scan...') scanListIndex++; processNextScan(); } else { logger.debug('Completed processing all scans...'); } }
[ "function setEndTimeForScanResults(){\n if(tempScanResultList.length > 0){\n var scanEndTimeMark = getTime(tempScanResultList[0].StartDateTime.replace('-','/').replace('-','/'),tempScanTime);\n var tempIndex = 0\n $.each(tempScanResultList,function(index,item){\n if(item.StartDate...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Resolve some variable to its actual value, or undefined.
function resolve (variable) { var value = values[Math.abs(variable)]; if (value === undefined) return undefined; return variable < 0? value: !value; }
[ "function findVar(v, defaultIfUndefined) {\r\n\r\n var notFound = false;\r\n try {\r\n notFound = eval('typeof ' + v + ' === \"undefined\"');\r\n } catch (error) {\r\n if (defaultIfUndefined) {\r\n return defaultIfUndefined;\r\n }\r\n return undefined;\r\n }\r\n\r\...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Returns the deserialization strategy to decode packets to Discord
get unpack() { return this.strategy === 'etf' ? Erlpack.unpack : JSON.parse; }
[ "function MessageDeserializer(PacketManager_lengthInteger__var, PacketManager_lengthString__var, PacketManager_lengthUInt16__var, PacketManager_MAX_PACKET_SIZE__var, PacketManager_START_BYTE__var, PacketManager_STOP_BYTE__var, PacketManager_ESCAPE_BYTE__var, PacketManager_CODE_POSITION__var, PacketManager_LENGTH_PO...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Records scroll position for each category in the toolbox. The scroll position is determined by the coordinates of each category's label after the entire flyout has been rendered.
recordScrollPositions() { this.scrollPositions = []; const categoryLabels = this.buttons_.filter((button) => button.isLabel() && this.getParentToolbox_().getCategoryByName(button.getButtonText())); for (const button of categoryLabels) { if (button.isLabel()) { this.scrollPositions.push...
[ "function ScrollPosition() {}", "function scrollPos(){\n\t\tvar div = document.getElementById(\"secLayerDiv\").scrollTop;\n\t\tvar startPos = windowStart1(div);\n\n\t\tchangeFirstLayerWindow(startPos);\n\t\t\n\t\tthirdLayerPointer(div);\n\t}", "function positionControls() {\n var scrollPosition = getScrollTo...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Format any errors returned by sequelize (Generally used to format 500 errors)
formatSequelizeErrors(error) { let validationErrors = []; if (error.errors) { validationErrors = this.extractSequelizeErrors(error.errors); } else if (error.message) { validationErrors.push(error.message); } else { validationErrors.push(error.toString()); } return validationErr...
[ "formatValidationErrors(errors) {\n let warningRegex = RegExp('^Warning*');\n let validationErrors = this.extractSequelizeErrors(errors);\n return validationErrors.filter(\n (error) => !warningRegex.test(error.message)\n );\n }", "function formatError() {\r\n\t\terror(format.apply(this, argument...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Function to Clean all nodes
function cleanNodes() { while (container.firstChild) { container.removeChild(container.firstChild); } }
[ "function clearNodes() {\n for (var n in nodes) {\n if (!touchedNodes[n]) {\n removeNode(n);\n }\n }\n }", "trim() {\n // get the reachable nodes from the root\n var reachable = this.reachableNodes;\n var visited = [];\n // ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Uses for strike laco pointer down event in external hover mode
_strikePointerDown() { for (let i = 0; i < this._pointerDownCallbacks.length; i++) { let currentCallback = this._pointerDownCallbacks[i][0]; currentCallback(this, event); } for (let i = 0; i < this._pointerDownCallbacks.length; i++) { ...
[ "_strikeMouseDown() {\n for (let i = 0; i < this._mouseDownCallbacks.length; i++) {\n let currentCallback = this._mouseDownCallbacks[i][0];\n\n currentCallback(this, event);\n }\n\n for (let i = 0; i < this._mouseDownCallbacks.length; i++) {\n ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Updates the hanging protocol by protocolId
function updateProtocol(protocolId, protocol) { // Collections can only be updated by database ID (_id) on client, so // get the database ID (_id) by the hanging protocol ID firstly const databaseId = getDatabaseIdByProtocolId(protocolId); // Skip if it does not exist in database if (!databaseId) {...
[ "updateProtocol(protocolId, protocol) {\n this.strategy.updateProtocol(protocolId, protocol);\n }", "function updateProtocol(protocolId, protocol) {\n // Collections can only be updated by database ID (_id) on client, so\n // get the database ID (_id) by the hanging protocol ID firstly\n ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }