query
stringlengths
9
34k
document
stringlengths
8
5.39M
negatives
listlengths
19
20
metadata
dict
assignGraph Function to bind te drawGraphPie function to the button prssed to update the graph with a new amount of taxes paid
function assignGraph() { let elem = document.querySelector('#update_graph') elem.addEventListener('click', function(){ let taxes_paid = +document.querySelector('#taxes_paid').value; fetch('static/data.json') .then(resp=>resp.json()) .then(budget => { docu...
[ "function redrawPAR1PieChart() {\n nv.addGraph(function () {\n var chart = nv.models.pieChart()\n .x(function (d) {\n return d.label\n })\n .y(function (d) {\n ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Handle styling of jumbotrons.
function styleJumbotrons() { $('.jumbotron-fade').each(function() { if (document.body.scrollTop > $(this).offset().top) { $(this).addClass('brightness-50'); $(this).children().addClass('opacity-50'); } else { $(this).removeClass('brightness-50'); $(thi...
[ "function createJumboTron() {\n // $(\"#mainContainer2\").append($(\"<div>\").addClass(\"container\").attr(\"id\", \"entry-text-container\"));\n $(\"#mainContainer2\").append($(\"<div>\").addClass(\"entry-text\").attr(\"id\", \"entry-text-container\"))\n $(\"#entry-text-container\").append($(\"...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Return last descendant of a BookmarkNode (return BN itself if no child)
function BN_lastDescendant (BN) { let children = BN.children; if (children == undefined) { return(BN); } let len = children.length; if (len == 0) { return(BN); } return(BN_lastDescendant(children[len-1])); }
[ "function last_child( par )\r\n{\r\n var res=par.lastChild;\r\n while (res) {\r\n if (!is_ignorable(res)) return res;\r\n res = res.previousSibling;\r\n }\r\n return null;\r\n}", "function TreeNode_getLastChild() {\n if (debug) alert(\"TreeNode@\"+this.identifier+\".getLastChild()\");\n\treturn (this.g...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
setter to update timeLeft value
set timeLeft(time){ this.currentTimeInput.value = this.renderTime(time); }
[ "function setTimeLeft(seconds) {\n\ttimeLeft = seconds\n}", "setTimeLeft(_pos) {\r\n\t\tthis.time = _pos*60;\r\n\t}", "function _setUpTimeLeft() {\n _timeLeft.amount = _timeLimit;\n}", "function setTimeLeft(newTimeLeft)\n {\n \tquestionStartTime = getGameTime()+newTimeLeft-globals.questionDuration*1000;\...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Abre un picklist DIV + IFRAME id: ID del elemento donde sera posicionado el picklist, y sera llenado el valor de tipo PK (comunmente) seleccionado en el picklist idCtl: ID del elemento en donde sera llenado el texto seleccionado en el picklist url: URL en donde se encuentra el action que sera mostrado como picklist anc...
function pickOpen(id, idCtl, url, ancho, altura, isMovil) { if (pickControl!=null) pickClose(); //verifica si existe el textbox var obj = document.getElementById(id); if (obj==null) { alert("ERROR (pickOpen): no existe un elemento con ID: " + id); return; } pickControl = id; idControl = idCtl; ...
[ "function jsPickList (id) {\n\t// identities\n\tthis.inheritsFrom(new jsObject(id || \"jsPickList\"));\n\tthis.name\t\t\t\t= this.id;\n\t\n\t// collections\n\tthis.options\t\t\t= new Array();\n\t\n\t// properties\n\tthis.listsize\t\t\t= 8;\n\tthis.style\t\t\t\t= \"width:200px;\";\n\tthis.cssClass\t\t\t= \"\";\n\t\n...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Represents a "main group", i.e. a tab for a single pref object.
function PrefMainGroup(parent, name) { // Init this group's object. this.parent = parent; // Private data for pref object. this.name = name; this.groups = new Object(); this.label = getMsg("pref.group." + this.name + ".label", null, this.name); this.tab = document.createElement("tab"); this...
[ "getMainGroup() {\n return this.groups[0];\n }", "function PrefSubGroup(parent, name)\n{\n this.parent = parent; // Main group.\n this.name = name;\n this.fullGroup = this.parent.name + \".\" + this.name;\n this.label = getMsg(\"pref.group.\" + this.fullGroup + \".label\", null, this.name);...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Serialize this species to an object.
serialize() { const genomes = this.genomes.map((genome) => { return genome.serialize(); }); this.maxFitness = Math.max(this.maxFitness, this.calculateMaxFitness()); return { genomes: genomes, staleness: this.staleness, maxFitness: this.maxF...
[ "newSpecies(obj) {\n this.species[obj.name] = new Species(obj);\n }", "toString() {\n return this.name + ' is part of the ' + Panda.scientificName() + ' species';\n }", "toString() {\n return this.name + ' is part of the ' + Penguin.scientificName() + ' species';\n }", "serialize() {...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
The core logic of reliable submission. Polls the ledger until the result of the transaction can be considered final, meaning it has either been included in a validated ledger, or the transaction's lastLedgerSequence has been surpassed by the latest ledger sequence (meaning it will never be included in a validated ledge...
async waitForFinalTransactionOutcome(transactionHash, sender) { const ledgerCloseTimeMs = 4 * 1000; await sleep(ledgerCloseTimeMs); // Get transaction status. let rawTransactionStatus = await this.getRawTransactionStatus(transactionHash); const { lastLedgerSequence } = rawTransac...
[ "async verifyAndSubmit(prunedMessage) {\n\n let orderedPlayers = _.orderBy(this.players, ['playerNumber'], ['asc']);\n let firstPlayer = _.minBy(orderedPlayers, 'playerNumber');\n let lastPlayer = _.maxBy(orderedPlayers, 'playerNumber');\n let me = _.find(this.players, { isMe: true });\n\n // If we g...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Returns an array of numOutputs arrays
function generateOutputComps(numOutputs) { let outputComps = []; for (var i = 0; i < numOutputs; i++) outputComps.push([]); return outputComps; }
[ "get numberOfOutputs() {\n if (isDefined(this.output)) {\n return this.output.numberOfOutputs;\n }\n else {\n return 0;\n }\n }", "get numberOfOutputs() {\n if (Object(_util_TypeCheck__WEBPACK_IMPORTED_MODULE_1__[\"isDefined\"])(this.output)) {\n ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Puts bomb and updates map.grounds and starts trigger
putBomb() { // search position of player let left = this.x * widthCase; let top = this.y * widthCase; //create bomb let id = "bomb" + this.bombs.length; const bomb = document.createElement('div'); bomb.style.position = "absolute"; bomb.className = 'bomb'...
[ "putBomb() {\n\n // search position of player\n let left = this.x * widthCase;\n let top = this.y * widthCase;\n\n //create bomb\n let id = \"bomb\" + this.bombs.length;\n const bomb = document.createElement('div');\n bomb.style.position = \"absolute\";\n bomb...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Set up the composer to use the currentlychosen effects stack.
function createEffectComposer (composer, scene, camera) { composer.reset(); // Every effects stack starts by just rendering the scene. composer.addPass(new RenderPass(scene, camera)); EFFECT_STACKS[$("select[name=aestheticSelect]").val()](composer); }
[ "setComposer() {\n\t\tthis.composer = new Wagner.Composer(this.renderer);\n\n\t\tthis.passes = [\n\t\t\tnew NoisePass({\n\t\t\t\tamount: .05\n\t\t\t}),\n\t\t\tnew VignettePass({\n\t\t\t\tboost: 1,\n\t\t\t\treduction: .4\n\t\t\t})\n\t\t];\n\t}", "function setup () {\n\n\tupdateTitle();\n\n\tvar views = viewCompone...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
find out how many elements 5% is sort the array remove the first 5%, then the last 5% calculate the mean
function meanOfArray(arr){ let numToRemove = Math.floor(arr.length / 100 * 5) arr.sort((a, b) => a - b) for (let i = 0; i < numToRemove; i++){ arr.shift() arr.pop() } const sum = arr.reduce((sum, num) => sum + num) return sum / arr.length }
[ "function findMedian(arr) {\n var sorted = arr.sort((x,y)=>x-y);\n //console.log(sorted)\n return sorted[(arr.length/2) - 0.5];\n}", "function betterThanAverage(arr) {\n var sum = 0;\n for(var i =0;i<arr.length;i++){sum+=arr[i]}\n var count = 0\n for(var i =0;i<arr.length;i++){\n if(ar...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Test the error handling on the boundaries of the queue.
function testUnderflow() { var hpq = createQueue(); try { pop(hpq); fail(); } catch (ex) { } }
[ "function checkErrors() {\n if(error_count >= 10)\n failover();\n\n // Reset the error counter\n error_count = 0;\n}", "function check_queue_input() {\n\t// Check if the queue is too short (not enough data for a complete message yet)\n\tif (proto[module_name].queue_input.length < proto[module_name].length_m...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Creates a new JSA CAS Frame from the given JSON frame.
static fromJSON(jsnframe) { var frame; //-------- frame = new CASFrame(); frame.setFromJSON(jsnframe); return frame; }
[ "setFromJSON(jsnframe) {\nvar JMPHS, bones, morphs;\n//----------\nJMPHS = jsnframe.morphs;\nmorphs = JMPHS.length === 0 ? null : JMPHS.map(CASMorph.fromJSON);\nbones = jsnframe.bones.map(CASTRSet.fromJSON);\nreturn this.set(jsnframe.time, jsnframe.duration, bones, morphs);\n}", "static fromJSON(json) {\n if (...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Builds out the dynamic html option for the select color select element.
function buildDynamicSelectColorHtml() { var html = ''; for (key in DiagramService.COLORS) { let color = DiagramService.COLORS[key]; html += '<option value="' + key + '">' + color.name + '</option>'; } _$selectColor.html(html); return this; }
[ "function _selectTag() {\n var html = '<select name=\"style\" tabIndex=\"1\">';\n html += _.map(editor.opts.imageMediaStyles, function(style) {\n var label = style.charAt(0).toUpperCase() + style.substring(1).replace(/_/, ' ');\n return '<option value=\"'+ style +'\">'+ label +'</option>';\n }).j...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Step 6: Total Refunds Issued
function singleClickRefundsIssued(){ runReportAnimation(30); //of Step 5 which takes 5 units //Refunded but NOT cancelled $.ajax({ type: 'GET', url: COMMON_LOCAL_SERVER_IP+'/'+SELECTED_INVOICE_SOURCE_DB+'/_design/refund-summary/_view/allrefunds?startkey=["'+fromDate+'"]&endkey=["'+toDate+'"]', timeo...
[ "function withdrawals() {\n let totalwithdrawals = user.transactionsMonthToDate.reduce(\n (total, currentAmount) => {\n let withdrawal = 0;\n if (currentAmount.type == \"withdrawal\") {\n withdrawal = currentAmount.amount;\n } else {\n currentAmount.amount = 0;\n }\n retur...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Pass render and setUserNav functions over the context object
function decorateContextFunction(ctx, next) { ctx.render = (content) => render(content, document.querySelector('main')); ctx.setUserNav = setUserNav; next(); }
[ "render() {\n return <NavigationContainer>{this.authHandler()}</NavigationContainer>;\n }", "renderMenu() {\n if (this.props.loggedIn) {\n return MenuAuth(this.props.user);\n } else {\n return MenuUnauth();\n }\n }", "render(){\n return(\n <nav>\n <h1>\n <Link to='/...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
when the user presses down, create the curve objects and add the first point
function drawStart(e) { curves = createCurves() addPoint(e) }
[ "function pointStart(){\n\tif((shapes || line) && !onObject && !select){\n\t\tstartDraw = true;\n\t\tif(!closedPath){\n\t\t\tvar lastpoint = pointsArray[pointsArray.length - 1];\n\t\t\tpointsArray.push([mousePos.x, mousePos.y]);\n\t\t\tclickCount = 1;\n\t\t\tif(pointsArray.length > 1){\n\t\t\t\tif(pointsArray[0] &&...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
transfers letters to the list for player two
function transferLetterTwo() { const index = Math.floor(Math.random() * letterPool.length); const letter = letterPool[index]; setLettersTwo({ type: 'add', value: letter }) setLetterPool({ type: 'remove', value: letter }) }
[ "function transferLetterOne() {\n const index = Math.floor(Math.random() * letterPool.length);\n const letter = letterPool[index];\n setLettersOne({\n type: 'add',\n value: letter\n })\n setLetterPool({\n type: 'remove',\n value: letter\n })\n }", "function displayPlay() {\r...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Calls Authorize of AFTERPAY
function Authorize(args) { var authorizationStatus = require('~/cartridge/scripts/payment/processor/AFTERPAY').Authorise(args); Logger.debug("Authorization response in AFTERPAY_CREDIT: "+JSON.stringify(authorizationStatus)); if(authorizationStatus.authorized) { return {authorized: true}; } else { return { ...
[ "function Authorize(args) {\n var paymentMethod = session.forms.billing.paymentMethods.selectedPaymentMethodID.value,\n orderNo = args.OrderNo,\n paymentInstrument = args.PaymentInstrument,\n order = args.Order,\n HiPayLogger = require(\"~/cartridge/scr...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
TODO Using what's in the query parameters and the value of Image.uri, create a queryParams object that will be sent to osd viewer. The logic is as follows: regarding channel info (url, aliasName, channelName, pseudoColor, isRGB) if url is defined on query parameter, get all the channel info from query parameter. otherw...
function initializeOSDParams (pageQueryParams, imageURI) { var loadImageMetadata = true, imageURIQueryParams = {}; var osdViewerParams = { mainImage: {zIndex: context.defaultZIndex, info: []}, channels: [], annotationSetURLs: [], z...
[ "function getQueryParams() {\n var queryStringsString = self.location.search;\n var queryStrings = queryStringsString.split(\"?\");\n if (queryStrings.length < 3 || !queryStringsString.includes(\"=\")) {\n invalidArgs()\n throw \"Invalid args\"\n }\n var imageUrl;\n if (queryStrings[1].startsWith(FILE_N...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Since TextEditor.edit returns a thenable but not a promise, this is a convenience function that calls TextEditor.edit and returns a proper promise, allowing for chaining
function editorEdit(editor, callback, options) { return new Promise((resolve, reject) => { editor.edit(callback, options).then((success) => { if (success) { resolve(true); } else { console.log('vscode-indent-to-bracket: Edit failed.'); ...
[ "function editOnInput(){var domSelection=global.getSelection();var anchorNode=domSelection.anchorNode;var isCollapsed=domSelection.isCollapsed;if(anchorNode.nodeType!==Node.TEXT_NODE){return;}var domText=anchorNode.textContent;var editorState=this.props.editorState;var offsetKey=nullthrows(findAncestorOffsetKey(anc...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Set for the imaginary y component
set y(value) {this._y = value;}
[ "set y(value) {\r\n this._y = value;\r\n this.updateY();\r\n }", "set y(val) {\n this.m[1] = val;\n }", "function FSS_SetCoordY(y, i)\n{\n\tthis.coordY[i] = y;\n}", "set y (y) {\n this.data.y = y;\n this.updateCss();\n }", "set y(y) {\n this._y = y\n this._clear()\n }", "set...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Check for ssh keys, used for connection vm
_checkAndGenerateSSHKeys() { var file = config('agent:vm:ssh_key'); return fsAsync.exists(file).then((exist) => { if (!exist) { this.info('configure.generating_key'); var script = ` set -x; ssh-keygen -t rsa -f ${file} -N ''; result=$?; set +x; echo ...
[ "_checkAndGenerateSSHKeys() {\n var file = config('agent:vm:ssh_key');\n return qfs.exists(file).then((exist) => {\n if (!exist) {\n this.info('configure.generating_key');\n var script = `\n set -x;\n ssh-keygen -t rsa -f ${file} -N ''; result=$?;\n set +x;\n ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Given imgId of the form group/name return [group, name].
function fromImgId(imgId) { const nameIndex = imgId.lastIndexOf(NAME_DELIM); assert(nameIndex > 0); return [imgId.substr(0, nameIndex), imgId.substr(nameIndex + 1)]; }
[ "function toImgId(group, name, type) {\n let v = `${group}${NAME_DELIM}${name}`;\n if (type) v += `${TYPE_DELIM}${type}`\n return v;\n}", "function getAgeGroupById(id){\n\t\tfor(var i = 0; i < age_groups.length; i++){\n\t\t\tif(age_groups[i]['id'] == id){\n\t\t\t\treturn age_groups[i]['name'];\n\t\t\t}\n\t\t}\...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Trigger the powerup for the player at the location
function powerTrigger(player, posX, posY) { //Check which player triggered the powerup //This client's player if (player == currentPlayer) { //Movement powerup if (map[((posY*mapWidth)+posX)] == 4) { window.dispatchEvent(thisPlayerMovePow); } //Vision ...
[ "function powerupPlayer(player, powerup){\r\n\tif(powerup.a_damage){\r\n\t\tplayer.poweredUp = true;\r\n\t\tplayer.damage = 2;\r\n\t}else if(powerup.m_speed){\r\n\t\tplayer.poweredUp = true;\r\n\t\tplayer.speed = 10;\r\n\t}else if(powerup.a_speed){\r\n\t\tplayer.poweredUp = true;\r\n\t\tplayer.attackSpeed = 2;\r\n\...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
the colour id tool shows the player what colour room they're in as well as facing
function colourID () { if (colourIDActivated == true) { $('.info').remove(txt); if (room[r][f] == undefined || room[r][f] == null) { facing = "none"; } else { facing = room[room[r][f]][4]; } var txt = $("<p class='info'>" + "room: " + room[r][4] + "<br/>" + "facing-r...
[ "function colorPlayer(){\n var info = [];//array for return information about that player\n colorTimes++;//Changing a var(colorTimes) on line 21\n var color = \"\";//player color var\n var coordX,coordY;//player coord x and y for canvas\n if(colorTimes == 1){//if for blue color\n color = \"Blue\";\n coor...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Returns number of milliseconds in the `count` of time `unit`. Available units: "millisecond", "second", "minute", "hour", "day", "week", "month", and "year".
function getDuration(unit, count) { if (!_utils_Type__WEBPACK_IMPORTED_MODULE_0__["hasValue"](count)) { count = 1; } return timeUnitDurations[unit] * count; }
[ "function getDuration(unit, count) {\n if (!$type.hasValue(count)) {\n count = 1;\n }\n\n return timeUnitDurations[unit] * count;\n}", "function getDuration(unit, count) {\n if (!hasValue(count)) {\n count = 1;\n }\n return timeUnitDurations[unit] * count;\n}", "function getDuration(unit, ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
retrieve gifs from storage
function getStoredGifs () { // if gifs array is stored in localStorage, retrieve and parse if (localStorage.getItem('gifs')) { return JSON.parse(localStorage.getItem('gifs')); } else { return []; // array for holding gifs } }
[ "getMyGifFromLocalStorage() {\n return JSON.parse(localStorage.getItem(\"mygifs\"));\n }", "function getGifs() {\n\tlet dirPath = path.join(__dirname, 'public/gifs');\n \n let allGifs = [];\n\n // Retrieve all file names located at the first level of our backend directory\n let files = fs.readd...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Returns ad groups keyed by ad group id based on productData also keyed by ad group id.
function getAdGroups(productData) { var adGroups = {}; var adGroupIterator = AdWordsApp.shoppingAdGroups().withIds(Object.keys(productData)).get(); while(adGroupIterator.hasNext()){ var adGroup = adGroupIterator.next(); adGroups[adGroup.getId()] = adGroup; } return adGroups; }
[ "function getAttributeGroupsForProduct(productId) {\n\t\t\tif(!productId || !cache.isValid) {\n\t\t\t\treturn null;\n\t\t\t}\n\n\t\t\tif(productToAttributeGroupsMap[productId]) {\n\t\t\t\treturn null;\n\n\t\t\t}\n\n\t\t\treturn productToAttributeGroupsMap[productId];\n\n\t\t}", "groupByProductType()\n {\n ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Get video by category id for badge
function GetVideosByCategoryId(id) { return $resource(_URLS.BASE_API + 'getVideosByCategoryId/' + id + _URLS.TOKEN_API + $localStorage.token).get().$promise; }
[ "function GetVideoByCategoryId(id) {\n return $resource(_URLS.BASE_API + 'get_video_by_category_id/' + id + _URLS.TOKEN_API + $localStorage.token).get().$promise;\n }", "function getVideo(id) {\n\t\t \t//https://www.googleapis.com/youtube/v3/videos?id=7lCDEYXw3mM&key=YOUR_API_KEY&part=snippet,co...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
check if product has required keywords
function checkKeywords(product, keywords) { if (!keywords.length) { return true; } let productName = product.getElementsByClassName('name-value')[0].innerText.trim().toLowerCase(); let specs = product.getElementsByClassName('chipset-value')[0].innerText.trim().toLowerCase(); for (let keyword of keywords...
[ "function checkRequiredKeywords()\n{\n\n var ret = true;\n var tbl = ge(\"keywordTable\");\n\n if (tbl)\n {\n\n var arr = tbl.getElementsByTagName(\"input\");\n\n for (var i=0;i<arr.length;i++)\n {\n\n var kid = arr[i].getAttribute(\"keyword_id\");\n var req = arr[i].getAttribute(\"required\");...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
the end game function is triggered by the server message of "end game" where the function then plays the end game sound, and resets the appropriate variables, makes all players come back to life,
function endGame(){ //plays the end game audio window.window.deathsound.play(); //sets timeout of 2.5 seconds so the game doesnt reset straight away setTimeout((function(){ window.reset();//resets game variables console.log("Resetting the game"); localPlayer.resetHealth(); //resets players health //makes al...
[ "function end() {\n game.end();\n console.log('End!!, thank you for playing');\n }", "function endGame() {\r\n\t\tgameOver = true;\r\n\t\tsetMessage2(\"Game Over\");\r\n\t}", "function endSala() {\r\n\tgame.endSala();\r\n}", "endGame() {\n setTimeout(function () {\n collectedItemsFin....
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
scroll up and show video trailer used in movie and tv detail
showVideoOnTop(){ this.scrollToTop(200) this.box.video = !this.box.video }
[ "function setupScrollVideoTray() {\n var itemWidth = parseInt($('.video-thumb').css('width'), 10);\n var trayWidth = tray.width();\n var itemsPerSection = Math.round(trayWidth/itemWidth)-1;\n\n $('#ca-container').contentcarousel({scroll:itemsPerSection});\n }", "functi...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Latitudinal rotation by phi0. Temporary hack until D3 supports arbitrary smallcircle clipping origins.
function hammerRetroazimuthalRotation(phi0) { var sinPhi0 = Object(__WEBPACK_IMPORTED_MODULE_1__math__["y" /* sin */])(phi0), cosPhi0 = Object(__WEBPACK_IMPORTED_MODULE_1__math__["h" /* cos */])(phi0); return function(lambda, phi) { var cosPhi = Object(__WEBPACK_IMPORTED_MODULE_1__math__["h" /* cos */])(...
[ "function hammerRetroazimuthalRotation(phi0) {\n var sinPhi0 = Object(__WEBPACK_IMPORTED_MODULE_1__math__[\"y\" /* sin */])(phi0),\n cosPhi0 = Object(__WEBPACK_IMPORTED_MODULE_1__math__[\"h\" /* cos */])(phi0);\n\n return function (lambda, phi) {\n var cosPhi = Object(__WEBPACK_IMPORTED_MODULE_1__math__[\...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Create selection list with all trades for current workrequest (from records in wrtr) Calls WFR AbBldgOpsOnDemandWorkgetTradesForWorkRequest
function populateTrades(){ var panel = View.getControl('', 'sched_wr_cf_cf_form'); //kb:3024805 var result = {}; //Get trades assigned to a work request,file='WorkRequestHandler.java'. try { result = Workflow.callMethod('AbBldgOpsOnDemandWork-WorkRequestService-getTradesForWorkRequest', panel.getF...
[ "function createWorkRequest(){\n var grid = View.getControl('', \"request_report\");\n var records = grid.getPrimaryKeysForSelectedRows();\n if (records.length == 0) {\n alert(getMessage(\"noRecords\"));\n return;\n }\n \n if (confirm(getMessage(\"confirmCreateWorkRequest\"))) {\n ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Setting animations to items
setAnimation() { this.pos-- this.item.style[this.options.y] = this.options.reverse ? (this.lastElement.offsetTop / this.pos) + 'px' : (this.itemOuterHeight / this.pos) * this.heightRange + 'px' this.item.style[this.options.x] = this.options.reverse ? (this.lastElement.offsetLeft / th...
[ "_setAnimation() {\n if (this.featuretteItems) {\n this.featuretteItems.forEach((item, index) => {\n item.setAnimation(true, index * 300);\n });\n }\n }", "function AnimateItem() {\n\n\t\t$('.has-animation').each(function() {\n\t\t\t$(this).appear(function() {\n\t\t\t\t$(this).delay($(this...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Get the children of parent those are in viewport
function getCurrentViewportDom(parent, container) { var children = parent.children; var domFragment = []; var isCurrentview = function isCurrentview(dom) { var _dom$getBoundingClien = dom.getBoundingClientRect(), left = _dom$getBoundingClien.left, top = _dom$getBoundingClien.top, ...
[ "_renderChildrenUnderViewports() {\n // Flatten out nested viewports array\n const viewports = this.deck ? this.deck.getViewports() : [];\n\n // Build a viewport id to viewport index\n const viewportMap = {};\n viewports.forEach(viewport => {\n if (viewport.id) {\n viewportMap[viewport.id...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Enable the user in cognito
function enableUser(user_name, cb) { var params = { UserPoolId: cognito.userPoolId, /* required */ Username: user_name /* required */ }; COGNITO_CLIENT.adminEnableUser(params, function (err, data) { if (err) cb(err, "") // an error occurred else { cb("", ...
[ "enable(event) {\n console.log(\"User enable\");\n return new Promise(function (resolve, reject) {\n updateUserEnabledStatus(event, true, function (err, result) {\n if (err)\n reject('Error enabling user');\n else\n resolve...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Runtime helper for resolving raw children VNodes into a slot object.
function resolveSlots(children,context){var slots={};if(!children){return slots;}for(var i=0,l=children.length;i<l;i++){var child=children[i];var data=child.data;// remove slot attribute if the node is resolved as a Vue slot node if(data&&data.attrs&&data.attrs.slot){delete data.attrs.slot;}// named slots should only b...
[ "function resolveSlots(children,context){var slots={};if(!children){return slots;}var defaultSlot=[];for(var i=0,l=children.length;i<l;i++){var child=children[i];var data=child.data;// remove slot attribute if the node is resolved as a Vue slot node\nif(data&&data.attrs&&data.attrs.slot){delete data.attrs.slot;}// ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
scale boxes for sorting
function drawScaleBoxes( d ) { var colors = ['rgb(254,237,222)','rgb(253,208,162)','rgb(253,174,107)','rgb(253,141,60)','rgb(241,105,19)','rgb(217,72,1)','rgb(140,45,4)'] //colors = colors.reverse(); $('#f0').html('F0: ' + scales[0]).css('background', colors[ 0 ]); $('#f1').html('F1: ' + scales[1])...
[ "function changeBox() {\n quickColor();\n\n //sub-box with similar design\n rect(125, 85, width - 50 - 85, 225);\n\n quickTextColor();\n type = sortType.value();\n textSize(12);\n textAlign(LEFT);\n textStyle(BOLD);\n text(type, 130, 100);\n textStyle(NORMAL);\n\n switch (type) {\n case 'Selection Sor...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
The Brackets constructor Input : Object for all properties the Brackets Object should have open : All valid Open Tags (String/RegExp or Array of String/RegExp) close : All valid Close Tags (String/RegExp or Array of String/RegExp) mate : [open, close] mates : Array of mate arrays escape : All valid Escape Tags (String/...
function Brackets( obj ){ var data = typeof obj === "object" ? obj : {}, regexFirst = typeof data.regexFirst === 'boolean' ? data.regexFirst : Settings.regexFirst, closeFirst = typeof data.closeFirst === 'boolean' ? data.closeFirst : Settings.closeFirst, openTagSources = [], closeTagSources = [], ...
[ "function BracketMatch() {\n\n this.findMatchingBracket = function(position) {\n if (position.column == 0) return null;\n\n var charBeforeCursor = this.getLine(position.row).charAt(position.column-1);\n if (charBeforeCursor == \"\") return null;\n\n var match = charBeforeCursor.match(...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Calls the fetchUser method when the component mounts
componentDidMount() { this.fetchUser(); }
[ "componentDidMount() {\n\t\tthis.props.fetchUser();\n\t}", "componentDidMount() {\n this.rendering.subscribe(this.loadUser);\n this.loadUser();\n }", "componentDidMount() {\n // Get user if not provided (i.e. not in store).\n if (!this.props.user) {\n this.props.getUser(this.props.us...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Gets the host name or IP address.
getHost() { let host = super.getAsNullableString("host"); host = host || super.getAsNullableString("ip"); return host; }
[ "function getHostAddress() {\n var i, candidate, nets = require('os').networkInterfaces();\n function filterFunc(item) {\n return item.family === 'IPv4' && !item.internal;\n }\n for (i in nets) {\n if (nets.hasOwnProperty(i)) {\n candidate = nets[i].f...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
removes matching stories code by David Wahlund
function remove_stories(){ // get all stories var messages = document.getElementsByClassName("UIStoryAttachment_Copy"); // number of stories var count = messages.length; // loop 'm for (var i = count - 1; i >= 0; i--){ // current story msg = messages[i]; //cycles through all forbid...
[ "removeStory(story) {\n this.stories = this.stories.filter(function(val) {\n return val.storyId !== story.storyId\n });\n }", "removeStory (story: Story) { return this.extractStoryChain(story, story.next); }", "removeStoryWithId(id){\n this.stories = this.stories.filter(story => story.storyId !==...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
This method for proxy touch down event from any animation framework to laco
externalTouchDown() { this._strikeTouchDown(); }
[ "externalTouchUp() {\n this._strikeTouchUp();\n }", "updateTouchDownEvents() {\n this._eventsManager.updateEventsContainer('touch-down');\n }", "function onTouchMoveCaptured(tracker,event){handleTouchMove(tracker,event);$.stopEvent(event);}", "_strikeTouchDown() {\n for ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Handles what should happen for each and every tier.
function tierHandler (tier) { if (tier == platinumTier) { platinumHandler(); return; } if (tier === silverTier) { silverHandler(); } else if (tier == goldTier) { goldHandler(); } }
[ "function getTierInfo () {\n\n function getPvP() {\n // fetch the pvp tier page\n if (!sessionStorage.pvp) {\n var xmlhttp = new XMLHttpRequest();\n xmlhttp.onreadystatechange = function() {\n if (xmlhttp.readyState == 4 && xmlhttp.status == 200) {\n ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Load a team's current iteration (e.g., sprint)
function loadIteration() { // Query rally for iteration info restApi.query({ type: 'iteration', fetch: ['FormattedID', 'Name', 'ScheduleState', 'PlanEstimate', 'Iteration', 'Children'], query: initialProjectQ, scope: { project: '/project/' + config.rally.projectid, up: false, down: true }, }, func...
[ "function loadCurrentTournament() {\n Tournament_v.findOne({where: {'current_flag': 'Y'}}, function(err, result) {\n if (result != null) {\n this.currTournamentName = result.tournament_name;\n this.currTournamentId = result.id;\n this.currNumberOfTable = result.number_of_tables;\n } else {\n ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Angular Validation factory scope magic function
scope() { return new ValidationComponents(); }
[ "function FormValidatorFactory() {\n}", "function validateDecorator ( scope ) {\n\n // --------------------------------------------------\n // Observers\n\n scope.changeCallbacks.push( function( newValue, oldValue, scope ) {\n // We validate the value each time it changes\n ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
getCardImageTag() Maak de image tag af met een kaart op basis van de kaartnummer Een kaartnummer loopt van 0 t/m 15
function getCardImageTag(card_index) { /* Onderstaande opdracht levert bijvoorbeeld het volgende op als card_index gelijk is 1 en op cards[1] staat het afbeeldingsnummer 8: <img class="play-card-img" src="img/8.jpg" /> */ return '<img class="play-card-img" src="img/' + cards[card_...
[ "function getCardImage( player, n )\n\t{\n\tvar\tv;\n\tn = player * 12 + n;\n\tv = getItem( \"card\" + n, \"pic\" + n );\n\treturn v;\n\t}", "function showcard(no) {\r\n var kind = card.kind(no);\r\n var number = card.no(no);\r\n var img = kind + number;\r\n}", "getImageNameForTag(tag, length) ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
go back button on the shortcode popup
function fpPOSH_go_back(){ $('#fpPOSH_back').click(function(){ $(this).animate({'left':'-20px'},'fast'); $('h3.notifications').removeClass('back'); $('.fpPOSH_inner').animate({'margin-left':'0px'}).find('.step2_in').fadeOut(); // hide step 2 $(this).closest('#fpPOSH_outter').find('.step2').fadeOut(...
[ "function evoPOSH_go_back(){\r\n\t\t\t$('#evoPOSH_back').click(function(){\t\t\r\n\t\t\t\t$(this).animate({'left':'-20px'},'fast');\t\r\n\t\t\t\t\r\n\t\t\t\t$('h3.notifications').removeClass('back');\r\n\t\t\t\r\n\t\t\t\t$('.evoPOSH_inner').animate({'margin-left':'0px'}).find('.step2_in').fadeOut();\r\n\t\t\t\t\r\n...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
MaskedTextBox key up handler
_textBoxKeyUpHandler() { const that = this; that.value = that._getValueWithTextMaskFormat({ start: 0, end: that._mask.length }, that.textMaskFormat); }
[ "function maskEvent(field, field_size, _mask, event) {\r\n\tvar key ='';\r\n\tvar aux='';\r\n\tvar len=0;\r\n\tvar i=0;\r\n\tvar strCheck = '0123456789';\r\n\tvar rcode = (window.Event) ? event.which : event.keyCode;\r\n\r\n\tif((rcode == 13) || (rcode == 8) || (rcode == 9) || (rcode == 0)) {\r\n\t\t//Enter ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Set up outgoing request to fit ProductHunt API requirement + attach token
willSendRequest (request) { request.headers.set('Accept', 'application/json') request.headers.set('Content-Type', 'application/json') request.headers.set('Host', 'api.producthunt.com') request.headers.set('Authorization', `Bearer ${TOKEN}`) }
[ "prepareRequest() {\n switch (this.mode) {\n case 'sandbox':\n this.httpsOptions.hostname = 'https://ws.sandbox.pagseguro.uol.com.br'\n default:\n this.httpsOptions.path = `/v2/checkout?email=${this.email}&token=${this.token}`\n this.httpsOptions.body = this.xmlHeader + this.xmlBui...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
The 'onchange' event handler for when the a11y navigation button setting is toggled on or off.
onA11yNavButtonsSettingChanged_() { this.userActed( ['set-a11y-button-enable', this.$.a11yNavButtonToggle.checked]); }
[ "function enableChangeListener(){\n var nav = document.getElementById('main-navigation');\n document.addEventListener('NAV_TRANSITION_CHANGE', function(evt){\n\n if (evt.detail.horizontal){\n nav.classList.add('horizontal-nav');\n nav.classList.remove('vertical...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Returns the data filename for the given set and channelID
function getFilename(set, channelID) { return __dirname + '/data/' + channelID + '-' + set + '-data.json'; }
[ "function getSaveFilename(targetChannelID) {\n return 'last_stream_' + targetChannelID + '.json'\n}", "function getSaveFilename(targetChannel) {\n return 'last_video_' + targetChannel + '.json'\n}", "function get_filename() {\n let file_name = DATASET_NAME;\n if (TEST_CFG.min_depth === 1 && TEST_CFG.max...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Produces a randomly generated win state for the game board. The hint numbers are what determine the win state rather than the actual board state because we're not necessarily generating win states with only one solution.
generateWinState() { const size = this.state.dimensions.rows * this.state.dimensions.cols; let winSquares = []; for (let i = 0; i < size; i++) { winSquares.push((Math.random() < 0.5) ? SquareValue.EMPTY : SquareValue.FILLED); } this.setState({ goalHints: this.getHintNumbers(winSqua...
[ "function generateWinPossible() {\n\n var winPos = [];\n\n if ( isSquare ) {\n\n // vertical win\n winPos = [];\n for ( var n = 0; n < boardWidth; n++ ) {\n for ( var i = n; i < boardSize; i += boardWidth ) winPos.push( i );\n\n winPoss.push( winPos );\n winPos = [];\n }\n\n // horiz...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Increment a statistic in the database. Every stat is tracked on a daily basis, for graphing and aggregation. This functionality requires PostgreSQL 9.5 or later.
incrementStat (key, increment) { let period = new Date().toISOString().slice(0, 10); // 2016-01-01 this.run(` INSERT INTO stats (period, key, value) VALUES ($1, $2, $3) ON CONFLICT (period, key) DO UPDATE SET value = stats.value + EXCLUDED.value `, [period, key, increment],...
[ "function increaseStatsCounter(counterKey, docClient, done, hashKey) {\n// Increase counters...\n var params = {\n TableName: 'dnaStats',\n Key: {\n \"counterDescriptor\": counterKey\n },\n UpdateExpression: \"set #ct = #ct + :val\",\n ExpressionAttributeValues: {\n \":val\...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Get the app_delta folder for faster subsequent rebuilds on devices.
function getAppDeltaDirectory(bundleId) { // TODO: Maybe use .expo folder instead for debugging // TODO: Reuse existing folder from xcode? const deltaFolder = _path().default.join(_os().default.tmpdir(), 'ios', 'app-delta', bundleId); _fsExtra().default.ensureDirSync(deltaFolder); return deltaFolder; } // T...
[ "getOriginalAppDirForTestPackages() {\n const appDir = this._projectDirForLocalPackages;\n if (_.isString(appDir) && appDir !== this.projectDir) {\n return appDir;\n }\n }", "get stagingAppDir () {\n return path.join(this.stagingDir, this.baseAppDir, 'lib', this.appIdentifier)\n }", "function...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
;; camSetupTransport(place x, place y, exit x, exit y) ;; ;; A convenient function for placing the standard campaign transport ;; for loading in preaway missions. The exit point for the transport ;; is set up as well. ;;
function camSetupTransporter(x, y, x1, y1) { addDroid(CAM_HUMAN_PLAYER, x, y, "Transport", "SuperTransportBody", "V-Tol", "", "", "MG3-VTOL"); setTransporterExit(x1, y1, CAM_HUMAN_PLAYER); }
[ "function sendTransport()\n{\n\tvar position = camMakePos(landingZoneList[index]);\n\tswitchLZ += 1;\n\n\t// (2 or 3 or 4) pairs of each droid template.\n\t// This emulates wzcam's droid count distribution.\n\tvar count = [ 2, 3, 4, 4, 4, 4, 4, 4, 4 ][camRand(9)];\n\n\tvar templates = [ cTempl.npcybc, cTempl.npcybf...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Update the markings (that was probably) changed by the user on the marking panel.
function updateMarkings() { Array.from(document.getElementsByClassName('markingPanel-object')).forEach(function(item, index) { let marking = markedObjects[item.getAttribute('div-id')]; // Get the marking position and size. // In this case, data-x stores the delta x related to the original div position. // In ...
[ "_updateMarks() {\n const rects = getMarksRects(this.elems, this.cachedElemRects);\n\n this.opts.beforeUpdate(this.wrapper);\n\n each(rects, (i, rect) => {\n const mark = this.marks[i];\n mark.style.top = rect.top + 'px';\n\n this.opts.onUpdateMark(mark, this.wr...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Print Finished Event Catch for Chrome Don't use alert fucntion in this Fucntion
function PrintFinished(){ registRptPrintHistory(); }
[ "function qzDonePrinting() {\n // Alert error, if any\n if (qz.getException()) {\n alert('Error printing:\\n\\n\\t' + qz.getException().getLocalizedMessage());\n qz.clearException();\n return; \n }\n \n // Alert success message\n $(\"#progress\").slideUp();\n alert('Successfully sent print data to \...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Render specified page widgets.
renderPage(page, x, y, width, height) { this.render.renderWidgets(page, x - this.containerLeft, y - this.containerTop, width, height); }
[ "function findAllWidgetsForPage()\n {\n //todo\n }", "function renderWidgets(widgets, context, state) {\n\tfor(var i = 0; i < widgets.length; i++) {\n\t\twidgets[i].render(context, state);\n\t}\n}", "renderPage() {\t\t\n\t\tswitch (this.props.data.active) {\n\t\t\tcase 'user': \n\t\t\t\treturn this...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Add links from dropdown menus into regular mobile nav
function addNavDropdownLinks() { $(".nav-dropdown-item ul li").each(function() { $(".nav-items").append("<div class='nav-item nav-appended-dropdown'>" + $(this).html() + "</div>"); }); }
[ "function mobileMenu() {\r\n var outputElem = $('#mobile_menu');\r\n $('#slick_menu').slicknav({\r\n appendTo: outputElem,\r\n label: ''\r\n });\r\n }", "function linkDropdown() { $('body').on('touchstart.dropdown', '.dropdown-menu', function (e) { e.stopPropagation()...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
=================================== Click handler for the color bubbles at bottom of screen ===================================
function bubbleClickHandler(event) { /* guard clause to disable click handler if: 1) the game is over, 2) player is out of attempts, 3) player has won the round, 4) player has lost the round */ if ( gameState === 'gameOver' || gameState === 'playerWins' || gameState ===...
[ "function mouseClicked() {\n colorindex = ((colorindex+1)%colors.length)\n bgColor = colors[2][1]\n circleColor = colors[2][0];\n}", "function clickEvent(evt) {\n console.log(evt.target);\n const target = evt.target;\n if (target.classList.contains('paintable')) {\n window.prevItem = evt.target;\...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Retrieves the account details
getAccountDetails(accountId) { if (lock.isBusy(accountId)) throwError('Service Unavailable', 503); this.logger.info('Getting account details...', accountId); return { ...accountDatabase[accountId] }; }
[ "function getAccountDetails() {\n\tvar baseUrl = getClientStore().baseURL; \n\tvar accessor = objCommon.initializeAccessor(baseUrl, cellName);\n\tvar objAccountManager = new _pc.AccountManager(accessor);\n\tvar count = retrieveAccountRecordCount();\n\tvar uri = objAccountManager.getUrl();\n\turi = uri + \"?$orderb...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
given a park's Full name, Description, and URL, returns a item with formatted results
function parkHtml (name, description, url) { return ` <li> <h3>${name}</h3> <p>${description}</p> <p>For more information, visit: <a href="${url}">${url}</a></p> </li> `; }
[ "function showWebResult(item)\n {\n var p = document.createElement('p');\n var a = document.createElement('a');\n a.href = item.Url;\n $(a).append(item.Title);\n $(p).append(item.Description);\n // Append the anchor tag and paragraph with the description to the results div.\n $('#results').app...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Delete membership by id using an HTTP DELETE request
async function deleteMembership(id) { // Build the request object const request = { // set http method method: 'DELETE', headers: getHeaders(), // credentials: 'include', mode: 'cors', }; // Cofirm delete if (confirm("Are you sure?")) { //...
[ "function deleteMember(id) {\r\n\r\n\tvar client = new XMLHttpRequest()\r\n\tclient.addEventListener(\"load\", function () {\r\n\t\tif (this.status == 403) {\r\n\t\t\tshowAlert('Cannot get the members', 'You are not authorized to do this petition.', 'error', '/api/MemberRest.html')\r\n\t\t} else {\r\n\t\t\tshowAler...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Record the team's answer as incorrect and throw it over to the other team
function recordAnswerAsIncorrect(sourceElement, teamNumber) { if (!sourceElement.classList.contains("control-button-active")) { return } document.getElementsByClassName("correct-button")[teamNumber-1].classList.remove("control-button-active"); document.getElementsByClassName("incorrect-button")[teamNumber-1...
[ "function incorrectAnswer() {\n\t// if they answer incorrectly\n\t// show the correct answer\n\tshowAnswer(\"Wrong!\");\n\n\t// increment number of incorrect guesses\n\tstats.incorrect += 1;\n\n\t// after n seconds move to the next question\n\tsetTimeout(nextQuestion, waitTime * 1000);\n}", "function answerIsInco...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Author: [S.H] Name: _getListFanPageFailed Description: Callback failed (getListFanPages) Params: error Return: No one
function _getListFanPageFailed(error) { RightMenu.rightMenuLoading(false); Messages.showCancelMessage(MessagesHelper.MSG_SERVICE_ERROR_TITLE, MessagesHelper.MSG_SERVICE_ERROR); }
[ "function _getListFanPagesSucceed(listFanPages) {\n // End loading bar\n RightMenu.rightMenuLoading(false);\n if (listFanPages && listFanPages.length > 0) {\n fbPages.fanPages = listFanPages;\n RightMenu.showRightMenu(Pages.fbSearchResultStep, null);\n }\n e...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
This function will login to Yucata. Using the GUI avoids using NTLM authentication, which is more time than it's worth. Yucata uses NTLM authentication, which works in python with this import requests from requests_ntlm import HttpNtlmAuth user and password need to be changed in this line requests.get(" This will produ...
async function loginYucataGUI(browser, username, password) { const page = await browser.newPage(); const response = await page.goto('https://www.yucata.de/en'); await page.type('#ctl00_ctl07_edtLogin', username); await page.type('#ctl00_ctl07_edtPassword', password); await Promise.all([ ...
[ "function loginToApi() {\n\n // get username and password from the scrollView\n var username = scrollView.children('#usernameInput').first().text;\n var password = scrollView.children('#passwordInput').first().text;\n \n // store whether the user chose to remember their username\n if (rememberUser...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
When we mount, get the tokens from reactrouter and initiate loading the info
componentDidMount() { // params injected via react-router (thank you!) // dispatch injected via connect (react redux, thank you!) const { dispatch, params } = this.props; // access token and refresh token aquired thru react-router const { accessToken, refreshToken } = params; dispatch(setTokens(...
[ "componentDidMount() {\n window.addEventListener('hashchange', () => {\n this.setState({ route: parseRoute(window.location.hash) });\n }\n );\n const token = window.localStorage.getItem('react-context-jwt');\n const user = token ? decodeToken(token) : null;\n this.setState({ user, isAuthorizi...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
updateViz : for loop iterates over all items in stateArray calls display() function for each item
function updateViz() { background("seashell"); loadImage("USVizLegend.png", displayLegend); if (stateArray.length > 0) { for (let i = 1; i < stateArray.length; i++) { stateArray[i].display(); } } else { //handles error if stateArray does not contain data text("Wa...
[ "function displayState() {\n for(var i = 0; i < slots_in_state.length; i++) {\n $(\"#results\").append(\"<span class='location'>L\" + (i + 1) + \"</span>\")\n for(var j = 0; j < slots_in_state[i].length; j++) {\n $(\"#results\").append(\"<span class='block'>\" + slots_in_state[i][j] + \"...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
function that scrolls to the submit button
function goToSubmit() { var element = document.getElementById('car_submit'); element.scrollIntoView({ behavior: "smooth", block: "end" }); }
[ "function toggleAftersubmit() {\n this.classList.toggle(\"aftersubmit\")\n window.scrollTo(0, 150);\n}", "function scrollToForm() {\n\t$(window).on(\"load\",function(){\n\n\t\t/* Page Scroll to id fn call */\n\t\t$(\"a.btn-callback\").mPageScroll2id({\n\t\t\tscrollSpeed: 500,\n\t\t\toffset: '.header'\n\t\t});\n...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
group by the 'arr_objs' with distinct 'keys' and by concatinating the fields in 'arr_fields_concat'
function group_by(arr_objs, params){ if ((params == null) || (params == undefined)) { return arr_objs; } var keys = params.keys; var arr_fields_concat = params.concats; if((keys != undefined) && (arr_fields_concat != undefined)){ var new_arr = []; for (var i = 0; i < arr_objs.length; i++) { v...
[ "function group_by(arr_objs, params){\n\t\tvar keys = params.keys;\n\t\tvar arr_fields_concat = params.concats;\n\n\t\tif((keys != undefined) && (arr_fields_concat != undefined)){\n\t\t\tvar new_arr = [];\n\t\t\t\tfor (var i = 0; i < arr_objs.length; i++) {\n\n\t\t\t\t\tvar obj_values = collect_values(arr_objs[i], ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
ROTATION SCRIPT, LOOPS THROUGH ALL IMAGES IN CIRCLE AND INCREASE THEIR ANGLES
function rotate() { var imgs = document.getElementsByTagName('img'); for (var i= 0; i < imgs.length; i++) { if (imgs[i].className == "point") { var thisImg = imgs[i]; // IF THE ANGLE GOES OVER 360 RESET IT, STOPS NUMEBR INCREASING FOR EVER. i...
[ "function rotate(obj, xDir, yDir, /*currDir, imgArray*/){\n var directionIndex = 0;\n var tg = yDir / xDir;\n////////////////////////////////////////////////////////////////////////////////\n// trigonometric calculations... that works...\n//////////////////////////////////////////////////////////////////////...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
for the general questions each of the reponses are logged to the required tables
function insertGeneralQResponseData(interactionID, botTime, userTime, timeLapse, questionID, userID, userResponse, questionnaireID){ console.log("InteractionID: " + interactionID); console.log("BotTime: " + botTime); console.log("UserTime: " + userTime); console.log("TimeLapse: " + timeLapse); console.log("Questio...
[ "function processGeneralQResponse(session, response, questionID, questionnaireID){\n\t// Gets timestamp information\n\tvar botTimeFormatted = new Date(getBotMsgTime(session));\n\tvar userTimeFormatted = new Date(getUserMsgTime(session));\n\tvar timeLapseHMS = getTimeLapse(session);\n\n\t// inserts data into UserRep...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Returns whether the target element is fixed or not.
function isFixed() { return position === 'fixed'; }
[ "function isFixed() {\n\t\t\treturn position === 'fixed';\n\t\t}", "function isFixed() {\r\n return position === 'fixed';\r\n }", "function isFixed(element){var nodeName=element.nodeName;if(nodeName==='BODY'||nodeName==='HTML'){return false;}if(getStyleComputedProperty(element,'position')==='f...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
function to print out applicant name and their team
function showApplicants(applicants){ for(var i = 0;i < applicants.length;i++){ console.log((i+1) + ": name: " + applicants[i].name) console.log(' team: ' + applicants[i].teamName) } }
[ "function printRole() {\n for (i=0; i<devs.length; i++){\n let name = devs[i].name;\n let tech = devs[i].tech_stack;\n console.log(`${name} specializes is ${tech}.`);\n }\n }", "function getStringTeam(team){\n\tlet str = \"\";\n\t//console....
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Creates a dictionary of the image information given the image URL
async function createImageInfo(url) { var imageDict = {}; imageDict.url = url; const info = await tag(url); // Number on the list set to 8 // If less than 8 guesses, change the picture if (info === -1 || info.length <= 8) { console.log("length", info.length); return await createImageInfo(await addIm...
[ "function getImageDictionary(){\n // id:[label, url]\n const imageDictionary ={\n 'image1':['Confetti','../images/homework10/confetti.jpg'],\n 'image2':['Streamers','../images/homework10/streamers.jpg'],\n 'image3':['Image 3','../images/homework10/penants.png']\n };\n return imageDictionary;\n} // end...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Try to detect the encoding of some sample text. Returns an encoding name or null.
function detectEncoding(samples) { var encoding = null; if (looksLikeUtf8(samples)) { encoding = 'utf8'; } else if (looksLikeWin1252(samples)) { // Win1252 is the same as Latin1, except it replaces a block of control // characters with n-dash, Euro and other glyphs. Encountered in-the-wild...
[ "async function guessEncodingByBuffer(buffer) {\n const jschardet = await new Promise((resolve_4, reject_4) => { require(['jschardet'], resolve_4, reject_4); });\n // ensure to limit buffer for guessing due to https://github.com/aadsm/jschardet/issues/53\n const limitedBuffer = buffer.slice(0, ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Exit a parse tree produced by LUFileParsernestedIntentNameLine.
exitNestedIntentNameLine(ctx) { }
[ "exitNestedIntentName(ctx) {\n\t}", "exitNestedIntentBodyDefinition(ctx) {\n\t}", "visitNestedIntentNameLine(ctx) {\n\t return this.visitChildren(ctx);\n\t}", "enterNestedIntentNameLine(ctx) {\n\t}", "exitNestedIntentSection(ctx) {\n\t}", "exitIntentNameLine(ctx) {\n\t}", "exitNestedExpressionAtom(ctx)...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Sets up and formats the needed sheets in the Spreadsheet: "Config" with the configuration settings, "OriginLI" to host the origin Line Item info, "Destination LIs" to host the destination Line Items info.
function initSpreadsheet_() { if (!originLiSheet) { doc.insertSheet(ORIGIN_SHEET_NAME,0); originLiSheet = doc.getSheetByName(ORIGIN_SHEET_NAME); originLiSheet.setTabColor("yellow"); originLiSheet.getRange(1,1,1,100).setBackground("yellow"); originLiSheet.getRange(1,1,originLiSheet.getMaxRows(), ...
[ "function initializeStyles() {\n document.insertSheet('StyleConfiguration', 1);\n sheet = document.setActiveSheet(document.getSheets()[1]);\n sheet.appendRow([\"Look And Feel\", \"URL IS/IT\", \"Koninklijke\", \"Ghost\"]);\n sheet.appendRow([\"Description\", \"Looks like URL IS/IT's home page urlisit.com\", \"R...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Uncomment this line, but do not edit it. End of Challenge 2 CHALLENGE 3 Add code inside the function declaration below so that it returns the value of pounds 16.
function getOuncesFromPounds(pounds) { return pounds * 16; }
[ "function poundsToDollars(pounds) { //function declaration, pounds for later \n var dollars = pounds / 1.5; //set variable of dollars\n return dollars\n}", "function challenge3() {\n return (store4['Dark Chocolate Crunchies']['cost'] * store4['Dark Chocolate Crunchies']['sold on'].length).toFixed(2)\n}", ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Creates a book widget and add it to the application's main layer
function addBook(x, y, size, book) { var bk = new MultiWidgets.BookWidget(); if (bk.load("./Research")) { bk.addOperator(new MultiWidgets.StayInsideParentOperator()); bk.setAllowRotation(false); bk.setLocation(x, y); bk.setScale(1); root.addChild(bk); bk.raiseToTop(); } }
[ "function renderBook(book) {\n // Grab book box where books are displayed\n let bookBox = document.querySelector('.bookBox')\n let bookCard = makeBookCard(book)\n bookBox.appendChild(bookCard)\n}", "function addBook() {\n const title = getFieldValue('book-title');\n const author = getFieldValue('book-author...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Resolve data to the owner address.
function resolveOwner(data = 0) { let ownerId = data.toHexString ? data.toNumber() : data; // If it's an address, return it. if (typeof ownerId === "string" && utils.hexDataLength(ownerId) == 20) { return ownerId; } // If it's a 20 byte address, than pack and return. if (Ar...
[ "function resolveOwner(data = 0) {\n let ownerId = data.toHexString\n ? data.toNumber()\n : data;\n\n // If it's an address, return it.\n if (typeof ownerId === 'string' && utils.hexDataLength(ownerId) == 20) {\n return ownerId;\n }\n\n ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Copy the primary flash to the secondary flash location
async copyFlashToSec() { await this.write("copy flash flash sec"); await this.addListener("Done"); }
[ "function copyToMicroBit(directory_entry) {\n // Create the hex file to flash onto the device.\n var firmware = $(\"#firmware\").text();\n var hexfile = EDITOR.getHexFile(firmware);\n var hex_filename = filename + '.hex';\n saveFile(directory_entry, hex_filename, hexfile);\n }", "funct...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Return the tool symbol in a specific cell/square
function getToolSymbolAt(x, y) { let toolAtCell = document.getElementById("a" + y + x); let toolSymbolFor = toolAtCell.getAttribute("src"); return toolSymbolFor; }
[ "function getToolKeyWhich(which) {\r\n\treturn 'code'+which;\r\n}", "activeToolName() {\n if (this.toolStack.length > 0) {\n const tool = this.toolStack[this.toolStack.length - 1]\n for (const key in this.tools) {\n if (this.tools[key] == tool) return key\n }\n }\n return ''\n }", ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Applies the grayscale effect to a sprite, removing color information.
grayscale() { this.addEffect(new Effects.Grayscale()); }
[ "function grayscaleEffect() {\n var grayProps = {\n };\n simpleEffect(effectIds.GRAYSCALE, grayProps);\n}", "set grayscale(value) {}", "function grayScale() {\n // get image data\n var imgData = context.getImageData(0, 0, w, h);\n var data = imgData.data;\n // loop and change pixel value\n for...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
refresh chunks, call from game loop periodically
update( initPositionX, initPositionY ){ this.initPositionX = initPositionX; this.initPositionY = initPositionY; //calculates the chunk ID var chunkRow = ~~( initPositionX / 1280 );//remainder of div var chunkCol = ~~( initPositionY / 1280 ); this.chunkID = chunkCol*256 + chunkRow; //this.chunkID ...
[ "updateChunks() {\n // limite rate of chunk updates\n const now = Date.now();\n const interval = now - this.prevChunkUpdate;\n if (interval < this.chunkTickInterval) {\n return;\n }\n\n this.prevChunkUpdate = now;\n\n // console.log('updating chunks');\n // get the centre point to calcu...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
SeleneseMapper changes one Selenese command to another that is more suitable for WebDriver export
function SeleneseMapper() { }
[ "function parseRsel() {\n var TA=document.getElementById('pageContentId');\n var text = TA.value;\n\n // Note: All commands initially start with rsel|, to differentiate them from any other tables.\n // Fix first lines.\n text = text.replace(/^ *@selenium\\.open *\"([^\"]*)\" *$/m, \"rsel| script | Selenium te...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
rejectThousandSep: if true then the presence of the thousandsseparator is an error (nonnumeric) e.g. we don't accept it for point, since point/score is rarely in thousands range.
function isNumeric(string, rejectThousandSep ) { string = string.trim(); if ( rejectThousandSep !== null && rejectThousandSep ) { var hasThousands = ( string.search( new RegExp( THOUSANDS_SEP ) ) !== -1 ) ; if (hasThousands) { return false; } } string = string.replace...
[ "function numberThousandSeparator(x) {\n return x.toString().replace(/\\B(?=(\\d{3})+(?!\\d))/g, \".\");\n}", "_calculateThousandSeparator() {\n if(this._thousand !== ' ') {\n if(this._separator === '.') {\n this._thousand = ',';\n } else {\n this._thousand = '.';\n }\n }\n ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Renders the AWS CloudFormation properties of an `AWS::KafkaConnect::Connector.Capacity` resource
function cfnConnectorCapacityPropertyToCloudFormation(properties) { if (!cdk.canInspect(properties)) { return properties; } CfnConnector_CapacityPropertyValidator(properties).assertSuccess(); return { AutoScaling: cfnConnectorAutoScalingPropertyToCloudFormation(properties.autoScaling), ...
[ "function cfnConnectorProvisionedCapacityPropertyToCloudFormation(properties) {\n if (!cdk.canInspect(properties)) {\n return properties;\n }\n CfnConnector_ProvisionedCapacityPropertyValidator(properties).assertSuccess();\n return {\n McuCount: cdk.numberToCloudFormation(properties.mcuCou...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Rotate an object around an arbitrary axis in world space
function rotateAroundWorldAxis( object, axis, radians ) { var rotationMatrix = new THREE.Matrix4(); rotationMatrix.setRotationAxis( axis.normalize(), radians ); rotationMatrix.multiplySelf( object.matrix ); // pre-multiply object.matrix = rotationMatrix; object.rotation.setRot...
[ "rotate(axis, angle) {\n const w = vec3.normalize(vec3.create(), axis);\n let t = vec3.fromValues(0, 0, 1); // any vector not collinear with w\n if (vec3.equals(w, t)) {\n t = vec3.fromValues(0, 1, 0);\n }\n const u = vec3.normalize(vec3.create(), vec3.cross(vec3.create(), w, t));\n const v =...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Convert input date object to date/time query params in OTP API format, expressed in the specified time zone.
function dateToQueryParams(date, timeZone) { return { date: format(date, OTP_API_DATE_FORMAT, { timeZone }), time: format(date, OTP_API_TIME_FORMAT, { timeZone }) } }
[ "function convertParametersDate(date, time){\r\n return new Date(Date.parse(date.split('T')[0] + 'T' + time.split('T')[1].split('+')[0] + timeZoneOffset));\r\n }", "function performConvert(params) {\n\tif (!isValidTimezone(params.toTZ) && !isValidTimezone(params.fromTZ)) {\n\t\treturn {success: false, invalid...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
A compiler is a reusable object that resolved dependencies added as dependency definition objects. A compiler can have scopes just as the javascript language has them. Just like in javascript, compiler tries to resolve a dependency in its own scope (the current compiler instance). If it cannot find it, it tries its own...
function factory() { /** * The root compiler. There can be only one root compiler in gabriela * @type {null} */ this.root = null; /** * Parent compiler. Parent compiler in gabriela is the plugin compiler that holds plugin scope dependencies * @type {null} */ this.parent = n...
[ "function Compiler() {\n}", "function Compiler () {\n const Unfolded = new OneLevel ()\n const heap = Unfolded._heap\n const states = []\n this.apply = apply.bind (this)\n this._states = states\n\n for (let x of heap)\n states.push (Unfolded.apply (...x))\n\n this._inspect = function* () {\n for (let...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
ADD product count a end of list of product
function addCountProduct() { var divCount = document.createElement('div'); divCount.id="count-product"; divCount.innerHTML = 'Count : ' + (products.length + 1); document.querySelector("#list").append(divCount); }
[ "function addThreeNewProductsToTheEndOfTheProductList() {\n\n}", "function addProduct(pd){\n let newList = appstate.basket.products;\n \n const newItem = {\n count:1,\n id:pd.id,\n name:pd.name,\n price: pd.price\n }\n \n // const filtered = ne...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
draw the labels (e.g. L,R, Axial/Coronal etc). Called when changing viewer size or layout
drawlabels() { if (this.internal.volume===null) return; var context=this.internal.layoutcontroller.context; var dw=context.canvas.width; var dh=context.canvas.height; context.clearRect(Math.floor(this.cleararea[0]*dw),0,Math.floor(this.cleararea[1]*d...
[ "function drawLabels() {\n textAlign(RIGHT); fill(255);\n text(\"visible\", width - INSET, height - INSET + 14);\n textAlign(LEFT); \n text(\"infrared\", INSET, height - INSET + 14);\n fill(0); noStroke();\n if (handleX < width / 2.0) {\n rect(handleX, height - INSET, width / 4.0, INSET);\n } els...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Function to get the CSS value of the position property of the passed element.
function __getPositionValue(selector) { var position = $(selector).css('position'); return position; }
[ "function cssPosition(elem, newPosition)\n {\n if (newPosition === undefined)\n {\n // \"Computed styles of dimensions are almost always pixels\"\n // (http://api.jquery.com/css/). We assume this is the case.\n const position = elem.css(['left', 'top']);\n ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Constructs a new point number tester.
function newPointNumTester(pointSelectionDef) { return { xmin: 0, xmax: 0, ymin: 0, ymax: 0, pts: [], contains: function (pt, omitFirstEdge, pointNumber, searchInfo) { var idxWantedTrace = pointSelectionDef.searchInfo.cd[0].trace._expandedIndex; var idxActualTrace = searchInfo.cd[0...
[ "function newPointNumTester(pointSelectionDef) {\n return {\n xmin: 0,\n xmax: 0,\n ymin: 0,\n ymax: 0,\n pts: [],\n contains: function(pt, omitFirstEdge, pointNumber, searchInfo) {\n var idxWantedTrace = pointSelectionDef.searchInfo.cd[0].trace._expandedIndex...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Favorite Seller Data Transfer Object.
function FavoriteSeller(aUserId, aIsSandbox, aSellerId) { this._init(aUserId, aIsSandbox, aSellerId); }
[ "static async createFavorite({ username, favoriteQuote }) {\n //send text\n await sendSms(\n process.env.FAVORITE_HANDLER_NUMBER,\n `New favorite received: ${(username, favoriteQuote)}`\n );\n\n //store the favorite\n const favorite = await Favorite.insert(username, favoriteQuote);\n ret...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }