query
stringlengths
9
34k
document
stringlengths
8
5.39M
negatives
listlengths
19
20
metadata
dict
array with the wheel data setup wheelcollider for given wheel data wheel is the transform of the wheel maxSteer is the angle in degrees the wheel can steer (0 for no steering) motor if wheel is driven by engine or not
function SetWheelParams(wheel : Transform, maxSteer : float, motor : boolean, rad : float) { var result : WheelData = new WheelData(); // the container of wheel specific data // we create a new gameobject for the collider and move, transform it to match // the position of the wheel it...
[ "function mouseWheel(event) {\n rotx = rotx - event.delta/100;\n return false;\n}", "function turnWheelTo(angle) {\n\tglobal.target = angle;\n\tvar difference = (global.currentAngle - global.target);\n\t// NOTE, js treats '+' as string concatination by default, + in front of globa.target forces int typing\n\t\n...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
When the MetaRule is updated, this function refresh the current metaRule with the new changes
function metaRuleUpdatedSuccess(event, metaRule){ angular.copy(metaRule, edit.metaRule); }
[ "function updateRulesTable() {\n\tdeleteRulesTable();\n\tbuildRulesTable();\n}", "addRuleset() {\n var rulesets = this.state.rulesets\n rulesets.push([\"placeholder\"])\n this.setState({rulesets: rulesets, currentRuleset: rulesets.length-1}, () => {\n this.updateData()\n })\...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Reset playerPos variable when we've reached index 1 or player 2 in order to continue to use it for player 1 and 2. 0 = player1 1 = player2
function resetPlayerPos() { playerPos = 0; }
[ "switchPlayers(){\n if(this.currentPlayer == this.player1){\n this.currentPlayer = this.player2;\n }\n else this.currentPlayer = this.player1;\n }", "resetPosition(){\n this.speed = 0;\n this.deltaT = 0;\n this.rotation = 0;\n this...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Update entry thumbnail using URL.
static updateThumbnailFromUrl(entryId, url){ let kparams = {}; kparams.entryId = entryId; kparams.url = url; return new kaltura.RequestBuilder('baseentry', 'updateThumbnailFromUrl', kparams); }
[ "static updateThumbnailFromUrl(entryId, url){\n\t\tlet kparams = {};\n\t\tkparams.entryId = entryId;\n\t\tkparams.url = url;\n\t\treturn new kaltura.RequestBuilder('media', 'updateThumbnailFromUrl', kparams);\n\t}", "async updateImageSource() {\n const source = await this.getThumbnailURL();\n ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
This function writes the ACH account type selections This function calls the showACHItem function to determine if the account type should be displayed in the dropdown list
function writeACHAcctType(id) { var str=''; var type = showACHItem('ctx'); str+='<select><option selected> <\/option><option>CCD (Corporate)<\/option>'; str+='<option>CCD+ (Corporate with additional information)<\/option>'; if (type == '1'){ str+='<option>CTX (Corporate Trade Exchange)<\/option>';...
[ "prepareSelectTypes() {\n let items_buffer = getReferencesOfType('AGItem');\n let that = this;\n let types_buffer = [];\n let append_buffer = \"<option item_type = ''></option>\";\n if (items_buffer.length > 0) {\n items_buffer.forEach(function (element) {\n ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Returns the name of the category, with name of all parent categories
categoryFullName(id) { let categoryName = this.categoryName(id) let parentId = this.repo.category(id) && this.repo.category(id).parentId if (parentId) { return this.categoryFullName(parentId) + ' > ' + categoryName } else { return categoryName } }
[ "getFieldLabels() {\n return {\n \"name\":t(\"Name\"),\n \"parent\": t(\"Parent Category\")\n }\n }", "function getCategoryNameAtIndex(index) {\n return categoryIdentifiers[index];\n }", "get_name_by_id(cat_id){\n const sql = `select category_name, categ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
load video from href into overlayBox
function load_video( href ) { var data = {}; /*var video = '<video width="' + data.width + '" height="' + data.height + '" controls="controls" preload="autoplay" poster="' + data.poster + '"> <source type="video/mp4" src="' + href + '" /> <object width="928" height="523" type="application/x-shockwave-flas...
[ "function cargarVideo(url,imagen){\r\n var v = document.createElement(\"video\"); \r\n //if ( (!v.play) && (!Liferay.Browser.isSafari())) { // If no, use Flash.\r\n if(!Modernizr.video){\r\n var params = {\r\n allowfullscreen: \"true\",\r\n allowscriptaccess: \"always\",\r\n wmod...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
append questions to html
function showQuestions() { for (var i = 0; i < questionsArray.length; i++) { var questionHTML = getQuestionHTML(questionsArray[i], i + 1) $("#questions").append(questionHTML); } }
[ "function renderQuestion () {\n $('main').html(generateQuestion());\n}", "function questions_html(){\n let html = \"<ol>\";\n let nr = 0;\n if ( Object.keys( self.questions ).length > 0 ) for (const answers of Object.values( self.questions )){\n nr += 1;\n html +=...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
convertAudio Converts an audio file from disk into a mono channel wav file. If the audio gets successfully converted, it then deletes the old file from disk. params: fileName returns: promise conatians a string that represents tbe new file name
convertAudio(fileName) { console.log('in convertAudio => '); console.log('ffmpeg path: ' + ffmpegPath); console.log('audio dir path: ' + rootDir); var oldAudioFile = rootDir + '/' + directory + fileName + originalAudioType; var newAudioFile = rootDir + '/' + directory + fileName + convertedAudioType; return...
[ "function convertAudio(filePath, channel, user) {\n exec('ffmpeg -f s32le -i ' + filePath + ' -acodec pcm_s16le -ar 8000 -ac 1 ' + filePath + '.wav', (err, stdout, stderr) => {\n if (err) {\n // node couldn't execute the command\n return;\n }\n outputText(filePath, channel, user);\n });\n}", ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Method for Dual Wield which I haven't decided it I want to incorporate yet because of game balance issues
dualWieldAttack() { let randomNumber = Math.floor(Math.random() * 101); if (randomNumber <= player.dualWieldAccuracy){ let damageDone = (this.damage * 2) - boss.enemy[currentEnemy].armor; $playerText.text(`${player.name} strikes ${boss.enemy[currentEnemy].name} twice for a total ...
[ "function Shield() {\r\n var shieldPrice = 500;// initial price\r\n /**\r\n * accessor and mutator to the variable price of the shield\r\n * @param {number} p the price of the shield\r\n * @return the current price of the shield\r\n */ \r\n this.getShieldP...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Create an iterator over the listing's selected items.
selectedItems() { return this._listing.selectedItems(); }
[ "visitSelected_list(ctx) {\n\t return this.visitChildren(ctx);\n\t}", "get selectedDataItems() {\n return this.composer.queryItemsByPropertyValue('selected', true);\n }", "prepareSelectItems() {\n let that = this;\n let items_buffer = getReferencesOfType('AGItem');\n let select_i...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Assert that the currently authenticated eperson can edit this item, if they can not then this method will never return.
function assertEditItem(itemID) { if ( ! canEditItem(itemID)) { sendPage("admin/not-authorized"); cocoon.exit(); } }
[ "ableToEdit() {\n const accountIdForEdit = sessionStorage.getItem(\"accountIdForEdit\");\n if (accountIdForEdit !== null) {\n sessionStorage.setItem(\"accountId\", accountIdForEdit);\n return true;\n } else {\n return false;\n }\n }", "function isEditable() {\n return (current && curr...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Binds the event handlers for the up and down keys to switch betwen tabs.
function bindKeyboardShortcutsForTabs() { $( document ).keydown(function (event) { if($(document.activeElement).is('textarea,input,select')) { return; } switch (event.which) { case $.ui.keyCode.DOWN: event.preventDefault(); nextTab(); break; case $.ui.keyCode.UP: event.preventD...
[ "function registerNavigationKeys(keynapse){\n\tkeynapse.listener.simple_combo(\"tab\", nextKnCell);\n\tkeynapse.listener.simple_combo(\"enter\", selectKnCell);\n}", "bindAccordionEvents () {\n const tabTitles = this.accordion.querySelectorAll(`.${this.options.tabTitleClass}`)\n for (let i=0; i<tabTi...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Prompts list of employees Filters out selected employee to prompt manager choices Updates employee's manager in databae
async function updateEmployeeManager() { const employees = await db.findAllEmployees(); const employeeChoices = employees.map(({ id, first_name, last_name }) => ({ name: `${first_name} ${last_name}`, value: id })); const { employeeId } = await prompt([ { type: "list", name: "employeeId...
[ "function updateEmployeeManagerPickEmp(empArray){\n let eChoice=[]; \n for(e of empArray){\n eChoice.push({name:(e['First Name']+\" \"+e['Last Name']), value:e.ID});\n }\n inquirer.prompt({\n message:\"Choose Employee.\",\n type:\"list\",\n name:\"emp\",\n choices:eCho...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Alert next player to start. Then show player's ships
function alertNext(message){ alert(message); showShips(current); //Show ships for other player on bottom grid showColors(current); //Make sure colors match }
[ "function readyPlayer() {\n\t\tself.remainingShips = self.remainingShips - 1;\n\t\tif (self.remainingShips == 0) {\n\t\t\tconsole.log(\"All ships ready\");\n\t\t\tclientShips = self.shipList;\n\t\t\tconsole.log(clientShips);\n\t\t\tsendSocketData();\n\t\t}\n\t}", "function start2Player() {\n $(\"#NASAScore...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
returns the objs with a prop === val
function filter(obj, prop, val) { var arr = [] for (var k in obj) { var v = obj[k] if (v[prop] === val) arr.push(v) } return arr }
[ "function whoHasVal(tableObj, val){\n var hasIt = [];\n for (var name in tableObj){\n for (var prop in tableObj[name]){\n if (val === tableObj[name][prop])\n hasIt.push(name);\n }\n }\n return hasIt.join();\n}", "function obj_find(obj, prop, val) {\n\tfor (let k in obj) {\n\t\tlet v = obj[k]\...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Checks whether enemies should be removed from the list because they have moved off the edge of the screen If this didn't happen the array of enemies could become very large over time and collision checking would slow down the game
checkEnemyRemoval() { for (let enemyIndex = 0; enemyIndex < this.enemies.length; enemyIndex++) { let removeEnemy = false; const enemyToCheck = this.enemies[enemyIndex]; if (enemyToCheck.pos.x <= -this.level.tileWidth && enemyToCheck.movement.x < 0) removeEnemy = true; ...
[ "function checkEnemiesOutOfBounds()\r\n{\r\n\tlivingEnemies.length=0;\r\n\r\n enemies.forEachAlive(function(bad){\r\n\r\n \r\n livingEnemies.push(bad);\r\n });\r\n\t\r\n\tfor(var i = 0; i < livingEnemies.length; i++)\r\n\t{\r\n\t\tif(livingEnemies[i].body.y > game.world.height)\r\n\t\t{\r\n\t\t\...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
this function take a set of 4 answers and returns the set randomnly shuffled
function shuffleAnswers(answers) { var shuffledAnswers = []; var correctAnswerShuffled = 0; for(var i = 0 ; i < 4 ; i++) { var shuffleSpot = getRandomInt(0,answers.length-1); if(correctAnswerShuffled == 0 && shuffleSpot == 0) { multipleChoiceCorrectAnswer=i; ...
[ "function shuffleArray(){\n\tfor(i=0;i<questions.length;i++){\n\t\tvar j = Math.floor(Math.random()*questions.length);\n\t\tvar temp = questions[i];\n\t\tquestions[i] = questions[j];\n\t\tquestions[j] = temp;\n\t}\n}", "function randQ(){\n for (let i = triviaQuestion.length -1; i > 0; i--){\n const j = ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Create a list of all status codes.
function createStatusCodeList (codes) { return Object.keys(codes).map(function mapCode (code) { return Number(code) }) }
[ "static getSuccessCodes() {\n return [\n 200\n ];\n }", "function getAllComplaintsByStatus(status) {\n\t// \n\t$.ajax({\n\t\turl : link + ':8082/v1/complaint//status/' + status,\n\t\ttype : 'GET',\n\t\tcontentType : \"application/json; charset=utf-8\",\n\t\tdata : {},\n\t\tdataType : 'json',\n\t\tsucc...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Create array of entries to utilize bulk insert
function entriesBulk(entries, har_id) { let entries_bulk = []; entries.forEach(entry => { let new_entry = { har_id, startedDateTime: entry.startedDateTime, serverIPAddress: entry.serverIPAddress, timings_wait: entry.timings_wait, Request: ...
[ "async function tableInserter(pool, rowContent, sql) {\n let bulkContent = [];\n let bulkContentSpot = 0;\n for (let i = 0; i < rowContent.length; i++) {\n bulkContent[bulkContentSpot] = rowContent[i];\n bulkContentSpot++;\n if (bulkContentSpot >= 1000) {\n await bulkInsert(...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Check whether or not the current block has wall in the direction.
hasWallInDirection (x, y, direction) { return !(this.getBlockValue(x, y) & direction); }
[ "is_facing_wall_or_portal() {\n switch(this.direction){ \n case KeyboardCodeKeys.left:\n return this.maze.has_left_wall(this.row, this.col)\n || (this.col == 0);\n case KeyboardCodeKeys.right:\n return this.maz...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Show the "page_container" child div with the given id
show_page (page_id) { if (this.active_page == page_id) return; $('#page_container').children('div').each((index) => { const div = $('#page_container').children().eq(index); const div_id = div.attr("id"); if (div_id === page_id) { $('#'+div...
[ "function divShow(divId) {\n //console.log('divShow('+divId+')');\n\tif ( document.getElementById(divId) ) {\n\t document.getElementById(divId).style.display = 'block';\n\t} else {\n\t\tconsole.warn('document.getElementById('+divId+') == udefined');\n\t}\n}", "function addPage(page) {\n document.querySelector(...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Example For a = 2 and b = 7, the output should be rangeBitCount(a, b) = 11. Given a = 2 and b = 7 the array is: [2, 3, 4, 5, 6, 7]. Converting the numbers to binary, we get [10, 11, 100, 101, 110, 111], which contains 1 + 2 + 1 + 2 + 2 + 3 = 11 1s.
function rangeBitCount(a, b) { let sumOfOnes = 0; for(let i = a; i <= b; i++) { let binaryI = i.toString(2); for(let j = 0; j < binaryI.length; j++) { if(binaryI.charAt(j) == '1') sumOfOnes++; } } return sumOfOnes }
[ "bitCount() {\n let result = 0;\n for(let i = 0; i < this.array.length; i++){\n result += BitSet.countBits(this.array[i]) // Assumes we never have bits set beyond the end\n ;\n }\n return result;\n }", "function range(a,b)\n{\n\t// List to be returned\n\tlet li...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Add loss to division record
addDivisionLoss() { this.addConferenceLoss(); this.#records["division"].addLoss(); }
[ "addLeagueLoss() {\n this.#records[\"league\"].addLoss();\n }", "addConferenceLoss() {\n this.addLeagueLoss();\n this.#records[\"conference\"].addLoss();\n }", "function appendActualGainLoss() {\r\n var anchorElement=document.getElementById('equityTransOvrlGainLossAbs');\r\n var...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Visit a parse tree produced by PlSqlParserobject_member_spec.
visitObject_member_spec(ctx) { return this.visitChildren(ctx); }
[ "MemberExpression() {\n let object = this.PrimaryExpression();\n\n while (this._lookahead.type === \".\" || this._lookahead.type === \"[\") {\n // MemberExpression '.' Identifier\n if (this._lookahead.type === \".\") {\n this._eat(\".\");\n const property = this.Identifier();\n ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
The following rules define a valid object path. Implementations must not send or accept messages with invalid object paths. The path may be of any length. The path must begin with an ASCII '/' (integer 47) character, and must consist of elements separated by slash characters. Each element must only contain the ASCII ch...
function isValidObjectPath(path) { return path.match(/^(\/$)|(\/[A-Za-z0-9_]+)+$/); }
[ "function validatePath(path) {\n if ( path == \"\" ) {\n return 1;\n\t} else if (/^disk[0-2]|disk$/.test(path) == true || /^slot[0-1]$/.test(path) == true || /^NVRAM$/.test(path) == true || /^bootflash$/.test(path) == true || /^flash[0-1]|flash$/.test(path) == true) {\n return 0;\n } else {\n ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Makes sure session is in storage list of sessions and moves it to top (most recently used).
async touchSession(identifier, auth, remove = false) { let auths = await this.listSessions(identifier); let formattedAuth = formatAuth(auth); let existing = auths.findIndex((a) => formatAuth(a) === formattedAuth); if (existing >= 0) { auths.splice(existing, 1); } ...
[ "async load() {\n const sessions = await this._sessionInfoStorage.getAll();\n this._sessions.setManyUnsorted(sessions.map(s => new SessionItemViewModel(s, this)));\n }", "function moveMyListToTop() {\n\t\tvar $myList = getSectionByType('queue');\n\t\t\n\t\tgetContainers().$mainView.prepend($myLis...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Introduce the number of inches Convert the inches into centimeters Print centimeters
function ConvertInchesToCentimeters(){ var inches = parseInt(document.calculator.setInches.value); var inchesPerCentimeters= 2.54; centimeters = inches * inchesPerCentimeters; document.calculator.getCentimeters.value = centimeters; }
[ "function inchesToCentimetres(){\r\n\t\r\n}", "function metersToInches(numMeters){\n let inches = numMeters*(39.3701);\n return inches\n}", "function feetToCm(feet) {\n let feetConverter = feet / 0.032808;\n\n // console.log(feetConverter + \" \" + \"centimeters\");\n return feetConverter + \" \"...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Checks words remaining and wins if equal zero
function matchedWordsLeft() { gameState.wordsLeftToMatch--; if (gameState.wordsLeftToMatch === 0) { gameWon(); } }
[ "function calculatePossible(){\n\tvar allLetters = '';\n\tvar l = table.find('button');\n\tfor(var i = 0; i < l.length; i++){\n\t\tallLetters += l[i].innerHTML;\n\t}\n\t\tvar canBeFormed;\n\t\tvar yesCounter;\n\t\tvar tmpAllLetters;\n\t\tfor(var k = 0; k < wordsArray.length; k ++){\n\t\t\tyesCounter = 0;\n\t\t\ttmp...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
get all marks matching a filter criteria
function findAllBy(filter) { return db('marks') .where(filter) .select(); }
[ "function Q1(callback)\n\t{\n\t\tStudent.aggregate([\n\t\t\t{\n\t\t\t\t$match: { \n\t\t\t\t\tscores: {\n\t\t\t\t\t\t$not: {\n\t\t\t\t\t\t\t$elemMatch: { \n\t\t\t\t\t\t\t\tscore: { $lt: 93} \n\t\t\t\t\t\t\t} \n\t\t\t\t\t\t} \n\t\t\t\t\t} \n\t\t\t\t} \n\t\t\t},\n\t\t\t{\n\t\t\t\t$match: { \n\t\t\t\t\tscores: {\n\t\t\...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Move the spans inner html to the stash slot
function moveSpanIdToStash(srcSpanId, stashSlotId, contextPath) { var targetSpan = $("#stashSlot"+stashSlotId+" > .itemDrop"); if(targetSpan.length < 1) return; var targetId = targetSpan.attr('id'); swapSpanHtml(srcSpanId, targetId); swapSpanCompareHtml(srcSpanId, targetId, true); swapSpanOnDragStart(srcSpa...
[ "function swapSpanHtml(spanId1, spanId2) {\r\n\tvar html1 = $(\"#\"+spanId1).html();\r\n\tvar html2 = $(\"#\"+spanId2).html();\r\n\t$(\"#\"+spanId1).html(html2);\r\n\t$(\"#\"+spanId2).html(html1);\r\n\t\r\n\t// Make sure the drop location equipment details has been rendered\r\n\t$(\"#\"+spanId2).qtip('toggle', true...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
function to generate the Skin Table
function getSkinTable(){ dataReceived = ""; checkFollowUp(); getData("skin.php", sid); var skinData = JSON.parse(dataReceived); console.log(skinData); if(curedDname[1][0].length!=0){ creatTable("Skin"); for(var i = 0; i < curedDname[1][0].length; i++){ //if(diseaseName!=curedDname[1][0][j]) insert...
[ "function generateTable() {\n emptyTable();\n generateRows();\n generateHead();\n generateColumns();\n borderWidth();\n}", "function buildTable() {\n var table = document.getElementById(\"propertiesTable\");\n for (var i = 0; i < Properties.size; i++) {\n var eth = 1000000000000000000;...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Returns the BFH URI according to the specified language flag. Running your command with de will return the German URI. Running your command with fr will return the French URI. If no language is specified, the function will return the German URI by default.
function getMultilingualURI(args) { // set German URI as default var uri = uriDE; // check if the argument for DE has been specified (default) let flagDE = args.some((val) => { return val === '--de'; }); // check if the argument for FR has been specified (optional) let flagFR = args.some((val) => { return v...
[ "function flagUrl (country) {\n country = country.split(' ').join('-')\n return \"https://www.countries-ofthe-world.com/flags-normal/flag-of-\"+(country)+\".png\"\n }", "function currentLang() {\n if(window.location.pathname.slice(0, 4) == '/fr/') {\n return 'fr';\n } else {\n ret...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
From the page, extract the averge book rating
function parse_rating() { var ratings_elm = $('div#averageCustomerReviews i.a-icon-star span'); var ratings_text = ratings_elm.text().split(' ')[0]; return parseFloat(ratings_text); }
[ "function calculateAverage(){\n var sum = 0;\n for(var i = 0; i < self.video.ratings.length; i++){\n sum += parseInt(self.video.ratings[i], 10);\n }\n\n self.avg = sum/self.video.ratings.length;\n }", "function calculateAver...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Starts the demo server.
function startServer() { console.log('*** Starting demo for developer prototyping' + ' kit for BeagleBone Green ***'); // Starts the server. webserver.start(); // Checks internet connection on board. utils.checkInternetConnection(function(result) { webserver.sendEventToClient('hasInternet', result); ...
[ "function startServer() {\n\troutes.setup(router); //Set the route\n\tapp.listen(port); //Passing port for the server\n\t\n\tconsole.log('\\n Server started \\n Mode: ' + env + ' \\n URL: localhost:' + port);\n}", "function start() {\n test();\n var httpService = http.createServer(serve);\n httpServi...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
1) Plot on Map History Path 2) Display on Table
function displayHistory() { var lat_tot = 0, lg_tot = 0, lat_avg = 0, lg_avg = 0; var histData = $scope.histData.values; var hist_len = histData.length; var obj = []; var coordinates = []; for ( var inc = 0; inc < hist_len; inc++) { var arr = {}; if(histData[inc].Velocity>5){ arr.latitude = Nu...
[ "function displayMap(){\n var coordinates = infoForMap();\n createMap(coordinates);\n}", "function load_graph_to_map(results){\n load_markers(results.locations);\n //draw_lines(results);\n draw_spanning_tree(results);\n\n}", "function drawHistoryTable(result){\r\n let table = document.getEleme...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
If value of this parameter is 0, then current day is processed, 1 is for yesterday, +1 is for tomorrow AddEventToDay(int idx, int offsetWithToday, int currFestTop, GCFestivalBase fb)
AddEventToDay(idx, offsetWithToday, currFestTop, fb, bookID) { var t = this.m_pData[idx + offsetWithToday]; var md = t.AddEvent(DisplayPriorities.PRIO_FESTIVALS_0 + bookID * 100 + currFestTop, GCDS.CAL_FEST_0 + bookID, fb.name); currFestTop += 5; if (fb.fast > 0) { md.fasttype = fb.fast; md.fastsub...
[ "function getDay(offset) {\n var d = new Date();\n return new Date(d.setDate(d.getDate() + offset)).setHours(0,0,0,0);\n}", "function calculateDay(someDate, offsetInDays) {\n var offsetInMillis = offsetInDays * ONE_DAY;\n return new Date(someDate.getTime() + offsetInMillis);\n}", "function populateHomePageS...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Defining this overlay as a templates from OverlayMixin this is our source to give as .contentNode to OverlayController. Important: do not change the name of this method.
_overlayTemplate() { // TODO: add performance optimization to only render the calendar if needed // When not opened (usually on init), it does not need to be rendered. // This would make first paint quicker return html` <div id="overlay-content-node-wrapper"> ${this._overlayFrameTemplate()...
[ "function OnContentTemplateChanged(/*DependencyObject*/ d, /*DependencyPropertyChangedEventArgs*/ e) \r\n { \r\n// ContentControl ctrl = (ContentControl)d;\r\n d.OnContentTemplateChanged(/*(DataTemplate)*/ e.OldValue, /*(DataTemplate)*/ e.NewValue); \r\n }", "function initContentOverlay() {\n ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
manage web save parameters
function manageWebParametersSave(socket) { socket.on('save', function(data) { setParam( "TEMP_FAN", TEMP_FAN ); setParam( "TEMP_ATTENUATION", TEMP_ATTENUATION ); setParam( "ATTENUATION_SCALE", ATTENUATION_SCALE ); setParam( "CHECK_PERIOD", CHECK_PERIOD ); setParam( "TPS", TPS ); setParam( "NB_RAMPES", NB_R...
[ "function settingPage(autoSave = autoSaveGET,useLibraryJS = useLibraryJSGET,language = languageGET) {\n\t\t//___CREATED obj SETTING___\n\t\tvar objSetting = {\n\t\t\t'autoSave': autoSave,\n\t\t\t'useLibraryJS': useLibraryJSGET,\n\t\t\t'language': languageGET\n\t\t}\n\t\t//___SET STORAGE SETTING___\n\t\tstorageSET('...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Assign new Resource to a given ResourceCollection, as a subresource" which is related to a state rootresource either directly or through a chain of ancestors.
instantiateCollectionResource(state, {resourceCollection, data}) { if (Array.isArray(data)) { data.forEach(resourceData => { resourceCollection.instantiateNewResourceItem(resourceData) }) } else { resourceCollection.instantiateN...
[ "assignRootResource(state, {key, resource}) {\n state[key] = resource\n }", "updateResources() {\n let energyCollection = new ResourceCollection();\n this._compartments.forEach(compartment => {\n energyCollection.addFromCollection(compartment.collectResources());\n });\n this._c...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Return the total price of break sticks
total() { return Menu.getBreadSticksPrice(); }
[ "function getTotalPrice() {\n var totalPrice = 0;\n _.each(createSaleCtrl.saleProducts, function(product) {\n totalPrice += product.price*createSaleCtrl.bought[product.barCode];\n });\n createSaleCtrl.totalPrice = totalPrice;\n }", "function getPri...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Generate the DT HTML
function generateDT() { var now = new Date(); if (now.getHours() < 3) { now = addDaysToDate(now, -1); } var r = ""; r += "<table class=\"dt\">"; r += "<tbody>"; r += "<tr>"; r += " <th>Day</th>"; r += " <th>Date</th>"; r += " <th>Devotional Text</th>"; r += "</tr>"; var date = addDaysToDate(now, -4);...
[ "function drawDataInTable( data, prop, value ) {\r\n var response = \"<div class='tableHeader'>\" + prop + \": \" + value + \"</div>\";\r\n response += \"<table style='width:100%;text-align:left;border:1px solid black;'><tr><th>Date</th><th>App Version</th><th>Test Case ID</th><th>OBS ID</th></tr>\";\r\n ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
helper function to set the filter property of STORE as needed
function setFilter (input) { STORE.filter = input; }
[ "function set_with_filter(newValue) {\n\t\tif (filter) {\n\t\t\teachIndex(filter, function (fn) {\n\t\t\t\tif (fn) {\n\t\t\t\t\tnewValue = fn.call(obj, newValue);\n\t\t\t\t}\n\t\t\t});\n\t\t}\n\t\tset_without_filter(newValue);\n\t}", "applyFilters(state) {\n if (_.isEmpty(state.filters)) {\n ret...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
allows style to be set from parent
setStyle(style) { this.style = style; }
[ "havingStyle(style) {\n if (this.style === style) {\n return this;\n } else {\n return this.extend({\n style: style,\n size: sizeAtStyle(this.textSize, style)\n });\n }\n }", "updateStyle(stateStyle) {\n let {styles} = this.styleshe...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Our custom function for adding states. We do some processing on the config specific for GameController.
function addState(config) { var stateName = config.name; var settings = stateSettings[stateName]; config.onEnter = combineFuncs(function () { // Enable objects for this state enableObjectsForState(stateName); // Clear object children settings.clearChildren.forEach(destroyCh...
[ "async addState(state) {\n console.log(state.getClass())\n let key = this.ctx.stub.createCompositeKey(state.getClass(), state.getSplitKey())\n let data = State.serialize(state)\n await this.ctx.stub.putState(key, data)\n }", "switchState(state){\n\t\tthis.currentState = state;\n\t\tswitch(state){\n\t...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
BONUS Iteration 8: Best yearly score average Best yearly score average
function bestYearAvg() { }
[ "getWeightsYear(){\n let temp = [];\n let today = new Date();\n let progress = 0;\n for(var i=0; i< this.weightLog.length; i++){\n let then= this.weightLog[i].date;\n if(then.getFullYear() == today.getFullYear()){\n temp.push(this.weightLog[i]);\n ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Function to set box backrgound color depending on editor background color
function setBoxBackgroundColor() { let body = document.querySelector("body"); // Get current editor background color let editorBackgroundColor = tinycolor( getComputedStyle(root).getPropertyValue("--editorBackgroundColor") ); let boxBackgroundColor = ""; if (editorBackgroundColor.isLight...
[ "function f_refectSpEditBackgroundColor(){\n var bc = $('#sp-taginfo-background-color-input');\n var bcp = $('#sp-taginfo-background-color-picker');\n var backgroundColor = bcp.val().toUpperCase();\n bc.val(backgroundColor);\n fdoc.find('.spEdit').css('background-color',...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Enable Footer Fixed effect
function fixedFooter(){ var fooCheck = $('footer').hasClass('fixed-footer-enable'); if(fooCheck){ $('.site-wrapper').addClass('fixed-footer-active'); } var FooterHeight = $('footer.fixed-footer-enable').height(), winWidth = $(window).width(); if( winWidth > 991 ){ $('.fixed-footer-active').css({'mar...
[ "function togle_footer(){\n if(footer_hidden){\n showFooter();\n footer_hidden = false;\n }else{\n hideFooter();\n footer_hidden = true;\n }\n}", "applyFixedHeader() {\n if ( $('body').hasClass('allow-fixed-header') ) {\n if ($(window).scrollTop() > 0) {\n ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Used to have a form do nothing on submit.
function formDoNothing() { }
[ "function handleFormSubmit(evt) {\n const form = evt.currentTarget;\n const fileInput = form.elements.namedItem('file');\n if (fileInput.hidden) {\n fileInput.value = '';\n }\n }", "function emptyForm() {\n $('#rating_points').barrating('clear');\n $('#rating_title').val(\"\");...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
initializeDiagram: Reset the SVG tag to have the chosen size & background (with a pattern showing through if the user wants it to be transparent):
function initializeDiagram(cfg) { const svgEl = el('sankey_svg'); svgEl.setAttribute('height', cfg.size_h); svgEl.setAttribute('width', cfg.size_w); svgEl.setAttribute( 'class', `svg_background_${cfg.bg_transparent ? 'transparent' : 'default'}` ); svgEl.textContent = ''; // Someday use replaceChildr...
[ "function clearDiagram() {\n // clear presses\n for(let i = 1; i <= 5; ++i) {\n for(let j = 1; j <= 6; ++j) {\n let el = document.getElementById(i+\"-\"+j);\n el.style.backgroundColor = '';\n el.setAttribute('data-checked', \"false\")\n }\n }\n // clear closed and open strings\n for(let i...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
remember the current position of the current window, storing it on the specified stack
function remember(win, stack) { var wframe = win.frame(); stack.push({ win: win, x: wframe.x, y: wframe.y, width: wframe.width, height: wframe.height }); }
[ "function SetNextWindowPos(pos, cond = 0, pivot = ImVec2.ZERO) {\r\n bind.SetNextWindowPos(pos, cond, pivot);\r\n }", "function rememberLastState()\n {\n if ( lastState.layout !== \"sidebar\" )\n {\n lastState.position = $ui.position();\n lastSt...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Gets a list of recommended products using the item ID of the first product from the search API
function getRecommendedProducts(firstSearchProductId) { const processRecommendedProductsResponse = function (response) { const jsonResponse = JSON.parse(response); const recommendedProductsResponse = jsonResponse.recommendedProductsResponse; if (!recommendedProductsResponse || recommendedPr...
[ "function find_recommended_supplier(product_id)\n{\n\tfind_available_suppliers(product_id);\n\t//if available_suppliers are zero show no suppliers and put -1 in selected supplier \n\tif ((typeof(order_list[product_id].available_suppliers)=='undefined'))\n\t{\n\t\torder_list[product_id].selected_supplier = -1;\n\t\t...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Calculate a base64 encoded signature of the reputation item hash
async function calculateReputationItemSignatureAsync(repItemHash) { let wallet = new ethers.Wallet(env.NODE_ETH_PRIVATE_KEY) // generate the signature for the binary representation of `repItemHash` let sig = await wallet.signMessage(Buffer.from(repItemHash, 'hex')) return sig }
[ "function calculateReputationItemHash(repItem) {\n let idBytes = Buffer.alloc(4)\n idBytes.writeUInt32BE(repItem.id)\n let calBlockHeightBytes = Buffer.alloc(4)\n calBlockHeightBytes.writeUInt32BE(repItem.calBlockHeight)\n let calBlockHashBytes = Buffer.from(repItem.calBlockHash, 'hex')\n let prevRepItemHashB...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[MSOFFCRYPTO] 2.3.5.1 RC4 CryptoAPI Encryption Header
function parse_RC4CryptoHeader(blob, length) { var o = {}; var vers = o.EncryptionVersionInfo = parse_CRYPTOVersion(blob, 4); length -= 4; if(vers.Minor != 2) throw new Error('unrecognized minor version code: ' + vers.Minor); if(vers.Major > 4 || vers.Major < 2) throw new Error('unrecognized major version code: ' +...
[ "function createCipher(algorithm) {\n const cipherParams = AEADCipherParameters[algorithm];\n const ret = ((packet, keyMaterial, connEnd) => {\n const plaintext = packet.fragment;\n // find the right encryption params\n const salt = (connEnd === \"server\") ? keyMaterial.server_write_IV :...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
pf_update_history Push a new history entry, as we've just navigated to what could be a new bookmarkable page.
function pf_update_history() { // FIXME: g_runids is no longer available. // var url; // if (g_runids[1]) { // url = g_urls.comparison_template // .replace('<testid>', g_testid) // .replace('<run1id>', g_runids[0]) // .replace('<run2id>', g_runids[1]); // } el...
[ "updateHistory(flag) {\n this.search.current = `?status=${this.params.status.join('+')}&assignee=${this.params.assignee.join('+')}`;\n if (!flag) window.history.pushState({ state: this.search.current }, this.search.current, ('search' + this.search.current));\n }", "add(location, {setIndexToHead =...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
create testing user and message
async function createUserWithMessage() { await models.User.create( { username: 'andyliwr', email: 'andyliwr@outlook.com', password: '12345678', role: 'admin', messages: [ { text: 'Hello, GraphQL!', createdAt: new Date() } ] }, { ...
[ "function setupMessage() {\n let props = {\n id: 0,\n text: 'test',\n date: '1465332186',\n user: {\n name: 'John Doe',\n picture: 'johndoe.jpg'\n },\n current_user: {\n name: 'John Doe',\n picture: 'johndoe.jpg'\n }\n ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Renders a d3 histogram chart based on the data provided and a domain function for x axis. data data for the histogram chart xDomainFn A domain function for plotting the x Axis, takes attributes which it needs to plot on this axis in this case
function renderHistogram(data, xDomainFn) { let bins = fitDomains(data, xDomainFn, (_d) => {return _d.length; }); chartContainer.data('chart-type', 'histogram') d3.select("svg").call(drag); drawHistogram(svg, bins); }
[ "function drawHistogram(svgElem, binData) {\n d3.select(\"svg\").call(drag).transition();\n svgElem.selectAll(\"rect\")\n .data(binData)\n .enter()\n .append(\"rect\")\n .attr(\"class\", \"bar\")\n .attr(\"x\", 10)\n .attr(\"transform\", function(d) {\n return \"translate(\" + x(d.x0) + \",...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Function for MAX QTY upgrades
function updateMaxQty(maxQty, upgradePurchased, cost, currency) { if(currency >= cost) { maxQty += upgradePurchased; currency -= cost; updatePbFill(beans, beansMax, 'pbBeansFill'); document.getElementById('beans').innerHTML = "Beans: " + beans + "/" + beansMax; } }
[ "useMaxQty(event) {\n this.props.useMaxQty(event.target.checked);\n }", "maxHandleChange(event, index, maxPrice) {\n this.setState({ maxPrice });\n }", "function qtyMath(qty, id) {\n var tst = connection.query(\n \"SELECT * FROM products WHERE ?\", [{\n item_id: id\n }]...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
converts AA.List[index] to AA_i,j subscripts
index_to_sub( index ) { if (index < 0 || index >= this.length) throw "Index is out of range" // if reading row-major order const i = Math.floor(index/this.numColumns) const j = index - this.numColumns*i // if reading column-major order // const i = index % this.numRows // const j = Math.floor(index...
[ "sub_to_index( i, j ) {\n\t\tif (i < 0 || i >= this.numRows ) throw \"Subscript i is out of range\"\n\t\tif (j < 0 || j >= this.numColumns) throw \"Subscript j is out of range\"\n\t\t\n\t\t// if reading row/major order (like spoken, used in numpy and torch)\n\t\treturn j + i *this.numColumns\n\t\t\n\t\t// reading...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Given an ObjectExpression, this function returns the path of the value of the property with name `propertyName`.
function getPropertyValuePath(path: NodePath, propertyName: string): ?NodePath { types.ObjectExpression.assert(path.node); return path.get('properties') .filter(propertyPath => getPropertyName(propertyPath) === propertyName) .map(propertyPath => propertyPath.get('value'))[0]; }
[ "function getNameFromPropertyName(propertyName) {\n if (propertyName.type === typescript_estree_1.AST_NODE_TYPES.Identifier) {\n return propertyName.name;\n }\n return `${propertyName.value}`;\n}", "get propertyName() {}", "function field(obj, pathString) {\n if (!obj || typeof pathString !== '...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Get a cached copy of our profiles on Buffer
function getCachedProfiles () { return cachedProfiles; }
[ "toProfile(profile) {\n return { \"name\": profile.name, \"id\": profile.uuid, \"_msmc\": profile._msmc };\n }", "function restoreProfileFromSession() {\n var params = storageService.getUserInfo();\n if (params) {\n profile = params;\n }\n retur...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Promises to run before serving
async function beforeServeTasks() { if (shouldCache) { await bundleMain(); } }
[ "function done(status,response,headersString){if(cache){if(isSuccess(status)){cache.put(url,[status,response,parseHeaders(headersString)]);}else{// remove promise from the cache\ncache.remove(url);}}resolvePromise(response,status,headersString);if(!$rootScope.$$phase)$rootScope.$apply();}", "function start() {\n ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Resets all of the line positions
resetLines() { this.el.innerHTML = ''; for ( let i = 0; i < this.lines.length; i++ ) { this.lines[ i ].style.width = this.width + 'px'; this.lines[ i ].style.top = i * this.lineHeight + 'px'; this.el.appendChild( this.lines[ i ] ); } }
[ "clearCoordinatesFromCurrentLine() {\n this._currentLineCoordinates = []\n }", "_resetPosition() {\n this._monitor = this._getMonitor();\n\n this._updateSize();\n\n this._updateAppearancePreferences();\n this._updateBarrier();\n }", "reset(){\n this.setSpeed();\n ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
get random array member
function getRandomMember(array) { return array[getRandomInteger(0, array.length-1)]; }
[ "function getPerson() {\r\n return people[Math.floor(Math.random() * people.length)];\r\n}", "function randomProperty (obj, random) {\n\t\t\tvar keys = Object.keys(obj);\n\t\t\treturn obj[keys[ random ]];\n\t\t}", "function randomElement() {\n var len = engine.getNumberOfElements(),\n el = Math.flo...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Calculate the crown fire powerofthewind (ft+1 lb+1 ft2 s1). See Rothermel (1991) equations 6 & 7 (p 14).
function powerOfTheWind (wspd20, rActive) { // Difference must be in ft+1 s-1 const diff = positive((wspd20 - rActive) / 60) return 0.00106 * diff * diff * diff }
[ "function windC (savr) {\n return 7.47 * Math.exp(-0.133 * Math.pow(savr, 0.55))\n}", "function powerOfTheFire (fliActive) {\n return fliActive / 129\n}", "function flameLengthThomas (fli) {\n return fli <= 0 ? 0 : 0.2 * Math.pow(fli, 2 / 3)\n} // Active crown fire heat per unit area,", "function CoffeeMac...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Place les images dans le parent
function placeLesImages(fichiers, papa, chemin, ou){ for (var n=0; n<fichiers.length; n++){ var im = document.createElement('img'); im.name = "ImageBanque"; var f = fichiers[n].split('>')[0]; im.id = f; im.title = f; im.alt ...
[ "displayImages() {\n observeDocument(node => this.displayOriginalImage(node));\n qa('iframe').forEach(iframe => iframe.querySelectorAll('a[href] img[src]').forEach(this.replaceImgSrc));\n }", "function initImgs(){\n for(var i = 1; i <= datas.nbrOfImages; i++) {\n // génère les...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Is the event's date ranged fully contained by the given range? start/end already assumed to have stripped zones :(
function eventContainsRange(event, start, end) { var eventStart = event.start.clone().stripZone(); var eventEnd = t.getEventEnd(event).stripZone(); return start >= eventStart && end <= eventEnd; }
[ "function isRangeWhole(range, unit) {\n return range.isSame(expandDateToRange(range.start, unit));\n}", "function validateDateFilter() {\n var startEra = getEra(\"start\");\n var endEra = getEra(\"end\");\n var startDate = getDate(\"start\");\n var endDate = getDate(\"end\");\n\n if ((!startEra &&...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Checks if the bragg equation has been satisified. sin(theta) = wavelength/2d.
function check_bragg(d) { n = 1 factor = 1 // console.log("Theta:", theta) // console.log("Radians:", Math.sin(factor * radians), Math.sin(factor * radians).toFixed(3)) // console.log("Bragg:", wavelength / (2 * d), (wavelength / (2 * d)).toFixed(3)) document.getElementB...
[ "function hasBloodPressureMatchingIndicators() {\n var bpSystolic = Number.MAX_VALUE;\n var bpDiastolic = Number.MAX_VALUE;\n for (var i = 0; i < vitalSignList.length; i++) {\n if (vitalSignList[i].includesCodeFrom(targetBloodPressureSystolicCodes) &&\n vitalSignList[i...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
The AWS::ServiceDiscovery::Instance resource specifies information about a service instance that AWS Cloud Map creates. For more information, see Instance in the AWS Cloud Map API Reference. Documentation:
function Instance(props) { return __assign({ Type: 'AWS::ServiceDiscovery::Instance' }, props); }
[ "function Instance(props) {\n return __assign({ Type: 'AWS::EC2::Instance' }, props);\n }", "async function listInstances() {\n const instancesClient = new compute.InstancesClient();\n\n const [instanceList] = await instancesClient.list({\n project: projectId,\n zone,\n });\n\...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
DisplayFeaturedProductsController for displau products application
function DisplayFeaturedProductsController($scope, __DataStore, appServices, __Utils) { var scope = this; scope.pageData = {}; scope.pageStatus = false; scope.products = []; // inject breadcrumb service appServices.updateBreadcrumbs([ { items : '', last_item : __globals.getJSS...
[ "productsDisplayEvent_productsShow(products) {\n console.log(`AmazonProductsController: ${products}`);\n $('#amazonProductFinderDisplayContainer').hide();\n $('#amazonProductsDisplayContainer').show();\n this.apd.productsDisplayEvent_showProducts(products);\n }", "function viewProdu...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Total Amount Received Calculation. (Card Amount + Cheque Amount + Gift Voucher Amount + Cash)
function totalAmtReceived_Calc(){ var cashAmount = $("#cashAmount").val(); var cardAmount = $("#cardAmount").val(); var chequeAmount = $("#chequeAmount").val(); var voucherAmount = $("#voucherAmount").val(); var totalAmtReceived = 0; if( cashAmount == null || cashAmount.length == 0 || cashAmount == ...
[ "function CashCalculateCashTotal() {\n var totalFacture = 0;\n var comptArgent = parseFloat($('#argnt_pamnt').val());\n var comptDebit = parseFloat($('#debit_pamnt').val());\n var credit = parseFloat($('#visa_crdt_inpt').val());\n var postDateMnt = parseFloat($('#pst_dat_mnt').val());\n\n comptArg...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Almacena cursos en el local storage
function guardarCursoLocalStorage(curso){ let cursos; //toma el valor de un arreglo con datos de ls o vacio cursos = obtenerCursosLocalStorage(); //el curso seleccionado se agrega el arreglo cursos.push(curso); localStorage.setItem('cursos', JSON.stringify(cursos)); }
[ "function obtenereCursosLocalStorage () {\n let cursosLS;\n\n //Comprobamos si hay items en el local storage\n if(localStorage.getItem('cursos') === null) {\n //si no hay cursos en el LS inicias como array vacio\n cursosLS = [];\n }else{\n cursosLS = JSON.parse(localStorage.getItem('cursos'));\n }\n ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
to prevent the addition of Sales Order item lines with an amount greater than 10000
function validateLine(group) { var newType = nlapiGetRecordType(); if ( newType == 'salesorder' && group == 'item' && parseFloat(nlapiGetCurrentLineItemValue(' item','amount')) > 10000 ) { alert('You cannot add an item with amount greater than 10000.') return false; } return true; }
[ "function setStandardJournalCreditLines(recBill,recJE)\r\n{\r\n //set the journal credit line for expense\r\n var arrSubTab = [];\r\n arrSubTab.push('item');\r\n arrSubTab.push('expense');\r\n \r\n var currentLine = recJE.getLineItemCount('line');\r\n currentLine = (!currentLine || ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
function for cop quicktab modification in logged out case
function loggedOutQuicktabAlter(){ if($("body").hasClass("not-logged-in")){ $('.node-type-work-group .cop-quicktab .resources , .node-type-work-group .cop-quicktab .e-learning , .node-type-work-group .cop-quicktab .experts').wrapAll('<li class="wrapped-list"> </li>'); if( $('.not-logged-in.node-type-work-...
[ "function loggedInQuicktabAlter(){\n\t\tif(($(\"body\").hasClass(\"logged-in\")) && ($(\"body\").hasClass(\"i18n-en\"))){\n\t\t//cop-header shifted\n\t\t\tvar content = $('.cop-main-header').clone();\n\t\t\t$('.cop-main-header').remove();\n\t\t\t$('.customized-quicktab-menu .tab-content').before(content);\n\t\t//R...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
These lines clear the location that's being watched when the component unmounts.
componentWillUnmount() { navigator.geolocation.clearWatch(this.watchID); }
[ "componentWillUnmount() {\n this.stopMatching();\n }", "componentWillUnmount(){\n this.props.getProviderErase();\n }", "componentWillUnmount() {\n this.props.fnEraseCityStateData();\n }", "componentWillUnmount() {\n this.observer.disconnect();\n }", "beforeUnmount() {\n this.o...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
changes the image displayed, replaces the innerHTML of the selectedImage div with the innerHTML of the full size image written to the page onLoad thumbnail Index is used to find the correct full size image div
function showLargeImage(caption,thumbnailArrayIndex){ //set ID for previously selected thumbnail var oldObjIdString = 'FSI_' + currentImageIndex; currentImageIndex = thumbnailArrayIndex; var objIdString = 'FSI_' + thumbnailArrayIndex; //display image document.getElementById('selectedImage').innerHTML = document.g...
[ "function loadingMainImgAfterLocationIsSelected(id){\r\n\tselectElement(id).innerHTML = \"<img src='layout/img/Design/what-is-on-the-menu-is.png' class='img-responsive img-rounded center-block' alt='' title='loading'/>\";\r\n}", "function updateImageSelection() {\r\n var image_iframe = document.getElementById(...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
face: face of a origami to be creased, will be removed after new ones are generated edge: proposed creasing line, infinite length
singleCrease(origami, faceID, crease){ let face = origami.getFaceByID(faceID); if (!face){ // console.log('No such face to crease'); return Crease.RESULT_INVALID_FACEID; } let edge = face.intersectEdge(crease, true); if (edge === null) { // console.log('No such crease'); retu...
[ "function face() {\n noFill();\n stroke('white'); strokeWeight(10);\n var face = triangle(300, 100, 100, 500, 500, 500);\n var cheekl = ellipse(150, 400, 50, 10);\n var cheek2 = ellipse(450, 400, 50, 10);\n}", "generateLines() {\n for (var f = 0; f < this.faceData.length/3; f++) {\n // Calc...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
assigning indicator instance from indicator object instantiated above
_instantiate (o) { if (this.instances[o] !== undefined) throw new Error(`indicator ${o} already instantiated`) this.instances[o] = indicators[o] console.log('instantiated', o) }
[ "_initIndicators () {\n if (this.indicatorsList.length <= 0) return\n for (let i = 0; i < this.indicatorsList.length; i++) {\n this._instantiate(this.indicatorsList[i])\n }\n console.log(this.instances)\n }", "function addIndicatorSliderData(rootPanelId, handleId, trackId, initialValue, inputEle...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Funzione per chiamata ajax risultati pagine companies
function getCompanies(page){ console.log('page', page); $.ajax({ url: '/companies', data: { page: page }, success: function(data){ // Insert rendering page $('.card_companies').html(data); // Aggiungo colore stile segnaposto pagina $('.nav_compa...
[ "function buscando_personasCongreso(cual, valor, en_campo, form_id){\n\t\n//\tdocument.getElementById(form_id).style.color = \"#000000\";\n\n\tif(valor==\"\"){\n\t\t$(\"#\"+cual).css(\"display\",\"none\");\t\n\t}else{\n\t\t$(\"#\"+cual).css(\"display\",\"\");\n\t}\n\tpetision(\"buscarPersonasCongreso_ajax.php\", cu...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Sanitises a number (e.g. flat number, unit number etc) from lucene these are set to 1 if they don't exist, we'd prefer if they were undefined.
function sanitiseAddressNumber(number) { return number > 0 ? number : undefined; }
[ "function sanitizeNumber(number) {\n if (!number) {\n return 0;\n }\n if (typeof number === 'object') {\n return number;\n }\n number = number.toString();\n number = number.trim();\n if (!isNaN(parseFloat(number))) {\n return parseFlo...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Returns true if the slice occupies a continous set of elements in the 'flat' space.
function isSliceContinous(shape, begin, size) { // Index of the first axis that has size > 1. var firstNonOneAxis = size.length; for (var i = 0; i < size.length; i++) { if (size[i] > 1) { firstNonOneAxis = i; break; } } for (var i = firstNonOneAxis + 1; i < si...
[ "isFull() {\r\n\t\treturn (this.emptyCells.size() == 0);\r\n\t}", "function isContiguous(nums, target) {\r\n // find all combinations of the list\r\n // https://stackoverflow.com/questions/5752002/find-all-possible-subset-combos-in-an-array\r\n // https://codereview.stackexchange.com/questions/7001/generating-...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Returns an exception to be thrown when attempting to assign a nonarray value to a select in `multiple` mode. Note that `undefined` and `null` are still valid values to allow for resetting the value.
function getMatSelectNonArrayValueError() { return Error('Value must be an array in multiple-selection mode.'); }
[ "function dontselect(objVal,indexNo,strError){\n var objValue=document.getElementById(objVal);\n var finalerr=\"\";\n if(!objValue) {alert(\"Control with id \" + objVal + \" not found\"); return;}\n if(objValue.selectedIndex == null) \n finalerr=\"BUG: dontselect command for non-select Item\";\n ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Voeg een key 'achtergrond' toe met alle achtergronden
function addKey(results){ results.map(result => { result.achtergrond = result.achtergrond_Aru + ', ' + result.achtergrond_Cur + ', ' + result.achtergrond_Mar + ', ' + result.achtergrond_NL + ', ' + result.achtergrond_Sur + ', ' + result.achtergrond_Tur + ', ' + result.achtergrond_anders + ', ' + result.ach...
[ "static getKeys() {\n return [\n this.USD_N,\n //this.EUR_N,\n //this.BTC_N,\n ];\n }", "function listKeys() {\n let keyString = \"\";\n for (let key in flower) {\n keyString += key + \", \";\n }\n return keyString;\n}", "function giveKeys(cho...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
FUNCTION: RTCElement.setElementString DESCRIPTION: Set the element string data. ARGUMENTS: elmStr string. new string data for element. RETURNS: none
function RTCElement_setElementString(elmStr) { this.elementString = elmStr; }
[ "function RTCElement(elmType, elmStr)\n{\n // Type expected to be one of extUtils.DIRECTIVE_*, extUtils.RAW_CODE,\n // extUtils.PARAMETER.\n this.elementType = elmType;\n this.elementString = elmStr;\n}", "function writeString(attribute, val) {\n // write length of attribute (1 byte) \n buf.writeUInt8...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Returns an object from its key or UUID. TODO: should throw a NoSuchObject error on failure.
getObject (key, type) { const { all, indexes: { byRef } } = this._objects const obj = all[key] || byRef[key] if (!obj) { throw new NoSuchObject(key, type) } if (type != null && ( isString(type) && type !== obj.type || !includes(type, obj.type) // Arr...
[ "function findObjectByUuid(uuid) {\n var $tr = null;\n $('#attributeList tr').each(function () {\n var trId = $(this).attr('id');\n if (trId && (trId.startsWith(\"Object\") || trId.startsWith(\"Attribute\") || trId.startsWith('proposal'))) {\n var objectUuid = $('.uuid', this).text()....
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
CODING CHALLENGE 144 Create a function to count the number of 1s in a 2D array.
function countOnes(matrix) { let x = 0; for (let i = 0; i < matrix.length; i++) { for (let j = 0; j < matrix.length; j++) { if (matrix[i][j] === 1) { x++; } } } return x; }
[ "function solve0(matrix) {\n // Write your code here\n // Track the count\n let count = 0;\n // Loop through outer array\n for(let i=0; i<matrix.length; i++) {\n // Loop through inner array\n for(let j=0; j<matrix[i].length; j++){\n // Increment count if inner el is even\n ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Returns a boolean whether the currently toggled columns differ from the default set of visible columns.
columnsAreToggled() { return !ii(this.visibleColumns, this.defaultVisibleToggleableColumns); }
[ "function hasAllColumnsDeselected() {\n var allDeselected = true;\n for( var i = 0; i < vm.items.length; i++ ) {\n if(vm.items[i].selected) {\n \tallDeselected = false;\n break;\n }\n }\n return allDeselected...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Checks if a node is the last sibling
function lastSibling (node, parentNode) { var lastChild = 0; for (i=0; i< TreeNodes.length; i++) { var nodeValues = TreeNodes[i].split("|"); if (nodeValues[1] == parentNode) lastChild = nodeValues[0]; } if (lastChild == node) return true; return false; }
[ "function getLastSibling(node) {\n let sibling = node;\n\n while (sibling && sibling.next) {\n sibling = sibling.next;\n }\n\n return sibling;\n}", "function lastElementChild(element) {\n var child = element.lastChild;\n while (child !== null && child.nodeType !== 1) {\n child = ch...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
=== Fixes the position of buttons group in content header and top user navigation ===
function fix_position() { var uwidth = $('#user-nav > ul').width(); $('#user-nav > ul').css({width:uwidth,'margin-left':'-' + uwidth / 2 + 'px'}); var cwidth = $('#content-header .btn-group').width(); $('#content-header .btn-group').css({width:cwidth,'margin-left':'-' + uwidth / 2 + 'px'})...
[ "function setMoveButtons(radioGroup,upBtn,dnBtn)\n{\n var checkIdx = getRadioSelectedIndex(radioGroup);\n upBtn.disabled=false;\n dnBtn.disabled=false;\n //No button checked or only one button\n if ( checkIdx == -1 || !radioGroup.length)\n {\n upBtn.disabled=true;\n dnBtn.disabled=true;\n }\n //Top bu...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Function for create categories slider
function createCategoriesSlider() { let startPoint = document.querySelector(".dashboard__categories__slider"); categories.forEach((cat, i) => { let sliderItem = document.createElement("div"); sliderItem.className = "categories__slider__item"; sliderItem.classList.add(`${cat.classes}`); sliderItem.o...
[ "function createMainCategory() {\r\n var id = document.getElementById(\"main-category\");\r\n id.innerHTML = \"\";\r\n for (var i = 0; i < dict.mainCategory.length; i++) {\r\n id.appendChild(createMainCategoryButton(dict.mainCategory[i]));\r\n }\r\n id.firstChild.classList.add(\"menu-first-cat...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Apply up to Recover.MaxNext recovery actions that conceptually inserts some missing token or rule.
recoverByInsert(next) { if (this.stack.length >= 300 /* Recover.MaxInsertStackDepth */) return [] let nextStates = this.p.parser.nextStates(this.state) if ( nextStates.length > 4 /* Recover.MaxNext */ << 1 || this.stack.length >= 120 /* Recover.DampenInsertStackDept...
[ "recoverByDelete(next, nextEnd) {\n let isNode = next <= this.p.parser.maxNode\n if (isNode) this.storeNode(next, this.pos, nextEnd, 4)\n this.storeNode(0 /* Term.Err */, this.pos, nextEnd, isNode ? 8 : 4)\n this.pos = this.reducePos = nextEnd\n this.score -= 190 /* Recover.Delete...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Runs on page load, from createMap() make default colorbar queries for all datasets Makes colorbar url format and stores it with dataset (like parameters list)
function makeDefaultColorbarQueries(entry) { for (i = 0; i < entry["datasets"].length; i++) { var ds_info = entry["datasets"][i]; for (j = 0; j < ds_info.parameters.length; j++) { var colorbarInfo = ds_info.parameters[j]["colorbar"]; cbitems = []; cbitems.push(c...
[ "function setupColorMap() {\n var c3=colorbrewer.Dark2[8];\n var c1=colorbrewer.Set1[8];\n var c2=colorbrewer.Paired[8];\n colorMap.push('#1347AE'); // the default blue\n for( var i=0; i<8; i++) {\n colorMap.push(c1[i]);\n }\n for( var i=0; i<8; i++) {\n colorMap.push(c2[i]);\n }\n for( var i=0; i<8;...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
create a recipe card and render it
function generateRecipeCard(recipe) { const recipeCard = ` <div class="recipe-card"> <img src=${recipe.image} alt="recipe image"> <h4 class="title">${recipe.label}</h4> <p class="cal">Calories: ${recipe.calories.toFixed(0)}</p> </div>` recipeCardConta...
[ "function makeCards() {\n //clear previous search results\n cardWrapperDiv.innerHTML = ``;\n for (let i = 0; i < recipeList.length; i++) {\n let newCard = document.createElement(`div`);\n newCard.classList.add(`card`);\n newCard.setAttribute(`data-id`, [i]);\n newCard.setAttribute(`styl...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Add Lightbox Swipe Support
function addLightBoxSwipeSupport() { if ($("#lightbox-image").length) // Has Carousels { // Allow Swipes $("#lightbox-image").swipe( { swipeLeft:function(event, direction, distance, duration, fingerCount) { if ($('.next-lightbox').is(':visible')) { $('.next-lightbox').click(); } }, ...
[ "function wpsight_photoswipe() {\n \t\n \tvar thumbnails = 'a:has(img)[href$=\".bmp\"],a:has(img)[href$=\".gif\"],a:has(img)[href$=\".jpg\"],a:has(img)[href$=\".jpeg\"],a:has(img)[href$=\".png\"],a:has(img)[href$=\".BMP\"],a:has(img)[href$=\".GIF\"],a:has(img)[href$=\".JPG\"],a:has(img)[href$=\".JPEG\"],a:has...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
FUNCTION: DocEdit.processPriorNodeEdit DESCRIPTION: This function processes a docEdit node which is updating an existing node on the page. ARGUMENTS: index integer the position of this node within the docEdits.editList array. This is needed so that adjacent nodes can be referenced. RETURNS: nothing
function DocEdit_processPriorNodeEdit(index) { //only update if new text has been provided if (this.text != null) { //if nodeAttribute, only update the attribute (or tag section) if (this.weight.indexOf("nodeAttribute") == 0) { var pos = extUtils.findAttributePosition(this.priorNode, this.weight...
[ "function DocEdit_processForApply(index)\n{\n this.mergeDelims = null;\n if (!this.dontMerge)\n {\n this.mergeDelims = docEdits.canMergeBlock(this.text);\n }\n\n this.bDontMergeTop = false;\n this.bDontMergeBottom = false;\n\n this.formatForMerge();\n\n if (this.priorNode) //if node was already there, re...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
True when this hex can have a port on top of it
get canHavePort() { return false; }
[ "function port_range_is_invalid(){\n var cf = document.forms[0];\n var start = parseInt(cf.port_start.value, 10);\n var stop = parseInt(cf.port_end.value, 10);\n\n if (start<= 0\n || start >= 65535\n || stop <= 0\n || stop >= 65535\n || start > stop) {\n ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
here we check for active text boxes by checking mouse position against box coordinates
function nodeTextActive(){ for (var i = 0;i<visTree.orderedNodes.length;i++) { if (mouseX > visTree.orderedNodes[i].boxLeft && mouseX < visTree.orderedNodes[i].boxRight) { if (mouseY > visTree.orderedNodes[i].boxTop && mouseY < visTree.orderedNodes[i].boxBottom) { //sets flag...
[ "function handleMouseDown(e){\n e.preventDefault();\n startX=parseInt(e.clientX-offsetX);\n startY=parseInt(e.clientY-offsetY);\n \n // Put your mousedown stuff here\n for(var i = 0;i < texts.length;i++){\n \t if(textHittest(texts, startX, startY, i)){\n \t\t selectedType = 0;\n \t\t selectedT...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
On load set vat "ON".
function enable_vat () { $('#no_Vat').prop({'checked': 'false'}); $('#with_Vat').prop({'checked': 'true'}); $('#sid-with-Vat').prop({'checked': 'true'}); $('.vatControl.add').addClass('active'); $('.select-vat, .billing-profile-vat').removeClass('hide'); // Andreas 20/06/...
[ "ecoOn() {\n this._ecoMode(\"eco_on\");\n }", "function setVerbose(v) {\n verbose = v;\n }", "loaded(state, { isLoaded, uid }) {\n Vue.set(state.properties[uid], 'isLoaded', isLoaded)\n }", "function resourceOnload() {\n initShowdownExt();\n hljs.initHighlightingO...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
getCORS: Get CORS information of the bucket.
getCORS(callback) { return this.getCORSRequest().sign().send(callback); }
[ "deleteCORSRequest() {\n let operation = {\n 'api': 'DeleteBucketCORS',\n 'method': 'DELETE',\n 'uri': '/<bucket-name>?cors',\n 'params': {\n },\n 'headers': {\n 'Host': this.properties.zone + '.' + this.config.host,\n },\n 'elements': {\n },\n 'properties...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
drop all fields that aren't found in the attributes array
function cleanup(a) { return _.filter(a, function (a) { var field = a[0]; return attr[field]; }); }
[ "function removeFields(feature,fields) {\n if (typeof(fields) != \"undefined\" && fields != \"\" && feature.attributes) {\n var fieldsarr = fields.split(\",\");\n var remFlds = [];//array to hold fields to remove from object\n for (var n in feature.attributes) {\n if (fieldsarr.in...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }