query
stringlengths
9
34k
document
stringlengths
8
5.39M
negatives
listlengths
19
20
metadata
dict
Show/Update min and max price range values
showPriceRangeValues() { $('#price-min').text(this.getPriceRange()[0]); $('#price-max').text(this.getPriceRange()[1]); }
[ "function filterPriceMin(btn) {\n const maxUpdate = document.getElementById(\"two\")\n filterObject.priceRange.min = btn.value\n filterObject.priceRange.max = maxUpdate.value\n updateList()\n}", "function filterPriceMax(btn) {\n const minUpdate = document.getElementById(\"one\")\n filterObject.priceRange.ma...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Call the given method on every handler
function callEvery (method) { var args = Array.prototype.slice.call(arguments, 1); handlers.forEach(function (handler) { if (handler[method]) { handler[method].apply(handler, args); } }); }
[ "handle() {\n this.handlers.forEach(func => func.call(this));\n }", "setAllHandlers(handler) {\n Object.keys(this.callbackMap).forEach((untypedEvent)=>{\n const eventType = untypedEvent;\n this.callbackMap[eventType] = [];\n if (handler) this.callbackMap[eventType].push...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Drops a model from the database
async drop(model_name) { return Promise.reject(new Error('not implemented')); }
[ "async drop(model) {\n throw new Error('not implemented');\n }", "remove (modelName) { this.models.delete(modelName) }", "destroy() {\n if (this.isSaved()) {\n this._disassociateFromDependents();\n\n let collection = this._schema.toInternalCollectionName(this.modelName);\n\n this._sc...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Get the user id of a decoded JWT.
function userId(decodedToken) { return jwt_1.readPropertyWithWarn(decodedToken, exports.mappingUserFields.id.keyInJwt); }
[ "function extractUserID(jwtToken){\n\tvar payload = jwt.decode(token);\n return payload.user_id;\n}", "function getUserId(req) {\n var idToken = req.headers.authorization;\n return jwt.decode(idToken).sub;\n}", "function getUserID() {\n\n var token = getCookie()\n if (token == \"guest\") {\n retur...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Basic FXAA implementation based on the code on geeks3d.com with the modification that the texture2DLod stuff was removed since it's unsupported by WebGL.
function FXAAFilter() { //TODO - needs work core.Filter.call(this, // vertex shader "#define GLSLIFY 1\nattribute vec2 aVertexPosition;\nattribute vec2 aTextureCoord;\n\nuniform mat3 projectionMatrix;\n\nvarying vec2 v_rgbNW;\nvarying vec2 v_rgbNE;\nvarying vec2 v_rgbSW;\nvarying vec2 v_rgbSE;\...
[ "static DrawTextureAlpha() {}", "function q(){var t,e,i,n,r,a=createjs,s=new a.StageGL(\"target\"),o=[],c=[],h=8,u=.2,l=2e3,f=2.5;a.Ticker.timingMode=a.Ticker.RAF,a.Ticker.on(\"tick\",d),s.setClearColor(\"#201624\");while(c.length<l)p();function d(i){for(var n=i.delta,a=1*r,o=0,h=c.length;o<h;o++){var l=c[o],d=l....
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
a function to return a callback for adding a given class to an element when an event is fired
function add_class_cb(new_class, target, cb) { return function() { target ? $(target).addClass(new_class) : $(this).addClass(new_class); cb && cb($(this)); } }
[ "function addClass(element, class_name){element.className += ' ' + class_name;}", "function addEventToClass(element, className, eventName, handler) {\n\t for (var _iterator3 = Array.prototype.slice.call(element.getElementsByClassName(className)), _isArray3 = Array.isArray(_iterator3), _i3 = 0, _iterator3 = _is...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Display friendly prepared by or nothing
function displayFriendlyPreparedBy(value){ return value === undefined ? "" : value === null ? "" : value === 'null' ? "" : value; }
[ "function basicView(corpName, adress){\n var result = \"<p><bold>\" + corpName + \"</p></bold>\" + \n \" \" + adress ;\n return result;\n}", "_toStringDetails() {\n return '';\n }", "function printAnswerToEditSQL() {\n \n }", "function showRawDataSource(){\n var contents=\"Th...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Given a set of data for last month, calculate the numbers for the next month Also pass in a formData Map that has churn, rev, burn, cpa last needs sales_per_month, total_sales, cash, and total_revenue
function calculateMonth(last, data, date) { let churn_per_month = Math.round(data.get('churn') / 100 * last.get('total_sales')) // Last month's sales plus percentage growth minus total churn this month let sales_per_month = Math.round(last.get('sales_per_month') + data.get('perc') / 100 * last.get('sales_per_mont...
[ "function buildDataByMonth(dataMap){\n var ret = {}; //the result data map\n var i = 1; //next month index\n var sum = 0; //the sum for current month\n var count = 0; //the day count for current month\n var m; //the month index for the current day\n for(var day in dataMap){\n m = new Da...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
PARTIAL COMBINATION multiplies A by B
function multiply(partialsA,partialsB) { var l = Math.min(partialsA.length,partialsB.length); for (var i=1; i<(l); i++) { partialsA[i] *= ( partialsB[i-1]); } partialsA[0] = 0; }
[ "function sumAndmulitplyAnddivision ( a , b ){\nreturn [ a+b , a*b ]\n}", "function multiOf(a,b,c)\n{if (b==0)\n return a\n return c*multiOf(a,b-1,c) \n}", "eth_mult(a, b) {\n // Good luck!\n let table = [[a, b]];\n while (a !== 1) {\n [a, b] = [Math.floor(a / 2), b * 2];\n table.push([a, ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
sets volume of advertisement jingle down
function setAdVolumeDown() { var currentAdVolume = adJingle.volume; // volume steps: 20% if(currentAdVolume >= 0.2){ adJingle.volume = currentAdVolume - 0.2; } popUpVolumeDown(); // show new/current volume in popUp if(adJingle.volume.toString().charAt(0) == "1"){ document.getElem...
[ "function volumeDown() {\n sendSetAttrRequest('volume', 'down');\n }", "function setAdVolumeUp() {\n var currentAdVolume = adJingle.volume;\n // volume steps: 20%\n if(currentAdVolume <= 0.8){\n adJingle.volume = currentAdVolume + 0.2;\n } \n popUpVolumeUp();\n // show ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Responds to the call to display newer punches in the punches management view
function displayNewerPunches() { var currentDate = $('#punches-options-date').text(); currentDate = new XDate(currentDate); // Security to prevent viewing dates in the future var now = new XDate(); if (currentDate.getFullYear() === now.getFullYear() && currentDate.getMonth() === now.get...
[ "function displayOlderPunches() {\n var currentDate = $('#punches-options-date').text();\n currentDate = new XDate(currentDate);\n currentDate.addDays(-1);\n setPunchesRange($.cookie('punches'),currentDate);\n}", "function refreshWaitOn() {\n if (UI.view == 'waiton') {\n showWaitOn(); // Upd...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Commands for adding and editing bot repositories
function repoCommands() { app .command('repos <cmd> [locations...]') .description('Manage bot repositories') .action(repoActions); }
[ "async function addProjectRepository() {\n console.clear();\n fancyText('New Project');\n let questions = [{\n type: 'input',\n name: 'name',\n message: 'Project Name (lowercase no spaces)',\n validate: (value) => value.length > 0 || 'Please enter project name!'\n },\n {\n type: 'l...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Binds the elements for this module.
function bindElements() { _$el = $(EL_SELECTOR); _$confirmModal = _$el.find(CONFIRM_MODAL_SELECTOR); _$confirmModalText = _$confirmModal.find(CONFIRM_MODAL_TEXT_SELECTOR); _$selectColor = _$el.find(SELECT_COLOR_SELECTOR); _$selectShape = _$el.find(SELECT_SHAPE_SELECTOR); _$selectTexture = _$el.f...
[ "function bindNewElements() {\n Initializer.rebindDisplay();\n }", "function bindNewElements() {\n _init2.default.rebindDisplay();\n }", "function bindElements() {\n pageElement = document.getElementById(PAGE_ID);\n listElement = pageElement.querySelector('ul');\n }", "function bindEl...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
FRAZIONA LA STRINGA Ritorna un ARRAY
function fraziona(stringa) { var arrayStringa = []; // Pusho ogni lettera dentro un nuovo array for (var i = 0; i < stringa.length; i++) { arrayStringa.push(stringa[i]); } return arrayStringa; }
[ "function arrayOneString() {\n \n return [\"zwade\"];\n\n}", "function caml_string_of_array (a) { return new MlString(4,a,a.length); }", "function caml_string_of_array (a) { return new MlBytes(4,a,a.length); }", "function rovesciaArray(stringa) {\r\n var stringaReverseArray = [];\r\n\r\n // Popolo l'arra...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
actuall gmap instance get Default Center
function getDefaultCenter() { return { latitude: 40.1451, longitude: -99.6680 }; }
[ "function getDefaultLatLng() {\n return new google.maps.LatLng(WIDGET_MAP_CENTER[1], WIDGET_MAP_CENTER[0]);\n}", "setDefaultCenter() {\n if (this.state.activeRequest) {\n return this.state.activeRequest.location;\n } else if (this.props.highlightedPost) {\n return this.props.highlightedPost.loc...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Remove all the url from the whitelist and clear the table tbody
function removeAllWhitelistUrl() { savedWhitelistedURL = []; actualBrowser.storage.local.set({"whitelist": savedWhitelistedURL}); actualBrowser.runtime.sendMessage({data: JSON.stringify(savedWhitelistedURL), subject: "whitelist"}); }
[ "function cleanUpHTMLTable(tableToCleanUp) {\n for (var i = tableToCleanUp.rows.length; i > 0; i--) {\n tableToCleanUp.deleteRow(i - 1);\n }\n return;\n}", "function cleanupTables(){\n var elements = document.body.querySelectorAll(ALLELEMENTS);\n \n \n for(var i = elements.length -1 ; ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Synchronize the ServerDate object with the server's clock.
function synchronize() { // Request a time sample from the server. function requestTime() { var request = new XMLHttpRequest(); // Ask the server for another copy of ServerDate.js but specify a unique number on the URL querystring // so that we don't get the browser...
[ "function SyncWithServerTime(serverTime)\n{\n\tif (serverTime) \n\t{\n\t \t/* update time difference cookie */\n\t\tvar serverDelta=Math.floor(localTime-serverTime);\n\t \tdocument.cookie = 'e107_tdOffset='+serverDelta+'; path=/';\n\t \tdocument.cookie = 'e107_tdSetTime='+(localTime-serverDelta)+'; path=/'; /* s...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
the sub function subtracts one from the score and updates the over value as well as the totals accordingly
function sub1(elem, elemTotal) { if (elem.children[2].innerHTML != "0" && elem.children[2].innerHTML != "-") { //checks if the score isn't 0 or - let score = elem.children[2].innerHTML; //declares a local variable "score" to hold the number value of the score column for that hole score = Number.parseInt(score); ...
[ "function subt1(elem, elem19) { //begin function for subtracting from score\n if (elem.children[2].innerHTML > \"0\") { //only perform while the elem2 is greater than 0\n let currentScore = elem.children[2].innerHTML; //generate currentscore value\n currentScore = Number.parseInt(currentScore); //s...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Upload data from a readable stream or a local file to a remote file.
async uploadFrom(source, toRemotePath, options = {}) { return this._uploadWithCommand(source, toRemotePath, "STOR", options); }
[ "function uploadRemoteFile(pid, mid, uid, hostname, path, fileObject){\n\n if(fileObject.progress)\n {\n // Setting initial progress to 10%\n fileObject.progress(10);\n }\n if(fileObject.progress_status)\n {\n fileObject.progress_status('Uploading...');\n }\n\n client.put_upload_file_part({\n uid...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
DONE This function allows you to test whether some values in an object match a certain criteria. For example, are at least some of the values greater than 100? The function receives an object and a tester function. If at least 1 of the values in the object pass the tester function, true is returned. Otherwise, return f...
function some(obj, func) { let newArr =Object.values(obj); for(let i=0; i<newArr.length; i++) { if(func(newArr[i])) return true; } return false; }
[ "function hasYahtzee(obj) {\n let arr = Object.values(obj);\n for (let i = 0; i < arr.length; i++) {\n if (arr[i] >= 5) {\n return true;\n }\n }\n return false;\n\n\n}", "function evalObject(obj, tests) {\n\t\tvar pairs = _.toPairs(obj);\n\t\t\n\t\t// evaluate all the `'BOUND'` tests first\n\t\tvar...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
A public method to override the call timeout amount
function setCallTimeout(callTimeout) { _callTimeout = callTimeout; }
[ "requestTimeout() { return 3 * 60000; }", "get callTimeout() {\n if (this._impl)\n return this._impl.getCallTimeout();\n return undefined;\n }", "function FakeTimeout() {}", "setRequestTimeout(newTimeout) {\n this.options.timeout = newTimeout;\n }", "function setTimeout(timeout) {\n o...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
PROTECTED Writes the connection inside the map.
function writeConnection() { if (this.points != null) { var line = document.createElement("v:polyline"); line.setAttribute("id", this.id); line.setAttribute("points", this.points); var elem = document.getElementById(MAP).appendChild(line); elem.style.pixelTop = 0; elem.style.pixelLeft = 0; elem.s...
[ "function mapConnections (conn) {\n const key = conn.remoteAddress + ':' + conn.remotePort\n connections[key] = conn\n\n // once the connection closes, remove\n conn.on('close', function () {\n delete connections[key]\n })\n }", "function saveConnectionObj(con) {\n savedConnect...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Convert an array of index codes to the actual index sequences:
function indexLookup(codes) { var seqs = new Array(codes.length); var seq; for(var i = 0, n = codes.length; i < n; i++) { seq = indexTable(codes[i]); if(typeof seq === "undefined") { throw "UnknownIndexCodeExceeption"; } else { seqs[i] = seq; } } return seqs; }
[ "getCodeFromIndex(index) {\n const unpadded = index.toString(this.radix).split('');\n let i = 0;\n const code = [];\n for (; i < this.length - unpadded.length; ++i) {\n code[i] = 0;\n }\n for (; i < this.length; ++i) {\n code[i] = parseInt(unpadded[unpadded.length - this.length + i]);\n ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
The current state of a layout breakpoint.
function InternalBreakpointState() { }
[ "getCurrentBreakpoint() {\n if (this.isSM()) {\n return 'SM';\n }\n if (this.isMD()) {\n return 'MD';\n }\n if (this.isLG()) {\n return 'LG';\n }\n return 'XS';\n }", "function InternalBreakpointState() {}", "function getCurrentBreakpoint() {\n const w...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
get the comments of the partition
function getNewPartitionComments() { var partitionComments = ""; try { var partitionComments = $("#new_partition_comments").val(); } finally { // nothing } return partitionComments; }
[ "get comments() {\n return splitComments(this._comments)\n }", "function getComments() {\n return [\n '# Your Custom CEDICT-formatted dictionary.',\n '#',\n '# Compiled by Pinyinpod.',\n '# https://github.com/pffy/pinyinpod/',\n '#',\n '# Powered by Pinyinbase.',\n '# https://github.com/...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
force correct cupId format
function formatCupId() { return function(e) { if (e.keyCode === 8) return; var output; var input = $("#cup-id").val(); input = input.replace(/[^0-9]/g, ""); var year = input.substr(0, 2); var day = input.substr(2, 2); var id = input.substr(4, 6); if (year.length < 2) { output = y...
[ "function fixId(id) {\n if (id.length === 23 && id.startsWith(\"c\")) {\n return id.slice(1)\n }\n}", "formatId(){\n\n return this.props.group.replace(' ','').replace('.','') + ':' + this.props.code\n }", "function genContactIdShort(id) {\n var shortid = id.replace(/(.*)((-)?^(CINSX|CINCP)...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Entity Does Not Have Component Exception
function EntityDoesNotHaveComponentException(message, index) { _super.call(this, message + "\nEntity does not have a component at index (" + index + ") " + entitas.Pool.componentsEnum[index]); }
[ "function EntityAlreadyHasComponentException(message, index) {\n _super.call(this, message + \"\\nEntity already has a component at index (\" + index + \") \" + entitas.Pool.componentsEnum[index]);\n }", "addComponentToEntity(entity, component) {\n if (this.entityHasComponent(enti...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Redraw the background. In contrast to drawBg(), this function assumes the background has been drawn before and the old drawing needs to be removed first.
redrawBg() { this.clearBg(); this.drawBg(); }
[ "redrawBg() {\n\t\t\tthis.clearBg();\n\t\t\tthis.drawBg();\n\t\t}", "function repaintBackground() {\n background(80, 40, 40);\n}", "function drawBackground() {\n background(bg);\n}", "function drawBackground() {\r\n context.drawImage(backgroundCanvas, 0, 0);\r\n }", "redraw() {\n this.cr...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
TODO add functionality to adjust other screens when resizing one input: a window (expects it is the currently focused window) output: an array of all the window's that are currently bordering with given window (neighbours) effect: finds all neighbours of the given window and returns an array with them
function findNeighbours(focus_window) { var windows = focus_window.others(); var winLen = windows.length; var neighbours = []; var currwin = windows[0]; for(i = 0; i < winLen; i++) { currwin = windows[i]; if((currwin.topLeft().x+currwin.size().width)==focus_window.topLeft().x) { neighbours.push(currwin); ...
[ "function resizeNeighbours(focus_window) {\n\tvar neighbours = findNeighbours(focus_window);\n\tfor(i = 0; i < neighbours.length; i++) {\n\t\tneighbours[i].setFrame({\n\t\t\tx: neighbours[i].topLeft().x,\n\t\t\ty: neighbours[i].topLeft().y,\n\t\t\twidth: neighbours[i].size().width + 10,\n\t\t\theight: neighbours[i]...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Show new workflow editor
function showNewWorkflowEditor() { $(".perc-wf-default").find('input').prop('checked', false).prop('disabled', false); $(".perc-wf-default").find('input').attr('aria-disabled', "false"); hideWorkflowUpdateEditor(); hideWorkflowEditButton(); //create the workflo...
[ "showEditor() {}", "function showEditor() {\n // create a new editor instance\n editor.set(json)\n \n $container.show()\n}", "_displayEditor() {\n this.editor.display();\n this.terminal.hide();\n }", "function showIdiomCreatePreview(){\n\t\t\t$('pre[data-content]').popover(\"hide\"); // H...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Set / get leading
leading(value) { // act as getter if (value == null) { return this.dom.leading; } // act as setter this.dom.leading = new SVGNumber_SVGNumber(value); return this.rebuild(); }
[ "leading(value) {\n // act as getter\n if (value == null) {\n return this.dom.leading;\n } // act as setter\n\n this.dom.leading = new SVGNumber(value);\n return this.rebuild();\n }", "leading() {\n return this.native.leading();\n }", "leading(value){// act as getter\nif(null==val...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Exit a parse tree produced by LUFileParserpromptSection.
exitPromptSection(ctx) { }
[ "exitParse(ctx) {\n\t}", "exitNestedExpressionAtom(ctx) {\n\t}", "exitShellDeclaration(ctx) {\n\t}", "exitSyntaxColon(ctx) {\n\t}", "exitImportSection(ctx) {\n\t}", "exitCompilationUnit(ctx) {\n\t}", "exitDeclarationSpecifier(ctx) {\n\t}", "exitDeclaration(ctx) {\n\t}", "exitNestedRowExpressionAtom(...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
When year changes, clear other fields.
_onYearChange(year) { $("#firstBox").val(''); $("#middleBox").val(''); $("#lastBox").val(''); if (year.currentTarget) { year = $("#yearBox").val(); this.setState({useYear: (year !== '') }); } else { $("#yearBox").val(year); this.setState({useYear: !!year }); } this._search(); }
[ "function clear_year(year){\n\t\tvar farm = year.farm();\n\t\tvar full_update = farm.has_regrowing_crops();\n\t\t$.each(farm.plans, function(date, plans){\n\t\t\tfarm.plans[date] = [];\n\t\t});\n\t\tsave_data();\n\t\tupdate(year, full_update);\n\t}", "function changeYear() {\n var selectedYear = $y...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Read msg from the image in canvasid. Return msg (null > fail)
function readMsgFromCanvas_single(canvasid,pass,dct,copy,lim){ dct=(dct === undefined)?false:dct; pass=(pass=== undefined)?'':pass; copy=(copy=== undefined)?5:copy; lim=(lim=== undefined)?30:lim; var c=document.getElementById(canvasid); var ctx=c.getContext("2d"); var imgData=ctx.getImageDat...
[ "function readMsgFromCanvas(canvasid,pass,mode){\n mode=(mode=== undefined)?0:parseInt(mode);\n switch (mode) {\n case 1: return readMsgFromCanvas_single(canvasid,pass,true,11,15);\n case 2: return readMsgFromCanvas_single(canvasid,pass,true,9,20);\n case 3: return readMsgFromCanvas_singl...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Allow also CIbased baseurl //wpdesigntokens//jobs/219806015/artifacts/docs/php
function basepath(env, dfltValue) { if (!env.CI) { return dfltValue; } if (env.VUEPRESS_PHP_BASE) { return env.VUEPRESS_PHP_BASE; } return "/-/" + env.CI_PROJECT_NAME + "/-/jobs/" + env.CI_JOB_ID + "/artifacts/docs/php/"; }
[ "baseUrl(doc) {\n return 'https://.../'; // for dynamic baseUrls\n }", "getURL() { return Work.baseURL + this.url; }", "getMasterJobFilesUrl() {\n return `${this.configService.config.MASTER_WEBSERVER_URL}${this.configService.serverConfig.API_JOB_FILES_URL}`;\n }", "devBaseUrls() {\n ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Convert string to matrix
function stringToMatrix(source) { // remove matrix wrapper and split to individual numbers source = source .replace(SVG.regex.whitespace, '') .replace(SVG.regex.matrix, '') .split(SVG.regex.matrixElements) // convert string values to floats and convert to a matrix-formatted object return arrayToMat...
[ "stringToMatrix(s) {\n var m = s.split(\",\");\n return [[m[0], m[2], m[4]], [m[1], m[3], m[5]], [0, 0, 1]];\n }", "function str_to_matrix(str) {\n var matrix = [];\n var txtByLine = str.split('\\n');\n for (var i = 0; i < trainees.length; i++) {\n var arr = [];\n \tvar line = txtByLine[...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Set operators to the vehicle.
setOperators(operators) { this.operatorUnits = operators; }
[ "set isOperator (value) {\n this._isOperator = value\n /**\n * @event IrcUser#isOperator\n */\n this.emit('isOperator')\n }", "function enable_operators(operator) {\n if (power) {\n switch (operator) {\n case 'all':\n btn_sumar.status = true\n b...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
getIgnoreKeywords_allLeftNumberDecorations() Get all symbols that typically decorate the left side of a number. For example: pp, pg, no, etc..
function getIgnoreKeywords_allLeftNumberDecorations() { return [ 'n', 'no', 'nos', 'no\'s', 'num', 'number', 'pg', 'pgs', 'pp', 'pps', ]; }
[ "function getIgnoreKeywords_allDecoratedNumberSymbols_leftDecorations(args) {\n\t\tvar allnumbersymbols = args.allnumbersymbols;\n\t\tvar allleftnumberdecorations = getIgnoreKeywords_allLeftNumberDecorations();\n\t\t\n\t\tvar decoratednumbersymbols = [];\n\t\t\n\t\tfor(var i = 0; i < allleftnumberdecorations.length...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
BEGIN A generator function that produces a [0,1) prng function using 'code' as seed
function mk_prng(code) { // From https://stackoverflow.com/questions/521295/seeding-the-random-number-generator-in-javascript // which references http://pracrand.sourceforge.net/ // // [tobin] beware! experiments show that after seeding the first few values // returned are all very close to zero, w...
[ "function generateCode(){\n\n}", "function create_next_generation () {\n\ta1a1 = p * p;\n\ta1a2 = 2 * p * q;\n\ta2a2 = q * q;\t\n}", "function genCode(n) {\n var code = ''\n for (i = 0; i < n; i++) {\n code += String(Math.floor(Math.random() * 10));\n }\n return code;\n}", "function createNextGeneratio...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Returns a value indicating whether the given string looks sortable as a number. If true, returns a parsed number.
function lookSortableAsNumber(s) { if (!_.isString(s)) { TypeException("s", "string"); } var m = s.match(/[-+~]?([0-9]{1,3}(?:[,\s\.]{1}[0-9]{3})*(?:[\.|\,]{1}[0-9]+)?)/g); if (m && m.length == 1) { if (/(#[0-9a-fA-F]{3}|#[0-9a-fA-F]{6}|#[0-9a-fA-F]{8})$/.test(s)) { // hexadecimal string: alphabet...
[ "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" ] ] } }
This function receives data i.e titles and their platforms. It then makes API calls to get their IDs from TMDB and calls the fetchRecs functions
function sendData(mediaTitle, mediaPlatform) { if(mediaTitle.length) { console.log(mediaTitle); if(mediaPlatform=="Netflix") { // Checking the platform if(mediaTitle.match(/S[0-9]+/)){ // to check if it's a TV series var pos = mediaTitle.search(/S[0-9]+/); // getting the index of S[0-9] format...
[ "function loadData(name, type) {\n//Question - two problems - info source does not support name based queries, only type\n//update DOM without accessing ..using KO.\n//Dispatch URL returns XML data. Would liket to use NYT, Dispatch, Google, WIKI\n//Form queries that are acceptable to different external sources base...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
find_lower_bound_difference inputs the position of the set and the already used differences. It calculates a lower bound. Assumes that de differences are sorted. It uses this: As the differences between 2 elements of the set can not be equal to any other difference, then a set of length n has to be at least the sum of ...
function find_lower_bound_difference(position_in_set, used_differences = []) { // create the structures to keep the sum of the differences let sum_of_differences = 0; // amount of used differences starts at the amount of space in-between let counted_differences_amount = position_in_set; // from th...
[ "function lower_bound(a, b, c, k) {\n let s = 0;\n let e = Math.ceil(Math.sqrt(k));\n while (s <= e) {\n let mid = s + Math.floor((e - s) / 2);\n if (poly(a, b, c, mid) >= k) {\n e = mid - 1;\n } else {\n s = mid + 1;\n }\n }\n return s;\n}", "funct...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Serializes JS types to SendPortSync format: primitives > primitives sendport > sendport Function > [ 'funcref', functionid, sendport ] Object > [ 'objref', objectid, sendport ]
function serialize(message) { if (message == null) { return null; // Convert undefined to null. } else if (typeof(message) == 'string' || typeof(message) == 'number' || typeof(message) == 'boolean') { // Primitives are passed directly through. return message; ...
[ "function serializeWithFunctions (obj)\n{\n var serialized = JSON.stringify(obj, function(k, v) {\n // Convert functions to strings\n if (typeof v == 'function') {\n return v.toString();\n }\n return v;\n });\n\n return serialized;\n}", "sendOsSyncDatatypes_() {\n ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
prompts user with the given question, and lists their contacts.
function listUsers(question) { weChatClient.log(3, question); for (var i = 0; i < weChatClient.contacts.length; i++) { weChatClient.log(3, "Contact " + (i + 1) + ": " + weChatClient.contacts[i].NickName, -1); } }
[ "function searchContact() {\n var searchContact = readlineSync.question('Choose the contact you wish to search: ');\n for (var contact of contacts) {\n if (contact.name == checkInput(searchContact) || contact.number == parseInt(searchContact)) {\n console.log(contact.name, contact.number);\n }\n }\n}"...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
balance Returns a promise to get the balance for the given key Parameters: key : can be a KeyPair, public key, wif, private key (hex64) or file.
function balance( key ){ checkForMissingArg( key, "key" ); return getPublicKey(key).then( Blockchain.getBalance ); }
[ "async getBalance(publicKey, commitment) {\n return await this.getBalanceAndContext(publicKey, commitment).then(x => x.value).catch(e => {\n throw new Error('failed to get balance of account ' + publicKey.toBase58() + ': ' + e);\n });\n }", "async accountBalance() {\n let orgItem = await getOrganis...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Withdraws some tokens from Multisig wallet to a specified address. In case of 1 custodian `submitTransaction` method performs full withdraw operation. In case of several custodians, `submitTransaction` creates a transaction inside the wallet for other custodians to confirm. Other custodians need to invoke `confirmTrans...
async function walletWithdraw(wallet, address, amount) { const transactions = await runAndWaitForRecipientTransactions(wallet, "submitTransaction", { dest: address, value: amount, bounce: false, allBalance: false, payload: "", }); if (transactions.length > 0) { ...
[ "function performWithdraw() {\n\tlet obj = validateWithdraw();\n\tif (obj) {\n\t\t$(\"#withdrawModal\").modal(\"hide\");\n\t\tif (_W.currentAccount && _W.currentAccount.type === \"metamask\") {\n\t\t\t$(\"#confirmModal\").modal(\"show\");\n\t\t}\n\n\t\t// add the tx to the withdrawals table\n\t\tlet txIndex = addWi...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Query the database for theme start and end times for the current episode
function getThemeTimes(episodeId, v) { $.ajax({ url: BASE_URL+"/"+episodeId }) .done(function(res) { if (res[0] !== undefined) { console.log("\n* * * Episode "+v.episodeId+" found! * * *"); currentEpisodeInfo.themeStart = res[0].themeStart; currentEpisodeInfo.realThemeE...
[ "function checkAllTheThings() {\n var currentVolume;\n \n // This function runs every 100ms and the first thing it does is gathers and spits out a bunch of useful info about the currently playing title\n // This v object is global and can be accessed by all the functions\n v = getVideoData();\n\n ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
this.end: ends the timer prematurely executing the callback immediately
end() { this.cancel(); this.callback(); }
[ "function endTimeout() {\n\t\tclear( id );\n\t}", "function end() {\n\t/* eslint-disable no-invalid-this */\n\tvar self = this;\n\tif ( this._ended ) {\n\t\tthis.fail( '.end() called more than once' );\n\t} else {\n\t\t// Prevents releasing the zalgo when running synchronous benchmarks.\n\t\t_$nextTick_372( onTic...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Step 5//////////////////// Create a function called 'setPowers' that takes in arr as a parameter. Loop over the arr param and run a function called createLi(), which will take each item of the array as an agument. The createLi function is a function we created to set the data on the screen. It outside the scope of this...
function setPowers (arr); { }// CODE HERE
[ "function setPowers(arr){\n for(let i = 0; i < arr.length; i++){\n createLi(arr[i])\n }\n }", "addNewEvenArray() {\n this.resetList()\n this.listContainer.innerHTML = this.generateNewEvenArrayAsLi()\n }", "function build(arr) {\r\n\tfor (i=0; i<arr.length; i++) {\r\n\t\tvar item = \"<li class...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Insert style string into the DOM
function insertStyle(style) { var a=document.createElement("style"); a.innerHTML=style; document.head.appendChild(a); }
[ "function insert(css){\n tstyle.appendChild(document.createTextNode(css));\n }", "function addStyle(style) {\n\tvar content = document.getElementById('content');\n\tcontent.insertAdjacentHTML('afterbegin', style);\n}", "function addStyles() {\n document.body.previousElementSibling.appendChild(\n ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Handle edit properties action on context menu BN_id = String identifying the bookmark item to edit
function menuProp (BN_id) { let BN = curBNList[BN_id]; // Open popup on bookmark item let path = BN_path(BN.parentId); openPropPopup("prop", BN_id, path, BN.type, BN.title, BN.url, BN.dateAdded); }
[ "function edit_bookmark(){\r\n\tif(model.edit_mode){\r\n\t\t$.mobile.changePage('#edit_bookmark');\r\n\t\tmodel.selected.index = $(this).attr('index');\r\n\t\tmodel.selected.bookmark = model.bookmarks[model.selected.index];\r\n\r\n\t\t$('#edit_name').val(model.selected.bookmark.name);\r\n\t\t$('#edit_url').val(mode...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Check if key exists in the object.
keyExists(obj, key) { return obj[key] !== undefined; }
[ "__key_in_object(object, key) {\n if (Object.prototype.hasOwnProperty.call(object, key)) {\n return true\n } else {\n return false\n }\n }", "function hasKey(object, key) {\n return {}.hasOwnProperty.call(object, key);\n }", "function isItemExistInObj(object...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
todo : implement openTile volajte to cez konzolu
function openTile(row, col) { // otvori dlazidu na pozicii row, col vo field - nastavi jej stav na OPEN // iba pokial jej stav bol predtym CLOSED }
[ "function openTile(chosenTile){\n if ($(document.getElementById(chosenTile)).hasClass('clicked')) {\n return\n }\n else{\n if ($(document.getElementById(chosenTile)).hasClass('hidden')) {\n $(document.getElementById(chosenTile)).removeClass('hidden'); \n $(document.getElementById(ch...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Terminate screenshare. hangup() function can also be used.
function stopscreenshare () { if (typeof (webphone_api.plhandler) === 'undefined' || webphone_api.plhandler === null) webphone_api.addtoqueue('StopScreenShare', []); else webphone_api.plhandler.StopScreenShare(); }
[ "function webrtcdevStopShareScreen(){\r\n try{\r\n\r\n rtcConn.send({\r\n type:\"screenshare\", \r\n message:\"stoppedscreenshare\"\r\n });\r\n\r\n scrConn.closeEntireSession();\r\n webrtcdev.log(\"[screenshare JS] Sender stopped: screenRoomid \", screenRoomid ,\...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Get the currently selected produces value for an operation
function currentProducesFor(state, pathMethod) {var _context19, _context20; pathMethod = pathMethod || []; var operation = specJsonWithResolvedSubtrees(state).getIn(_babel_runtime_corejs3_core_js_stable_instance_concat__WEBPACK_IMPORTED_MODULE_2___default()(_context19 = ["paths"]).call(_context19, _babel_runtime_c...
[ "get value() {\n const selected = this._selectionModel ? this._selectionModel.selected : [];\n if (this.multiple) {\n return selected.map(toggle => toggle.value);\n }\n return selected[0] ? selected[0].value : undefined;\n }", "function getValue() {\n return selected...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
KinectSensor object constructor KinectSensor(baseEndpointUri, onconnection(sensor, isConnected)) baseEndpointUri: base URI for web endpoints corresponding to sensor onconnection: Function to call back whenever status of connection to the server that owns this sensor changes from disconnected to connected or vice versa.
function KinectSensor(baseEndpointUri, onconnection) { ////////////////////////////////////////////////////////////// // Private KinectSensor properties // URI used to connect to endpoint used to configure sensor state var stateEndpoint = baseEndpointUri + "/state"; ...
[ "function onConnect(sensorTag) {\n\t console.log(uuid + ' Connected');\n\t sensorTag.discoverServicesAndCharacteristics(function() {\n\t\tconsole.log(uuid + ' DiscoverServicesAndCharacteristics');\n\t\tsensorTag.on('humidityChange', function(temperature, humidity) {\n\t\t // Ignore readings of a disabled s...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
This function creates the xhttp request "/jobPostings/submitJobPosting" and sends it to the server. The response text is put into a div with id="jobpostings"
function loadJobPostings() { var xhttp = new XMLHttpRequest(); xhttp.onreadystatechange = function() { if (this.readyState == 4 && this.status == 200) { document.getElementById("jobpostings").innerHTML = this.responseText; } }; xhttp.open("GET", "/jobPostings/submitJobPosting", true); ...
[ "function postJob(jobData){\n // console.log('post job data is fired with data', jobData)\n $.post('https://apex-database.herokuapp.com/api/jobs/new', jobData)\n .done((data) => {\n // console.log('success', data)\n browserHistory.push('/list_jobs'); // redirects to profile\n })\n .error((error...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Renders the AWS CloudFormation properties of an `AWS::IoTEvents::DetectorModel.Firehose` resource
function cfnDetectorModelFirehosePropertyToCloudFormation(properties) { if (!cdk.canInspect(properties)) { return properties; } CfnDetectorModel_FirehosePropertyValidator(properties).assertSuccess(); return { DeliveryStreamName: cdk.stringToCloudFormation(properties.deliveryStreamName), ...
[ "function cfnApplicationOutputKinesisFirehoseOutputPropertyToCloudFormation(properties) {\n if (!cdk.canInspect(properties)) {\n return properties;\n }\n CfnApplicationOutput_KinesisFirehoseOutputPropertyValidator(properties).assertSuccess();\n return {\n ResourceARN: cdk.stringToCloudForm...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Change from a song number to play button when the song isn't playing and we hover over the row.
function onHover(event) { songNumberCell = $(this).find('.song-number'); songNumber = songNumberCell.data('song-number'); if (songNumber !== currentlyPlayingSong) { songNumberCell.html('<a class="album-song-button"><i class="fa fa-play"></i></a>'); } }
[ "function offHover(event) {\n songNumberCell = $(this).find('.song-number');\n songNumber = songNumberCell.data('song-number');\n if (songNumber !== currentlyPlayingSong) {\n songNumberCell.html(songNumber);\n }\n }", "function togglePlaySong(){\n if (!song[2].isPlaying()){\n son...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Hits Facebook Post To Page Route
hitsFacebookPostToPage(requestBody) { return this.chakram.post(this.baseUrl + '/includes/ajax/ajax_facebook_post_to_page.inc.php', requestBody, this.options); }
[ "function postToPage(body) {\n var ACCESS_TOKEN;\n //call API for all pages user manages\n FB.api('/me/accounts', 'get', function(response) {\n //iterate through data returned, matching the page id to find access token\n for(var i = 0;i<response.data.length; i++){\n if(response.data[i].id === Router.c...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Open a the menu as a submenu using the item node for positioning.
function openSubmenu(menu, item) { var rect = clientViewportRect(); var size = mountAndMeasure(menu, rect.height); var box = phosphor_domutil_1.boxSizing(menu.node); var itemRect = item.getBoundingClientRect(); var x = itemRect.right - SUBMENU_OVERLAP; var y = itemRect.top - box.borderTop - box....
[ "function openSubmenu(menu, item) {\n var vpRect = clientViewportRect();\n var size = measureMenu(menu, vpRect, 0);\n var box = createBoxSizing(menu.node);\n var itemRect = item.getBoundingClientRect();\n var x = itemRect.right - SUBMENU_OVERLAP;\n v...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
CHALLENGE 5: MAX CHARACTER Return the character that is most common in a string ex. maxCharacter('javascript') == 'a'
function maxCharacter(str) { let mostCommonCharacter = ''; let latestHighestCount = 0; let blacklistedCharacters = [' ']; for(let i = 0; i < str.length; i++) { if(blacklistedCharacters.includes(str.charAt(i))) { continue; } let reg = new RegExp(str.charAt(i), 'gi'); let matc...
[ "function maxCharacter(str) {}", "function maxCharacter(str) { }", "function maxChar(str) {\n let i;\n let chars = {};\n\n for (i of str) {\n chars[i] = chars[i] ? chars[i] + 1 : 1;\n }\n\n const most = Math.max.apply(null, Object.values(chars));\n let x;\n let sol;\n\n for (x in chars) {\n if (ch...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Gets the GFX texture.
get texture() { return textureAsset.getGFXTexture(); }
[ "get texture() {\n return textureAsset.getGFXTexture();\n }", "get texture() {\n return textureAsset.getGFXTexture();\n }", "get Texture() {}", "getTexture()\n {\n switch(this.direction)\n {\n case \"up\": return app.loade...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Creates an instance of BreadcrumbService.
function BreadcrumbService(activatedRoute) { this.activatedRoute = activatedRoute; this.breadcrumbsSubject = new rxjs__WEBPACK_IMPORTED_MODULE_19__["Subject"](); this.breadcrumbs$ = this.breadcrumbsSubject.asObservable(); }
[ "function BreadcrumbService(activatedRoute) {\n this.activatedRoute = activatedRoute;\n this.breadcrumbsSubject = new rxjs__WEBPACK_IMPORTED_MODULE_3__[\"Subject\"]();\n this.breadcrumbs$ = this.breadcrumbsSubject.asObservable();\n }", "createBreadcrumb(path, isCurrent = false) {\n ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
This function creates the questionanswer minigame for the easy level. This will be called when the "Easy" button on the choose level page is clicked. Sources: shuffle elements:
function createEasyQAGame(){ //clear the entire document document.body.innerHTML = ""; upToQuestion = 0; //create a question mathQuestionElement = createParagraph("", "question"); var userAnswerDiv = createDiv(); userAnswerDiv.id = "userAnswerDiv"; //create an answer text box for the user var answe...
[ "function createMediumQAGame(){\n //clear the entire document\n document.body.innerHTML = \"\";\n upToQuestion = 0;\n\n //create a question\n mathQuestionElement = createParagraph(\"\", \"question\");\n\n var userAnswerDiv = createDiv();\n userAnswerDiv.id = \"userAnswerDiv\";\n\n //create an answer text bo...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
removeCourse(item) deletes the course specified (passed in as "item") looks through selectedCourses, finds, then delete
async removeCourse(item) { var res = this.state.selectedCourses; // look for the index and remove for (var i = 0 ; i < this.state.selectedCourses.length; i++) { if (this.state.selectedCourses[i] === item) { delete res[i] aw...
[ "function removeSavedCourse(book_item_id) {\n book_item_id.remove();\n}", "remove(item)\n {\n this.$store.commit('REMOVE_ITEM', item);\n \n this.selectBest();\n this.save();\n }", "removeCourse(token, id, idOfCourse) {\r\n return this._call('delete', `course/${id}`, { idOfC...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
move the selected strain in 'searchList' to selection list 'repList' to become the reference strain for the query
function setReference(searchList, repList) { ct = 0; selIndex = -1; for (i = 0; i < searchList.options.length; i++) { if (searchList.options[i].selected) { ct = ct + 1; selIndex = i; } } if (ct == 0) ...
[ "function unSetReference(searchList, repList)\n {\n if (repList.options.length > 0)\n {\n\t repList.options[0].selected = 1;\n\t moveOptions (repList, searchList);\n }\n }", "function updateList() {\n selectWithSearchDatasource.getSelectOptions(selectWithSearchModalControll...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Takes in MySQL UTC timestamp string Converts to local time Returns Javascript Date Object
function convertSqlTimestampToLocalObject(timestamp) { // string modifications timestamp = timestamp.replace("T", " "); timestamp = timestamp.substring(0, timestamp.length - 5); // split into year, month, day, etc var t = timestamp.split(/[- :]/); // create the date objects var date = new Da...
[ "function mysqlDateTimeToJSDate(datetime) {\n // Split timestamp into [ Y, M, D, h, m, s ]\n var t = datetime.split(/[- :]/);\n return new Date(t[0], t[1]-1, t[2], t[3], t[4], t[5]);\n}", "function mysqlDateTimeToJSDate(datetime) {\n\t// Split timestamp into [ Y, M, D, h, m, s ]\n\tvar t = datetime.split...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Renders the string representation of this Dsn. By default, this will render the public representation without the password component. To get the deprecated private representation, set `withPassword` to true.
function dsnToString(dsn, withPassword = false) { const { host, path, pass, port, projectId, protocol, publicKey } = dsn; return ( `${protocol}://${publicKey}${withPassword && pass ? `:${pass}` : ''}` + `@${host}${port ? `:${port}` : ''}/${path ? `${path}/` : path}${projectId}` ); }
[ "function dsnToString(dsn, withPassword = false) {\n const { host, path, pass, port, projectId, protocol, publicKey } = dsn;\n return (\n `${protocol}://${publicKey}${withPassword && pass ? `:${pass}` : ''}` +\n `@${host}${port ? `:${port}` : ''}/${path ? `${path}/` : path}${projectId}`\n );\n }...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Removes dish from menu
removeDishFromMenu(item) { this.menu = this.menu.filter(element => element.id !== item.id); this.notifyObservers({type: "menu", index: this.menu}); }
[ "removeDishFromMenu(id) {\n //TODO Lab 1\n }", "removeDishFromMenu(id) {\n this.menu = this.menu.filter(dish => dish.id !== id)\n }", "removeDishFromMenu(id) {\r\n this._menu = this._menu.filter(dish => dish.id != id);\r\n this.notifyObservers({change: \"dishRemoved\"});\r\n }", "removeDishFrom...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
creat svg text for showing repressing TFs
function createRTFs(){ var gc_enter=svg.selectAll("g") .append("text") .attr("class","RTFText") .attr("opacity",0) .attr("x","0em") .attr("y","0em") gc_enter.call(addRTFText,20); }
[ "function createEdgeTF(){\r\n\t\tvar gc_enter=svg.selectAll(\"g\")\r\n\t\t.append(\"text\")\r\n\t\t.attr(\"class\",\"TFText\")\r\n\t\t.attr(\"opacity\",0)\r\n\t\t.attr(\"x\",\"-10em\")\r\n\t\t.attr(\"y\",\"-3em\")\r\n\t\tgc_enter.call(addTFText,20);\r\n\t\t\r\n\t}", "function createEdgeTF(){\n\t\tvar gc_enter=svg...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
define function to open notes modal and populate existing data where applicable
function openNotesEditModal(e) { e.preventDefault(); dmpNotesModal.style.display = "block"; currentEditDay = e.target.dataset.jsEditNotes; currentEditDayNumber = parseInt( currentEditDay.charAt(currentEditDay.length - 1) ); currentDayDisplay = days[currentEditDayNumber - 1]; dmpNotesModa...
[ "function showModal() {\n client.interface.trigger(\"showModal\", {\n title: \"New Note\",\n template: \"modal.html\",\n data: \"\"\n }).then(function (data) {\n console.log(data)\n }).catch(function (error) {\n console.log(error);\n });\n}", "function notesModal(articleID) {\n // ajax call ge...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Instantiates new table params from source data files and current source data viewed
function refreshFileTables() { // extract current file ids for convenience var currentFileIds = $scope.currentSourceData.sourceDataFiles.map(function(item) { return item.id; }); // available: any items not in current file ids (not attached to viewed // sourceData) $scope.tpAvailable = ne...
[ "function refreshTables() {\n $scope.tpSourceDatas = new NgTableParams({}, {\n dataset : sourceDatas,\n counts : []\n // hides page sizes\n });\n $scope.tpSourceDataFiles = new NgTableParams({}, {\n dataset : $scope.currentSourceData ? $scope.currentSourceData....
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Conversion from grid coordinates to geodetic coordinates.
function grid_to_geodetic(x, y) { var lat_lon = new Array(2); if (central_meridian == null) { return lat_lon; } // Prepare ellipsoid-based stuff. var e2 = flattening * (2.0 - flattening); var n = flattening / (2.0 - flattening); var a_roof = axis / (1.0 + n) * (1.0 + n * n / 4.0 + n * n * n * n / 64.0...
[ "function internalCoordinatesToGrid(concept, grid) {\n self = getBoundingBox(concept.ref);\n return {\"left\": grid.x + concept.x * grid.width - self.width/2,\n \"top\": grid.y + concept.y * grid.height - self.height/2}\n}", "function OSGridToLatLong(gridRef) {\r\n var gr = gridrefLetToNum(gridR...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
2. The unique count of last names
async uniqueLastNameCount () { const nameData = await this.trimData(this.inFile) const lastNames = [] nameData.forEach((element) => { const lastNameData = element.split(' ')[1] lastNames.push(lastNameData) }) const uniqueLastNames = lastNames.filter(this.uniqueElement) console.log('2...
[ "async uniqueFirstNameCount () {\n const nameData = await this.trimData(this.inFile)\n const firstNames = []\n nameData.forEach((element) => {\n const firstNameData = element.split(' ')[0]\n firstNames.push(firstNameData)\n })\n const uniqueFirstNames = firstNames.filter(this.uniqueElement)...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
movePlayer() Updates player position based on velocity, wraps around the edges.
function movePlayer() { // Update position playerX = playerX + playerVX; playerY = playerY + playerVY; // Wrap when player goes off the canvas if (playerX < 0) { // Off the left side, so add the width to reset to the right playerX = playerX + width; } else if (playerX > width) { // Off the righ...
[ "function movePlayer() {\n // Update position\n playerX += playerVX;\n playerY += playerVY;\n\n // Wrap when player goes off the canvas\n if (playerX < 0) {\n // Off the left side, so add the width to reset to the right\n playerX += width;\n } else if (playerX > width) {\n // Off the right side, so s...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
stringToWords: converts a continuous block of text into and array of words, parsed spans of words, and the height of the box
function stringToWords(sentence, box) { var fontSize = 20; var fontHeight = 24; var space = 6; //blank space is 5 pixels var splits = new Array(); var wordBundle = { words: [], parsed: "", boxHeight:0}; var x = 0; var y = 0; splits = sentence.split(" "); for (var i = 0; i < splits.length(); i++) { var text ...
[ "words(string) {\n return string.split(' ');\n }", "words(string){\n const wrds = string.split(' ');\n return wrds\n }", "words(string){\n return string.split(' ');\n }", "function getIndividualWords(string){\n\t\t\tlet words = new Array();\n\n\t\t\tlet nextSpace = string.in...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Rewinds the animation to the first frame.
rewind() { this.frame = 0; }
[ "rewind()\n {\n this.animfinished = false;\n this.frame = 0;\n }", "reset() {\n this.currentFrame = 0;\n }", "function resetAnimation() {\n m_animationState.currentTime = new Date(m_animationState.range.start.getTime());\n }", "function firstAnimationState() {\n ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Call load on our SegmentLoaders
load() { this.mainSegmentLoader_.load(); if (this.audioPlaylistLoader_) { this.audioSegmentLoader_.load(); } }
[ "load() {\n this.mainSegmentLoader_.load();\n if (this.mediaTypes_.AUDIO.activePlaylistLoader) {\n this.audioSegmentLoader_.load();\n }\n if (this.mediaTypes_.SUBTITLES.activePlaylistLoader) {\n this.subtitleSegmentLoader_.load();\n }\n }", "function loadSegments() {\n var regions = J...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
handleClick resets the input form, and resets the displayed tab to display list
handleClick () { this.props.returnToTab(); this.form.value=""; }
[ "function toggleTabList() {\n let chromeTab = document.querySelector('.chrome-tab-switch');\n\n if (chromeTab.classList.contains('show')) {\n chromeTab.classList.remove('show');\n } else {\n chromeTabModule.getAllTabs(chromeTabModule.constructTabs);\n chromeTab....
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Returns the ID from an element if none is found, returns the ID of the closest parent that does
function getId(element) { return $(element).closest('[id]').attr('id'); }
[ "function getParentId(element) {\n let pNode = element.parentNode;\n if (pNode !== undefined && (pNode.tagName === 'A' || pNode.tagName === 'DIV')) {\n if (pNode.hasAttribute(\"id\")) {\n return pNode.getAttribute(\"id\");\n } else if (pNode.hasAttribute(\"name\")) {\n retu...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Handles the click on the color 'buttons' in the sample code app. It uses the dell.led API to change the color of the LED to the chosen color clicked by the user.
function handleColorClick(event) { event.preventDefault(); var color = event.target.className; /* color should be valid following dell.led.colors array */ dell.led.changeColor(color); chrome.runtime.sendMessage({ color: color }, null); currentSelectedColor = color; }
[ "function colorButtonHandler() {\n\t\tArray.prototype.forEach.call(playersColorsButtons, (btn) => {\n\t\t\tbtn.addEventListener(\"click\", (e) => {\n\t\t\t\tlet btnStyle = window.getComputedStyle(btn);\n\t\t\t\tlet color = btnStyle.getPropertyValue(\"background-color\");\n\t\t\t\te.preventDefault();\n\t\t\t\tbtn.cl...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Filter spaces based on booking rules
function filterSpacesRules(list = [], building_settings, host, options) { return list.filter((space) => { var _a; const booking_rules = (_a = building_settings[space.level.parent_id].details) === null || _a === void 0 ? void 0 : _a.booking_rules; const { date, all_day, duration, visitor_type...
[ "filterSpaces(list) {\n const settings = this._org.building_settings;\n const res = Object(_bookings_src_lib_booking_utilities__WEBPACK_IMPORTED_MODULE_7__[\"filterSpacesRules\"])(list, settings, this._staff.current, Object.assign({}, this._data));\n return res;\n }", "function filterAccom...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Installs a `TargetObservers` for the provided target (if not already installed), and replaces the given property with a getter and setter that will respond to changes and call `TargetObservers`. Subsequent calls to `installObserver()` with the same target and property will not override the property's previously install...
function installObserver(target, property) { var observersMap = new Map(); if (!allTargetObservers.has(target)) { allTargetObservers.set(target, { isEnabled: true, getObservers: function (key) { var observers = observersMap.get(key) || []; ...
[ "function installObserver(target, property) {\n var observersMap = new Map();\n if (!allTargetObservers.has(target)) {\n allTargetObservers.set(target, {\n isEnabled: true,\n getObservers: function (key) {\n var observers = observersMap.get(key) || [];\n ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
update selection list of days based on selected month and year
function updateDays() { var pickedDay = document.getElementById("pickDy"); var dates = pickedDay.getElementsByTagName("option"); var pickedMonth = document.getElementById("pickMo"); var pickedYear = document.getElementById("pickYr"); var selectedMonth = pickedMonth.options[pickedMonth.selectedIndex].valu...
[ "function set_days_in_month() {\n\tvar month_number = $('select.month').val();\n\tvar year = $('select.year').val();\n\tvar days_in_month = new Date(year, month_number, 0).getDate();\n\tvar html = \"\";\n\tvar selected = \"\";\n\tvar tomorrow = new Date();\n\tvar leadingZeroDay = \"\";\n\ttomorrow.setDate(tomorrow....
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Deletes the current chatroom(document) and its messages(documents in subcollection)
async deleteChatroom(room_info) { //Retrieve an instance of our Firestore Database const db = firebase.firestore() //Delete messages(documents in subcollection) in the chatroom let messagesRef = await db.collection('chat-rooms').doc(room_info.creator_uid).collection('messages') await messagesR...
[ "function deleteChat(chat_id, model_chat, user_model){\n model_chat.findByIdAndDelete(chat_id,function(err){\n if(err){\n console.log(err);\n }else{\n console.log(\"Chat successfully deleted\");\n user_model.updateMany({Chats:chat_id},{$pull:{Chats:chat_id}}, function(err){\n if(err){\n...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Gets the top X skiers by district
async function getSkiersByDistrict(listSetID, numSkiersPerGender) { let skiers = await combineLists(listSetID); skiers = _.filter(skiers, skier => skier.age <= config.districtComp.maxAge); const unListedClubs = _(skiers) .filter(skier => !skier.district) .map('club') .uniq() .valueOf(); if (!_.isEmpty...
[ "function getTop20Wells(){\r\n var allWells = d3.entries(idv.wellMap);\r\n allWells.sort (function(a, b) {\r\n return b.value.radius- a.value.radius;\r\n });\r\n var topWells = [];\r\n for (var i=0;i<numNeighbor+1;i++){ //numNeighbor is defined in select.js \r\n topWells.push(allWells[i].value);\r\n }...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Update the sizes of the combos according to their children Used for combos nonoverlap, but not rerender the combo shapes
updateComboSizes(comboMap) { const self = this; const comboTrees = self.comboTrees; const nodeMap = self.nodeMap; const nodeSize = self.nodeSize; const comboSpacing = self.comboSpacing; const comboPadding = self.comboPadding; (comboTrees || []).forEach(ctree => { ...
[ "updateComboSizes(comboMap) {\n const self = this;\n const comboTrees = self.comboTrees;\n const nodeMap = self.nodeMap;\n const nodeSize = self.nodeSize;\n const comboSpacing = self.comboSpacing;\n const comboPadding = self.comboPadding;\n (comboTrees || []).forEach...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Clear filtered columns visual indicator (background color)
clearActiveColumns() { let tf = this.tf; tf.eachCol((idx) => { removeClass(tf.getHeaderElement(idx), this.headerCssClass); if (this.highlightColumn) { this.eachColumnCell(idx, (cell) => removeClass(cell, this.cellCssClass)); } ...
[ "function filterClearCrosstable ()\n{\n\n hdr = crosstable.Crosstable.Horizontal.header;\n for (var n = 0; n < hdr.length; n++) {\n hdr[n][0].hide = 0;\n }\n hdr = crosstable.Crosstable.Vertical.header;\n for (var n = 0; n < hdr.length; n++) {\n hdr[n][0].hide = 0;\n }\n return;\n}", "_clearRowFilter...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
A narrative documentation view that provides a text editor that allows the user to type in free text documentation.
function FreeTextDocumentationView() { }
[ "function TextEditor() {}", "function showDocumentation() {\n console.log('showDocumentation clicked');\n\n var $this = $(this);\n var src = DEFAULTS.SDK_DOC_URL + $this.data('href');\n\n window.TTB._modal({\n id: 'doc-modal',\n sizeClass: 'modal-full',\n title: 'Documentation <a class=...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
hrHR validation function (Osobni identifikacijski broj (OIB), persons/entities) Verify TIN validity by calling iso7064Check(digits)
function hrHrCheck(tin) { return algorithms.iso7064Check(tin); }
[ "function hrHrCheck(tin) {\n return algorithms.iso7064Check(tin);\n}", "function hrHrCheck(tin) {\n return iso7064Check(tin);\n}", "function svSeCheck(tin) {\n // Make copy of TIN and normalize to two-digit year form\n var tin_copy = tin.slice(0);\n if (tin.length > 11) tin_copy = tin_copy.slice(2)...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Replace IMG to EMBED
function img2embed2(code) { if (useXHTML == 1) { code = code.replace(/<\/embed\/?>/gi, ""); } c1 = /(<img[^>]*?name2="([\s\S]*?)"[^>]*?>)/gi; code = code.replace(c1,function(s1,s2,s3){ r1 = s2.match(/width\s*[:|=]\s*(\S+)[%|px]?/gi); r2 = s2.match(/height\s*[:|=]\s*(\S+)[%|px]?/gi); s3 = unes...
[ "function replace_em(str){\n\t$.each(face,function(i){\n\t\tif(str.contains(i)){\n\t\t\tstr = str.replace(i,'<img src=\"img/face/'+face[i]+'\"/>');\n\t\t}\n\t});\n\treturn str;\n}", "function imagePreservation(article){\n var imageRegex = /\\[\\[\\s*File:.*\\]\\]/g;\n images = article.match(imageRegex);\n ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Marca las cookies como aceptadas
function aceptarCookies () { // Oculta el HTML de cookies ocultarAviso(); // Guarda que ha aceptado miLocal.setItem('cookie', true); }
[ "_parseDivolteCookies() {\n const dvp = this._getCookie(this.divoltePartyCookie);\n if (dvp) {\n this.party = { id: dvp };\n this.partyIsNew = false;\n }\n const dvs = this._getCookie(this.divolteSessionCookie);\n if (dvs) {\n this.session = { id: dvs, accessTime: now() };\n this....
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
INVERSE KINEMATICS /// Resolvedrate IK with geometric jacobian //////////////////////////////////////////////// CS148: generate joint controls to move robot to move robot endeffector to target location / CS148: reference code has functions for: robot_inverse_kinematics iterate_inverse_kinematics
function robot_inverse_kinematics(target_pos, endeffector_joint, endeffector_local_pos) { // compute joint angle controls to move location on specified link to Cartesian location if (update_ik) { iterate_inverse_kinematics(target_pos, endeffector_joint, endeffector_local_pos); endeffector_geom....
[ "function robot_inverse_kinematics(target_pos, endeffector_joint, endeffector_local_pos) {\n\n\t// compute joint angle controls to move location on specified link to Cartesian location\n\tif (update_ik) {\n\n\t\titerate_inverse_kinematics(target_pos, endeffector_joint, endeffector_local_pos);\n\t\tendeffector_geom....
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Get Custom Media from CSS File / ==========================================================================
function getCustomMediaFromCSSFile(_x) { return _getCustomMediaFromCSSFile.apply(this, arguments); }
[ "async function importCustomMediaFromCSSFile(from) {\n\tconst css = await readFile(path.resolve(from));\n\tconst root = postcss.parse(css, { from: path.resolve(from) });\n\n\treturn importCustomMediaFromCSSAST(root);\n}", "function importCustomMediaFromCSSAST(root) {\n\treturn getCustomMedia(root, { preserve: tru...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Validates a text to be shorter than 1000 characters.
function validateText(value, field) { if (value === field.unknown) return [] return value !== undefined && value.length <= 1000 ? [] : ['Text too long (< 1000 characters)'] }
[ "function isLengthOK(name) {\n var limit = 50;\n return name.trim().length <= limit;\n}", "function validateLength(text){\n\treturn text.length <= 15;\n}", "function isValidLength1000(str3)\n{\n\tvar slen3=str3.length\t\n\tif (slen3>1000)\n\t\t{return false;}\n\telse\n \treturn true;\n}", "function isLon...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
set disclaimer cookie to yes upon clicking
function setDisclaimer(value) { document.cookie = "acceptedDisclaimer=" + value; }
[ "function cookieYes() {\n\tvar d = new Date();\n\td.setTime(d.getTime() + (cookieLife * 24 * 60 * 60 * 1000));\n\tvar expires = 'expires=' + d.toUTCString();\n\tdocument.cookie = 'cookie_yes=yes; ' + expires + '; path=/';\n\tdocument.getElementById('cookie-banner').style.display = 'none';\n}", "function yesPlease...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
function is_template (to be called by createPTTables) Parameters: table: the array of the "landmarks" of the conformity table. col2_data: array of data of column 2 in the current sheet col3_data: array of data of column 3 in the current sheet active_spreadsheet: the active spreadsheet Returns: true if it's a template. ...
function is_template(table, col2_data, col3_data, active_spreadsheet) { var template_specs_sheet = active_spreadsheet.getSheetByName("TemplateSpecs"); var template_specs_last_row = template_specs_sheet.getDataRange().getLastRow(); var t_col2_data = template_specs_sheet.getRange(1,2,template_specs_last_row,1).getV...
[ "function isTemplate(value) {\n return (\n typeof value == \"object\" &&\n value.source &&\n value.data\n );\n}", "get _hasUserProvidedTemplate() {\n\t\tvar template = dom(this).querySelector('template');\n\t\treturn Boolean(template);\n\t}", "function supportsTemplate() {\n return...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Write a function firstListItem that does not accept any parameters. The function should use a firstchild selector to return the first list item in the ul with the ID piclist.
function firstListItem(){ // console.log($('#pic-list:first-child')) return $('#pic-list li:first-child') }
[ "function firstListItem()\n{\n return $('ul[id=\"pic-list\"] li:first')\n}", "function firstListItem() {\n return $('#pic-list li:first-child');\n}", "function firstListItem(){\n return $('ul#pic-list li:first-child');\n}", "function firstListItem() {\n return $('div ul li:first-child')\n}", "function f...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
looks for an given Note On event in a given step's action list and removes it if present. returns true if Note On event is found and removed, otherwise false.
function unsetNoteOnEvent(stepNumber, instrumentIndex, noteNumber) { var searchResult = findNoteOnEvent(stepNumber, instrumentIndex, noteNumber); if (searchResult >= 0) { // remove the action found by the search step[stepNumber].actionList.splice(searchResult, 1); // update sequencer grid to reflect the change ...
[ "function removeEvent(o, e, f, s)\n{\n\tfor(var i = (e = o[\"_on\" + e] || []).length; i;)\n\t\tif(e[--i] && e[i][0] == f && (s || o) == e[i][1])\n\t\t\treturn delete e[i];\n\treturn false;\n}", "function removeNote(e) {\n var noteToRemove = e.path[1];\n for (var i = 0; i < notesArray.length; i++) {\n if (no...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }