query
stringlengths
9
34k
document
stringlengths
8
5.39M
negatives
listlengths
19
20
metadata
dict
We assume that, since the `begin` phase, the binding of visual roles to dimensions (or source roles) has not changed. However, the translation has now had a chance to configure the complex type project, defining new dimensions or just configuring existing ones (with valueType, label, etc), and, in any case, marking tho...
function end() { visualRolesBinder_assertState(state, 2); // began state = 3; // ending context.query().each(function(r) { if(!r.isPreBound()) autoPrebindUnbound(r); }); // By now, any not sourced, unbound required role already caused throwing a required rol...
[ "function applySingleRoleDefaults() {\r\n def.eachOwn(singleRoleByDimName, function(r, n) {\r\n complexTypeProj.setDimDefaults(n, r.dimensionDefaults);\r\n }, this);\r\n }", "function dimensionRequired() {\n let state = this.dimension\n return typeof state === 'string' ? false : true...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Initializes the state based on the properties given.
initializeState(props) { /** * DirectionalModal must have 'direction' property. * This property defines which direction the modal will slide to if animated. */ if (props.direction == null) { throw new Error("DirectionalModal: 'direction' property is required."); } /** * DirectionalModal must ...
[ "function initState() {\n\t\tfor (var name in state) {\n\t\t\tvar prop = state[name];\n\t\t\tif (prop.value !== undefined) {\n\t\t\t\tself[name] = prop.value;\n\t\t\t}\n\t\t}\n\t}", "initFromState(newState){\n //Validate properties of newState \n for (let [key, value] of Object.entries(newSta...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
This method is used for transmitting messages over HTTP to the provided address. For simulation purpose, the device radio (represented by a boolean value) is activated before transmission and then deactivated once the message is transmitted.
transmitEvent(event,address){ this.activateRadio(); axios.post(address,event).then((res) => { console.log("Device ID:"+this.deviceId+", Transmission Successful!"); this.deactivateRadio(); }).catch((error) => { console.error(error); }); }
[ "function sendMessage(address, value) {\n\tlet postData = JSON.stringify({ id: 1, 'address': address,\n 'value': value });\n\n//\txmlHttpRequest.open(\"POST\", HOST + '/sendMessage', true);\n\txmlHttpRequest.open(\"POST\", HOST + '/sendMessage', false);\n xmlHttpRequest.setRequestHeader(\"Conten...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Takes a subjectId and an updated subject object with a required property of name Returns updated subject object
function updateSubject(subjectId, updatedSubject) { return SubjectCollection.findByIdAndUpdate(subjectId, updatedSubject, {new: true}) }
[ "function updateSubject(req, res) {\n console.log(\"UPDATE recu subject : \");\n console.log(req.body);\n Subject.findByIdAndUpdate(\n ObjectID(req.body._id),\n req.body,\n { new: true },\n (err, subject) => {\n if (err) {\n console.log(err);\n res.send(err);\n } else {\n ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
get city Image url
function getCityImageUrl(){ return fetch(`http://localhost:8080/cityImageUrl?city=${where}`) .then(res => res.json()); }
[ "function getImage(city) {\n\n let lowerCity = city.replace(/\\s/g, '').toLowerCase();\n return \"images/\" + lowerCity + \".jpg\";\n\n}", "function cityImageGenerator() {\n // var queryURL = \"https://api.flickr.com/services\";\n // var key = \"b5cbe7b98d8f661d255ab22ddd185ada\";\n // var ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Sets the welcome msg based on login information.
function setWelcomeMsg(userObject) { if (userObject.displayName) { welcomeMsg.innerHTML = "Welcome " + userObject.displayName + "!"; } else if (userObject.username) { welcomeMsg.innerHTML = "Welcome " + userObject.username + "!"; } else { welcomeMsg.innerHTML ...
[ "function getDefaultWelcomeMessage() {\n var message = \"\";\n var username = {'username': USER_NAME};\n invoke('get_default_welcome_message', username, function (data) {\n message = CHAT_AGENT_NAME + data['welcome_msg'];\n $(CHATBOX_ID).append(message);\n }); //inv...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Question 1: When, button 1 is clicked, select all paragraphs on the page with jQuery, and changed the color to blue. click button1 select all paragraphs change color to blue
function turnBlue() { $('p').css('color', 'blue'); }
[ "function change() {\n\tvar changeColorP = document.getElementById('paragraph1');\n\tchangeColorP.style.color = 'red';\n}", "function firstParagraphClicked(){\n if(firstParagraphIsClicked){\n firstPTag.style.color = \"black\";\n firstParagraphIsClicked = false;\n } else {\n firstPTag.style...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
build html saved list on our html page
function buildSavedList(saved) { let htmlSavedList = ""; for (i in saved) htmlSavedList += `<li><a href='${saved[i].urlLink}' target="blank">${saved[i].username}</a></li>`; document.getElementById("savedList").innerHTML = htmlSavedList; }
[ "function createHTML(list){\n html = '';\n for (var i = 0; i < list.length; i++) {\n html += '<li>' + list[i] + '</li>'\n };\n return html\n }", "function savedList() {\n\tlet todoList = document.createElement(\"ul\");\n\ttodoList.setAttribute(\"id\", \"ulElement\");\n\n\tlet ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
read project root from cordova context
function getProjectRoot (context) { return context.opts.projectRoot || null; }
[ "function getProjectRoot (context) {\n return context.opts.projectRoot || null\n }", "function getProjectRoot(context) {\n return context.opts.projectRoot || null;\n }", "function getProjBasePath() {\n return getHomePath() + '/prjbase';\n}", "getRoot() {\n return process.cwd();\n }", "ge...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Get menu popup map section data.
function getMenuPopupMap(options) { var sections = []; // scripts if (typeof options.scripts !== 'undefined') { var menuTree = {}; for (var key in options.scripts) { var script = options.scripts[key]; if (typeof script.scriptid !== 'undefined') { var items = splitPath(script.name), name = (item...
[ "get menuAPI() {\n return $(this.element).data('popupmenu') || undefined;\n }", "function get_topicmap_id() {\n return ui.menu_item(\"topicmap-menu\").value\n }", "function extractGeoInfo(section) {\n section = $(section);\n var topLeft = getLatLng(section, \"data-top-left\");\n ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Helper function. Given an ID of an item in the current restaurant's menu, returns that item object if it exists.
function getItemById(id){ let categories = Object.keys(currentRestaurant.menu); for(let i = 0; i < categories.length; i++){ if(currentRestaurant.menu[categories[i]].hasOwnProperty(id)){ return currentRestaurant.menu[categories[i]][id]; } } return null; }
[ "static findItemById(id) {\n let foundItem = null;\n data.items.forEach((item) => {\n if (item.id === id) {\n foundItem = item;\n }\n });\n return foundItem;\n }", "function finditembyid (id) {\n\n\tfor (var i = 0; i < food_pickup.length; i++) {\n\n\t\tif (food_pickup[i].id == id) {\...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Returns the number of contact points on the maximal disk circle implied by this [[CpNode]]. Note, however, that even oneprongs and sharp corners will return 2 (see [[isTerminating]] for more details); if this is not desired use [[getRealProngCount]] instead which will return 1 in these cases.
function getProngCount(cpNode) { // const startCp = this as CpNode; const startCpNode = cpNode; let cpNode_ = startCpNode; let i = 0; do { i++; cpNode_ = cpNode_.nextOnCircle; } while (cpNode_ !== startCpNode); return i; }
[ "get maxParticlesCount()\n {\n return this._aliveParticles.length + this._deadParticles.length;\n }", "getLongestCR(){\n let size=0;\n this.triples.forEach(triple => {\n let cValue = triple.constraint.toString().length;\n let rValue = triple.shapeRef.toString().length;\n ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Displays the APIElem with the given absolute path.
function display(path) { redirect('/api' + path); }
[ "function displayAPOD(response) {\n let apodResponseObject = JSON.parse(response);\n titleAPODElem.textContent = apodResponseObject.title;\n dateAPODElem.textContent = apodResponseObject.date;\n displayAPODElem.src = apodResponseObject.url;\n explainAPODElem.textContent = apodResponseObject.explanati...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Retrieve a file system with the given configuration.
function getFileSystem(config, cb) { var fsName = config['fs']; if (!fsName) { return cb(new ApiError(ErrorCode.EPERM, 'Missing "fs" property on configuration object.')); } var options = config['options']; var waitCount = 0; var called = false; function finish() { if (!called...
[ "function getFileSystem(type, success, error)\n {\n var type = type || parseInt(document.getElementById('fsType').value),\n success = success || function(fileSystem) {\n // get the root file system entry\n var root = fileSystem.root;\n ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Allow progression by enabling the main button or setting up the auto forfeit timer.
function allowProgression (nextPhase) { if (nextPhase !== undefined && nextPhase !== eGamePhase.END_FORFEIT) { gamePhase = nextPhase; } else if (nextPhase === undefined) { nextPhase = gamePhase; } if (humanPlayer.out && !humanPlayer.finished && humanPlayer.timer == 1 && gamePhase !=...
[ "function onGoal(){\n demoTimePaused = true;\n goalScored = true;\n document.getElementById(\"goalButton\").disabled = true;\n document.getElementById(\"demoTimerPause\").disabled = true;\n document.getElementById(\"demoTimerStart\").disabled = false;\n}", "function wait_btn_Fn(scope){\n\tgetChild(...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Get the UI style title tags of radioset
colorRadioSetTitle(title) { return `{black-fg,blue-bg}${title}{/black-fg,blue-bg}` }
[ "static getRadiothonName()\n {\n return $('#title').text();\n }", "get styleRadioSet() { return Object.assign({}, this.style.common); }", "function titleGroup(L) {\n return L\n ? (selection) =>\n selection\n .filter(([i]) => nonempty(L[i]))\n .append('title')\...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Calculate overall invoice summary
function calculate_invoice_summary() { var total_main_amount = 0; // var len = $("#invoiceForm .invoice_participantRow .invoice_main-group").length; var len = $("#invoiceForm .invoice_participantRow .invoice_main-group").length; var disc_type = $('#invoice_participantTable .invoice_discount_section .cus...
[ "function calculateSummary() {\n let subtotal = 0;\n for (var i = 0; i < elements.length; i++) {\n let item = elements[i];\n subtotal = subtotal + prices.prices[item.id];\n }\n subtotal = parseFloat(subtotal.toFixed(2));\n let tax = parseFloat((0.06 * subtotal).toFixed(2));\n let total =...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
emails with intern or position word in them function to analyze text of an object
async function analyzeText(res) { // GRAB SUBJECT OF TEXT let subject = res.data.payload.headers; subject.forEach( (name) => { if(name['name'] == 'Subject') { subject = name['value']; } }); // PUT CONTENT INTO READABLE TEXT let text = null; //used later if (res.data.payload.parts[0].body.d...
[ "extractEmails(text){\n return text.match(/([a-zA-Z0-9._-]+@[a-zA-Z0-9._-]+\\.[a-zA-Z0-9._-]+)/gi);\n }", "function inspectText(body, context) {\r\n var toDisplay = [];\r\n console.log(body);\r\n var prev, pref, word;\r\n var prefix = [\"\", \"den \", \"der \", \"de \", \"van \"];\...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
OR return the largest number of a non empty array by using reduce
function maxOfArray(array) { const reduced = array.reduce(function (max, num) { return num > max ? num : max; }, 0); console.log(reduced); return reduced; }
[ "function maxR(array) {\n return reduce(array, function(max, number) {\n if (max < number) {\n max = number;\n }\n return max;\n }, array[0]);\n}", "function greatestNumber(arr){\r\n var greatestNum;\r\n\r\n arr.reduce(function(previous, current){\r\n current > previous ? greatestNum ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Fetches items from Campaign Manager based on the provided parameters and it handles pagination by fetching all pages. This uses the list method of the API params: entity: The name of the Campaign Manager API entity listName: Name of the list returned by the API options: Additional options to be passed to the list API c...
function fetchAll(entity, listName, options) { var response = _retry(function() { return DoubleClickCampaigns[entity].list(profileId, options) }, constants.DEFAULT_RETRIES, constants.DEFAULT_SLEEP); var result = []; while (response && response[listName] && response[listName].length > 0) { r...
[ "getPaginatedItems(options={delayIndex: 0}) {\n let url = `http://api.walmartlabs.com/v1/paginated/items?apiKey=${this.apiKey}`;\n if (options.categoryId) {\n url += `&category=${options.categoryId}`;\n }\n if (options.specialOffer) {\n url += `&specialOffer=${options.specialOffer}`;\n }\n ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Update file corsi.json on server
function updateCorsi(corsi) { waitingDialog.show("Scrivendo sul server...", {progressType: "warning"}); $("#corso-modal").modal("hide"); // Sort corsi in alphabetical order by name corsi.sort(function compare(a, b) { if (a.name < b.name) return -1; if (a.name > b.name) return 1; return 0; }); ...
[ "async function configureBucketCors() {\n await storage.bucket(bucketName).setCorsConfiguration([\n {\n maxAgeSeconds,\n method: [method],\n origin: [origin],\n responseHeader: [responseHeader],\n },\n ]);\n\n console.log(`Bucket ${bucketName} was updated with a CORS c...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Function to resize dots on window resize
function resizeDots() { pageWidth = getWidth(); pageHeight = getHeight(); globalRadius = (pageWidth + pageHeight) / 200; numberOfDots = Math.ceil(((pageWidth * pageHeight) / 2) / Math.pow(2 * globalRadius, 2)) canvas = document.getElementById('backCanvas'); ctx = canvas.getContext('2d'); ctx.canvas.width...
[ "_resize() {\n\t\tthis.graphOptions.width = window.innerWidth * 0.7;\n\t\tthis.graphOptions.height = window.innerWidth * 0.5;\n\t\tthis.notifyPath('graphOptions.width');\n\t\tthis.notifyPath('graphOptions.height');\n\t}", "function onWindowResize() {\n updateSizes();\n }", "function resize() {\n xMax =...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
PAttributesForm form declraion for constructor class
function PAttributesForm(M_AttributeSetInstance_ID, M_Product_ID, M_Locator_ID, C_BPartner_ID, proWindow, AD_Column_ID, pwindowNo) { this.onClose = null; var $self = this; var $root = $("<div style='position:relative'>"); var $busyDiv = $("<div class='vis-apanel-busy' style='width:98%;he...
[ "function CSAFormField(formNameIn, nameIn, valueIn, statusIn )\r\n{\r\n\tthis.FormName = formNameIn;\r\n\tthis.Name = nameIn;\r\n\tthis.Value = valueIn;\r\n\tthis.Status = statusIn;\r\n}", "function _form_new(base, doc, caller, data) { _form.apply(this, arguments); }", "function CalipsoForm() {\n\n // TODO - t...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
newFromData Create empty model from create function newFromData + write = add
newFromData( data = {}, make_dirty = false ) { let model = factory.make_reactive_model( this.modelDefinition, data, this._create_context(), false ); // model._update_data( generated_data, null, true ); return model }
[ "create (data) {\n\n // create new model instance\n var newModel = new this[_Model](data);\n\n // append model to the collection\n this.append(newModel);\n\n // return newly created model\n return newModel;\n }", "static newRecord(dbModel, data) {\n const record...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
This checks myTeam array by playerId to look for duplicates to add or not add
function checkDuplicates(playerId) { for (var i = 0; i < myTeam.length; i++) { var element = myTeam[i]; if (playerId == element.id) { return true } } return false }
[ "function AddPlayerToSet(arr, playerToAdd) {\n var safeToAdd = true;\n for (var i = 0; i < arr.length; i++) {\n if (arr[i].steam64Id == playerToAdd.steam64Id) {\n safeToAdd = false;\n }\n }\n if (safeToAdd) {\n arr.push(playerToAdd);\n }\n}", "getRevenge(opponentTeam...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
picks the color of the squares to be the one to be guessed
function pickRGB(squares, numOfSquares){ return $(squares[randomNum(numOfSquares)]).css("backgroundColor"); }
[ "function winningColors(color){\n //loop through all the squares\n for(let i=0;i<squares.length;i++){\n //change all colors to match the picked color\n squares[i].style.backgroundColor = color; \n } \n}", "function selectCorrectColor(){\n if(hardMode){\n correctRGB = squares[get...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
this function removes the possible from a particular column
function removePossibleFromCol(rowNo, colNo, squareValue) { for (var i = 0; i < 9; i++) { if (possibles[i][colNo].indexOf(squareValue) !== -1) { possibles[i][colNo].splice(possibles[i][colNo].indexOf(squareValue),1) } } }
[ "removeCellOptionsByColumn(i, j) {\n for (let y=0;y<i;y++) {\n if (this.state[y][j] != X) {\n let o = this.options[i][j].indexOf(this.state[y][j]);\n if (o > -1) \n this.options[i][j].splice(o,1);\n }\n }\n for (let y=i+1;y<N;y++) {\n if (this.state[y][j] != X) {\n ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Wrapper for exportKey. Safari does not support exporting of ASN.1 types spki and pkcs8. Try the export first, but if it fails with one of these formats, try again using JWK format. Applies to WebCryptoVersion.V2014_01/2 only.
function exportKey(format, key) { return Promise.resolve() .then(function(){ return cryptoSubtle.exportKey(format, key); }) .catch(function(e) { if (format !== 'spki' && format !== 'pkcs8') { throw e; } return cryptoSubtle.e...
[ "exportPublicKey() {\n return crypto.subtle.exportKey('jwk', this.publicKey_).then(jwk => {\n const x = base64UrlToUint8Array(jwk.x);\n const y = base64UrlToUint8Array(jwk.y);\n\n let publicKey = new Uint8Array(65);\n publicKey.set([0x04], 0);\n publicKey.set(x, 1);\n publicKey.set(...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Select all tasks due tomorrow
function selectAllTasksDueTomorrow() { var tomorrow = new Date(); tomorrow.setHours(0); tomorrow.setMinutes(0); tomorrow.setSeconds(0); tomorrow.setMilliseconds(0); tomorrow.setTime(tomorrow.getTime() + 24 * 60 * 60 * 1000); var ruleInFunc = function(dueSpan) { var id = dueSpan.i...
[ "function selectAllOverdueTasks()\n{\n var today = new Date();\n var ruleInFunc = function(dueSpan)\n {\n var id = dueSpan.id.replace(\"due\", \"\");\n //GM_log(\"date: \" + $$(\"span[date!=0]\"));\n var taskDueDate = getTaskDueDate(dueSpan);\n var compareDate = new Date(today.g...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
deactivate all projectiles within a list
function resetProjectiles(list) { list.forEach(function (proj) { proj.isAlive = false; proj.isFirst = true; }); }
[ "Unselect() {\r\n this.map.forEach(mapx => {\r\n mapx.forEach(tile => { tile.selected = false; });\r\n });\r\n }", "pruneToVisibleTiles () {\n this.removeTiles(tile => !tile.visible);\n }", "clearProjectiles()\n {\n this.projectiles.length = 0;\n }", "functio...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
is the given string numeric?
function isNum(str) { return !isNaN(str.toString()); }
[ "function isNum(s){\n // based on utility function isNum from xml2json plugin (http://www.fyneworks.com/ - diego@fyneworks.com)\n // few bugs corrected from original function :\n // - syntax error : regexp.test(string) instead of string.test(reg)\n // - regexp modified to accept comma a...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Polyfilled methods will automatically be added to the chainable prototype. However, Object.getOwnPropertyNames cannot be shimmed for nonenumerable properties, so if it does not exist, then the only way to access native methods previous to ES5 is to provide them as a list of tokens here.
function defineNativeMethodsOnChainable() { var nativeTokens = { 'Function': 'apply,call', 'RegExp': 'compile,exec,test', 'Number': 'toExponential,toFixed,toLocaleString,toPrecision', 'Object': 'hasOwnProperty,isPrototypeOf,propertyIsEnumerable,toLocaleString', 'Array': 'conc...
[ "getAllAvailableClassMethods() {\r\n return eval(`Object.getOwnPropertyNames(${this.constructor.name}.prototype)`);\r\n }", "function patchBuiltins() {\n // These patches can always be done, for all supported browsers.\n patchBuiltin(window.Node.prototype, nodeMixin);\n patchBuiltin(window.Text.proto...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Find product by ASIN from products JSON
function findProductByAsin(asin){ var product = products[(asin || '').toUpperCase()], defaultProduct = {}; if(product){ console.log('found product', product.name, product); } else { defaultProduct = products.B002RP8YH2; console.log('did not find product for', asin, 'defaulting to'...
[ "function getProduct(id){\n return productsJSON[id].product;\n}", "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 itemNo...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Alien Functions This adds aliens to the cells for the start of the game
function addAliens() { aliensStart.forEach(alien => { cells[alien].classList.add('alien') }) aliensMovingRightInterval() }
[ "function drawAliens() {\n var noAliens = true;\n for (var c = 0; c < alienColumnCount; c++) {\n for (var r = 0; r < alienRowCount; r++) {\n var thisAlien = aliens[c][r];\n // if alien is alive and well give new x,y, show and attack\n if (thisAli...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
removes matching stories and starts the timer
function no_quiz(){ remove_stories(); // remove 'm now t = setInterval(remove_stories, 1000); // remove future stories (viz. when clicking the more link) }
[ "function resetStory() {\n stop();\n number = 30;\n $('#timer').html('<h2>' + number + '</h2>');\n runStory();\n if (aud.currentTime < 264) {\n aud.currentTime = switchTime;\n aud.play();\n switchTime = 262;\n }\n $('#question').empty...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Calls the Functions for deleting the Movie
function deleteMovie(toolBar){ var isWanted = confirm("Wollen sie den ausgewählten Film wirklich entfernen?"); if(isWanted){ var toolBarId = toolBar.attr("id"); var idBase = toolBarId.replace(/toolBar_/g, ""); var trId = createId(idBase, 1); var tcId = createId(idBase, 2); ...
[ "destroy() {\n let movieTitle = this.title;\n let movieId = this.movieId;\n\n delete Movie.instances[movieId];\n\n console.log( \"Movie \" + movieTitle + \" deleted.\" );\n\n }", "function movieDeleteButtonHandler(movieObj) {\r\n movieLibrary = movieLibrary.filter(movie => movie....
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Get the OrderDetails using entityAspect.loadNavigationProperty
function queryOrderDetailsWithLoadNavigationProperty(data) { var firstOrder = data.first; return firstOrder.entityAspect.loadNavigationProperty("OrderDetails"); }
[ "function queryOrderDetailsWithFromEntityNavigation(data) {\n var firstOrder = data.first;\n\n var navProp = firstOrder.entityType.getNavigationProperty(\"OrderDetails\");\n\n var navQuery = EntityQuery\n .fromEntityNavigation(firstOrder, navProp)\n .expand(\"Product\");\n...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
bindingStructue: A binding to a structure. bindingStructue : symbol, ?, (listof symbol), symbol, symbol, (listof symbol) (listof symbol) (listof permission), location > Binding
function bindingStructure(name, moduleSource, fields, constructor, predicate, accessors, mutators, permissions, loc){ this.name = name; this.moduleSource = moduleSource; this.fields = fields; this.constructor = constructor; this.predicate = predicate; this.accessors = accessors; ...
[ "function checkBindingCompatibility(binding, exportedBinding){\n if( (binding instanceof plt.compiler.provideBindingStructId)\n && (!(exportedBinding instanceof structBinding))){\n throwError(new types.Message([\"provided-structure-not-structure: \", exportedBinding.symbl]));\n } ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Call an effect after a component update, skipping the initial mount.
function useUpdateEffect(effect, deps) { var mounted = Object(__WEBPACK_IMPORTED_MODULE_0_react__["useRef"])(false); Object(__WEBPACK_IMPORTED_MODULE_0_react__["useEffect"])(function () { if (mounted.current) { effect(); } else { mounted.current = true; } // eslint-disable-next-line react-ho...
[ "function useDidUpdateEffect(fn, inputs) {\n const didMountRef = React.useRef(false);\n React.useEffect(() => {\n if (didMountRef.current) fn();else didMountRef.current = true;\n }, inputs);\n}", "function useUpdateEffect(effect, dependencies) {\n const isInitialMount = useRef(true);\n useEffect(() => {\n...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Recursively deserialize (JSON like) the BN tree from a String Returns: a BN tree
function BN_deserialize (jsonstr) { let BNtree; try { BNtree = JSON.parse(jsonstr); } catch (e) { console.log("Error when parsing BN JSON string: "+e); } return(BNtree); }
[ "static deserialize(stringTree) {\n const arr = JSON.parse(stringTree);\n const rootVal = arr.shift();\n const rootNode = new BinaryTreeNode(rootVal);\n rootNode.constructFromArray(arr);\n return new BinaryTree(rootNode);\n }", "static deserialize(stringTree) {\n const arr = JSON.parse(stringTr...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
adds the number of chips the user has
addChips(chips) { this.chips += chips; }
[ "addChips(chipDifference) {\n this.chips += chipDifference;\n }", "function addChipToBet(chip)\r\n{\r\n\tPLAYER.bet.sumChips += CHIP_VALUE[chip];\r\n\tBETSVIEW.innerHTML = PLAYER.bet.sumChips;\r\n}", "function addCount() {\n if (count == 16) {\n count = 0;\n // console.log(count);\n ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Import wallets to polkadot keystore
async polkadotKeysImport (containerName) { try { console.log('Importing keys to keystore...'); // Importing 5 validator keys into keystore await this.importAKey(containerName, config.polkadotKeyGran, 'ed25519', 'gran'); await this.importAKey(containerName, config.polkadotKeyBabe, 'sr25519',...
[ "function importAccountFromSeed() {\n\n var password = 'Password';\n lightwallet.keystore.createVault({\n password: password,\n seedPhrase: document.getElementById('private-key').value,\n //random salt \n hdPathString: \"m/0'/0'/0'\"\n }, function(err, ks) {\n\n global_ke...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
giving user 4 guesses to try to guess the number 2 for how many dogs I have
function theDogGame() { for (var i = 0; i < 4; i++) { var numDogs = parseInt(prompt('We know that Cheyna is a dog lover. You have 4 guesses to tell me how many dogs do you think she has?')); numGuesses = numGuesses + 1; console.log('total guesses '+ numGuesses); if (numDogs === 2) { alert(corre...
[ "function numguesses(randomword) {\n return 5;\n}", "function question_6() {\n var randomNumber = Math.floor(Math.random() * 20) + 1; //had done work with random numbers previously but had to consult http://stackoverflow.com/questions/4959975/generate-random-number-between-two-numbers-in-javascript to jog my ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
FUNCTION: dwscripts.encodeSQLColumnRef DESCRIPTION: Returns a column reference suitable for use within a SQL statement. Adds the table name qualifier if needed, and wraps the reference in quotes if the column name contains a space, starts with an underscore, or starts with a number. ARGUMENTS: tableName string the tabl...
function dwscripts_encodeSQLColumnRef(tableName, columnName, encodeSQLReservedWords) { var retVal = ""; // Use the Server Model version if it exists var serverObj = dwscripts.getServerImplObject(); if (serverObj != null && serverObj.encodeSQLColumnRef != null) { retVal = serverObj.encodeSQLColumnRef(ta...
[ "function encodeSQLColumnRef(tableName, columnName)\n{\n var retVal = \"\";\n\n cName = columnName;\n if (columnName.charAt(0) == \"_\")\n {\n cName = \"`\" + cName + \"`\";\n }\n else if (dwscripts.isNumber(columnName.charAt(0)))\n {\n cName = \"`\" + cName + \"`\";\n }\n else if (columnName.indexOf...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Chapter 10 Sidney and Jennifer Revenge When the fight ends
function C010_Revenge_SidneyJennifer_EndFight(Victory) { // Change the girls attitude depending on the victory or defeat ActorSpecificChangeAttitude("Sidney", 0, Victory ? 2 : -2); ActorSpecificChangeAttitude("Jennifer", -1, Victory ? 2 : -2); ActorSpecificSetPose("Sidney", "Angry"); ActorSpecificSetPose("Jennif...
[ "function C010_Revenge_AmandaSarah_EndFight(Victory) {\n\t\n\t// Change the girls attitude depending on the victory or defeat\t\n\tActorSpecificChangeAttitude(\"Amanda\", -2, Victory ? 2 : -2);\n\tActorSpecificChangeAttitude(\"Sarah\", -2, Victory ? 2 : -2);\n\tGameLogSpecificAdd(\"C010_Revenge\", \"Amanda\", Victo...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Given a text node in the DOM as 'this', and a string 'separator' in scope, replace the text node in the DOM, with several text nodes interspersed with BR tags where the separators were
function inPlaceTextSplit() { var parent = this.parentNode; var insertionPoint = this.nextSibling; var lines = $(this).text().split(separator); if (lines.length > 1) { for(var i = 0; i < lines.length; i++) { if (i > 0) { parent.insertBefore(document.createElement('br'), insertion...
[ "function addBreak(text)\n{\n return text.replace(/\\n/g, \"<br />\");\n}", "function lineBreak(node) {\n addElement(node, \"br\");\n}", "function replaceBreaks( text ){\n\t\t\n\t\treturn text.replace( /(?:\\r\\n|\\r|\\n)/g, \"<br>\" );\n\t\t\n\t}", "function escapeHTMLBr(value){\n\t// Replace with newline c...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Change Insights Slider size
function changeInsightsSliderSize() { wrapperI.css({ width: itemsI.length * sliderInsightsWidth + "vw" }); paddingI.css({ padding: "0 " + sliderInsightsPadding + "vw" }); itemsI.each(function() { if(parseFloat($(this).css("width")) != 0) { $(this).css({ width: sliderInsight...
[ "_changeSliderSize() {\n\t\t\t\tlet width = this.model.get('width'),\n\t\t\t\t\theight = this.model.get('height');\n\n\t\t\t\tthis.$el.css({width, height});\n\t\t\t}", "function changeSliderSize() {\n\t\t\twrapperA.css({\n\t\t\t\twidth: itemsA.length * (sliderWidth + 2 * sliderMargin) + \"vw\",\n\t\t\t\tmarginLef...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Drops player chip to the target chip cell in the current chip column
function dropChip() { // Set the current player chip color currentPlayerChipColor = (currentPlayer === 1 ? player1ChipColor : player2ChipColor); // Get the current chip column (clicked chip column) var chipColumn = []; for (i = 0; i < nrows; i++) { chipColumn.push(allChipCells[topChipCells...
[ "function dropChip () {\n if (board[activeColumn][board[0].length-1] === 'emptyCell') {\n const lowestIndex = board[activeColumn].findIndex(element => {\n return element === 'emptyCell'\n })\n board[activeColumn][lowestIndex] = `player${player}Cell`\n player = player === 1 ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Returns a 4x4 matrix with diagonal elements set to the given vector.
diagonalMat4c(x, y, z, w) { return math.diagonalMat4v([x, y, z, w]); }
[ "diagonal() {\r\n if (!this.isSquare) {\r\n return null;\r\n }\r\n const els = [];\r\n const n = this.elements.length;\r\n for (let i = 0; i < n; i++) {\r\n els.push(this.elements[i][i]);\r\n }\r\n return Vector.create(els);\r\n }", "toDiagonalMatrix() {\n return Matrix.Diagonal...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Oneshots seem to fire 10 msec late Grab current time, calculate when next game starts, return the diff in msec
function msecUntilNextGame() { var now = new Date().getTime(); var timePrevGameOver = Math.floor(now / MSECS_IN_COMPLETE_CYCLE) * MSECS_IN_COMPLETE_CYCLE; return (timePrevGameOver + MSECS_IN_COMPLETE_CYCLE) - now; }
[ "function totalGameTime() {\r\n const currentTime = new Date();\r\n return currentTime.getTime() - startingTime.getTime();\r\n}", "getGameTime() {\n return this.time / 1200;\n }", "function _realTimeSinceLastManipulation () {\n\treturn _realTime() - realTimeAtLastManipulation;\n}", "function s...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
when reifying, if a package is technically in a bundleDependencies list, but that list is the root project, we still have to install it. This getter returns true if it's in a dependency's bundle list, not the root's.
get inDepBundle () { const bundler = this.getBundler() return !!bundler && bundler !== this.root }
[ "function canInstallPrebundledApps() {\n freezeDriedBundlePath = _(config.FrozenAppPaths).find(function(bundlePath) {\n var err;\n try {\n console.log(\"Looking for prebundled path in: \" + bundlePath);\n return fs.existsSync(bundlePath);\n } catch (_error) {\n err = _error;\n console....
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Requeue job i.e. create new job instance based on current job
function requeueJob() { var dialogInstance = $uibModal.open({ templateUrl: 'components/confirmation-dialog/confirmation-dialog.view.html', controller: 'ConfirmationDialogController', controllerAs: 'confirmationDialogCtrl', resolve: { confirmationText: function() { ...
[ "function queueJob(job, callback) {\n if (typeof (job) === 'undefined') {\n return callback(new wf.BackendInternalError(\n 'WorkflowRedisBackend.queueJob job(Object) required'));\n }\n var multi = client.multi();\n var p;\n\n for (p in job) {\n ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
computes the perimeter of a square
function computePerimeterOfSquare( side ) { return multiply( side, 4 ); }
[ "function perimeter (width, height){\n return 2 * (width + height)\n}", "function squarePerimeter(side){\n return side * 4;\n}", "calculatesPerimeter(){\n return (2*this.length)+(2*this.width);\n }", "function findPerimeter(height, width) {\n return (height + width) * 2\n}", "function perimete...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Initializes the slider with the input options and callback
function Slider(options, callback) { this.options = options; this.callback = callback; this.initialize(); }
[ "function initSlider(){\n\t$('.slider').slider({\n\t\torientation: 'vertical',\n\t\trange: [0, gradientSize],\n\t\tvalues: handleArray,\n\t\tstart: function( event, ui) {\n\t\t\tappTooltips('hide-handle');\n\t\t},\n\t\tstop: function( event, ui ) {\n\t\t\tupdateAfterArrayChanges();\n\t }\n\t});\n}", "function ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
name: sendAlert(reason, data[optional]) purpose: Sends email alerts to admins input: String reason, Array data [optional] output: none (sends email) eg. reason = 'ERRORS' send email listing errors caught from a given function NB: better just to have 'reason' var activate different spreadsheets containing the template d...
function sendAlert(reason, data) { var to = 'reece@g.harvard.edu' var from = 'Psych2500 Daemon' var subject var body if (reason == 'NOCLASS') { subject = 'No 2500 class this week' body = 'That is all there is to discuss. Thanks!' } else if (reason == 'ERRORS') { subje...
[ "function sendAlert(contents) {\n //PLACEHOLDER for alert e-mail\n var email = \"austin.taing001@gmail.com\";\n var subject = \"Negative Feedback Alert\";\n var body = \"\";\n var questions = getData();\n \n //Formats user's numeric responses to go with the questions\n for(i=0; i<contents.length-1; i++)\n ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
! PUKI EVENTS This is the function that runs to build puki drag and drop events
function buildPukiDrag(){ for(n=0;n<animation_arr.length;n++){ if(animation_arr[n].interact){ var targetAnimate = $.pukiAnimation[animation_arr[n].name]; targetAnimate.cursor = "pointer"; targetAnimate.addEventListener("mousedown", function(evt) { togglePukiDragEvent(evt, 'drag') }); targetAnimat...
[ "static dragEvents(){\n //enter drag\n Quas.on(\"dragenter dragstart\", \".drop\", function(e){\n e.preventDefault();\n new Element(this).addCls(\"dragenter\");\n });\n\n //exit drag\n Quas.on(\"dragend dragleave\", \".drop\", function(e){\n e.preventDefault();\n new Element(this)...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
The range picker that this input is associated with.
get rangePicker() { return this._rangePicker; }
[ "function Rangepicker(){\n\n\tthis._defaults = {\n\t\tmonthNames: [\t// default month name displays. Used for converting from 0-11 to months\n\t \t\t\t\t\"Jan\",\n\t \t\t\t\t\"Feb\",\n\t \t\t\t\t\"Mar\",\n\t \t\t\t\t\"Apr\",\n\t \t\t\t\t\"May\",\n\t \t\t\t\t\"Jun\",\n\t \t\t\t\t\"Jul\",\n\t \t\t\t\t...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Save changes in published blog handler
function saveChangesInPublishedBlog(e) { // Get content data from ckeditor var contentData = CKEDITOR.instances.ckeditor.getData(); // Make 'tags' string to array var tagsArr = []; var tagsList = document.querySelectorAll('#myTags li .tagit-label'); function tagsToArr() { for (var ...
[ "function handleBlogUpdate() {\n\t\tvar currentBlog = $(this)\n\t\t.parent()\n\t\t.parent()\n\t\t.data(\"blog\");\n\t\twindow.location.href = \"/csm?blog_id=\"+ currentBlog.id;\n\t}", "function handleArticleSave() {\n // trigger when user wants to save article\n var articleToSave = $(this).parents(\...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
A silly naming convention that prepends an underscore (_) to every property name.
function UnderscoreNamingConvention() { return new breeze.NamingConvention({ serverPropertyNameToClient: function (serverPropertyName) { return '_' + serverPropertyName; }, clientPropertyNameToServer: function (clientPropertyName) { return clientPropertyName.s...
[ "function NoUnderscoreConvention() {\n\n var _underscoredNames = {}; // hash of every translated server name\n\n return new NamingConvention({\n name: 'noUnderscore',\n clientPropertyNameToServer: clientPropertyNameToServer,\n serverPropertyNameToClient: serverPropertyNameToClient\n });\n\n ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
3. From 1 100, log "Rick" if div. by 3, "Roll" if div. by 5, "RickRoll" if div. by both, and the number if none.
function rickRoll () { for (let y = 0; y <= 100; y++) { if ((y % 5 == 0) && (y % 3 == 0)) { console.log("RickRoll"); } else if (y % 3 == 0) { console.log("Rick"); } else if (y % 5 == 0) { console.log("Roll"); } else { console.log(y); } } }
[ "function factorOfNumbers(number){\nlet string = \"\";\n\nif (number % 3 !==0 && number % 5 !==0 && number % 7 !==0){\n string = \"Ops! Raindrop-speak doesn't know what to make of that\" \n} \nif(number % 3 ===0){\n(string += \"Pling\");\n}\n if( number % 5 === 0){\n(string += \"Plang\"); \n}\n if( number % 7 ===...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Deletes all created tacos
deleteAllTacos () { this.setState({ tacos: [] }) // Update cookie Cookies.set(COOKIE_KEY, []) this.props.onSave([]) }
[ "function destroyAll() {\n\tfor (var id in _todos) {\n\t\tdestroy(id);\n\t}\n}", "deleteAll() {\n realm.write(() => {\n const cashe = realm.objects('Cashe');\n realm.delete(cashe);\n });\n }", "function del_all_rtu() {\n for (var i = DB.length - 1; i >= 0; i--) {\n if (fs.existsSync(DB[i].s...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Sets the index:th property value of the given object.
setProp(obj, index, value) { return this._propSetters[index](obj, value); }
[ "setByIndex(index, value) {\n let key = this.getKeyByIndex(index);\n super.set(key, value);\n }", "function updateProperty(index) {\n var prop = properties[index];\n if (prop === Undefined)\n return;\n\n if (prop.update) {\n prop.update();\n return;\n }\n\n if ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Set immutablility policy on the blob.
async setImmutabilityPolicy(immutabilityPolicy, options) { const { span, updatedOptions } = createSpan("BlobClient-setImmutabilityPolicy", options); try { return await this.blobContext.setImmutabilityPolicy(Object.assign({ abortSignal: options === null || options === void 0 ? void 0 : option...
[ "async setImmutabilityPolicy(immutabilityPolicy, options = {}) {\n return tracingClient.withSpan(\"BlobClient-setImmutabilityPolicy\", options, async (updatedOptions) => {\n return assertResponse(await this.blobContext.setImmutabilityPolicy({\n immutabilityPolicyExpiry: immutability...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
validateUserAndSubmit(action) Validate delete users action
function validateUserAndSubmit(action) { var flag = 0; if(action == "delete") { //for only one site if (document.myForm.adminUserId.value) { if (document.myForm.adminUserId.checked) flag = 1; } else { for (var i=0; i<document.myForm.adminU...
[ "function onSubmitDeleteUser() {\n var select = document.getElementById(\"currentUsersList\");\n var userId = select.options[select.selectedIndex].value;\n deleteUser(userId);\n }", "function deleteUser() {\r\n populateUsers();\r\n var username = document.getElementsByClassName(this.name)[0].val...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Code Example 5.4 Creating a Range object using two different overloaded versions of the Sheet "getRange()" method. "getSheets()[0]" gets the first sheet of the array of Sheet objects returned by "getSheets()". Both calls to "getRange()" return a Range object representing the same range address (A1:B10).
function getRangeObject () { var ss = SpreadsheetApp.getActiveSpreadsheet(), sh = ss.getSheets()[0], rngByAddress = sh.getRange('A1:B10'), rngByRowColNums = sh.getRange(1, 1, 10, 2); Logger.log(rngByAddress.getA1Notation()); Logger.log( rngByRowColNums.getA1Notation()); }
[ "function getRangeObject() {\n var ss = SpreadsheetApp.getActiveSpreadsheet(),\n sh = ss.getSheets()[0],\n rngByAddress = sh.getRange('A1:B10'),\n rngByRowColNums = sh.getRange(1, 1, 10, 2);\n Logger.log(rngByAddress.getA1Notation());\n Logger.log(\n rngByRowColNums.getA1Notation())...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Returns a cursor to current working directory or null
getCWD() { let cwd = this.state.cursor().get( 'cwd' ) return cwd || null }
[ "static get defaultCursor() {}", "getFile() {\n const at = vscode.window.activeTextEditor;\n if (!at) {\n return null;\n }\n const cursor = at.selection.active;\n if (cursor.line < 1) {\n return null;\n }\n return this._files[cursor.line - 1];...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Returns an observable whose values are those of this observable with the project function applied
function map(first, project) { let index = 0; return new Observable_1.Observable((o) => first({ next: (x) => o.next(project(x, index++)), error: o.error, complete: o.complete })); }
[ "function combineAll(project) {\n return function (source) { return source.lift(new CombineLatestOperator(project)); };\n}", "function combineAll(project) {\n return function (source) { return source.lift(new combineLatest/* CombineLatestOperator */.Ms(project)); };\n}", "function combineAll(project) {\n ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
style function for flood
function floodLegendStyle(feature) { if (feature.get('Flood') < 8) { return new ol.style.Style({ image: new ol.style.Circle({ radius: 5, fill: new ol.style.Fill({ color: '#fef0d9' // yellow }), ...
[ "function FloodRiskstyle(feature) {\r\n\treturn {\r\n\t\tfillColor: '#66a3ff ',\r\n\t\tweight: 1,\r\n\t\topacity: 1,\r\n\t\tcolor: '#66a3ff',\r\n\t\tfillOpacity: 0.7\r\n\t};\r\n}", "function wallColorizer() {\n return 'rgb(150,150,150)';\n}", "floodFill (stack, {channel = 0, threshold = 255}) {\n let pt\n ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
/Called by clicking Find Information button on MapLocationControl. / Displays MapFindInformationLocationControl in "FindInformation" state. / / ID of parent mapLocationControl / Bool true if location is unresolved on map
function FindInformation(mapLocationControl, locationUnresolved) { SetZoomControlInstructions(mapLocationControl, false); // Display appropriate row document.getElementById(mapLocationControl+'_headerButtonRow').style.display='none'; document.getElementById(mapLocationControl+'_headerTextRow').style.display=''; ...
[ "function highlightLocationOnMap() {\n //get current location id\n var attrLocationId = this.getAttribute('data-location-id');\n\n //if location is hided on map\n if (this.textContent == 'location_off') {\n //show location on map\n document.getElementById('label-for-checkbox-location' + at...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIE...
function addRandomGreeting() { const greetings = ['I play viola and trumpet! I have played the viola since the 5th grade and trumpet since the 7th grade.']; // Pick a random greeting. const greeting = greetings[Math.floor(Math.random() * greetings.length)]; // Add it to the page. const greetingContain...
[ "function addRandomGreeting() {\n\n const greetings =\n ['IM IN', 'Lets do this', '你好,世界!', 'Hee Hee'];\n\n // Pick a random greeting.\n const greeting = greetings[Math.floor(Math.random() * greetings.length)];\n\n // Add it to the page.\n const greetingContainer = document.getElementById('greeting-contai...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
open a popup code description window when click on any code
function openCodeDescriptionPopUp(codeType, code, codeDescription, rowNum,codeScale){ if ($('#code_desc_popup').css('display') == 'block') closeCodeDescriptionPopUp(); //if (qsStageId == 49 && $('#data_point_transcript').css('display') == 'block') //cancelDataPointsTranscript(); var...
[ "function sample2Code(event){\n TipFixCode(JS2_OPT,event,{iWidth:1000, iTipMaxHeight:400,szTitle:\"JS Source Code - Popup Option\" });\n}", "function showTheCode() {\n $(\"#meridian-map\").hide();\n const dialog = $(\"<div>\").addClass(\"dialog flex flex-column\");\n const heading = $(\"<div>\")\n .addClas...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Add one highlight match pattern
addHighlightMatch(pat) { this._highlights.push(pat); }
[ "function addHighlightSpan(match, p1, offset, string) {\n return \"<span class=\\\"searchHighlight\\\">\" + match + \"</span>\";\n }", "function CustomHighlight() {}", "addHighlight() {\n\t\tconst self = this\n\t\tdocument.querySelector('#highlightdialog').style.display = 'table'\n\t\tdocument.querySe...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Section: Update functions Function: deleteLocal remove local data at path. Fires: change
function deleteLocal(path, local, remote) { logger.info('DELETE', path, 'REMOTE -> LOCAL'); return store.removeNode(path, remote.timestamp); }
[ "function deleteLocal(path, local, remote) {\n logger.info('DELETE', path, 'REMOTE -> LOCAL');\n var oldValue = store.getNodeData(path);\n store.removeNode(path, remote.timestamp);\n }", "function deleteRemote(path, local, remote) {\n logger.info('DELETE', path, 'LOCAL -> REMOTE');\n wireClient.re...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
afterGameDisplay Gets the canvas and context, setting appropriate font styles to use in drawing text. draws a message to the canvas based on if the player won, lost, or drew with the dealer. increments the appropriate entry for winLossDrawRate. entry 0 being wins, 1 being losses, and 2 being draws. Returns void
function afterGameDisplay(label, index){ //get the canvas context for drawing let canvas = document.getElementById('GameCanvas'); let context = canvas.getContext('2d'); context.font = "3rem Sriracha"; context.fillStyle = "white"; context.textAlign = "center"; context.fillText(label, canvas....
[ "function handleGameWon()\n{\n ctx.fillStyle = 'black';\n ctx.font= '20px Arial';\n ctx.fillText('You won! Score: ' + score, 20, canvas.height - 20);\n}", "function drawGameOver() {\n\tdrawBackground();\n\tdrawBanner();\n\tif (livesRemaining === 0) {\n\t\tcolorTxt('OUT OF LIVES', canvas.width / 2, canvas.heigh...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
grading_note: I based these textures off of images found online most similar to CS Source textures, then went into photoshop and did some warping/manipulation to make them look "correct"
function initTextures(){ var texture = gl.createTexture(); if(!texture){ console.log("failed to create texture object"); return false; } //get u_sampler storage locale var u_Sampler = gl.getUniformLocation(gl.program, 'u_Sampler'); if(!u_Sampler) { console.log("failed to ...
[ "RebuildTextures() {}", "function transformTexture(x) {\n if (x.band3 === undefined) {\n for (let gnxs in x) {\n const gn = gnxs;\n if (gn.endsWith(\"red2\") || gn.endsWith(\"green2\") || gn.endsWith(\"blue2\") || gn.endsWith(\"refl2\")) {\n x[gn.substring(0, gn.leng...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
make sure all flip down card will be group into n row base on their card number
mapFlipDownCards(cards) { if (!cards) return; let flatArr = this.getFlatten(cards); // let flatArr = cards.flat(); let cardsNumberOnHand = 5; let totalLen = flatArr.length; // if cards number is under n, split flipdown card into two row; if (totalLen <= cardsNumberOnHand) { let mid = M...
[ "function provideCards(number) {\n if (number < 0) {\n return;\n }\n\n let accordion = $(\"#accordion\");\n let length = function () {\n return accordion.children().length;\n };\n\n while (length() !== number) {\n if (length() > number) {\n accordion.children().last...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Make the table selected by the provided CSS selector into a dataTables table using the default_datatable_args with the extra_args deep merged in.
function initialize_data_table(tableSelector, extra_args) { $(function () { initialize_data_table_synchronous(tableSelector, extra_args); }) }
[ "function createDataTable2(jQuerySelector) {\n var oTable = $(jQuerySelector).dataTable({\n \"sScrollX\": \"100%\",\n \"sScrollY\": \"100%\",\n \"bScrollCollapse\": true,\n \"bPaginate\": false,\n \"bJQueryUI\": false,\n \"bPaginate\": true,\n \"bLengthChange\": t...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Returns length of item
function listLength() { return item.length; }
[ "function sizeOf(item)\n{\n\treturn item.length();\n}", "function itemCount() {\n return this.items.length;\n }", "function getLengthOfList(){\n return itemList.length;\n}", "function length() {\n\treturn this.listSize;\n}", "function arrayItemCount(item) {\n return item.length;\n}", "__len_...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Get details about a location. Calls the following HTTP API: `GET /locations/` For example: ```javascript import as Qminder from 'qminderapi'; Qminder.setKey('API_KEY_HERE'); const locationDetails = await Qminder.locations.details(1234); // locationDetails.id = 1234 // locationDetails.name = 'Example Location' ```
static details(locationId) { return api_base_1.default.request(`locations/${locationId}/`).then((details) => new Location_1.default(details)); }
[ "function getLocationDetails(locationID, authInfo) {\n return {\n Pull_GetLocationDetails_RQ: {\n ...createAuthentication(authInfo),\n LocationID: locationID\n }\n }\n}", "async getCurrentLocation() {\n try {\n const url = '/locations/' + this.props.matc...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Function to get the portfolio content
function getPortfolio(parentEl) { // API Fetch fetch( "https://cdn.contentful.com/spaces/9635uuvwn9dq/environments/master/entries?access_token=cgtQv23ag7qZw92QlPnJwslq6vWfK8sDwB8fNk62QTI&content_type=portfolio" ) .then((res) => res.json()) .then((data) => processPortfolio(data, paren...
[ "function getPortfolio() {\r\n portfolioEl.innerHTML = \"\";\r\n fetch(\"http://studenter.miun.se/~aslo1900/dt173g_projekt_rest/portfolio.php\")\r\n .then(response => response.json())\r\n .then(data => {\r\n data.forEach(portfolio => {\r\n portfolioEl.innerHTML +=\r\n ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Ex. 2 A function that takes in an array of numbers, and returns the third number in the array.
function thirdInArray(numArray) { return numArray.index(2); }
[ "function getThird(array) {\n return array[2]\n}", "function getThird(array) {\n return array[2];\n}", "function grabTheThird(arr) {\n}", "function third(sequence) {\n return sequence[2];\n}", "function third (seq) {\n return seq[2];\n}", "function third(sequence){\n var thirdValue = sequence[2]\...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Disables infinite scroll. See more on [GitHub](
disableInfiniteScroll() { if (!this._hasInfiniteScroll) { return; } this._modalComponent._infiniteScroll.disabled = true; }
[ "function disableLazyLoadDown() {\n scrollDown = false;\n}", "function handleInfiniteScrollDisabled(v) {\n _scrollEnabled = !v;\n if (_scrollEnabled && _checkWhenEnabled) {\n _checkWhenEnabled = false;\n ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Function: maskOr Description: Performs IPv4Address | IPv4Subnetmask and returns the resulting IPv4Address as an integer.
function maskOr(ip, mask) { /* The following line adjusts the ip address to match the first address in the subnet (filtering all non-subnet mask bits in the ip */ /* Not that this is done for the left 16 bits and the right 16 bits separately since the bitwise operator works on 32 bit signed integers yielding ne...
[ "function COMM_IPv4IPADDR(network, mask, host)\n{\n\tnetwork = COMM_IPv4NETWORK(network,mask);\n\tvar m = Math.pow(2, parseInt(32-mask, 10))-1;\n\thost = parseInt((host & m), 10);\n\treturn COMM_IPv4INT2ADDR(COMM_IPv4ADDR2INT(network)+host);\n}", "function IPAddress$createIpv4Mask(maskSize) {\n return -1<<(32-...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
If `range` is a proper range with a start and end, returns the original object. If missing an end, computes a new range with an end, computing it as if it were an event. TODO: make this a part of the event > eventRange system
function ensureVisibleEventRange(range) { var allDay; if (!range.end) { allDay = range.allDay; // range might be more event-ish than we think if (allDay == null) { allDay = !range.start.hasTime(); } range = $.extend({}, range); // make a copy, copying over other misc properties range.end = t.g...
[ "function ensureVisibleEventRange(range) {\n\t\tvar allDay;\n\n\t\tif (!range.end) {\n\n\t\t\tallDay = range.allDay; // range might be more event-ish than we think\n\t\t\tif (allDay == null) {\n\t\t\t\tallDay = !range.start.hasTime();\n\t\t\t}\n\n\t\t\trange = {\n\t\t\t\tstart: range.start,\n\t\t\t\tend: t.getDefau...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
gets the azure player
function getAzurePlayer() { return azurePlayer }
[ "get TizenPlayer() {}", "get SamsungTVPlayer() {}", "load_player() {\n this.player = this.cookie.get(this.cookie_board_player);\n return this.player;\n }", "getCurrentUserPlayback() {\n return new Promise((resolve, reject) => {\n this.requestHandler.request('GET', 'me/player...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Extracts one Sherlock "section" from aSource. A section is essentially an HTML element with attributes, but each attribute must be on a new line, by definition.
function getSection(aLines, aSection) { LOG("_parseAsSherlock::getSection: Sherlock lines:\n" + aLines.join("\n")); var lines = aLines; var startMark = new RegExp("^\\s*<" + aSection.toLowerCase() + "\\s*", "gi"); var endMark = /\s*>\s*$/gi; va...
[ "function parseSections(sourceText) {\n\t\tconst lines = sourceText.split(\"\\n\");\n\t\tlet sections = [];\n\t\tlet inSection = false;\n\t\tlet currentSection = null;\n\t\t//find all sections\n\t\tfor(let i=0; i<lines.length; i++)\n\t\t{\n\t\t\tlet line = lines[i];\n\t\t\tif(line.length == 0)\n\t\t\t\tcontinue;\n\...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Finding style based on class name and returns style
function getStyle(className) { for(var i = 0; i < document.styleSheets.length; i++){ var classes = document.styleSheets[i].rules || document.styleSheets[i].cssRules if(classes != null) for(var x=0;x<classes.length;x++) { if(classes[x].selectorText==classNa...
[ "function getStyleByClass(t, c, p) {\n\t// first loop over elements, because if they've been modified they\n\t// will contain style data more recent than that in the stylesheet\n\tvar elements;\n\tif(t == '*') {\n\t\t// '*' not supported by IE/Win 5.5 and below\n\t\telements = (ie) ? document.all : document.getElem...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
clean words of extraneous characters
function cleanWord (word) { if (!word) return '' var cleanWord = word.replace(/[()!,;:."]+/, '') return cleanWord }
[ "function deleteUselessChars(word){\n return word.replace(/[^\\w]/g,\"\");\n}", "function cleanup(str) {\n return str.replace(/\\(S\\)|\\(W\\)|\\(G\\)| ELEM|/gi, ''); \n}", "function stripWords()\n {\n for(var i = 0; i < wordArray.length; i++)\n {\n wordArray[i] = wordArray[i]...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
= Description Returns a style of the main DOM element of the component. Utilizes +ELEM+ cache to perform the action. = Parameters +_name+:: The style name (css syntax, eg. 'backgroundcolor') = Returns The style property value (css syntax, eg. 'rgb(255,0,0)')
style(_name) { if (this.elemId) { return ELEM.getStyle(this.elemId, _name); } else { console.warn('HView#style warning; no elemId!'); return ''; } }
[ "function extractInlineStyle(element, name) {\n const re = new RegExp(`${name}:([^;]*)`);\n return element.getAttribute('style').match(re)[1].trim();\n }", "function getStyleItem( divName )\n\t{\n\tvar\tobj;\n\tobj = document.all[divName].style;\n\treturn obj;\n\t}", "function getStyle(element, styleName...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Update all saving throws based on their proficiencies and relevant ability scores.
function updateSavingThrows() { const proficiency = document.querySelector('#proficiency-bonus'); const proficiencyBonus = (proficiency.textContent.includes('+')) ? parseInt(proficiency.textContent.slice(1)) : parseInt(proficiency.textContent); const abilityScores = ['str', 'dex', 'con', 'int', 'wis...
[ "function updateAllFinances() {\n var $levelDifficultyMultiplier = (Math.abs(($hive.level / 3) - 100) / 100);\n $hive.healthRate = ((($hive.workerCount * $workerBee.healthRate) + ($hive.maintenanceWorkerCount * $maintenanceWorkerBee.healthRate)) / 10);\n //stuff affected by winter\n if ($game.se...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
store file in resources
function storeInResources(params, callback) { const file = params.file; generateResource({ file: file }, resource => { director.setResource({ resource: resource }, function (err, res) { if (err) { callback(err); } callback(null, res); }); }); }
[ "async write_resources(file, resources) {\n const file_content = _.map(resources, resource => JSON.stringify(resource)).join('\\n');\n await fs.promises.writeFile(file, file_content);\n }", "readResources(path){\n var readdir = fs.readdirSync( path ),\n files = readdir.filter(it...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
XPATH FOR MEETING CARD ALL NAVIGATION Xpath for Expert Tips Tab
get expertTipsTab() {return browser.element("~Expert Tips");}
[ "get meetingExpertTips_Header1() {return browser.element(\"//android.widget.TextView[@text='Featured Tips & Analysis']\");}", "get newsHub_OpinionTab() {return browser.element(\"~Opinion\");}", "get meetingExpertTips_1stContent() {return browser.element(\"//android.view.ViewGroup[3]/android.widget.ScrollView/an...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Get the headers from the Google Sheet
function getHeaders(accessToken, context) { // * May Require Update: // Range property below must be extended if headers in google sheet extend beyond Z column // "sheetId" should reflect the name used to store the sheetId const getBody = { access_token: accessToken, spreadsheetId: context[sheetIdKeyNam...
[ "function getHeaders(sheet) {\n let headings = sheet\n .getDataRange()\n .offset(0, 0, 1)\n .getValues()[0];\n let headers = [];\n for (let i = 0; i < headings.length; i++) {\n let header = headings[i];\n // headers[header] = i + 1;\n headers[i] = header;\n }\n return headers;\n}", "functio...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
window.addEventListener("load", add_advanced_mode_event); Advanced mode toggle advanced mode classes
function add_advanced_mode_event(){ var checkbox = document.getElementById("advanced_mode") checkbox.addEventListener("input", function(e){ divs = document.getElementsByClassName("advanced_mode") if(this.checked){ for (div of divs){ div.style.display = "block"; } } else{ f...
[ "function toggleAdvancedMode() {\n\t\n\tadvancedMode = !advancedMode;\n\t\n\tif (advancedMode) {\n\t\tvar quadReg = document.getElementById(\"togglequadreg\");\n\t\tquadReg.style.visibility = \"visible\";\n\t\tquadReg.style.display = \"inline\";\n\t} else {\n\t\tvar quadReg = document.getElementById(\"togglequadreg...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Gets a folder by server relative relative path if your folder name contains and % characters you need to first encode the file name using encodeURIComponent() and then pass the url let url = "/sites/test/Shared Documents/" + encodeURIComponent("%123"); This works only in SharePoint online.
getFolderByServerRelativePath(folderRelativeUrl) { return new Folder(this, `getFolderByServerRelativePath(decodedUrl='${folderRelativeUrl}')`); }
[ "getFolderByServerRelativeUrl(folderRelativeUrl) {\r\n return new Folder(this, `getFolderByServerRelativeUrl('${folderRelativeUrl}')`);\r\n }", "function getPublicUrl(folder, file) {\n // TODO: escape this\n return 'https://host.googledrive.com/host/' + folder.getId() + '/' + file.getName();\n}", "g...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Return the node object whose key is 'key'. Returns null if key not found
findNodeByKey (key) { return Tree.findEntry2 (key, this.rootEntry); }
[ "function findNode(key)\n {\n for(var i = 0; i < nodes.length; i++)\n {\n if(nodes[i].key === key)\n {\n return nodes[i];\n }\n }\n return null;\n }", "search(key, node = this.head) {\n thi...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
loadCurrentTournament will retrieve the tournament that is set to be the current one. If there is none, it will then set the current value to None Selected.
function loadCurrentTournament() { Tournament_v.findOne({where: {'current_flag': 'Y'}}, function(err, result) { if (result != null) { this.currTournamentName = result.tournament_name; this.currTournamentId = result.id; this.currNumberOfTable = result.number_of_tables; } else { this.cur...
[ "function loadTournament_v() {\n Tournament_v.find(params.id, function (err, tournament) {\n if (err) {\n redirect(path_to.tournaments());\n } else {\n this.tournament = tournament;\n next();\n }\n }.bind(this));\n}", "function selectTournamentName(myTou...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Helper function to print info messages to the chat window
function print(infoMessage, asHtml) { var $msg = $('<div class="info">'); if (asHtml) { $msg.html(infoMessage); } else { $msg.text(infoMessage); } $chatWindow.append($msg); }
[ "function print(infoMessage, asHtml) {\n var $msg = $('<div class=\"info\">');\n if (asHtml) {\n $msg.html(infoMessage);\n } else {\n $msg.text(infoMessage);\n }\n $activeChatWindow.append($msg);\n }", "function print(infoMessage, asHtml) {\n var $msg = $('<div class=\"info\">');\n ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Generate cart action buttons.
function generateCartAction() { let cartAction = elt( 'footer', { className: 'cart-action' }, elt( 'button', { className: 'action-checkout', onclick: () => notImplementedAlert('Checkout') }, 'Checkout' ), elt('button', { className: 'action-deleteall', onclick: deleteAll }, 'Delet...
[ "function createCartButtons() {\n\n\t//all .tekserverental-show-cart-button-container (display:none by default) get a button and bind it\n\tjQuery('.tekserverentals-show-cart-button-container').each( function() {\n\n\t\tvar target = areYouMyMother(this);\n\t\tjQuery(this).append('<a class=\"cartbutton button\" href...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Country Posts Parameters Add a "countries" property to terms which can be used to filter all existing Posts views.
function addCountryParameter (parameters, terms) { var country = terms.country || terms["country[]"]; // filter by country if country slugs are provided if(country){ // do nothing //} else if (country) { var countriesIds = []; var selector = {}; if (typeof country === "string") { // country ...
[ "function addCountryParameter (parameters, terms) {\n\n var cat = terms.cat || terms[\"cat[]\"];\n\n // filter by country if country slugs are provided\n if (cat) {\n\n var countriesIds = [];\n var selector = {};\n\n if (typeof cat === \"string\") { // cat is a string\n selector = {slug: cat};\n ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }