query
stringlengths
9
34k
document
stringlengths
8
5.39M
negatives
listlengths
19
20
metadata
dict
Options are the values that are going to be passed as environment variables to the script; Static envs should work as a filter.
function envOptions(path, queries, staticEnv, data) { //Evaluate json queries var env = evalQueries(queries, data) _.merge(env, staticEnv); //static from descriptor _.merge(env, _.omit(process.env, function(value, varName) { if (_.includes(varName, 'npm_')) return true; return false; })); //process environ...
[ "_parseOptionsEnv() {\n this.options.forEach((option) => {\n if (option.envVar && option.envVar in process.env) {\n const optionKey = option.attributeName();\n // Priority check. Do not overwrite cli or options from unknown source (client-code).\n if (this.getOptionValue(optionKey) === ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
will iterate through the global codeObj JSON object and when done, run itself again after a delay
function iterateCodeObj() { var lastFadeId; var tDelay = 0; for(key in codeObj) { tDelay += delayArrIteration(codeObj[key], tDelay); var fadeDelay = tDelay + 4000; lastFadeId = setTimeout(codeContainerChildrenFade, fadeDelay); fadingTimeoutIds.push(lastFadeId); } clearTimeout(lastFadeId); lastF...
[ "function geoCodeLoop(geoCodeArray, geocoder, data, geoCodeIndex, iterations) {\n for (i = 0; i < iterations; i++) {\n geoCodeIndex--;\n //Find the mural ID in the geoCodeArray by selecting it by it's index\n var muralID = geoCodeArray[geoCodeIndex];\n //decriment geoCodeIndex to coun...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Gets the source of the recipe by making another API call using the id fetched from getRecipe() The function was from the tutorial but we'll still want to use it, probably.
function getSource(id){ $.ajax({ url:"https://api.spoonacular.com/recipes/"+id+"/information?apiKey=99a01e3d7525405894929bfbec77ffa3", success: function(res) { document.getElementById("sourceLink").innerHTML=res.sourceUrl document.getElementById("sourceLink").href=res.sourceUrl } }); }
[ "static async getRecipeById(id) {\n\t\tconst res = await this.request(`recipe/${id}`);\n\t\treturn res.recipe;\n\t}", "static async getRecipe(id) {\n let res = await this.request(`recipes/${id}`);\n return res;\n }", "async function getSingleRecipe(recipeId) {\r\n let singleRecipe = await fetc...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Action creator for showing link context.
function showLinkContext() { return function(dispatch, getState) { var state = getState(); var selectedContacts = state.outlook.pages[state.outlook.page].filter(function(e) { return e.selected; }); if (selectedContacts.lengt...
[ "function hideLinkContext() {\n return function(dispatch) {\n dispatch({ type: actionTypes_1.default.HIDE_LINK_CONTEXT });\n };\n }", "function linkToAction(showLink, action, text) {\n if (!showLink) {\n return text;\n }\n return \"<a href='javascript:eng.ProcessA...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Creates a matrix of 2N3 equations based on the method of joints, and solves it
function methodOfJoints(){ var force_matrix=[]; //each row will represent an Fx and Fy equation for each node var solution=[]; //this will represent the external forces in the x and y direction acting on the node for(var i=0;i<E.nodes.length;i++){ //iterate through all of the nodes that exist var rowX=[]; //will ...
[ "function Translational3Constraint(joint, limitMotor1, limitMotor2, limitMotor3) {\n\n this.m1 = NaN;\n this.m2 = NaN;\n this.i1e00 = NaN;\n this.i1e01 = NaN;\n this.i1e02 = NaN;\n this.i1e10 = NaN;\n this.i1e11 = NaN;\n this.i1e12 = NaN;\n this.i1e20 = NaN;\n this.i1e21 = NaN;\n th...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Sets default footer template
_setDefaultFooterTemplate(initialization) { const that = this; that.$.calendarDropDown.footerTemplate = that._defaultFooterTemplate; if (initialization) { that.$.calendarDropDown._handleLayoutTemplate(that.$.calendarDropDown.$.footer, that._defaultFooterTemplate); } ...
[ "_setDefaultFooterTemplate(initialization) {\n const that = this;\n\n that.$.calendarDropDown.footerTemplate = that._defaultFooterTemplate;\n\n if (initialization) {\n that.$.calendarDropDown._handleLayoutTemplate(that.$.calendarDropDown.$.footer, that._defaultFooterTemplate);\n ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Resize the iframe to be the size of the article.
function resizeIframe(iframe) { iframe.height = iframe.contentWindow.document.body.scrollHeight + "px"; }
[ "function _resizeIframe() {\n if (isOn && $iframe) {\n var chatBoxWidth = chatBox.$panel.innerWidth() + \"px\";\n $iframe.attr(\"width\", chatBoxWidth);\n }\n }", "function sizeFrame(){\r\nvar frameWidth = $('.slide iframe').width();\r\nvar aspect = (frameWidth * 0.75)\r\n$(...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Grab players from sessionStorage and push into players array
function getPlayerStorage() { let storage = JSON.parse(sessionStorage.getItem('players')); for (item in storage) { addPlayer(storage[item].color, storage[item].name); } }
[ "function setPlayerStorage() {\r\n sessionStorage.setItem(\"players\", JSON.stringify(players));\r\n}", "function getPlayers() {\r\n let players;\r\n if (sessionStorage.getItem(\"players\") === null) {\r\n players = [];\r\n } else {\r\n players = JSON.parse(sessionStorage.getItem(\"playe...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Finds the pcb that will be rolled out for a roll in
function get_least_important_pcb() { var worst_pcb; for (pid in _residency) { if (_residency[pid].partition !== undefined && _residency[pid].partition !== null) { worst_pcb = _residency[pid]; } } return worst_pcb; }
[ "function calculatePinsUpRoll2(rolls){\n\treturn 10-rolls;\n}", "determineProposer() {\n let proposerPower = 0;\n this.roundAccumPower.forEach((power, addr) => {\n //this.log(` ${addr} has ${power} (${typeof power}) voting power.`);\n if (power > proposerPower) {\n this.currentProposer = ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Add get role method, hard coded as "Manager"
getRole(){ return "Manager" }
[ "getRole(){\n return 'Manager';\n }", "getRole() {\r\n return \"Manager\";\r\n }", "getRole() {\n return \"Manager\";\n }", "getRole() {\n return \"Manager\";\n }", "getRole() {\n\n return \"Manager\";\n }", "getRole() {\n //add code to re...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
update heading when creating/managing movie night theme
function updateHeading() { var mnTheme = $('input[field="theme"]').val(); $('h1#lmnopHeading').text('New ' + mnTheme); }
[ "updateTitle() {\n if (this.style == 'full') {\n if (this.tileable.title.includes(this.app.get_name())) {\n this.title.text = this.tileable.title;\n } else {\n const escapedAppName = GLib.markup_escape_text(this.app.get_name(), -1);\n ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
wrapper for selectHeirloom, to handle the protect button
function newSelectHeirloom(number, location, elem){ selectHeirloom(number, location, elem); protectHeirloom(); }
[ "function selectionTool() {\r\n var ref = $(\"[id^='select-']\");\r\n for (var i = 0; i < ref.length; i++) {\r\n $(ref[i]).click(function (evt) {\r\n if (varsel == 0) {\r\n selctfeaturelayerlistwidget.show();\r\n }\r\n var t = evt.target.value;\r\n t = t.toUpperCase()...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Get start menu shortcut id.
function getStartMenuShortcutId(installPath) { return "startMenuShortcut_" + makeUniqueShortId(installPath) }
[ "get startedUsingShortcut() {\n return this._startedUsingShortcut;\n }", "function getDesktopShortcutId(installPath) {\n\treturn \"desktopShortcut_\" + makeUniqueShortId(installPath)\n}", "getID() {\n return this._menuID;\n }", "getSubmenuId() {\n return 'submenu-' + this.submenuIndex++;\n }...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
A helper function useful for extracting `R3DependencyMetadata` from a Render2 `CompileTypeMetadata` instance.
function dependenciesFromGlobalMetadata(type,outputCtx,reflector){var e_1,_a;// Use the `CompileReflector` to look up references to some well-known Angular types. These will // be compared with the token to statically determine whether the token has significance to // Angular, and set the correct `R3ResolvedDependencyT...
[ "function dependenciesFromGlobalMetadata(type,outputCtx,reflector){// Use the `CompileReflector` to look up references to some well-known Angular types. These will\n// be compared with the token to statically determine whether the token has significance to\n// Angular, and set the correct `R3ResolvedDependencyType`...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
create Struts Xml insert values variable
function makeStrutsXmlInsertValues() { var xml = ''; for (var i = 1; i < gValuesOfRange.length; i++) { /** set common var in column range*/ if (!setCommonVar(i)) { return ''; } if (cPhysicalNameOfColumn == '') { break; } xml += '#' + c...
[ "function makeStrutsXmlUpdateValues() {\n\n var xml = '';\n\n for (var i = 1; i < gValuesOfRange.length; i++) {\n\n /** set common var in column range*/\n if (!setCommonVar(i)) {\n return '';\n }\n\n if (cPhysicalNameOfColumn == '') {\n break;\n }\n\n ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
the sentence "The quick brown fox jumps over the lazy dog" is a pangram, because it uses the letters AZ at least once (case is irrelevant). Given a string, detect whether or not it is a pangram. Return True if it is, False if not. Ignore numbers and punctuation. remove all nonletter chars split the string
function isPangram(str){ const alphArr = ['a','b','c','d','e','f','g','h','i','j','k','l','m','n','o','p','q','r','s','t','u','v','w','x','y','z']; let s = str.replace(/[^a-z]/ig, ''); let strArr = s.toLowerCase().split(''); strArr.map(char => alphArr.includes(char) && alphArr.splice(alphArr.indexOf(cha...
[ "function isPangram(string) {\n return [...string.replace(/[^\\w\\s]|_/g, \"\").replace(/[0-9]/g, '').split(\" \")].every((item) => item.length + 1 === 26 ? false : item.length === new Set(item).size);\n}", "function isPangram(string){\n return /(?=.*a)(?=.*b)(?=.*c)(?=.*d)(?=.*e)(?=.*f)(?=.*g)(?=.*h)(?=.*i)(?...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Changes the groupings (x and yaxis color bars).
function change_groups(inst_index) { d3.selectAll('.' + dom_class) .style('fill', function(d) { return group_colors[d.group[inst_index]]; }); }
[ "function runGroupingStep() {\n var groupColors = [\"#1abc9c\", \"#3498db\", \"#9b59b6\", \"#2ecc71\",\n \"#f1c40f\", \"#e67e22\", \"#e74c3c\",\n \"#16a085\", \"#27ae60\", \"#2980b9\", \"#8e44ad\",\n \"#f39c12\", \"#d35400\",\"#...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
All calls to setToggleButton should be protected, and only called within a callback from getDropListChildren
function setToggleButton (e, checked) { let toggleButton = e.parentElement.querySelector("button.upDownButton"); let dropList = e.parentElement.querySelector("div.dropList"); let dropListItems = dropList.children; let n = countShowing(dropList); if (checked) { if (n == 0) { toggleButton.checked = tru...
[ "handleToggleDropList() {\n if (this.state.isOpen) {\n removeEvent(document, 'click', this.handleDocumentClick);\n } else {\n addEvent(document, 'click', this.handleDocumentClick);\n }\n\n this.setState({\n isOpen: !this.state.isOpen\n });\n }",...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Coloured Rounded Line Chart Line Chart
function coloredRounedLineChart(dataColouredRoundedLineChart) { optionsColouredRoundedLineChart = { lineSmooth: Chartist.Interpolation.cardinal({ tension: 10 }), axisY: { showGrid: true, offset: 40, labelInt...
[ "getLineColorsAndWidth(){\n\n\t\tthis.radarChart.series.forEach((value,j) => {\n\t\t\tfor(let i=0;i<this.chartVizInfo.length;i++){\n\t\t\t\tif( i === j){\n\t\t\t\t\tthis.chartVizInfo[i].XX_LINE_COLOR.lineColor = value.lineColor;\n\t\t\t\t\tthis.chartVizInfo[i].XX_LINE_WIDTH.lineWidth = value.lineWidth;\n\t\t\t\t}\n...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Estimates crosssection widths given image collection (higherorder function).
function etimateWidthForImages(images) { return function(crossSection) { var timeSeries = getWidthTimeSeries(images, crossSection) var widths = timeSeries.aggregate_array('width') var widths_masked = timeSeries.aggregate_array('masked') var times = timeSeries.aggregate_array('system:time_star...
[ "function generateWidthForCatchment(c, index, crossSections) {\n var bounds = c.geometry()\n \n crossSections = crossSections.filterBounds(bounds)\n\n crossSections.size().evaluate(function(size) {\n print(index)\n \n if(!size) {\n print('<no cross-sections detected>')\n return\n }\n \n...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Renders the message difference. / / The message edited at text. / The nothing selected text. / The select both text. / The select different text.
function RenderMessageDiff(messageEditedAtText,nothingSelectedText,selectBothText,selectDifferentText){var oldElement=$("input[id*='New']:checked");var newElement=$("input[id*='Old']:checked");if(newElement.length && oldElement.length){ // check if two different messages are selected if($("input[id*='Old']:checked").at...
[ "_updateDifference () {\n if (this.to.length > this.from.length) {\n this.textDifference = this.to.substring(this.from.length, this.to.length);\n this.animationDirection = TEXT_ANIMATION_DIRECTIONS.ADD;\n }\n else {\n this.textDifference = this.from.substring(th...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
showMoveAnimation(i, j, i, k);
function showMoveAnimation( fromx , fromy , tox , toy ){ var numberCell = $('#number-cell-'+fromx+'-'+fromy ); numberCell.animate({ top:getPosTop( tox ,toy ), left:getPosLeft(tox ,toy) },200) }
[ "function animate() { }", "function updateVis(move) {\n ;\n}", "function animG(){\r\n\tAnimation13();\r\n\tAnimation14();\r\n}", "function animE(){\r\n\tAnimation9();\r\n\tAnimation10();\r\n}", "animation() {}", "function kinetic(){\n biglogs.animate();\n pinkcar.animate();\n racecar.animate()...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Update an item in the this._cache and fire an UPDATE event. If the item does not exist, an ADD event will be fired instead.
update(item) { this._cache[item._id] = item; this.emit(events.CHANGE, item, this); }
[ "function updateItem(item) {\n $.ajax({\n method: \"PUT\",\n url: \"/api/items\",\n data: item\n })\n .done(function() {\n getItems();\n getItemsDevoured();\n });\n }", "update () {\n if (this._disabled) return\n\n this._cache()\n this._update()\n }", "handleUpdat...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Random input strings test. No output verification, useful for valgrind etc. Exercises fromCharCode(), toUpperCase(), toLowerCase(), toLocaleUpperCase(), toLocaleLowerCase().
function randomStringTest() { var i, j, len, arr, str, res1, res2, res3; for (i = 0; i < 100; i++) { if ((i % 10) == 0) { print(i); } len = Math.floor(Math.random() * 40000); arr = []; for (j = 0; j < len; j++) { arr.push(Math.floor(Math.random() * 0x1000000)); ...
[ "function testInLowerCaseAlphabet(){\n\t\tvar StringUtils = LanguageModule.StringUtils;\n\t\tvar stringUtils = new StringUtils();\n\t\tvar encodings = stringUtils.stringEncodings;\n\t\tvar lencodings = stringUtils.languageEncodings;\n\t\tvar isLowerCaseInAlphabet1 = stringUtils.isLowerCaseInAlphabet(\"abcdef\", enc...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
creates the commonCovariance matrix for all gesture classes
function getCommonCovarianceMatrix(gestureClasses) { let commonCovMatrix = [...Array(NUM_FEATURES)].map(e => Array(NUM_FEATURES)); let numClasses = gestureClasses.length; // C let covMatrices = new Array(numClasses); let numGestureExamples = 0; for (let i = 0; i < numClasses; i++) { numGestureExamples += gestur...
[ "function setCommonCovarianceMatrix(GestureSet) {\n let matrix = [];\n for (var i = 0; i < RubineFeatures.length; i++) {\n matrix[i] = [];\n for (let j = 0; j < RubineFeatures.length; j++) {\n let num = 0.0;\n let den = -_this.gestureClasses.length;\n Object.keys...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
show edit post button and input field
function showEditPost(postid){ if(document.getElementById("editPostDiv" + postid).style.display == "none"){ document.getElementById("editPostDiv" + postid).style.display = "block" document.getElementById("showEditPostBtn" + postid).innerHTML = "Cancel" } else { document.getElementById("editPostDiv" + posti...
[ "function editClicked() {\n editButton.style.display = 'none';\n saveButton.style.display = 'block';\n postHeading.style.border = '2px solid pink';\n postContent.style.border = '2px solid pink';\n postHeading.setAttribute('contenteditable', true);\n postContent.setAttribute('contenteditable', true);\n}", "f...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Transitions the caption depending on alignment
function captionTransition(caption, duration) { if (caption.hasClass("center-align")) { caption.velocity({opacity: 0, translateY: -100}, {duration: duration, queue: false}); } else if (caption.hasClass("right-align")) { caption.velocity({opacity: 0, translateX:...
[ "function captionTransition(caption, duration) {\n if (caption.hasClass(\"center-align\")) {\n caption.velocity({ opacity: 0, translateY: -100 }, { duration: duration, queue: false });\n } else if (caption.hasClass(\"right-align\")) {\n caption.velocity({ opac...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Compare another graph to this one.
equals(other) { if (this === other) return true; // handle string case here if (typeof other == 'string') { let s = other; other = new this.constructor(); if (!other.fromString(s)) return s == this.toString(); if (other.n > this.n) return false; if (other.n < this.n) other.expand(th...
[ "equals(other) {\n\t\tif (this === other) return true;\n\t\t// handle string case here\n if (typeof other == 'string') {\n let s = other; other = new this.constructor();\n\t\t\tif (!other.fromString(s)) return s == this.toString();\n\t\t\tif (other.n > this.n) return false;\n\t\t\tif (other.n < th...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Parses a setcookiestring based on the standard defined in RFC6265 S4.1.1.
function parseSetCookieString(str) { str = cleanCookieString(str); str = getFirstPair(str); var res = COOKIE_PAIR.exec(str); if (!res || !res[VALUE_INDEX]) return null; return { name : unescape(res[KEY_INDEX]), value : unescape(res[VALUE_INDEX]) }; }
[ "function parseSetCookieString(str) {\n str = cleanCookieString(str);\n str = getFirstPair(str);\n\n var res = COOKIE_PAIR.exec(str);\n\n return {\n name: decodeURIComponent(res[KEY_INDEX]),\n value: decodeURIComponent(res[VALUE_INDEX])\n };\n}", "function parseCookies(setCookieHeader) {\n if (!setC...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Bind header actions for queues and tickets
function queuesAndTicketHeader(configPass, tktType) { setCurrentRole(); fromDate(".fromDate"); changeRoles(configPass); ticketActions(configPass); add_ticket_button(configPass); get_single_ticket(configPass); addResponse(configPass); addTime(configPass); getGravatar("p.cir_gravatar", 40); // This should be...
[ "editTopicInChatHeader() {\n AppDispatcher.dispatch('edit-topic');\n }", "function setHeaders(){\n\theaders = [\"ID\",\"Name\"];\n\tfor(var i=0;i<headers.length;i++){\n\t\toutlet(5,\"set \"+ i + \" 0\" + \"\\t\" + headers[i]);\n\t}\n}", "function headersmenu(obj, button, event)\n {\n $('li > a', o...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Allows you to hoist methods, except those in an exclusion set from a source object into a destination object.
function hoistMethods( // tslint:disable-next-line:no-any destination, // tslint:disable-next-line:no-any source, exclusions) { if (exclusions === void 0) { exclusions = REACT_LIFECYCLE_EXCLUSIONS; } var hoisted = []; var _loop_1 = function (methodName) { if (typeof source[methodName] === '...
[ "function hoistMethods(destination, source, exclusions) {\n\t if (exclusions === void 0) { exclusions = REACT_LIFECYCLE_EXCLUSIONS; }\n\t var hoisted = [];\n\t var _loop_1 = function (methodName) {\n\t if (typeof source[methodName] === 'function' &&\n\t destination[methodName] === undefin...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
set global var of sheet
function setGlobalVar() { gActiveSheet = SpreadsheetApp.getActiveSheet(); gMaxRow = gActiveSheet.getLastRow(); gValuesOfRange = gActiveSheet.getRange(10, 1, gMaxRow, 50).getValues(); gIndexOfLogicalNameOfColumn = gValuesOfRange[0].indexOf('カラム名(論理)'); gIndexOfPhysicalNameOfColumn = gValuesOfRange[0...
[ "function setup() {\n var sheet = SpreadsheetApp.getActiveSpreadsheet();\n SCRIPT_PROP.setProperty(\"key\", sheet.getId());\n}", "function _initSheet(){\r\n var sskey = PropertiesService.getScriptProperties().getProperty(\"ss_key\");\r\n var ss = null;\r\n if(sskey!==null){\r\n try{\r\n ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
populating domain capacity down button dynamically using the values fetched from database
function populate_capacity_dropdown_by_query() { let select = document.getElementById("Select Capacity"); let arr= Get("api/buttonsdynamically/get/capacity"); if(select===null) alert("empty object retrieved from DOM parse"); if( select.length>1) { //alert("capacities already exist in und...
[ "drawBadges (){\n /**\n * container in the left hand side\n * @type {T | string}\n */\n select (\"slot_not_available\").innerHTML = this.slotsArray.reduce((acc, [slotTime, flag], i)=>acc +\n `<button class=\"btn btn-primary\" ${flag?\"disabled\":\"\"} onclick=\"makeA...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Renders the AWS CloudFormation properties of an `AWS::ApplicationInsights::Application.CustomComponent` resource
function cfnApplicationCustomComponentPropertyToCloudFormation(properties) { if (!cdk.canInspect(properties)) { return properties; } CfnApplication_CustomComponentPropertyValidator(properties).assertSuccess(); return { ComponentName: cdk.stringToCloudFormation(properties.componentName), ...
[ "renderProperties(x) { return ui.divText(`Properties for ${x.name}`); }", "function cfnNetworkInsightsAnalysisAnalysisComponentPropertyToCloudFormation(properties) {\n if (!cdk.canInspect(properties)) {\n return properties;\n }\n CfnNetworkInsightsAnalysis_AnalysisComponentPropertyValidator(proper...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Given a price, returns its pixel position
function getPixelY(vizState, price) { return vizState.canvasHeight - (((+price - vizState.minPrice) / (vizState.maxPrice - vizState.minPrice)) * vizState.canvasHeight); }
[ "getX(price) {\n const xRatio = (price - this.firstPrice) / (this.lastPrice - this.firstPrice)\n const x = this.leftYAxisX + this.chartWidth * xRatio\n\n // the coordinate should stay within the chart axis, hence the 1px max/min\n const leftCappedX = Math.max(x, this.leftYAxisX + 1)\n return Math.min...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Maps tile ids to shape ids (both are nonnegative integers). Supports onetomany mapping (a tile may belong to multiple shapes) Also maps shape ids to tile ids. A shape may contain multiple tiles Also supports 'flattening' removing onetomany tileshape mappings by removing all but one shape from a tile. Supports onetomany...
function TileShapeIndex(mosaic, opts) { // indexes for mapping tile ids to shape ids var singleIndex = new Int32Array(mosaic.length); utils.initializeArray(singleIndex, -1); var multipleIndex = []; // index that maps shape ids to tile ids var shapeIndex = []; this.getTileIdsByShapeId = func...
[ "function drawShapes( ctx ) {\n map_tiles.map(( col, c ) => {\n col.map(( row, r ) => {\n let item = row;\n item.shape.draw( ctx );\n });\n });\n }", "updateMap() {\n const shape = this.shape,\n data = this.shape.shape,\n map = this...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Returns a reference to the current period's horizontal FireMeshLine ignition points
horzIgnitionPoints () { return this._horzIgnitions }
[ "get leftLine() {\n if (!this._leftLine) {\n this._leftLine = new Line(this.leftTopPoint, this.leftBottomPoint)\n }\n return this._leftLine\n }", "get horizontalLineVisibility() {\r\n return this.i.pl;\r\n }", "getHorizontalLine(slab) {\n // console.log(\"getHorizontalLine() -- \" +...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
a helper function to determine whether a list of time off requests contains a given day
function timeOffRequestContains(indicesList, day, timeoff) { let contains = false; //if there is more than one request object, loop through every list if (indicesList.length > 1) { for (let i = 0; i < indicesList.length; i++) { for (let j = 0; j < timeoff[indicesList[i]].days.length; j+...
[ "function timeOffRequestContains(indicesList, day){\n var contains = false;\n\n //if there is more than one request object, loop through every list\n if(indicesList.length > 1){\n for(var i = 0; i < indicesList.length; i++){\n for(var j = 0; j < timeOffData[indicesList[i]].days.length; j+...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
ISMonkey is an extension manager that sets up the required MutationObservers and serv socket to be used throughout.
constructor() { this.socketEventList = []; this.asyncExtensionList = []; this.extensions = {}; this.setupSocket(); }
[ "function ExtensionObserver() {\n this._eventsDict = {};\n\n AddonManager.addAddonListener(this);\n AddonManager.addInstallListener(this);\n}", "startServer () {\n return new Promise((resolve, reject) => {\n if (!this.autoreload || !this.isWatching || this.server) return resolve()\n const { host, ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
that takes no arguments and returns the value 4
function return4 () { return 4; }
[ "function four() {\n\treturn 4;\n}", "function returnFour(){\n var number = 4;\n return console.log(number);\n}", "function addFour(num) {\n return num+4;\n}", "function addFour(inputArgument){\n return inputArgument + 4;\n}", "function fourAddNumber(a,b,c,d){\n let abcd=a+b+c+d\n ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
posts an album to the database
function postAlbum(res) { console.log("Album Post!", res); renderAlbum(res); }
[ "async createAlbum (title) {\n const token = await GoogleSignin.getTokens();\n data = {\n URI: 'https://photoslibrary.googleapis.com/v1/albums',\n method: 'POST',\n headers: {\n 'Content-Type': 'application/json',\n 'Authorization': 'Bear...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
get all collections nearby location
function getCollections(locObj, count){ var deferred = $q.defer(); $http({ url: API_ENDPOINT + APIPATH.collections, method: 'GET', params: { lat: locObj.latitude, lon: locObj.longitude, count: count } }) .then(function (data) { ...
[ "async function getLocations() {\n return await locations.find().toArray()\n }", "GetAllLocations() {\n return location_queries.GetAllLocations(this.pool);\n }", "function getEntriesInRegion(lat, lon, maxDistance, collection){\n\tsubCollection= [];\n\tfor(var c = 0;c < collection.length;c++){\n\t\tif(co...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Removes the query if there are no observers left
maybeRemoveQuery(query) { if (query.observers.length === 0) { query.clear(); delete this._queries[buildTypeKey(query.types)]; } }
[ "destroy() {\n this.unmonitorForChanges();\n this.set('status', this.is(EMPTY) ? NON_EXISTENT : DESTROYED);\n this.get('store').removeQuery(this);\n Query.parent.destroy.call(this);\n }", "pauseObservers() {\n // No-op if already paused.\n if (this.paused) {\n return;\n ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
the flame behind the rocket
drawRocketFlame() { stroke('red') line(-50, 0, -100, 0) line(-50, 4, -70, 4) line(-50, -4, -85, -4) }
[ "function syanFireFly(fireflyParam){\n var firefly = new THREE.Object3D();\n // create the body of the firefly\n var bodyGeom = new THREE.SphereGeometry(fireflyParam.bodyRadius, 32, 32, 0, Math.PI);\n var bodyMat = new THREE.MeshLambertMaterial({color: fireflyParam.bodyColor, shading: THREE.FlatShading})\n var...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Build beta fuzzy functions Functions matching input command to data by using string similarity (provided by fuse.js).
function buildFuzzyCmds() { var data, columns; var columnprops = []; var columnnames = []; var options = { maxRows: 0, ignoreAliases: false, ignoreSelection: true }; activeSheet.getUnderlyingDataAsyn...
[ "function DiversiFuzzy(reZ, hashCombos) {\n //VAR: reZ = string that is the format for RegExpFuzzy\n\n //CLASS: Extension of RegExpFuzzy that will allow to swap individual words. Play on \"Diversiform\"\n DiversiFuzzy.flagSwap = '@@'; //if present, then this RegExpZ can be swapped with different str...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
code TODO: menu_1Ctrl | controller_by_user controller by user
function controller_by_user(){ try { } catch(e){ console.log("%cerror: %cPage: `menu_1` and field: `Custom Controller`","color:blue;font-size:18px","color:red;font-size:18px"); console.dir(e); } }
[ "function controller_by_user(){\n\t\ttry {\n\t\t\t\n\t\t\t\n\t\t} catch(e){\n\t\t\tconsole.log(\"error: page side_menus => custom controller\");\n\t\t\tconsole.log(e);\n\t\t}\n\t}", "function controller_by_user(){\n\t\ttry {\n\t\t\t\n\t\t\t\n\t\t} catch(e){\n\t\t\tconsole.log(\"%cerror: %cPage: `menu` and field: ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
called from onchange event of selectedCSI function as well as addSelectedCSI function box
function addSelectCSI(wasCSSelected, isFromEvent, selCSCSI_id) { if (obj_selectedCS.selectedIndex >= 0) { var selCS_id = obj_selectedCS[obj_selectedCS.selectedIndex].value; var selCS_name = obj_selectedCS[obj_selectedCS.selectedIndex].text; } var isExists = false; //get ...
[ "function addSelectedCSI(wasCSSelected)\n {\n //get cs id and name from selectedCS list\n if (obj_selectedCS.selectedIndex >= 0)\n {\n var selCS_id = obj_selectedCS[obj_selectedCS.selectedIndex].value;\n var selCS_name = obj_selectedCS[obj_selectedCS.selectedIndex].text;\n }\n ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
make a deck of 52 cards
function makeDeck() { let deck = []; const suits = ['spades', 'hearts', 'clubs', 'diamonds']; const values = [2, 3, 4, 5, 6, 7, 8, 9, 10, 'jack', 'queen', 'king', 'ace']; for (let i = 0; i < 4; i++) { for (let j = 0; j < 13; j++) { deck.push(new Card(suits[i], values[j])); } } ...
[ "function buildDeck(deck){\n\n // It makes four loops, each time building a different suit\n for(i=0; i<suit.length; i++){\n\n // For each suit, it makes thirteen loops, one for the ace, nine for 2-10, and three for the face cards\n for(j=1; j<14; j++){\n if(j<2){\n deck.push({\n ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Get the mods in this set as an array
mods() { let mods = []; for (let slot of ModSet.slots) { if (this[slot]) { mods.push(this[slot]); } } return mods; }
[ "toArray() {\n return this._modifiers;\n }", "_getModPackages() {\r\n\t\tconst modFiles = this.filemanager.getAllModsFiles();\r\n\t\tthis.mods = [];\r\n\t\tfor (const modFile of modFiles) {\r\n\t\t\tthis.mods.push(new Mod(this, modFile));\r\n\t\t}\r\n\t}", "function getBaneModArr(bane) {\n return [\"-\",...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Start the game by create a player and dealer class, generating their hands, and saving the data
function start_game() { var p1 = new Player(); var dealer = new Player(); generate_hand(p1); generate_hand(dealer); var data_property = {'Player 1':JSON.stringify(p1), 'Dealer':JSON.stringify(dealer)}; scriptProperties.setProperties(data_property) }
[ "deal() {\n\t\t// Create a hand for each player\n\t\tthis.hands = {};\n\t\tfor(let uid in this.players) {\n\t\t\tthis.hands[uid] = [];\n\t\t}\n\n\t\t// Deal out deck\n\t\t// TODO: Jokers\n\t\tvar deck = Cards.createFullDeck();\n\t\tCards.shuffle(deck);\n\n\t\tvar index = 0;\n\t\twhile(deck.length) {\n\t\t\tthis.han...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
A hack to find the name of the first artist of a playlist. this is not yet returned by mopidy does not work wel with multiple artists of course
function getArtist (pl) { for (var i = 0; i < pl.length; i++) { for (var j = 0; j < pl[i].artists.length; j++) { if (pl[i].artists[j].name !== '') { return pl[i].artists[j].name } } } }
[ "function GS_getArtist( ) {\n // Grab title element, since text portion can be truncated\n var artist = $(\"div#now-playing-metadata a.artist\").attr('title');\n if( artist == undefined ) {\n // Fall back to text portion if title attr is empty\n artist = $(\"div#now-playing-metadata a.artist\").text...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Unlikes the comment as the current user
unlike() { return this.clone(Comment, "Unlike").postCore(); }
[ "function dislike() {\n LikeService.delete(vm.user.username, $stateParams.id, vm.currentUser._id)\n .then(() => {\n // remove like from local array\n vm.likes.splice(vm.likes.findIndex(x => x._id == vm.currentUser._id), 1);\n\n vm.isLiked = false;\n ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
If the screen size is tablet or smaller, add the mobile print class. This class displays all sections, regardless of 'show' or 'hide' class. This is used for displaying all sections when printing from a small screen.
function _setPrintClass($selector) { if(window.innerWidth < 1025) { $selector.addClass('cis-mobile-print'); } else { $selector.removeClass('cis-mobile-print'); } }
[ "function screenClass() {\n\t if($(window).innerWidth() > 959) {\n\t $('body').addClass('big-screen').removeClass('small-screen');\n\t $('.nav-list').css('display','flex');\n\t } else {\n\t $('body').addClass('small-screen').removeClass('big-screen');\n\t $('.nav-list').css('displa...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Called from WatchmanWatcher (or WatchmanClient during reconnect) to create a watcherInfo entry in our _watcherMap and issue a 'subscribe' to the watchman.Client, to be handled here.
subscribe(watchmanWatcher, root) { let subscription; let watcherInfo; return this._setupClient() .then(() => { watcherInfo = this._createWatcherInfo(watchmanWatcher); subscription = watcherInfo.subscription; return this._watch(subscription, root); }) .then(() => th...
[ "_createWatcherInfo(watchmanWatcher) {\n let watcherInfo = {\n subscription: this._genSubscription(),\n watchmanWatcher: watchmanWatcher,\n root: null, // set during 'watch' or 'watch-project'\n relativePath: null, // same\n since: null, // set during 'clock'\n options: null, // cre...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Determine whether the given properties match those of a `ApplicationLocationProperty`
function CfnApplication_ApplicationLocationPropertyValidator(properties) { if (!cdk.canInspect(properties)) { return cdk.VALIDATION_SUCCESS; } const errors = new cdk.ValidationResults(); errors.collect(cdk.propertyValidator('applicationId', cdk.requiredValidator)(properties.applicationId)); ...
[ "function CfnApplication_ApplicationLocationPropertyValidator(properties) {\n if (!cdk.canInspect(properties)) {\n return cdk.VALIDATION_SUCCESS;\n }\n const errors = new cdk.ValidationResults();\n if (typeof properties !== 'object') {\n errors.collect(new cdk.ValidationResult('Expected an...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
fungsi untuk mengisi element ul yang diatas dengan product dari database
function listProduct(i) { if (!products[i].name) { products[i].name = "Tidak ada nama product"; } else if (Array.isArray(products[i].name)) { products[i].name = products[i].name.join(" "); } else if (typeof products[i].name === "number") { products[i].name = "Product " + products[i].name; } var l...
[ "function createProductMenuHTML(beers,oUl){\n for (var i = 0; i < beers.length; i++) {\n const data = beers[i];\n const liHTML = createLi(\"\",\"beer_line\",\n // hidden beer id\n createHiddenP(\"\",\"\", data[0].articleid)\n + createP(\"\",\"beer_name\",'Name: ' + ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
UpdateFileName is a helper function to replace the extension
function UpdateFileName(fileName, extension) { var fileName = fileName.split('.'); fileName.pop(); (extension == null) ? "" : fileName.push(extension); return fileName.join("."); }
[ "function UpdateFileName(fileName, extension) {\n\tfileName = fileName.split('.');\n\tfileName.pop();\n\t\n\tif(extension !== null) fileName.push(extension);\n\t\n\treturn fileName.join('.');\n}", "function changeFileExtension(filename, newExtension) {\n return filename.substr(0, filename.lastIndexOf(\".\")) +...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Shorter way to get the value of a node when there is only once instance of it within a given block (elem).
function getNodeValue(elem, tag) { return elem.getElementsByTagName(tag)[0].firstChild.nodeValue; }
[ "function getValue(elem) \n{\n if (elem !== null && elem !== undefined && typeof elem === 'object' && elem.get)\n {\n return elem.get();\n }\n else\n {\n return elem;\n }\n}", "getElementWithValue(value, els) {\n value = hash_key(value);\n\n if (value !== null) {\n for (...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
move body forward or backwards (1 or 1)
moveBody (sign) { var dir = VR.camera.object.getWorldDirection() VR.body.position.add(dir.multiplyScalar(sign * .2)) }
[ "switchBodyOrder(direction, index) {\n const bodyObj = this.state.body;\n const temp = bodyObj[index];\n if (direction === 'up' && bodyObj[index - 1]) {\n bodyObj[index] = bodyObj[index - 1];\n bodyObj[index - 1] = temp;\n } else if (direction === 'down' && bodyObj[index + 1]) {\n bodyObj...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Merges several adjacent polygon to find the outlining one, which is returned.
function mergePolygons(poly) { var merged = [], edges = []; // traverse all edges and mark how may times, each one is used. poly.forEach(function (p, pi) { p.edges.forEach(function (e, ei) { if (e.edge.use === undefined) e.edge.use = { count: 1, poly: [pi], index: [ei] }; ...
[ "function intersectionsWithPolygon(){\r\n intersections.push(0) //the first and the last index of the route must be contained in the array in order to be able to calculate the lengths of the sections. \r\n for (let i = 0; i < positionToPolygon.length; i++){\r\n if (!positionToPolygon[i] && positionToPo...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
This function prints the dice number in the dice box.
function printNumber(number) { var diceNumber = document.getElementById('diceNumber'); // Declares variable for the dice box. diceNumber.innerHTML = number; // Returns the dice number in the dice box. }
[ "function printNumber() {\n return dice.roll();\n}", "function rollDice(){\n var num = Math.floor((Math.random() * 6) + 1);\n document.getElementById('dice').innerHTML = num;\n}", "function rollDice(){\n\t\n\t\t// clear any previous message\n\t\tdocument.getElementById('results').innerHTML = \"\";\n\t\...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Removes all "active" themes. Any charts created subsequently will not have any theme applied to them.
function unuseAllThemes() { _Registry__WEBPACK_IMPORTED_MODULE_1__["registry"].themes = []; }
[ "function unuseAllThemes() {\n _Registry.registry.themes = [];\n}", "function unuseAllThemes() {\n registry.themes = [];\n}", "function unuseAllThemes() {\n _Registry__WEBPACK_IMPORTED_MODULE_1__[\"registry\"].themes = [];\n }", "function unuseAllThemes() {\r\n _Registry__WEBPACK_IMPORTED_MODUL...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Given the current step and the timestamp of the log, draw the timestamp above the client field.
function draw_timestamp(step, t) { svg.append('text') .text(t) .attr('x', get_text_x(step)) .attr('y', 55) .attr('font-family', 'sans-serif') .attr('font-size', '18') .attr('text-anchor', 'middle'); }
[ "function paintPrevious() {\n\tif (parseInt(cur_time) - step > 0) {\n\t cur_time = parseInt(cur_time) - step;\n\t\tcur_real_time = time_map[cur_time];\n\t\tconsole.log(\"current time id: \" + \n\t\t\tcur_time.toString() + \n\t\t\t\"\\ncurrent real time: \" +\n\t\t\tcur_real_time.toString());\n\t\tpaintWithTimeId(c...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Register elements to mediaQueryEvents event.
_registerElements() { const self = this; // Loop al defined breakpoints. Each time browser reaches one of them, // mediaQueryEvents will act and execute the new position of the // elements assigned to this breakpoint. Object.entries(this.opts.breakpoints).map(([k, v]) => { self.$win.on('mq.' ...
[ "_listenToMediaQueryChanges() {\n $(window).on('changed.zf.mediaquery', () => {\n this._respondToMediaQuerySize();\n });\n }", "useMediaQuery(mediaQuery) {\n if (typeof mediaQuery !== 'string')\n throw new Error('Media Query must be a string');\n this.currentMe...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
return what percentage of city taxes originally came from the restaurant
function calculateTaxContibution(rest){ return rest.taxesDue / rest.cityTaxes }
[ "function getTotalTaxes(country){\n\n return this.tax * this.middleSalary * this.vacancies;\n}", "function totalTaxCost(){\n\t\t\n\t\treturn totalPrice * taxPercentage;\n\t} // End totalTaxCost.", "function taxCalculator(price, state) {\n\tlet tax;\n\tif (state === 'NY') tax = .04;\n\telse if (state === 'NJ') ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Sizing up image in list and adding caption for closing
function sizingImg(event){ let elem = event.target; if(elem.tagName == 'IMG'){ elem.classList.toggle('img_big'); let caption; if(elem.classList.contains('img_big')){ caption = document.createElement('p'); caption.classList.add('img_caption'); caption.i...
[ "function looping_image_display(targetdiv, imagelist){\n\t\t\tvar newobject = imagelist[0];\n\t\t\tvar newimage = newobject.image_ref;\n\t\t\t//console.log(\"newimage: \"+newimage);\n\t\t\tvar newtext = newobject.obj_text; \n\t\t\timagelist.shift();\n\t\t\timagelist.push(newobject);\n\t\t\t$(targetdiv).append('<fig...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
block keyboard event when the keyCode is 13 > Enter
blockKeyEvent(event) { if (event.keyCode === 13) { event.preventDefault(); } }
[ "function stopEnter(event)\n{\n\tvar code = (event.keyCode ? event.keyCode : event.which);\n \tif(code == 13) \n\t{\n \t\tevent.stopPropagation();\n\t\treturn false; \n\t}\n\n}", "if (event.which === 32 || event.which === 13) {\n return;\n }", "function vfK(e){ if(e.keyCode == 13){ return true...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
/ This takes as input an array which defines several urls simultaneously present in a D3 window. This array might come from the main window or is the summary ("Tools") window. It bears the same name for clarity, as it is a singleton in these two windows. The result is a single url which represents the merging of the in...
function ConcatenateMergeUrl(lstLoadedUrls,cgiArgs) { var urlFull; /* If there is one element, we might as well simply return it. It is a frequent case. */ console.log("ConcatenateMergeUrl lstLoadedUrls.array_urls.length="+ lstLoadedUrls.array_urls.length); if( lstLoadedUrls.array_urls.length == 1 ) { urlFull ...
[ "static URLJoin(urls){\n return urljoin(urls);\n }", "function openGroup(urls) \n{\n\tsafari.self.hide();\n\n\tvar window = safari.application.activeBrowserWindow;\n\tvar theWindow;\n\tif (window.tabs.length == 1 && !window.activeTab.url) theWindow = window;\n\telse theWindow = safari.application.openBr...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Check if all the metadata fields for supplemental files have values filled in.
hasSupplementalMetadata(){ var invalidInputs; invalidInputs = $("#additional_metadata :input:visible").map(function() { if (this.value === undefined || this.value.length === 0) { return 'invalid' } }) return invalidInputs.length === 0 }
[ "function isAllStandardFieldsEmpty(entry) {\n return (entry.userName.length == 0) && \n (entry.password.length == 0) && \n (entry.url.length == 0) && \n (entry.notes.length == 0); \n}", "function allFilled(fields){\r\n for(let y=0;y<fields.length;y++){\r\n if(!fields[y].va...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Loads new native crashes from disk and sends them to Sentry.
_sendNativeCrashes(extra) { return tslib_1.__awaiter(this, void 0, void 0, function* () { // Whenever we are called, assume that the crashes we are going to load down // below have occurred recently. This means, we can use the same event data // for all minidumps that we load...
[ "_nativeCrash() {\n Sentry.nativeCrash();\n }", "function manage_crash()\n {\n if (localStorage.last_update)\n {\n if (parseInt(localStorage.last_update) + (time_period * 2) < Date.now())\n {\n //seems a crash came! who knows!?\n //loc...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Detect subsampling in loaded image. In iOS, larger images than 2M pixels may be subsampled in rendering.
function detectSubsampling( img ) { var iw = img.naturalWidth, ih = img.naturalHeight, canvas, ctx; // subsampling may happen overmegapixel image if ( iw * ih > 1024 * 1024 ) { ...
[ "function detectSubsampling( img ) {\n var iw = img.naturalWidth,\n ih = img.naturalHeight,\n canvas, ctx;\n \n // subsampling may happen overmegapixel image\n if ( iw * ih > 1024 * 1024 ) {\n ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Create a new `AWS::WAFv2::IPSet`.
constructor(scope, id, props) { super(scope, id, { type: CfnIPSet.CFN_RESOURCE_TYPE_NAME, properties: props }); try { jsiiDeprecationWarnings.aws_cdk_lib_aws_wafv2_CfnIPSetProps(props); } catch (error) { if (process.env.JSII_DEBUG !== "1" && error.name === "Deprec...
[ "ipSets(index) {\n return new GlobalacceleratorAcceleratorIpSets(this, 'ip_sets', index);\n }", "function IP(){\n\t\t// start by instantiating a blank object\n\t\tthis._bits = gen32bitZeroArray();\n\t\t\n\t\t// if an argument was passed, try init the object with it\n\t\tif(arguments.length >= 1){\n\t\t\...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
The default calipso form object, with default configuration values. Constructor
function CalipsoForm() { // TODO - tagStyle should also affect whether attributes can be minimised ('selected' vs. 'selected="selected"') // tagStyle should be one of [html, xhtml, xml] this.tagStyle = "html"; // adjust the way tags are closed based on the given tagStyle. this.tagClose = this.tagStyle == "...
[ "function FormDefault( ){\n\tthis.xpath = \"\";\n\tthis.names = new Array();\n\tthis.values = new Array();\n\t\n\tthis.addName = function(x) {\n\t\tthis.names.push(x);\n\t}\n\t\n\tthis.addValue = function(x) {\n\t\tthis.values.push(x);\n\t}\n}", "function _form_new(base, doc, caller, data) { _form.apply(this, arg...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Assign channels to a new instance of a base color / ==========================================================================
function assign(base, channels) { const color = Object.assign({}, base); Object.keys(channels).forEach(channel => { // detect channel const isHue = channel === "hue"; const isRGB = !isHue && blueGreenRedMatch.test(channel); // normalized value of the channel const value = normalize(channels[ch...
[ "function assign(base, channels) {\n const color = Object.assign({}, base);\n Object.keys(channels).forEach(channel => {\n // detect channel\n const isHue = channel === 'hue';\n const isRGB = !isHue && blueGreenRedMatch.test(channel); // normalized value of the channel\n\n const value = normalize(chan...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
check if someone is won;
function checkWon() { isPlayerWon = playerGuess.value.toUpperCase() === computerBase; isComputerWon = computerGuess.value === playerBase; }
[ "function hasUserWonOrLost() {\n // check if user has won\n if (userTotalScore == bigCrystalNumber) {\n wins++;\n console.log(\"user won\");\n initializeVariables();\n }\n\n // check if user has lost\n if (userTotalScore > bigCrystalNumber) {\n ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
console.log(deleteOne("Hello Brother", false)) / Ex.5 Write a function called "onlyLetters" which receives a string as a parameter and returns it removing all the digits. Ex.: onlyLetters("I have 4 dogs") => returns "I have dogs"
function onlyLetters (string){ return string.replace(/[0-9]/g,'') }
[ "function OnlyLetters(x){ \n const result= x.replace(/[0-9]/g, '');\n return result\n\n \n}", "function deleteOne(anyString, anyBoolean){\n if (anyBoolean === true) {\n return anyString.slice(1)\n } else {\n return anyString.slice(0,12)\n }\n}", "function deleteOne(num) {\n str = nu...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
getting the details of the webseries list
getwebSeriesDetails() { axios.get('/webseriesDetails').then((res) => { this.setState({ webSeriesList: res.data }) }) }
[ "function getSeries() {\n let api = \"../api/Series/Admin\";\n\n ajaxCall(\"GET\", api, \"\", getSeriesSuccessCB, getErrorCB);\n}", "function takeListSerie() {\r\n\t\t$.ajax({\r\n\t\t\turl:'https://api.themoviedb.org/3/tv/popular?api_key=44a293499bc60fded2357760668ac47c&language=fr-FR&page=1',\r\n\t\t\tsucc...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Quick Time Buttons / change the current timer or open modal
function changeCurrentTime(){ /* don't open disabled button */ if(this.classList.contains('btn-greyed')){ return false; } /* open modal if + not assigned button */ else if(this.textContent == " + "){ if(this.id == "btn-cust-1"){ customSelected = 3; /* index value of selec...
[ "function startTimerForQA() {\n renderQuestionForUI();\n renderTimerForUI();\n renderQuestionListNavigationForUI();\n switchModeOfTimerControlButton(START);\n}", "function getTimer (btn) {\n $(\"#duration\").val($(\"#time\").text().substring(0,8));\n $(\"#exercise_status\").val(btn.id);\n $(\"#time...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Event: error See Method: on Install an event handler See for documentation. Method: getNode Get a node. Parameters: path absolute path Returns: a node object. If no node is found at the given path, a new empty node object is constructed instead.
function getNode(path) { logger.info('getNode', path); if(! path) { // FIXME: fail returned promise instead. throw new Error("No path given!"); } validPath(path); return dataStore.get(path).then(function(node) { if(! node) { node = {//this is what an empty node looks like ...
[ "getNode() {\n return null;\n }", "function getNode(tree, path) {\n searchPath = path.slice();\n var node = tree;\n while (searchPath.length) {\n part = searchPath.shift();\n node = find(node.dependencies, part);\n if (!node) {\n console.log...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
See the general considerations discussion in IExposeCommands. Everything that apply to get_commands applies also to each area.
function IExposeCommandsEx() {}
[ "function addCommands(app, palette) {\n const category = 'Main Area';\n let command = CommandIDs.activateNextTab;\n app.commands.addCommand(command, {\n label: 'Activate Next Tab',\n execute: () => {\n app.shell.activateNextTab();\n }\n });\n palette.addItem({ command,...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
displaying all buttons in array villains
function renderButtons() { //deletes all existing buttons $("#buttons-view").empty(); // loop through array for (var i = 0; i < villains.length; i++) { //new button tag var newButton = $("<button>"); // class="villain-btn" given to button tag newButton.addClass("villain-btn"); // data-name ...
[ "function renderButtons() {\n\n // Clear all of the buttons so that buttons don't repeat\n $(\".buttons\").empty();\n\n // Looping through the array of pokemon\n for (var i = 0; i < pokemon.length; i++) {\n\n var a = $(\"<button>\");\n\n a.addClass(\"btn btn-info poke-bt...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
If you want to use your own accessor implementation, you can use this method to invoke the patcher. Since all subsequent accessors for children of this accessor are obtained through the methods in the accessors, you retain full control of the implementation throguhgout the application. Have a look in ImmutableAccessor ...
applyViaAccessor(accessor) { var result = accessor; var idAccessor = accessor.getAttribute('_id'); var id; if (idAccessor) { id = idAccessor.get(); } else { throw new Error('Cannot apply patch to document with no _id'); } this.patches.forEach(patch => { if (patch.id !== i...
[ "function patchAccessors(proto) {\n patchAccessorGroup(proto, OutsideAccessors);\n patchAccessorGroup(proto, InsideAccessors);\n patchAccessorGroup(proto, ActiveElementAccessor);\n}", "function patchAccessors(proto) {\n\t patchAccessorGroup(proto, OutsideAccessors);\n\t patchAccessorGroup(proto, InsideAccess...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Click to hide or reveal video
function clickVideo(video){ if(document.getElementById(video).style.visibility == "visible") document.getElementById(video).style.visibility = "hidden"; else{ document.getElementById(video).style.visibility = "visible"; } }
[ "function toggleShowVideo(e) {\n\tif (videoElement.classList.contains(\"hidden\")) {\n\t\tvideoElement.classList.toggle(\"hidden\");\n\t\tvideoButton.innerHTML = 'Hide';\n\t} else {\n\t\tvideoElement.classList.toggle(\"hidden\");\n\t\tvideoButton.innerHTML = 'Show';\n\t}\n}", "function onVideoClickTrigger(){\n ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Draw table for callers
function drawTable(callerArr){ for(var a = 0 ; a < callerArr.length; a++){ var tableStr = '<tr>'+ '<td>'+callerArr[a].name+'</td>'+ '</tr>'; $("#callerTableBody").append(tableStr); } }
[ "function drawTable(){\n\n}", "function drawTable(reply, app){}", "function drawTable(game) {\n\n var tableHeaders = \"<tr>\";\n var firstAndSecondScores = \"<tr>\";\n var finalScores = \"<tr>\";\n var rowEnder = '</tr>';\n var table = \"\";\n var runningTotal = null;\n game.frames.forEach(function(frame...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
2.3 UZDUOTIS paleisti fja "printX(xx)" 12 kartu ir atspausdinti <img ... PATARIMAS: pabandyti isideti nuotrauka i HTML faila, jie pavyks tada nusikopijuoti ir ideti i js faila
function printX3(xx) { for (var i = 0; i < 12; i++) { document.write("<img src=" + xx + ">"); } }
[ "function imgTag(nota) {\n\tnota = Math.round(nota)\n\treturn \"<img src='\"+nota+\".png' title='\"+nota+\"'>\"\n}", "function printImg(s,e){\n\t//var i=1,j=k=l=0;//end=5,\n\t\t//main=document.getElementById(\"content\"),\n\t\t\n\t//for(;i<=end;i++)\n\t\t//for(j=0;j<=end;j++)\n\t\t\t//for(k=0;k<=end;k++)\n\t\t\t\...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Test the is lower cause in alphabet string functionality
function testInLowerCaseAlphabet(){ var StringUtils = LanguageModule.StringUtils; var stringUtils = new StringUtils(); var encodings = stringUtils.stringEncodings; var lencodings = stringUtils.languageEncodings; var isLowerCaseInAlphabet1 = stringUtils.isLowerCaseInAlphabet("abcdef", encodings.ASCII, lencodin...
[ "checkLowerCharacter() {\n this.report.checkLowerCharacter = /[a-z]/.test(this.input);\n }", "function isLower(c){\r\n return c.toLowerCase() == c;\r\n}", "function hasLower(string) {\n return (/[a-z]/.test(string)); \n }", "function containsLowerCase(text){\r\n return /['a-z']/.test(text...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Download all visuals of an order
downloadVisuals() { let imgArray = []; this.currentOrder.content.forEach((order) => { order.visual.forEach((visual) => { if (visual.fullsizeimage !== undefined) { imgArray.push(visual.fullsizeimage); } }); }); downloadAll(imgArray); }
[ "function download_image() {\n // dom-to-image dependency\n domtoimage\n .toPng(div_viz, {\n filter: node =>\n // Remove foreground nodeboxes for faster rendering\n // (Background nodes not excluded as they are purposely styled)\n !(node.classList && [...node...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Given a list of projects as JSON, create a table
function list(projects) { var table = $('<table>').class('table'); var head = $('<tr>').append('<th>Name</th>').appendTo(table); projects.forEach(function(project) { var row = $('<tr>').append( $('<td>').text(project.name) ).appendTo(table); }); return table; ...
[ "function buildProjectListAsTable(json) {\r\n var arr = [];\r\n for (p in projects) {\r\n var project = projects[p];\r\n\r\n // Get name of PMC\r\n var pmc = committees[project.pmc] ? committees[project.pmc].name : \"Unknown\";\r\n\r\n // Get project type\r\n var type = \"Su...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Updates task on a database params: task task object to update updates only changes callback method called with list to return
updateTask(task, callback) { var response, params; var db = this.db; var tableName = this.tableName; //GetItem to make sure it's an update params = { TableName: tableName, Key: { taskId: task.taskId } }; db.get...
[ "function updateTask(task, callback) {\n database.serialize(function() {\n var expiry_time = getExpiryTime(task);\n var update_task = \"UPDATE \"+table_name+\" SET task = ?, \"\n +\"at = datetime(\"+expiry_time+\") WHERE \"+table_name+\".id = ?\";\n\n log.debug('sqlite-adapter','Running query...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Normalizes a time string to have the following format: hh:mm:ss
function normalizeTime(time) { var _time$split3 = time.split(regexSplitTime), _time$split4 = _slicedToArray(_time$split3, 3), hours = _time$split4[0], minutes = _time$split4[1], seconds = _time$split4[2]; return "".concat(hours.length === 1 ? "0".concat(hours) : hours, ":").conc...
[ "function zenNormalizeTime(str)\n{\n\tvar out = '';\n\ttry {\n\t\tvar t = str.split(\":\");\n\n\t\tvar hour = parseInt(t[0],10);\n\t\tvar min = parseInt(t[1],10);\n\t\tvar sec = parseInt(t[2],10);\n\t\t// am/pm\n\t\tvar mod1 = str.substr(str.length-1,1);\n\t\tvar mod2 = str.substr(str.length-2,2);\n\n\t\tif (!isNaN...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[1] LocationPath::= RelativeLocationPath | AbsoluteLocationPath e.g. a, a/b, //a/b
function locationPath(stream, a) { return absoluteLocationPath(stream, a) || relativeLocationPath(null, stream, a); }
[ "function locationPath(stream,a){return absoluteLocationPath(stream,a)||relativeLocationPath(null,stream,a);}", "function locationPath(stream, a) {\n\t return absoluteLocationPath(stream, a) ||\n\t relativeLocationPath(null, stream, a);\n\t }", "function relativeLocationPath(lhs,stream,a,isOnlyRoo...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
SERVICE_TIME functions / Expects: void Returns: Service time from local storage ordered by the patient
function getServiceTime () { var serviceTime = new Date(); serviceTime.setTime(parseInt(localStorage.getItem("serviceTime"))); return serviceTime; }
[ "function serviceGetMeasureTime(req, resp) {\n\t\tlogger.info(\"<Service> GetMeasureTime.\");\n\t\tvar getData = parseRequest(req, ['id']);\n\t\t\n\t\twriteHeaders(resp);\n\t\tgetMeasureTime(getData.id, function(err, time) {\n\t\t\tif (err) { error(2, resp, err); return; }\n\t\t\tresp.end(JSON.stringify({ time: tim...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
================================================================================ / Update the UI with current minimum bounty when called
async function updateBounty(){ const bounty = await Riddle.methods.bounty().call(); updateBountyUI(bounty); }
[ "updateBattler() {\n if (this.battlerFrame.update()) {\n Manager.Stack.requestPaintHUD = true;\n }\n }", "function update() {\n healthBar.value = health;\n choosePick();\n lowhealth();\n}", "_updateProgressBar() {\n this._progressBarContainer.progressBar.updateProgress(th...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Generate the html Element containing the link to the wikipedia article
generateLink() { return ` <a href='https://en.wikipedia.org/wiki/${encodeURI(this.options[0])}' property='rdf:seeAlso'> ${this.options[0]} </a>&nbsp; `; }
[ "function getWiki( where ) {\n\t\tvar $v = $( '<a></a>', {\n\t\t\t\"class\": \"tbdocslink\",\n\t\t\t\"alt\": \"Link to documentation for topic\",\n\t\t\t\"title\": \"Link to documentation for topic\",\n\t\t\t\"target\": \"_blank\",\n\t\t\t\"href\": _DOCURL + String(where || \"\")\n\t\t} );\n\t\t$v.append( '<i class...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
PUBLIC Sets the background image of the map and allocates it at the specified coordenates from the upper left corner of the map.
function setMapBackgroundImage(img, x, y) { if (img.indexOf("/") != -1) { this.bgImage = img; } else { this.bgImage = URL_IMAGES + img; } this.bgImageXCoord = x != null ? eval(x) : 0; this.bgImageYCoord = y != null ? eval(y) : 0; if (this.hasExtendedInformation) { this.minimap.setBackgroundImage(th...
[ "function loadBackgroundImage() {\n\t\tmapImage = new Image()\n\n\t\tmapImage.onload = setBackgroundImage;\n\t\tmapImage.src = \"gtasa-map-small.png\";\n\t}", "function background(number){\n\n mapHeroCtx.drawImage(mapOrganisation[number], 0, 0);\n\n}", "function genBackground(){\n\tfor(var x = 0;x<mapWid...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
A tag can use a renderer or a template to do the rendering. If a template is provided then the value should be the path to the template to use to render the custom tag.
template(value) { var tag = this.tag; var dirname = this.dirname; var path = nodePath.resolve(dirname, value); if (!exists(path)) { throw new Error('Template at path "' + path + '" does not exist.'); } tag.template = path; }
[ "function renderTag(template, tag, value) {\n if (!tag) {\n console.log('Resources:renderTag: The tag is invalid');\n return template;\n }\n if (value === null || value === undefined) {\n value = '';\n }\n var regex = new RegExp(tag, 'gmi');\n return template.replace(regex, value);\...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Compute the CRC for the data bytes.
computeDataCrc() { let crc = 0xFFFF; const index = this.dataIndex; const begin = index - 4; const end = index + this.getLength(); for (let i = begin; i < end; i++) { crc = Crc16_1.CRC_16_CCITT.update(crc, this.getByte(i)); } return crc; }
[ "computeDataCrc() {\n let crc = 0xFFFF;\n const index = this.dataIndex;\n const begin = index - 4;\n const end = index + this.getLength();\n for (let i = begin; i < end; i++) {\n crc = CRC_16_CCITT.update(crc, this.getByte(i));\n }\n return crc;\n }", ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Constructs an `HttpHandler` that applies interceptors to a request before passing it to the given `HttpBackend`. Use as a factory function within `HttpClientModule`.
function interceptingHandler(backend) { var interceptors = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : []; if (!interceptors) { return backend; } return interceptors.reduceRight(function (next, interceptor) { return new HttpInterceptorHandler...
[ "function interceptingHandler(backend) {\n var interceptors = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : [];\n\n if (!interceptors) {\n return backend;\n }\n\n return interceptors.reduceRight(function (next, interceptor) {\n return new HttpInterceptorHandle...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Abstract the clicked button, and add an event listener to store the value of the choice variable when clicked
function selectAns(event) { choice = event.target.id; }
[ "function setAnswer(clicked_id) {\n ansChoice = clicked_id;\n}", "function handleChangeChoice(e) {\n setChoice(e.target.value);\n console.log(\"Changing choice to: \" + e.target.value);\n }", "function userSelection() {\n\t\t$(\".animal-choice__one\").on(\"click touchstart\", function() {\n\t\t\tuserC...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Convert Koa legacy generatorbased middleware to modern promisebased middleware.
function convert (mw) { if (typeof mw !== 'function') { throw new TypeError('middleware must be a function') } // assume it's Promise-based middleware if ( mw.constructor.name !== 'GeneratorFunction' && mw.constructor.name !== 'AsyncGeneratorFunction' ) { return mw } const converted = fu...
[ "function toPromise(v) {\n\tif (isGenerator(v) || isGenerator(v)) return fo(v);\n\tif (v.then) return v;\n\tif (typeof v === 'function') {\n\t\treturn new Promise((resolve, reject) => {\n\t\t\tv((error, res) => error ? reject(error) : resolve(res));\n\t\t});\n\t}\n\t// Magic array handler\n\tif (Array.isArray(v)) r...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }