query
stringlengths
9
34k
document
stringlengths
8
5.39M
negatives
listlengths
19
20
metadata
dict
set the value of a select2 key and id can be a string or a string array in case of multiple tags if no key(s) is specified, select2 will be left empty if the select2 is not a tag ajax, all other options are removed, and these ones are put
function setValue(select2_, value, id) { var select2 = _getSelect2(select2_); empty(select2, true); if (!id) id = value; if (typeof value === "string") { value = [value]; id = [id]; } else if (!value)...
[ "function setSelectedById(select2_, id) {\n var select2 = _getSelect2(select2_);\n if (isTags(select2) || isAjax(select2)) // if tag, then setSelectedById won't work. just setValue instead\n setValue(select2, id, id);\n select2.val(id);\n select2.trigger('c...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Check if transactions have changed. Compare form data to storage data.
checkTransactionsChange() { const transactions = JSON.stringify(this.getTransactions()); const prevTransactions = localStorage.getItem('transactions'); return transactions !== prevTransactions; }
[ "function hasDataChanged() {\n if (!$scope.submissionLoaded) {\n return false;\n }\n\n var inputData = getInputData();\n if (!originalData || typeof originalData.title == 'undefined') {\n // There is no original data, assume it hasn't changed.\n return fa...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Fungsi getNama. Fungsi akan mengambil dan mengembalikan nilai dari nama ditambah dengan .png (hanya untuk mempermudah dalam membuka file bukan untuk menentukan ekstensi file) Jika kosong akan memanggil fungsi snackbar dan mengembalikan nilai false
function getNama() { if ($("#nama").val() == "") { fireSnackBar(); return false; } else { var nama = $("#nama").val(); return nama; } }
[ "function getNama_custom() {\n if ($(\"#nama-custom\").val() == \"\") {\n fireSnackBar();\n return false;\n } else {\n var nama = $(\"#nama-custom\").val();\n return nama;\n }\n}", "function getNama_multi() {\n if ($(\"#nama-multi\").val() == \"\") {\n fireSnackBar();\n return false;\n } el...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Disables icons when HTML editor is enabled
function disabledIcons() { vectorClass.forEach(element => { var selector = document.querySelector(richText + '.' + element + '-click'); selector.style.opacity = '0.5'; selector.classList.add('not-active'); }); }
[ "function MODIFIER_DISABLED$static_(){IconWithTextBEMEntities.MODIFIER_DISABLED=( IconWithTextBEMEntities.BLOCK.createModifier(\"disabled\"));}", "function MODIFIER_ICON_ONLY$static_(){IconWithTextBEMEntities.MODIFIER_ICON_ONLY=( IconWithTextBEMEntities.BLOCK.createModifier(\"icon-only\"));}", "function setEmot...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
MQTT string (length MSB, LSB + data)
function mqttStr(s) { return fromCharCode(s.length>>8, s.length&255)+s; }
[ "function mqttStr(str) {\n return sfcc(str.length >> 8, str.length&255) + str;\n}", "function mqttPacketLength(length) {\n var encLength = '';\n do {\n var encByte = length & 127;\n length = length >> 7;\n // if there are more data to encode, set the top bit of this byte\n if ( le...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
make an array of 3element arrays from a pairing_probabilities result
function apMakePlis(pairprob) { pairprob = pairprob || []; var n = Math.floor(pairprob.length/3); var plis = new Array(n); for (var i=0; i<n; i++) { var i3 = i*3; plis[i]=[Number(pairprob[i3]),Number(pairprob[i3+1]),Number(pairprob[i3+2])]; } return plis; }
[ "function getAllPairs(skill_array) {\n var pair_array = [];\n for (var i=0;i<skill_array.length;i++){\n for (var j=0;j<skill_array.length;j++){\n if(i > j){\n if(j%2){\n pair_array.push({\"label\":skill_array[i] + \" or \" +skill_array[j], \"param1\":skill_array[i], \"param2\":skill_array[...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
get employee names, return id as promise
async function getEmployeeNamesAndValues() { const sql = `SELECT * FROM employee`; return new Promise((resolve, reject) => { return connection.query(sql, (err, row) => { if (err) { console.log(`Error: ${err}`); return reject(err); } // Method was shown during office hours. befo...
[ "function getEmployeeNamesArray() {\n return new Promise((resolve, reject) => {\n // first get employee info from the database\n createChoiceArray(\"employee\", \"first_name\", \"last_name\").then(empArray => {\n\n // Concatenate the first and last names of each employee, and add to the ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Creates a listener for the TDs of the VM table
function vMachineInfoListener(){ $('#tbodyvmachines tr').live("click", function(e){ if ($(e.target).is('input')) {return true;} popDialogLoading(); var aData = dataTable_vMachines.fnGetData(this); var id = $(aData[0]).val(); Sunstone.runAction("VM.showinfo",id); return false; }); }
[ "addTableEvents () {\n this.table.addEventListener('click', this);\n window.addEventListener('scroll', this.onBodyScrollThrottle);\n this.tooltips = new Tooltips({ elem: this.elem });\n }", "function tableAddListeners(){\n document.getElementById('disp_table').addEventListener('dblclick', setRPOnDblC...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Adds a new product to the database, loads the manager menu
function addNewProduct(val) { connection.query( "INSERT INTO products (product_name, department_name, price, stock_quantity) VALUES (?, ?, ?, ?)", [val.product_name, val.department_name, val.price, val.quantity], function(err, res) { if (err) throw err; console.log(val.product_name + " ADDED T...
[ "function addNewProduct(val) {\n connection.query(\n \"INSERT INTO products (product_name, department_name, price, sotck_quantity) VALUES (?,?,?,?)\",\n [val.product_name, val.department_name, val.price, val.quantity],\n function(err, res) {\n if(err)throw err;\n console.log(val.product_name, +\...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Spawns a new process
function newProcess(message, socket) { console.log("New process: " + message); // Separate the process name from the command var processName = message.split(" ", 1)[0]; var processCommand = message.substring(processName.length + 1); // Run the process and save it to the list var process = cp.e...
[ "function spawn(command, args) {\n return new Promise(function(resolve, reject){\n handle = child_process.spawn(command, args);\n handle.on('close', function(code){\n if(code == 0) {\n resolve();\n } else {\n reject();\n }\n });\n });\n}", "function spawnProcess(lambda, pid...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Gets a value indicating whether or not this [[Router]] is the root in the router tree. I.e., it has no parent.
get isRoot() { return !this.parent; }
[ "get isRoot() { return (!this.parent) }", "isRoot() {\n return !this.parent;\n }", "get isRoot() {\n return !this.parent;\n }", "isRoot() {\n\t\treturn (!this.id || this.id === 'root');\n\t}", "isRoot() { return (this.type == 'root'); }", "isRootFound() {\n ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
The version of the FHIR specification on which this StructureDefinition is based this is the formal version of the specification, without the revision number, e.g. [publication].[major].[minor], which is 3.0.1 for this version.
get fhirVersion () { return this._fhirVersion; }
[ "getVersion() {\n return this.defn.info.version;\n }", "getFhirVersion() {\n return (0, lib_1.fetchConformanceStatement)(this.state.serverUrl).then(metadata => metadata.fhirVersion);\n }", "get documentVersion() {\n return this.getStringAttribute('document_version');\n }", "get schemaV...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Focus on the password field
toPassword() { if (this.pwd_field && this.pwd_field.nativeElement) { this.pwd_field.nativeElement.focus(); this.focus = 'password'; } }
[ "function focusPassword() {\n\t$.password.focus();\n}", "function focusPwd() { //setter peker i tekstboksen for gammelt passord\n document.getElementById(\"gPwd\").focus();\n } // focusPwd", "clickPasswordField() {\n this.passwordInput.click();\n }", "function setFocus()\n {\n $('login_e...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Get Character format in table
getCharacterFormatInTableCell(tableCell, selection, start, end) { if (end.paragraph.isInsideTable) { let containerCell = this.getContainerCellOf(tableCell, end.paragraph.associatedCell); if (containerCell.ownerTable.contains(end.paragraph.associatedCell)) { let startCell ...
[ "function makeCharTable() {\n var table = [];\n\n for (var i = 0; i < 128; ++i) {\n table[i] = \"\";\n }for (var i = 65; i <= 90; ++i) {\n table[i] = \"identifier\";\n }for (var i = 97; i <= 122; ++i) {\n table[i] = \"identifier\";\n }add(\"whitespace\", \"\\t\\u000b\\f \");\n ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
trackNameInputID: input element id contextid: can be empty string errorDivID: where the error message should go
function checkUserTrackName(trackNameInputID, errorDivID, contextID){ var trackName; if(!contextID){ trackName=$("input[id='"+Util.jqSelector(trackNameInputID)+"']").val(); } else{ trackName=$("input[id='"+Util.jqSelector(trackNameInputID)+"']", $("#"+Util.jqSelector(contextID))).val(); } if(!contextID){ ...
[ "function validate(inID, errID) {\n\tvar name = document.getElementById(inID).value.trim();\n\tvar nameField = document.getElementById(inID);\n\tvar errorMess = document.getElementById(errID);\n\t\n\t//Validate user input and add message. Message is blank if input okay\n\terrorMess.innerHTML = \ttestInput(nameField...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Returns the container specified by name.
function getContainerByName(name) { for (var i = 0; i < containers.length; i++) { if (containers[i].name === name) { return containers[i]; } } return null; }
[ "function findContainer(containerName) {\n for (let i = 0; i < containerList.length; i++) {\n if (containerList[i].nameIdentifier == containerName) {\n return containerList[i];\n }\n }\n //console.log(\"ERROR: CONTAINER NOT FOUND\");\n return null;\n}", "findContainer(containe...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
ajax requestor to ping the cser and ask it to load more minidumps for the given error
function RequestTenMoreMinidumps( errorid ) { $('requestOutput').innerHTML = ''; AppsAjaxRequest( g_szBaseURL + '/errors/moreminidumps/' + errorid, { }, function( results ) { StandardCallback( results, 'requestOutput' ); } ); }
[ "function error_ajax_calls() { }", "function startPing()\n{\n /* init vars */\n ping_id = null;\n ping_loop = null;\n ping_ip = null;\n \n /* get ip for the ping */\n ping_ip = $('#ping_dest_hostname').val();\n\n /* disable form */\n $('#ping_dest_hostname').attr('disabled', true);\n ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Copy FPD over to OpenRTB standard format in each adunit
function convertAdUnitFpd(arr) { var convert = []; arr.forEach(function (adunit) { if (adunit.fpd) { adunit['ortb2Imp'] ? utils.mergeDeep(adunit['ortb2Imp'], convertImpFpd(adunit.fpd)) : adunit['ortb2Imp'] = convertImpFpd(adunit.fpd); convert.push(function (_ref) { var fpd = _ref...
[ "function MakeDvlpFldr(apDoc, update) {\n var ForReading = 1, ForWriting = 2, ForAppending = 8;\n var TristateUseDefault = -2, TristateTrue = -1, TristateFalse = 0;\n var fso = new ActiveXObject(\"Scripting.FileSystemObject\");\n var apDocFldr = GetApDocDir(apDoc);\n var apDocDvlpFldr = apDocFldr+\"d...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Called when a concept from the low concepts list is clicked
function showLowConceptRecommendations(e) { //console.log($(this).attr("data-concept")); // Track that the student clicked this track("clicked","conceptPoint"+$(this).attr("data-concept")); // Deslect other points, and select this one and move it to the front of the view hierarchy $(".selectedConceptPoint").attr("...
[ "function onAddConcept() {\n\t\tvar newConcept = newConceptField.val();\n\t\tif (newConcept === \"\") { return; }\n\t\tif (findClassifier(newConcept)) { return; }\n\t\taddConcept(newConcept);\n\t\tnewConceptField.val('');\n\t}", "chooseSpell(event) {\n this.kind = event.target.getAttribute(\"id\");\n docume...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
given a single slotName, adds all items in equipDiv to the unequips that match that slot.
function addSlotToUnequip(equipDiv,slotName) { if (debug) GM_log('entering addSlotToUnequip'); var inputs=equipDiv.getElementsByTagName('input'); var unequipRegEx=/unequip/; var multiRegEx=/unequipall/; var inputName; var countRegEx=/ x (\d+):/; var itemRegEx=/([^_]*)_unequip/; var slotTaken=0; var unequips=...
[ "addItemWithChildrenToEquipmentSlot(equipmentSlots, parentId, parentTpl, itemWithChildren)\r\n {\r\n for (const slot of equipmentSlots)\r\n {\r\n const container = this.inventory.items.find(i => i.slotId === slot);\r\n if (!container)\r\n {\r\n contin...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Function drawSmiles() draws 30 smiles in random position
function drawSmiles(){ var bodySel = d3.select("body"); var svgEl = bodySel.append("svg") .attr("xmlns", "http://www.w3.org/2000/svg") .attr("width",1280) .attr("height",600) .attr("viewBox", "0 0 1280 600") .attr("preserveAspectRatio", "xMinYMin meet") .classed("...
[ "function drawSmiles() {\n SmilesDrawer.apply();\n}", "function drawSmile() {\n\t//draw smile\n\tcontext.beginPath();\n\tcontext.arc(250, 300, 90, 0.2, Math.PI - 0.2);\n\tcontext.strokeStyle = \"#c20000\";\n\tcontext.lineWidth = 5;\n\tcontext.stroke();\n}", "function drawMissiles() {\n missiles.forEach((mis...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Computes the CSS scale currently applied on the element. Returns an object with `x` and `y` members as horizontal and vertical scales respectively, and `boundingClientRect` as the result of [`getBoundingClientRect()`](
function getScale(element) { var rect = element.getBoundingClientRect(); // Read-only in old browsers. return { x: rect.width / element.offsetWidth || 1, y: rect.height / element.offsetHeight || 1, boundingClientRect: rect }; }
[ "function getScale(element){var rect=element.getBoundingClientRect();// Read-only in old browsers.\nreturn{x:rect.width/element.offsetWidth||1,y:rect.height/element.offsetHeight||1,boundingClientRect:rect};}", "scaleClientRect (rect) {\n let self = this;\n \n return {\n x : rect.x / self.scale,\...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Determine if order history should be shown (opened accordion on link)
function custOrderHistory() { let place = window.location.href; if (place.includes('#order-history-body')) { document.getElementById('order-history').click(); } }
[ "function modalHistoryShowsItsOpen(){\n\tif(history.state !== null && history.state.modal == 'open') {\n\t\treturn true;\n\t}\n\telse {\n\t\treturn false;\n\t}\n}", "function activate_history(id){\n if ($(\"div#\"+id+\" div#sentences\").children('div.sentence').length > 1){\n $(\"div#\"+id).show();\n }else i...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Function add bucket list bucket.html
function readBucketList_bucket(obj) { checked = ['✗', '✓']; $.each(obj.bucket, function(index, value){ var temp = "<li>"+ checked[value.checked] + " " + value.content + "</li>"; $(".show-bucket-list").append(temp); }) }
[ "function buckets(req, res){\n s3.bucket({}, function(data){\n // log(sys.inspect(data.listallmybucketsresult.buckets.bucket))\n var a = [], \n list = data.listallmybucketsresult.buckets.bucket, \n b;\n \n for (var i=0; i < list.length; i++) {\n b = li...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
9.newcap /jshint newcap: true
function newcapFun() { this.a = 'a'; }
[ "function c_cap(n_cap) {\n\tvar patt = new RegExp(\"[0-9]{5}\");\n\tvar t = patt.test(n_cap);\n\treturn t;\n}", "cap(name){\n\t\t\tlet firstL = name.charAt(0).toUpperCase()\n\t\t\tlet rest = name.slice(1)\n\t\t\tthis.name = firstL + rest\n\t\t}", "function validateClassCapacity(cap) {\n if (isNaN(cap)) retur...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Preloads snowflake spritesheet and font used
function preload() { spritesheet = loadImage('images/Flakes1.png'); font = loadFont('font/Freeride.otf'); }
[ "function preload() {\n for (let i = 1; i < 6; i++)\n skin[i] = loadImage(`textures&font/color${i}.png`);\n restart_before = loadImage(`textures&font/restart_before.png`);\n restart_after = loadImage(\"textures&font/restart_after.png\");\n font = loadFont('textures&font/pixel.otf');\n}", "funct...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Create a google font icon
function createFontIcon(fontType) { var iconfontObj = document.createElement('i'); iconfontObj.className = 'material-icons'; iconfontObj.innerHTML = fontType; return iconfontObj; }
[ "function GenIcon() {\n}", "drawIcon() {\n return `<i class=\"fas fa-flask\"></i>`\n }", "get font_download () {\n return new IconData(0xe167,{fontFamily:'MaterialIcons'})\n }", "static createIcon(iconName, {\n asElement=false,\n classes=[],\n align=null,\n dataset={}...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Primarily for internal use. Insert a [[CpNode]] into the MAT tree graph after the specified point and returns the freshly inserted [[CpNode]].
function insertCpNode(isHoleClosing, isIntersection, cpTree, cp, prev_) { // const cpNode = new CpNode(cp, isHoleClosing, isIntersection); const cpNode = createCpNode(cp, isHoleClosing, isIntersection); if (typeof _debug_ !== 'undefined') { _debug_.generated.elems.cpNode.push({ generated...
[ "function f(cpNode) {\n let loop = cpNode.cp.pointOnShape.curve.loop;\n let cpTree = newCpTrees.get(loop);\n if (!cpTree) {\n cpTree = new flo_ll_rb_tree_1.default(cp_node_1.CpNode.comparator, [], true);\n newCpTrees.set(loop, cpTree);\n }\n cpTree.insert(cpN...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
will encrypt the signature using crypto against the passed key and encode it
function sign (str, key) { return crypto.createHmac('sha256', key).update(str).digest('base64'); }
[ "encryptWithkey(buffer, key){\n var cipher = crypto.createCipheriv('aes-256-ecb',key,new Buffer(0));\n var crypted = cipher.update(buffer,'utf8','base64');\n crypted = crypted+ cipher.final('base64');\n console.log('printed: ', crypted);\n r...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Handle stream start messages from obs websocket.
onStreamStart() { if (this.onStartTrigger.length > 0) { this.onStartTrigger.forEach(trigger => { controller.handleData(trigger); }) } }
[ "function startStream() {\n\n // Send signal through socket.io\n socket.emit(\"start_stream_signal\");\n}", "function wsStart() {\n\t\tvar ws = new WebSocket(opts.websocket);\n ws.onopen = function() { opts.intro_messages.opening.created_at = new Date(); send_to_wire(opts.intro_messages.opening); };\...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
exported sheetToObject, I hate guard dogs / convert a sheet to a single object. Based on singlefrozenheaderrow names, good for config files
function sheetToObject(sheet) { return sheet.sheets.reduce(function(prev,cur){ prev[cur.properties.title] = tableToObject(trimFlat(worksheetToFlat(cur))); return prev; }, {}); }
[ "function rowsToSheet() {\n\n var sheet = {};\n\n var range = { s: { c: 0, r: 0 }, e: { c: fields.length, r: rows.length } };\n\n rows.forEach(function (row, i) {\n\n row.forEach(function (value, j) {\n\n var cell = { v: typeof value == \"undefined\" || value === n...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Determines if the provided object is a navigation command. A navigation command is anything with a navigate method.
function isNavigationCommand(obj) { return obj && typeof obj.navigate === 'function'; }
[ "function isNavigationCommand(obj) {\n return obj && typeof obj.navigate === 'function';\n }", "function isNavigationCommand(obj) {\r\n return obj && typeof obj.navigate === 'function';\r\n}", "function FM_IsNavigationValid(strCommand, strCommandData) {\r\n this.m_commandMgr.SetCommand(strComman...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Handle cut bookmark item action to clipboard on context menu or shortcut key selection = selection Object Sets global variables bkmkClipboardIds, bkmkClipboard, noPasteZone, isClipboardOpCut
function menuCutBkmkItem (selection) { // Cancel previous cut and clipboard if any if (isClipboardOpCut == true) { refreshCutPanel(bkmkClipboardIds, false); refreshCutSearch(bkmkClipboardIds, false); noPasteZone.clear(); } bkmkClipboardIds.length = bkmkClipboard.length = 0; // Filter to keep only unique b...
[ "function menuCopyBkmkItem (selection) {\n // Cancel previous cut and clipboard if any\n if (isClipboardOpCut == true) {\n\trefreshCutPanel(bkmkClipboardIds, false);\n\trefreshCutSearch(bkmkClipboardIds, false);\n\tnoPasteZone.clear();\n }\n bkmkClipboardIds.length = bkmkClipboard.length = 0;\n isClipboardOpCu...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Funcion que lleva a la pagina principal limpia (sin sesion de usuario abierta)
function paginaPrincipal (){ document.querySelector("#auxLanding").style.display = "block"; //Muestro nuevamente botones de registro document.querySelector("#bodyHome").style.display = "block"; //Muestro portada de pagina document.querySelector("#h1TitBienvenida").innerHTML = `Bienvenidos a Escuela De Mú...
[ "function setPage(usuario) {\n /*\n var rol = usuario.tipo.N.toString();\n switch (rol) {\n case \"1\":\n // encaso de tipo 1\n break;\n case \"2\":\n window.location.href = \"../home/index.html\";\n break;\n case \"3\":\n window.l...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Returns true if the given object is an instance of DefaultNetworkAcl. This is designed to work even when multiple copies of the Pulumi SDK have been loaded into the same process.
static isInstance(obj) { if (obj === undefined || obj === null) { return false; } return obj['__pulumiType'] === DefaultNetworkAcl.__pulumiType; }
[ "static isInstance(obj) {\n if (obj === undefined || obj === null) {\n return false;\n }\n return obj['__pulumiType'] === NetworkAcl.__pulumiType;\n }", "static isInstance(obj) {\n if (obj === undefined || obj === null) {\n return false;\n }\n ret...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
initialize the patient list
function init() { self.patients = App.models.patients.getPatients(); }
[ "function createPatientList() {\n var patients = [{\n 'dfn': '3',\n 'name': 'EIGHT,PATIENT',\n 'roomBed': '722-B',\n 'siteId': 'SITE'\n }, {\n 'dfn': '100162',\n 'name': 'TWOHUNDREDSIXTEEN,PATIENT',\n 'roomBed': '',\n 'siteId': 'SITE'\n }];\n\n ret...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Listens ref value from Firebase path
function listenRef(path, callback) { database.ref(path).on('value', (snapshot) => { callback(snapshot); }); }
[ "firebaseGet(ref, callback){\n \n }", "static getRef(path) {\n return firebase.database().ref(path);\n }", "function firebaseRef(path) { // jshint ignore:line\n var ref = new Firebase(FBURL); // jshint ignore:line\n var args = Array.prototype.slice.call(arguments);\n if( args.length ) {\n...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
DESC: Upper bounds of User ID
function xqserver_msgadd_upperbounduserid(){ l_qwUserId=new QWORD(0xFFFFFFFF,0xFFFFFFFF); setup(l_qwUserId); engine.TickleListen(true,g_wPort); engine.MsgAdd(l_dwSessionID,++l_dwSequence,QWORD2CHARCODES(l_qwUserId),1,g_dw0QType,g_bstr0QTypeData,g_dw0QTypeDataSize); WaitForTickle(engine); if (1!=engine.GetTi...
[ "static getUserIdsBetweenRoles(lower, upper) {\n return game.users\n .filter((user) => {\n return user.role >= lower && user.role <= upper;\n })\n .map((user) => user.id);\n }", "function userLevelId(el) {\n if (el && !ew.checkInteger(el.value)) return {\n ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
console.log(result); console.log(result2); console.log(result3); exercise 2 Pascalize (Reto adaptado): Construye un metodo que convierta un string de cualquier formato a PascalCase Examples (Casos de prueba): "hey jude" > "HeyJude" "iliKejavaSCRIPT" > "ILikeJavascript" "software DEveloPment IS my pAsSiOn" > "SoftwareDe...
function pascalize(words) { const pascalFormat = words.match(/[a-zA-Z]+/g) //[ 'hey', 'jude' ] me descarta los simbolos (no match) .map(word => word[0].toUpperCase() + word.slice(1).toLowerCase()) // first char to Upper case, second and next char in a word to lower case .join('') console.log(pascalFormat); re...
[ "function pascalCase(str){\nreturn str.\nsplit(SPLIT).\nmap(mapToPascal).\njoin('');}", "function pascalcase(str){if(\"string\"!=typeof str)throw new TypeError(\"expected a string.\");return str=str.replace(/([A-Z])/g,\" $1\"),1===str.length?str.toUpperCase():(str=str.replace(/^[\\W_]+|[\\W_]+$/g,\"\").toLowerCas...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
function draws an accept state on the canvas
function drawAcceptState(event) { //get mouse click x and y let arr = getMouseCoords(event); let x = arr[0]; let y = arr[1]; canvas.off(); var c1 = new fabric.Circle({ strokeWidth: 5, radius: 40, fill: '#fff', stroke: 'black', left: x-40, top: ...
[ "function addAcceptState()\n{\n document.getElementById(\"addState\").disabled = true;\n document.getElementById(\"addAcceptState\").disabled = true;\n document.body.style.cursor = \"pointer\";\n\n canvas.on('mouse:down', function(options) {\n drawAcceptState(options);\n\n });\n document.bo...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Runs once before the setup() and loads our data (images, phrases)
function preload() { // Loads simulation images (arm, finger) -- DO NOT CHANGE! arm = loadImage("data/arm_watch.png"); fingerOcclusion = loadImage("data/finger.png"); // Loads the target phrases (DO NOT CHANGE!) phrases = loadStrings("data/phrases.txt"); // Loads UI elements for our basic keyboard leftA...
[ "function preload()\n{ \n suggestions = loadStrings(\"data/simplified_count.txt\");\n suggestions2 = loadStrings(\"data/simplified_count2.txt\");\n\n // Loads simulation images (arm, finger) -- DO NOT CHANGE!\n arm = loadImage(\"data/arm_watch.png\");\n fingerOcclusion = loadImage(\"data/finger.png\");\n ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
use Joi to validate data received from request when creating a new extra
function validateExtra(req) { const schema = Joi.object({ extraName: Joi.string().min(3).max(50).required(), dailyCost: Joi.number().required().integer(), unitsAvailable:Joi.number().required().integer() }); return schema.validate(req); }
[ "async function validateCreate(body) {\n const joischema = Joi.object({\n expenseName: Joi.string().min(1).max(50).required(),\n expenseDescription: Joi.string().min(1).max(50),\n defaultExpense: Joi.boolean().required(),\n spentBy: Joi.string().min(1).max(50).required(),\n spe...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
moves the current point to the current postion of the mouse
function movePoint(event) { if(moveMode == 1) { // sets the x and y position relative to the drawing canvas var rect = canvas.getBoundingClientRect(); var x = event.clientX - rect.left; var y = event.clientY - rect.top; // update the current points x and y positions to th...
[ "mouseMove(delta){\n this.position.setCurrent(delta);\n this.move();\n }", "warpPointer(x, y) {\n this._mouse.notify_absolute_motion(0, x, y);\n }", "function moveFinger() {\n finger.x = mouseX;\n finger.y = mouseY;\n}", "function movePoint(point) {\n point.x += point.dx / 5;\n po...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
displays count of employees
function updateCountOfEmployees() { $("employeeCount").innerHTML = employee_list.length; }
[ "function getEmployeeCount() {\n return salesReport.employees.length;\n}", "getEmployeeCount() {\n return salesReport.employees.length;\n }", "function updateCount() {\n $(\"numEmployees\").innerHTML = `Showing ${employeeList.length} employees`;\n}", "function displayEmployees(employees) {\n ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Return Category sending status
getCategorySendingStatus(state) { return () => { return state.categorySendingStatus } }
[ "setCategorySendingStatus(state, status) {\n state.categorySendingStatus = status\n }", "get statusCategory() {\n return (this.status / 100) | 0;\n }", "logCategory(category, enabled) {\n let params = {};\n params[category.toString().toLowerCase()] = enabled;\n return this.do(new AM...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Remove .active CSS class from all community filter elements
function flushClass(){ $( '.community-filter' ) . removeClass( 'active' ); }
[ "function removeFilterActiveClasses(e) {\n expiringButton.classList.remove('active')\n verifiedButton.classList.remove('active')\n codeButton.classList.remove('active')\n allButton.classList.remove('active')\n if (e.target.classList.contains('filter')) {\n e.target.classList.add('active')\n } else if (e.ta...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> SPARK : Send email to the admins (Username is a "merge_fields" custom MC field) TODO: Utilize SparkSendEmail()
function SparkEmailSignupNotification(email, res, memberCount, username, src) { console.log('[Spark] Sending signup notification email to admins..'); transporter.sendMail({ from: '"Imperium42" <noreply@imperium42.com>', to: adminEmails, // [] subject: '[MC] +1 Subscriber (' + email ...
[ "sendEmail() {\n email([EMAIL], null, null, null, null);\n }", "sentEmailforRegisterUsers(uEmail) {\n let transport = nodemailer.createTransport({\n host: 'smtp.gmail.com',\n port: 587,\n secure: false,\n auth: {\n user: 'cassertmusic@gmail.com...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Add receipent as `cc`
cc(address, name) { this.nodeMailerMessage.cc = this.nodeMailerMessage.cc || []; this.nodeMailerMessage.cc.push(this.getAddress(address, name)); return this; }
[ "addCc(cc) {\n if (typeof cc === 'undefined') {\n return;\n }\n this.cc.push(EmailAddress.create(cc));\n }", "function setCC() {\n if(that.cc != null || that.cc) {\n addRecipients(Message.RecipientType.CC, that.cc);\n }\n }", "function setCC (newCC) {\n container.cc...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Handle the process of creating a client and doing a capability check and getting a valid response, then setting up local data based on that. This is split from _setupClient and _createClientAndCheck so it can provide the backoff handling needed during attempts to reconnect.
_handleClientAndCheck(resolve, reject) { this._createClientAndCheck().then( value => { let resp = value.resp; let client = value.client; try { this._wildmatch = resp.capabilities.wildmatch; this._relative_root = resp.capabilities.relative_root; this._clie...
[ "_createClientAndCheck() {\n return new Promise((resolve, reject) => {\n let client;\n\n try {\n client = new watchman.Client(\n this._watchmanBinaryPath\n ? { watchmanBinaryPath: this._watchmanBinaryPath }\n : {}\n );\n } catch (error) {\n // if...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
calcola la posizione apparente di un astro inizio.
function pos_app(njd,AR,DE){ // calcola la posizione apparente di un astro -nutazione e aberrazione della luce var T=(njd-2415020.0)/36525; var obli_eclittica=23.452294-0.0130125*T-0.00000164*T*T+0.000000503*T*T*T; obli_eclittica=Rad(obli_eclittica); var nutaz=nutazione(njd); // eff...
[ "function gestioneImpegnoCaricato(e) {\n var imp = e.subimpegno ? e.subimpegno : e.impegno;\n var capitolo = imp.capitoloUscitaGestione;\n var provvedimento = imp.attoAmministrativo;\n\n // Ottengo la disponibilita\n var disponibilita = imp.disponibilitaLiquidare || 0;\n //...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
========================================== This code makes the taglines disappear when scrolling ==========================================
function hidTagLines() { let items = $(".taglines__item"); Array.from(items).forEach((item) => { let coords = item.getBoundingClientRect(); let newOpacity = normalize(300, 170, 100, 0, coords.top); $(item).css("opacity", `${newOpacity}%`); }); }
[ "removeScrollHandling() {}", "function linesOnScroll() {\n $('.line-container').each(function () {\n if (!$(this).parents('aside').hasClass('aside') && !$(this).parent().hasClass('aside-block')) {\n w_h = $(window).height();\n winTop = $(window).scrollTop();\n elOffTop =...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Note: isSameDesc should return true if both desc1 and desc2 represent a 'required' property (otherwise two composed required properties would be turned into a conflict)
function isSameDesc(desc1, desc2) { // for conflicting properties, don't compare values because // the conflicting property values are never equal if (desc1.conflict && desc2.conflict) { return true; } else { return ( desc1.get === desc2.get && desc1.set === desc2.set ...
[ "function hasDesc(descs) {\n for (var d in descs) {\n if (descs[d].description && descs[d].description.length > 0) {\n return true;\n }\n }\n return false;\n }", "functi...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
TODO: It will be better to canonicalize union types, instead of 'new'ing them each time and needing a deep equals op.
function typeEquals(type1, type2) { if (type1 === type2) return true; // TODO handle intersection types if (!(type1 instanceof UnionType)) return false; if (!(type2 instanceof UnionType)) return false; if (type1.types.length !== type2.types.length) return fals...
[ "function snapsjot_unify_union_types(union1, union2) {\n\n var redo = true;\n\n while (redo) {\n\n redo = false;\n\n for (var i = 0; !redo && i < union1.length; i++) {\n\n for (var j = 0; !redo && j < union2.length; j++) {\n\n\tvar type = null;\n\n\tif (union2[j] !== null) {\n\n\t if (snapsjot_equal_t...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Test the language encoding functionality
function testLanguageEncodings(){ var StringUtils = LanguageModule.StringUtils; var stringUtils = new StringUtils(); var encodings = stringUtils.languageEncodings; expect(_.isObject(encodings)).to.eql(true); expect(_.has(encodings, "ENGLISH")).to.eql(true); expect(_.has(encodings, "SPANISH")).to.eql(true); ...
[ "function testStringEncodings(){\n\t\tvar StringUtils = LanguageModule.StringUtils;\n\t\tvar stringUtils = new StringUtils();\n\t\tvar encodings = stringUtils.stringEncodings;\n\t\texpect(_.isObject(encodings)).to.eql(true);\n\t\texpect(_.has(encodings, \"ASCII\")).to.eql(true);\n\t\texpect(_.has(encodings, \"UTF8_...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Project access authentication. Executes pass() if the user can access the project. Executes fail() if they cannot.
function authProjectAccess(id, username, pass, fail) { db.get().collection('projects').find({ id: id, $or: [{ owner: { $in: [username] } }, { collaborators: { $in: [username] } }, { viewers: { $in: [username] } }] }).toArray((err, project) => { if (err || project.length != 1) { fail(); }...
[ "function authProjectOwner(id, username, pass, fail) {\n db.get().collection('projects').find({ id: id, owner: username }).toArray((err, project) => {\n if (err || project.length != 1) {\n fail();\n }\n if (project.length == 1) {\n pass();\n }\n });\n}", "fu...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
extend the compromise tagset
addTags(tags) { tags = Object.assign({}, tags) this.tags = Object.assign(this.tags, tags) // calculate graph implications for the new tags this.tags = inferTagSet(this.tags) return this }
[ "with_tags(more_tags) {\n var tags = {\n 'host': this.host\n };\n\n this.extra_tags.forEach(function (t, v) {\n tags[t] = v;\n });\n\n if (more_tags != null && typeof(more_tags) != 'undefined') {\n more_tags....
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Renders the AWS CloudFormation properties of an `AWS::WAFv2::RuleGroup.GeoMatchStatement` resource
function cfnRuleGroupGeoMatchStatementPropertyToCloudFormation(properties) { if (!cdk.canInspect(properties)) { return properties; } CfnRuleGroup_GeoMatchStatementPropertyValidator(properties).assertSuccess(); return { CountryCodes: cdk.listMapper(cdk.stringToCloudFormation)(properties.c...
[ "function cfnWebACLGeoMatchStatementPropertyToCloudFormation(properties) {\n if (!cdk.canInspect(properties)) {\n return properties;\n }\n CfnWebACL_GeoMatchStatementPropertyValidator(properties).assertSuccess();\n return {\n CountryCodes: cdk.listMapper(cdk.stringToCloudFormation)(propert...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Handler for when the Close Completed action is clicked. This will confirm that the user wants to close the selected review requests. Once they confirm, the review requests will be closed. Args: ev (Event): The event that triggered the callback.
_onCloseCompletedClicked(ev) { ev.stopPropagation(); ev.preventDefault(); this._closeReviewRequests(RB.ReviewRequest.CLOSE_SUBMITTED); }
[ "_onCloseDiscardedClicked(ev) {\n ev.stopPropagation();\n ev.preventDefault();\n\n this._closeReviewRequests(RB.ReviewRequest.CLOSE_DISCARDED);\n }", "async closeRequestedHandler() {\n\t\tconst args = await this.confirmCloseToolbar();\n\t\t// proceed even if there is an error in case the u...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Converts a given name into a valid class name
function toClassName(name) { var result = ''; var upNext = false; for (var i = 0; i < name.length; i++) { var c = name.charAt(i); var valid = /[\w]/.test(c); if (!valid) { upNext = true; } else if (upNext) { result += c.toUpperCase(); upNext = false; } else if (result === '')...
[ "function sanitizeClassname(name) {\n return name.replace(/[^a-z0-9]/g, function(s) {\n var c = s.charCodeAt(0);\n if (c == 32) return '-';\n if (c >= 65 && c <= 90) return '_' + s.toLowerCase();\n return '__' + ('000' + c.toString(16)).slice(-4);\n });\n}", "function sanitizeCla...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Perform OpenSearch parameter substitution on aParamValue.
function ParamSubstitution(aParamValue, aSearchTerms, aEngine) { var value = aParamValue; var distributionID = MOZ_DISTRIBUTION_ID; try { distributionID = gPrefSvc.getCharPref(BROWSER_SEARCH_PREF + "distributionID"); } catch (ex) { } // Custom search parameters. These are only available to default sea...
[ "function setParamValue(paramName,value,url) {\n\tvar myLocation = url;\n\t\n\t// no tiene parametros\n\tif(myLocation.indexOf(\"?\") < 0)\n\t{\n\t\tmyLocation += \"?\" + paramName + \"=\" + value;\n\t}\n\telse\n\t{\n\t\t// tiene par?metros, no tiene paramName\n\t\tif(myLocation.indexOf(paramName) < 0)\n\t\t{\n\t\t...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Grab the asynchronous data used by the queue function panel.
async function grabData() { // Including selected instance to ensure we can grab // current queueables on load. return await eel.dashboard_queue_function_information(activeInstance())(); }
[ "function retrieveQueue() {\n\n d3.json(\"/all_live_data\", function (error, allLiveData) {\n\n if (error) throw error;\n\n allLiveData.forEach(function (msg) {\n msg[\"msg_content\"] = \"rfq_new\";\n processMessage(msg);\n });\n\n });\n\n}", "async function updateQueueFunctions() {\n ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
checkPageLoaded check if page loaded. Use PAGECONTENT_REGEXP for checking Call:res = checkPageLoaded(content) Where:res result: true or false content page content
function checkPageLoaded(content) { //console.log("Check page load for " + INPUT['type'] + ": " + PAGECONTENT_REGEXP[INPUT['type']]); var re = new RegExp(PAGECONTENT_REGEXP[INPUT['type']]); // var res = content.match(re); //if (res) { // console.log("MATCH!!\n" + JSON.stringify(res,undefined," ")); //} return re....
[ "async isPageLoaded(){\n return await this.getPageReadyState() === `complete`\n }", "isPageLoadedOrLoading(page)\n {\n if(this.idList.isPageLoaded(page))\n return true;\n if(this.loadedPages[page] || this.loadingPages[page])\n return true;\n return false;\n ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Part 3 Combining functions See if you can write one function that takes some parameters and combines the functionality of the makeAPizza and makeAVeggiePizza functions. BONUS: Create your own function with parameters. This function could do anything!
function makeAPizza () { let topping1 = 'pepperoni'; let topping2 = 'cheese'; let topping3 = 'mushrooms' console.log('Coming right up! A pizza with ' + topping1 + ', ' + topping2 + ' and ' + topping3 + '.'); }
[ "function preparePizza([orderSize, orderCrust, orderToppings]) {\nconsole.log(\"...we are cooking your pizza...\");\nreturn {\n size: orderSize,\n crust: orderCrust,\n toppings: orderToppings\n};\n}", "function makePizza(crust,size,numberOfSlice) {\n var addIngredients = function(string){\n return...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Converts a 0255 integer value to its 100based percentage equivalent.
function _byteToPercent(value) { return (value / 255.0) * 100.0; }
[ "function _percent255(_, // @param String: \"100.0%\"\r\n n) { // @param String: \"100.0\"\r\n // @return Number: 0~255\r\n return (n * 2.555) & 255;\r\n}", "function briToPercentage(bri) { return Math.round(parseInt(bri)/255 * 100); }", "function valueToPercent...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Run a query with a specific starting point and size
function query_start(start, size) { var inputs = $(":input"); var data = {} if (start > 0) data['@startwith'] = start if (size > -1) data['@pagesize'] = size for (var i = 0; i < inputs.length; i++) data[inputs[i].name] = inputs[i].value; jQuery.get(action, data, display); return false; }
[ "function query()\n{\n return query_start(0, -1)\n}", "function runQuery() {\n var chunkWriter = getChunkWriter(QUERY_RESULTS_SHEET);\n runSqlQuery(getProjectId(), readQuery(), chunkWriter);\n}", "function ConvertToQueries(boxList) {\n\n\t//console.log(\"[INFO][START] Creating query set...\");\n\n\t// Init...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
define elements Shopping cart link
get cartLink() { return $('//a[contains(@href, "/cart")]'); }
[ "function updateGoToCartLinkHref() {\n const localStorageProducts = localStorage.getItem('products')\n ? JSON.parse(localStorage.getItem('products')).join(',')\n : '';\n\n goToCartLink.href = localStorageProducts\n ? `/cart?products=${localStorageProducts}`\n : '/cart';\n}", "goToCart() {\r\n if(...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
This function requests all fields of a Facebookprofile
function RequestAllUserFields() { var fieldsString = ''; var i = 0; fieldsString += user_fields_type_description[0]; // Increment by 3 because 3 entrys form a unit of one field for (i = 3; i < user_fields_type_description.length; //125; i = i + 3) { fields...
[ "function RequestFacebookDetails() {\n var fieldsString = '';\n var i = 0;\n fieldsString += requested_user_field_type_description[0];\n // Increment by 3 because 3 entrys form a unit of one field\n for (i = 3;\n i < requested_user_field_type_description.length;\n i = i + 3) {\n...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Set constraint steps X.
set constraintStepsX(value) { const newValue = (Math.round(+value) || 0).toString(); this.setAttribute('constraint-steps-x', newValue); }
[ "get constraintStepsX() {\n return +this.getAttribute('constraint-steps-x') || 0;\n }", "set constraintStepsY(value) {\n const newValue = (Math.round(+value) || 0).toString();\n this.setAttribute('constraint-steps-y', newValue);\n }", "set X(x) {\n if (isNaN(x)) {\n ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Performs manytoone data record aggregation on an array of data records Returns an array of data records for a set of aggregated features
function aggregateDataRecords(records, getGroupId, opts) { var groups = groupIds(getGroupId, records.length); return aggregateDataRecords2(records, groups, opts); }
[ "function multiAggByGroup(data, aggArray, groupRecord) {\n var newRecords = [];\n var groupColumn = groupRecord.column;\n var newGroupName = groupRecord.name;\n var aggregators = [];\n for (var i = 0; i < aggArray.length; i++) {\n var aggInfo = a...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
> Helpers read github from cache
function gh_read_cache(page) { var path = gh_cache_dir(page); if (fs.existsSync(path)) { return fs.readFileSync(path); } // try to load default cache. if (getLang(page)) { path = pathFn.join(_config.cache_dir, page.path.substring(page.lang.length + 1)); if (fs.existsSync(path)) { re...
[ "getGitHubData() {\n const cachePath = path.join(cacheDir, this.cacheFilename);\n const owner = this.owner;\n const repo = this.repo;\n const number = this.number;\n const type = this.type;\n const self = this;\n\n function log(msg) {\n if(!debug) return;\n\n const info = number ? `${...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Show or hide the loading animation. Take a boolean as argument. True => show the loader div, False => remove the loader div
function showLoader(bool){ if(!bool){ document.getElementById('loader').remove(); } else if(bool){ let loader = document.createElement("DIV"); loader.id = 'loader'; document.getElementById("loaderContainer").appendChild(loader); } }
[ "function showLoaderAnimation() {\n $('#comparify-btn').hide();\n $('#loading').show();\n}", "function showLoadingAnimation() {\n $(\"#loadingAnimationDiv\").show();\n}", "function showLoadingSpinner(){\n loader.hidden = false;\n quoteContainer.hidden = true;\n}", "function showLoadingAnimation(...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
ensures that scratching mechanic only takes place within the circle. uses pythagoras to calculate the distance between cursor and circle center.
function distFromCircleCenter(cursorX, cursorY,idx){ var x_diff = (cursorX - spaces[idx].pos_x)**2; var y_diff = (cursorY - spaces[idx].pos_y)**2; return ( Math.ceil(Math.sqrt(x_diff + y_diff)) ); }
[ "setupCoordinates(){\n // Start the circle off screen to the bottom left.\n // We divide the size by two because we're drawing from the center.\n this.xPos = -circleSize / 2;\n this.yPos = height + circleSize / 2;\n }", "function update_cursor(event) {\n var eventDoc, doc, body, pageX, pageY; // T...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Create a save directory Try to create a subdirectory with the set name in the given base directory
function createSaveDir(baseSaveDir, setName) { if (!baseSaveDir.isDirectory()) { promptWarning("The chosen directory does not exist! " + saveDir.path); return null; } var saveDir = baseSaveDir.clone(); saveDir.append(setName); if (!saveDir.exists()) { try { saveDir.create(saveDir.DI...
[ "function mkdir_recursive(basepath, custompath){\n var fullpath = basepath;\n for(var i = 0; i< custompath.split('/').length-1; i++){ //length-1 makes sure that the filename itself is not included in the path creation\n fullpath = fullpath + custompath.split('/')[i]+'/';\n if (!fs.existsSync(ful...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Convert string to camelCase text.
function camelCase(str){ str = toString(str); str = replaceAccents(str); str = removeNonWord(str) .replace(/[\-_]/g, ' ') //convert all hyphens and underscores to spaces .replace(/\s[a-z]/g, upperCase) //convert first char of each word to UPPERCASE .repl...
[ "function camelCase (text) {\n return text.replace(/-([a-z])/g, function parse (g) {return g[1].toUpperCase()});\n }", "function camelCase(str) {\n return str.replace(/^([A-Z])|[\\s-_](\\w)/g, function (match, p1, p2, offset) {\n if (p2)\n return p2.toUpperCase();\n ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
xEachUntilReturn, Copyright 20062007 Daniel Frechette Part of X, a CrossBrowser Javascript Library, Distributed under the terms of the GNU LGPL Access each element of a collection sequentially (by its numeric index) and do something with it. Stop when the called function returns a value.
function xEachUntilReturn(c, f, s) { var r, l = c.length; for (var i=(s || 0); i < l; i++) { r = f(c[i], i, l); if (r !== undefined) break; } return r; }
[ "function test_return()\n {\n for (let i in gen()) {\n if (i != 1)\n throw \"unexpected generator value\";\n return 10;\n }\n }", "function Ra() {\n var ret = returnVal.pop();\n //returnVal = undefined;\n exceptionVal = undefined;\n ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
__CSS class experimental if the "style" argument is an object, the object keys must be valid css property name. e.g. "fontweight" not "fontWeight" constructor
function __CSS (/*@string*/ selector, /*@string|@object*/ style, /*@string*/ styleId /*=undefined*/) { this.selector = selector; this.style = style; // styleId is used to identify the <style> tag which will be appended to the document. this.styleId = styleId || null; }
[ "function styl(style) {\n// allow multiple style object args\n for (var i = 0; i < arguments.length; i++) {\n// extract keys from each style object\n \tfor (var key in arguments[i]) {\n// check that it is a valid key\n if (Object.prototype.hasOwnProperty.call(arguments[i], key)) {\n \ts...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
how to iterate through an array backwards
function backwards(array){ for(let i = array.length - 1; i >= 0; i--){ console.log(array[i]); } }
[ "function backwards (array) {\n const result = [];\n for (let i = array.length-1; i >= 0; i--) {\n result.push(array[i])\n }\n return result;\n}", "function backwardsIterator() {\n var array = this;\n var i = array.length;\n return {\n next() {\n var value = array[--i];\n return i < 0 ? { d...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Produce legible assertion results. If two rects are not equal, the error message will be of the form "Expected (Object) but was (Object)"
function assertRectsEqual(expected, actual) { if (!goog.math.Rect.equals(expected, actual)) { assertEquals(expected, actual); } }
[ "function assertRectsEqual(expected, actual) {\n if (!GoogRect.equals(expected, actual)) {\n assertEquals(expected, actual);\n }\n}", "function checkRect(entry, expected, description=\"\") {\n assert_equals(entry.intersectionRect.left, expected[0],\n 'left of rect ' + description);\n assert_equals(entry...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Extract the physical resource id from the path (dot notation) to the data in the API call response.
static fromResponse(responsePath) { return new PhysicalResourceId(responsePath, undefined); }
[ "function parsePathToId(path)\n{\n return parsePathToIdArray(path).join('-');\n}", "restResourcePath(id = null) {\n let modelConfig = {...this.model.globalJsonApiConfig, ...this.model.jsonApiConfig};\n let apiRoot = modelConfig.apiRoot;\n let restResource = modelConfig.entityToResourceRout...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Build the checklist file after the new entry.
function buildChkXmlFile2(xmlBuildChkDoc, chkInsert) { var buildChkContent = new stringBuffer(); var chkFile = new Array(); var chkFileLen = 0; chkFile = xmlBuildChkDoc.getElementsByTagName('item'); chkFileLen = chkFile.length; if (chkFileLen > 0) { for (var i=chkInsert;i < chkFileLen;i++) { if (chkFile...
[ "function buildCheckList() {\n showNextSlide()\n let project_content = request.response;\n let nodeElement = document.createElement(\"p\");\n nextButton.style.display = 'none';\n\n nodeElement.innerHTML = `${project_content[2].ThanksCopy[0].thanksMessage}`;\n nodeElement.classList.add(\"checklist-thanks-copy\...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Remove error on password focus
function inputPassFocus(e) { e.target.classList.add('input--focus'); e.target.parentElement.children[0].classList.add('icon--focus'); e.target.parentElement.children[0].children[0].classList.add( 'icon__svg--focus' ); e.target.classList.remove('input_error', 'password_error'); e.target.parentElement.children[0]...
[ "function validPassword() {\r\n\r\n inputPassword.onblur = () => testPasswordBlur();\r\n\r\n testPasswordFocus();\r\n }", "function validateFocusPasswordText() {\n\n if (passwordInput.value === \"\" || passwordInput.value === null) {\n infoDivPassword.style.display = \"none\...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
LOCATION FUNCTIONS xMin,yMin 46.175, 23.4411 :xMax, yMax 45.7756, 23.1389 refresh location variables
function refreshLocVariables(){ targetPoint = false; tempTin=false; tin=false; nearest=false; nearest_turf=false; buffered=false; ptsWithin=false; myPoint=false; coords_x = []; //define an array to store the lng coordinate coords_y = []; //define an array to store the lat coordinate coords_z = []; //define a...
[ "function setWorldCoordinates(xmin, ymin, xmax, ymax) {\r\n\txwmin = xmin;\r\n\tywmin = ymin;\r\n\txwmax = xmax;\r\n\tywmax = ymax;\t\r\n}", "adjustMinMaxLimits() {\n if (this.robotPosition.x < this.minX) { this.minX = this.robotPosition.x; }\n if (this.robotPosition.x > this.maxX) { this.maxX = this.robotP...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Updates table widget location.
updateTableWidgetLocation(tableWidget, location, isUpdateToTop) { tableWidget.y = location = location + tableWidget.topBorderWidth; let cellSpacing = 0; for (let i = 0; i < tableWidget.childWidgets.length; i++) { let rowWidget = tableWidget.childWidgets[i]; rowWidget.y = ...
[ "updateChildLocationForTable(top, tableWidget) {\n for (let i = 0; i < tableWidget.childWidgets.length; i++) {\n let rowWidget = tableWidget.childWidgets[i];\n rowWidget.x = rowWidget.x;\n rowWidget.y = top;\n this.updateChildLocationForRow(top, rowWidget);\n ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Check if this PeerId instance is valid (privKey > pubKey > Id)
isValid (callback) { // TODO Needs better checking if (this.privKey && this.privKey.public && this.privKey.public.bytes && Buffer.isBuffer(this.pubKey.bytes) && this.privKey.public.bytes.equals(this.pubKey.bytes)) { callback() } else { callback(new Error('Keys not match')...
[ "isValid() {\n var _a;\n return Boolean(this.privKey &&\n this.privKey.public &&\n this.privKey.public.bytes &&\n ((_a = this.pubKey) === null || _a === void 0 ? void 0 : _a.bytes) instanceof Uint8Array &&\n areEqual(this.privKey.public.bytes, this.pubKey.by...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
size classification of all streets: tiny/small/normal/big/huge; if the size is unknow the default value is 'normal' :)
sizeClassification(){ let a; if(this.streetLength < 1) a=`tiny`; else if(this.streetLength < 2 && this.streetLength>1) a =`small`; else if(this.streetLength < 4 && this.streetLength>2) a =`normal`; else if(this.streetLength < 5 && this.streetLength>4) a =`big`; else a =`h...
[ "sizeClass() {\n const l = this.lengthofStreet;\n let size = '';\n\n if (l <= 0.4) {\n size = 'tiny';\n } else if (l > 0.4 && l <= 0.8) {\n size = 'small';\n } else if ((l > 0.8 && l <= 1.2) || l === undefined) {\n size = 'normal';\n } else ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Models the memory one agent has of another.
function MemoryOfAgent(agentID, age, x, y, otherAgentID) { this.agentID = agentID; this.age = age; this.x = x; this.y = y; this.visits = 1; this.otherAgentID = otherAgentID; this.distanceFromLastUntriedPath = -1; }
[ "function MemoryOfAgent(agentID, age, x, y, otherAgentID) {\r\n this.agentID = agentID;\r\n this.age = age;\r\n this.x = x;\r\n this.y = y;\r\n this.visits = 1;\r\n this.otherAgentID = otherAgentID;\r\n this.distanceFromLastUntriedPath = -1;\r\n}", "function Memory(agentID, age, x, y) {\r\n ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Sync the actual display DOM structure with display.view, removing nodes for lines that are no longer in view, and creating the ones that are not there yet, and updating the ones that are out of date.
function patchDisplay(cm, updateNumbersFrom, dims) { var display = cm.display, lineNumbers = cm.options.lineNumbers; var container = display.lineDiv, cur = container.firstChild; function rm(node) { var next = node.nextSibling; // Works around a throw-scroll bug in OS X Webkit if (we...
[ "function patchDisplay(cm, updateNumbersFrom, dims) { // 844\n var display = cm.display, lineNumbers = cm.options.lineNumbers; // 845\n var container = display.lineDiv, cur = container.firstChild...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Returns current nth throw's score Input: 0, 1, 2 Output: score of nth throw
function nthThrow(playerDiv, index) { var score = $(playerDiv).find('input:nth-of-type(' + (index + 1) + ')').val() || '0'; switch (score.charAt(0).toUpperCase()) { case 'D': return 2 * parseInt(score.substring(1)); case 'T': return 3 * parseInt(score.substring(1)); default: ...
[ "function getScore(n) {\n return (50 + (n-1) * 25) * n;\n }", "function getScore(n) {\n return n * (n + 1) * 25;\n }", "function getValueOfNextTwoThrows(allFrames, currentIndex) {\n\n let frameScore = 0;\n if (currentIndex === 9) {\n\n const nxtFrame = readFrame(allFrames[currentInd...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Determine the color of a person's username in the userlist based on their current vote.
function colorByVote(vote) { if (!vote) { return '#fff'; // blame Boycey } switch (vote) { case -1: return '#c8303d'; case 0: return '#fff'; case 1: return '#c2e320'; } }
[ "function colorByVote(vote)\n{\n if (!vote) {\n return '#fff'; // blame Boycey\n }\n \n switch (vote) {\n case -1: // Meh\n return '#c8303d';\n case 0: // Undecided\n return '#fff';\n case 1: // Woot\n return '#c2e320';\n }\n}", "function colorifyUsers() {\n var unique_ids =...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
EXTRACTRADECVALS %%%%%%%%%%%%%%%%%%%%%%%% passed 3/12/2019
function extractRaDecVals(reg,txt) { var charPos = []; var raDeg, decDeg; var r1, r2, r3, d1, d2, d3,s; var r2Acc,r3Acc,d2Acc,d3Acc; var raAcc,decAcc; var findMatch = txt.match(new RegExp(reg)); if (findMatch) { r1 = findMatch[1].replace(/[^0-9]/g,''); r2 = findMatch...
[ "function getResults() {\n res = microtonal_utils.parseCvt($('#expr').val());\n // The EDO case\n if (res.type == \"EDO\") {\n return [\"EDO\", [], range(1,res.edo).map(i => i + \"\\\\\" + res.edo).join(\"%0A\")];\n }\n const intv = res.type == \"interval\" ? res.intv : res.intvToRef.mul(res.ref.intvToA4);\...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
clears display, sub display, and sets chain of operations to default 0
function clearAll() { opChain = [0]; display.innerHTML = "0"; displaySub.innerHTML = ""; }
[ "function clearDisplay () {\n\tdisplay.textContent = \"0\";\n\tpreviousOperator = \"\";\n\tpreviousData = 0;\n\tcurrentData = 0;\n}", "function clear(display) {\n // reset values\n Calc.num1 = \"0\";\n Calc.num2 = \"0\";\n Calc.result = \"0\";\n Calc.operator = \"\";\n\n // reset display\n updateDisplay(di...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Calculate and set the song position in seconds (song.scrobbleTime) when the song will be scrobbled or 1 if disabled
function calcScrobbleTime() { if (song.scrobbled) return; if (song.info && song.info.durationSec > 0 && isScrobblingEnabled() && !isIgnoreLastFm(song.info) && !(song.ff && settings.disableScrobbleOnFf) && !(settings.scrobbleMaxDuration > 0 && song.info.durationSec > settings.scrobb...
[ "seekSeconds (seconds) {\n if (currentTrack.audio) {\n this.setTimeCode(seconds);\n\n if (currentTrack.timeCode || currentTrack.timeCode === 0) {\n let index = findIndex(playlist.tracks, (track) => seconds < track.timeCode);\n\n if (index === -1) {\n index = playlist.tracks.lengt...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Add click event listeners.
addEventListeners() { this.container.addEventListener( 'click', this.handleClick, false ); }
[ "function addClickEvents(){\n var selector = config.clickSelectors.join(',');\n selector = config.clickSelectors.length > 0 ? ',' + selector : '';\n $('a.' + config.buttonClass + selector).click(config.animateScroll.bind(config));\n }", "function bind_click_events() {\n var mute_but...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
inserts wrapped element in the buffer the first argument is either operation keyword (see below) or a number for operation 'insert' for insert the number is the index for the buffer element the new one have to be inserted after operations: 'append', 'prepend', 'insert', 'remove', 'update', 'none'
insert(operation, item) { const wrapper = { item: item }; if (operation % 1 === 0) {// it is an insert wrapper.op = 'insert'; buffer.splice(operation, 0, wrapper); } else { wrapper.op = operation; switch (operation) { case 'append': ...
[ "_insertEl(t) {\n const n = this.getCursorElement();\n x(n) ? E(t.outerHTML) ? this.$editor.insertBefore(t, n) : n === this.$editor.children[this.$editor.children.length - 1] ? this.$editor.insertBefore(h(this.options.childNodeName, {}, t), n) : (n.innerHTML = \"\", n.append(t)) : (E(t.outerHTML) || (t = h(th...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Takes a valid github repository url and parses it, returning an object of type `ParsedGithubUrl`
function parseGithubUrl(urlStr) { let match; for (const pattern of githubPatterns) { match = urlStr.match(pattern); if (match) { break; } } if (!match) throw new Error(invalidGithubUrlMessage(urlStr)); let [, auth, username, reponame, treeish = `master`] =...
[ "function parseRepoUrl(url) {\n if (typeof url !== \"string\" || url.length === 0)\n throw new Error(\"type error\");\n var parsedUrl = new URL(url, \"https://github.com\");\n var pathParts = parsedUrl.pathname.split(\"/\");\n if (pathParts.length < 2) {\n throw new Error(\"invalid url for...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
checks if the given path is available if not try to resolve wildcards
function checkAndFixPath(filePath) { let result = filePath; if (!doesFileExist(result)) { log(LOG_LVL.WARN, 'NOT FOUND: ' + result); log(LOG_LVL.WARN, ' --> check for wildcards ...'); result = resolveWildcards(filePath); } if (result) { log(LOG_LVL.SUCCESS, 'FILE FOUND: ' + result); } ret...
[ "resolve() {\n let resolvedPath = '';\n let resolvedLookup;\n this.lookups.some(lookup => {\n // Check that the file exists on the file system.\n if (lookup.type === types_1.LookupType.FILE_SYSTEM) {\n if (lookup.path.exists()) {\n resolve...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
FUNCTION that gets current minute
function getMinutes() { let date = new Date(); let minute = date.getMinutes(); return minute; }
[ "minute() {\n var abs = this._abs();\n var mod = abs.mod(constants.secondsPerHour.toUnsigned()).toSigned();\n return mod.div(constants.secondsPerMinute).toNumber();\n }", "function getMinuteTimestamp(now) {\n now = reg.test(now) ? now : ~~(Date.now() / 1000);\n var diff = now % 60;\n return now...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
;; camRemoveEnemyTransporterBlip() ;; ;; Removes the last blip that an enemy transporter left behind, if any. ;;
function camRemoveEnemyTransporterBlip() { if (camDef(__camTransporterMessage)) { hackRemoveMessage(__camTransporterMessage, PROX_MSG, CAM_HUMAN_PLAYER); __camTransporterMessage = undefined; } }
[ "function remove_actor( actor ){\n\twrap_plane.remove_actor( actor );\n}", "function C010_Revenge_AmandaSarah_StopMasturbating() {\n\tCommon_PlayerPose = \"Locker\";\n}", "invulnerabilityStop(tempEnemyId) {\n enemies[tempEnemyId].invulnerability = false; \n enemies[tempEnemyId].alpha = 1; \n ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
create hash of user sub, and append it to the first 8 characters of the user sub
function getHash (sub) { const hash = crypto .createHash('shake128', {outputLength: 6}) .update(sub, 'utf-8') .digest('base64') // remove any characters that are not letters, numbers, or underscores .replace(/\W/g, '') return sub.split('@').shift().slice(0, 8) + hash }
[ "function getHash (email) {\n // create hash of user sub, and append it to the first 8 characters of the user sub\n // for cisco.com email addresses, just use the part before the @\n const parts = email.split('@')\n if (parts[1] === 'cisco.com') {\n return parts[0]\n }\n // for all other non-cisco users, g...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Stores the element which contains the clicked element, substracts 1 from the count variable and makes sure if the checkbox contained in the stored element is checked. If so the checked variable also substracts 1 to its value. Finally once checks are done, using the shortcut variable "list" it removes the stored element...
function deleteTask(event){ child = event.target.parentElement; count--; if(child.getElementsByTagName("input")[0].checked==false){ checked--; } list.removeChild(child); updateItemCount(); updateCheckedCount(); }
[ "function updateCheckedCount(list) {\n var checkItems = list.checkItems;\n var checkedItems = 0;\n var allCheckedItems = 0;\n var allCheckItems = 0;\n\n angular.forEach(checkItems, function (checkItem) {\n if (checkItem.checked)\n {\n checkedItems++;\n }\n });\n\n list.checkItemsChecked =...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }