query stringlengths 9 34k | document stringlengths 8 5.39M | negatives listlengths 19 20 | metadata dict |
|---|---|---|---|
Returns a file id from a file path | function getIdFromFilePath(filePath) {
return pathToIdMap[filePath];
} | [
"function getFileID(filepath){\r\n for(i in files){\r\n if(files[i].path == filepath) return files[i].id;\r\n }\r\n return undefined;\r\n}",
"async function pathToId(path) {\n\tvar components = path.split(\"/\");\n\tvar folderName = components[components.length-2];\n\tvar folder = await searchFol... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Count Number of Visible Tabs | function GetTabListCount() {
return TabList.length;
} | [
"function GetTabCounts()\n{\n if(Pane_DDRC_Channels.Visible)\n {\n var active_Tab = Tab_Available.ActiveTab.get_TabControl().get_Tabs()\n Tab_Count = active_Tab.VisibleTabsCount\n Log.Message(\"Visible tab count are\" + Tab_Count)\n }\n}",
"get tabcount() {\n return this.tabList.querySelectorAl... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Load Buttons Load all the buttons for the Three.js Toolbar | function load_buttons(){
//Load Title
var loader = new THREE.TextureLoader();
loader.crossOrigin = true;
// 0 - Undo Button
var T = loader.load( 'Images/undoButton.png' );
T.minFilter = THREE.LinearFilter;
var T1 = new THREE.SpriteMaterial( { map: T, color: 0xffffff } );
var undoButton = ne... | [
"function loadToolbar() {\n\n\ttbBtns = ge(\"toolbarBtns\");\n\ttbTitle = ge(\"toolbarTitle\");\n\n\t//setup our buttons\n\ttbBtns.appendChild(siteToolbarCell(\"Save\",\"save()\",\"save.png\"));\n \n}",
"function setupButtons() {\n d3.selectAll('.btn-group')\n .selectAll('.btn')\n .on('click', function () ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Prunes active macros. Checks each active macro's key combo and if found to no longer to be satisfied, each of the macro's key names are removed from active keys. | function pruneMacros() {
var mI, combo, kI;
for(mI = 0; mI < activeMacros.length; mI += 1) {
combo = parseKeyCombo(activeMacros[mI][0]);
if(isSatisfiedCombo(combo) === false) {
for(kI = 0; kI < activeMacros[mI][1].length; kI += 1) {
removeActiveKey(activeMacros[mI][1][kI]);
}
activeMacros.spl... | [
"function pruneActiveKeyBindings(event) {\n var bindingStack = queryActiveBindings();\n var output;\n\n //loop through the active combos\n for (var bindingCombo in activeBindings) {\n if (activeBindings.hasOwnProperty(bindingCombo)) {\n var binding = activeBindings[bindingCombo],\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Initializes the notification window. | _initWindow() {
this._window = new BrowserWindow({
focusable: false,
show: false
});
this._window.loadURL(Notifier.PathToWindow);
} | [
"function initNotifications () {\n updateNotification.init();\n}",
"function initialise()\n{\n\tinitCanvas();\n\t\n\tthis.popup = new PopupBox(0,0);\n\tthis.popupVisible = false;\n}",
"_buildWindow()\n\t{\n\t\tthis.window = new MotionTrackerWindow();\n\t\tthis.currentCanvasPosition = MotionTracker.CONFIG.can... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Test 09: 2player option works. | function test09(){
console.log("Test 09: 2-player option works: ");
if(bird2)
console.log("Passed.");
else
console.log("Failed.");
} | [
"function startAlternativePlayers() {\n if (startPlayer == 'x') {\n startPlayer = 'o';\n currentPlayer = 'o';\n } else if (startPlayer == 'o') {\n startPlayer = 'x';\n currentPlayer = 'x';\n }\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Function to find how many percent of the stepGoal is reached. | getProgressPercent() {
const progressPercent = this.state.pastStepCount / this.state.stepGoal;
return Math.floor(progressPercent * 100);
} | [
"function getFitnessScore() {\r\n if (finished) {\r\n return +1/steps;\r\n } else {\r\n return -1/steps;\r\n }\r\n }",
"calcPercent(goal, saved) {\n return(Math.round((saved/goal)*100))\n }",
"function _getProgress() {\n // Steps are 0 indexed\n var curren... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Renders the given JSON argument as HTML. Recursive for arrays and mapping objects. | function renderJSON(obj, path) {
path = path || "root";
var elem = $('<div class="renderjson-value" title="' + path + '">');
if (obj instanceof Array) {
elem.addClass("renderjson-array");
for (var i = 0; i < obj.length; i++) {
var pairElem = $('<div class... | [
"function jsonToHTMLBody(json) {\n return `<div id=\"json\">${valueToHTML(json, '<root>')}</div>`;\n }",
"function json2html(json, options) {\n var html = '';\n\n if (typeof json === 'string') {\n // Escape tags\n var tmp = json.replace(/&/g, '&').replace(/</g, '<').replace(/>/g, '>');... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
generate walls adjacent to existing walls | function generateAdjacentWalls(i) {
var adjacent = [];
var emptyAdjacent = [];
if (isAdjacent(i, upFrom(i))) {
adjacent.push(upFrom(i));
}
if (isAdjacent(i, downFrom(i))) {
adjacent.push(downFrom(i));
}
if (isAdjacent(i, leftFrom(i))) {
adjacent.push(leftFrom(i));
}
... | [
"buildWalls() {\n var step = [];\n\n for (let row = 0; row < this.getGridHeight(); row++) {\n\n if (row % 2 == 0) {\n for (let col = 0; col < this.getGridWidth(); col++) {\n step.push(new Cell(col, row, Cell.wall()));\n }\n } else {\n for (let col = 0; col < this.getGri... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
code TODO: utamaCtrl | controller_by_user controller by user | function controller_by_user(){
try {
} catch(e){
console.log("%cerror: %cPage: `utama` 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(\"%cerror: %cPage: `granos_y_semillas` and field: `Custom Controller`\",\"color:blue;font-size:18px\",\"color:red;font-size:18px\");\n\t\t\tconsole.dir(e);\n\t\t}\n\t}",
"function controller_by_user(){\n\t\ttry {\n\t\t\... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Property setter for 'data' property of a cursor. This creates a new generation of the managed data object with the provided 'newValue' replacing whatever exists in the 'path' of the current generation No attempt is made to address issues such as stale writes. Concurrency issues are the responsibility of caller. | set data(newValue) {
privateDataMap.get(this).update(this.path, newValue);
} | [
"update(path, newValue) {\n // this.currentData is about to become the \"previous generation\"\n const prevData = this.currentData;\n\n if (path.length === 0) {\n // Replace the data entirely. We must manually force its immutability when we do this.\n this.currentData = Im... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Gets the Map Symbol key layer state | function getMapSymbolLayerState(/*Id of the key container control*/ctrl) {
var layerState = null;
// Get the initial control state to start with
var controlLayerState = getInitialControlState();
var pointXLayerState = new Array();
var ctrlElm = document.getElementById(ctrl + panelViews[1]);
... | [
"function getInitialSymbolControlState() {\n var state = new Array(7);\n\n // Layer state for transport key symbols\n state[0] = new Array(false, false, false, false, false, false, false);\n\n // Layer state for PointX key symbols \n for (var i = 1; i < 7; i++) {\n state[i] = new Array(false, ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
get service model, as there are many useless prop in net data | getServiceModel(service) {
const item = {
/** used for update prop */
oneApm: service.oneapm,
appMonitor: service.appMonitor,
environments: JSON.parse(JSON.stringify(service.environments)),
hosts: JSON.parse(JSON.stringify(service.hosts)),
prestopCommand: service.prestopCommand,
... | [
"static async getServiceByServiceName(id, serviceName) {\n const expedition = await this.where({ id_ekspedisi: id }).fetch({\n withRelated: [{ services: qb => (qb.where('nama_ekspedisiservice', serviceName)) }],\n });\n if (!expedition) throw getExpeditionError('expedition', 'not_found');\n return ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
This function retrieves the fields options from the database It accepts the application name, form name, paramid, callback | function getFieldOptions(appName, factName, paramid, callback) {
//appName,fact, field, lookup,updateId, callback
$('table').remove();
quickforms.getMultiData(appName, factName, paramid, '1=1', '',
function (data) {
displayEditingPage(data, paramid);
});
} | [
"function getFieldList() {\n var appId = kintone.app.getId();\n kintone.api(\n kintone.api.url('/k/v1/form', appIsGuest()),\n 'GET',\n {app: appId},\n function(resp) { //success\n var properties = resp.properties;\n for (var i ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Location: js/lib/ui/typeaheadpro/sources/search_friend_source.js r109250 / Machine: 10.16.140.102 / Generated: July 15th 2008 12:34:54 AM PDT / HTTP Host: static.ak.fbcdn.net | function search_friend_source(get_param){this.parent.construct(this,get_param);new AsyncRequest().setMethod('GET').setReadOnly(true).setURI('/ajax/typeahead_search.php?'+get_param).setErrorHandler(function(){}).setTransportErrorHandler(function(){}).setHandler(function(response){var payload=response.getPayload();this.v... | [
"function typeahead() {\n\t\tconsole.log(\"typeahead\"); //test\n\n\t\t$(\"#sun_query\").typeahead({\n\t\t minLength: 1,\n\t\t source: function (query, process) {\n\t\t return $.post(\n\t\t '/autocomplete', \n\t\t { msg: query }, \n\t\t function (data) {\n\t\t ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
function to change the size of an entity: | function resizeEntity() {
if (uploadInProgress || downloadInProgress)
return;
// get the preview container for the entity
var container = $("#" + currentEntity.id);
// set the entities width and height to those of the container
console.log("TEST");
currentEntity.width = container.... | [
"changeSize(width, height) {\n\t\t\t\tthis.each(function (model) {\n\t\t\t\t\tmodel.set({width, height});\n\t\t\t\t});\n\t\t\t}",
"setSize(size) {\n this.size = size;\n }",
"set size(val) {\n this._setAttributes(val,'size')\n }",
"set size(value) {\n switch (value) {\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
TODO: add formula per variable Frequency TODO: add Frequency switcher TODO: fix hIndex object 9bit 256 columns 8bit 8/8 tuple/nested 6bit 32 properties 28bits...total 5bit tweaking... Variable.values description; 5bits for 16timelines, er is nog niet negedacht over Scenario/Optie tijdlijn combinaties, alle 15 additione... | function CalculationModel(modelData)
{
this._modelName = modelData.modelName;
this._startCalculationTime = new Date().getTime();
this._calculationRound = 0;
this._calculations = 0;
this._lookups = 0;
this._vars = [];
var formulasets = modelData.formulasets.length;
this._reset = function()
{
this._calculation... | [
"function getChiOETable(x,y){\r\n removeNA(x,y);\r\n var result = [];\r\n // transform the categorical value to count data table\r\n var obj = {};\r\n obj = transfromToCountData(x,y);\r\n // find row total and column total\r\n var row_total = [];\r\n var column_total = [];\r\n var all_tot... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Creates failed request result. | function failed(result) {
return { kind: "failed", result: result };
} | [
"function failedChedk(result) {\n $log.debug(TAG + 'checkFile exisence error', result);\n result.code === 1 ? createIidFile() : deferred.reject(result);\n }",
"function createExpenseFailure() {\n return { type: types.CREATE_EXPENSE_FAILURE };\n}",
"function Failure(value) {\n return new _Result... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Get the HMD, and if we're dealing with something that specifies stageParameters, rearrange the scene. | function setupStage() {
navigator.getVRDisplays().then(function (displays) {
if (displays.length > 0) {
vrDisplay = displays[0];
if (vrDisplay.stageParameters) {
setStageDimensions(vrDisplay.stageParameters);
}
vrDisplay.requestAnimationFrame(animate);
}
});
} | [
"function setupStage() {\n navigator.getVRDisplays().then(function(displays) {\n if (displays.length > 0) {\n vrDisplay = displays[0];\n if (vrDisplay.stageParameters) {\n alert(\"HMD not supported yet - Sorry!\")\n// setStageDimensions(vrDisplay.stageParameters);\n }\n vrDispl... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Change the Per Frame Exposure Value | function changeVPSExposure() {
logMessage('Frame[' + lstFrames.selectedIndex + ']');
logMessage('Current Exposure Value =' + frameControllers[lstFrames.selectedIndex].exposureControl.value);
var control = document.getElementById(vpsPerFrameControlList[0].control);
logMessage('Set Exposure Value =' + con... | [
"setApertureValue(aperture) {\n return this.fetchPropertyUpdate('av', aperture);\n }",
"set additiveReferencePoseFrame(value) {}",
"function set_frameRate(value)\n\t{\n\t\tframeRate = Math.floor(Math.max(value, 1));\n\t\t_SetFrameRate(frameRate);\n\t\t_SetMapEngineFrameRate(frameRate);\n\t}",
"incre... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Initializes a new instance of the StateHoldr class. | function StateHoldr(settings) {
if (!settings.ItemsHolder) {
throw new Error("No ItemsHolder given to StateHoldr.");
}
this.ItemsHolder = settings.ItemsHolder;
this.prefix = settings.prefix || "StateHolder";
this.collectionKeys = [];
} | [
"constructor() { \n \n StateType.initialize(this);\n }",
"initializeState() {}",
"constructor() {\n if (State.instance) {\n return State.instance;\n }\n State.instance = this;\n\n this.state = new Map();\n }",
"constructor() {\n super()\n this.state = intialSta... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Get private room names | function get_private_room_list() {
const room_list = [];
private_rooms.forEach(room => {
room_list.push(room)
});
return room_list;
} | [
"function getRooms(){\n return pub.smembersAsync('availableRooms')\n .then(rooms=>rooms.map(roomId=>roomId.replace('Room:', '')));\n}",
"function getRoomLetters(roomName) {\n return roomToLetters[roomName];\n}",
"getUserList(room) {\n //filter out those users whose room matches the given room\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Return value atribute of a declaration. | function value(decl) {
return decl.value;
} | [
"getValueDeclaration() {\r\n const declaration = this.compilerSymbol.valueDeclaration;\r\n if (declaration == null)\r\n return undefined;\r\n return this._context.compilerFactory.getNodeFromCompilerNode(declaration, this._context.compilerFactory.getSourceFileForNode(declaration));\r\... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Helper function that updates the Throwins numbers and graph | function updateThrows()
{
totalThrows = T1.throwIns + T2.throwIns;
var t1_bar = Math.floor((T1.throwIns / totalThrows) * 100);
var t2_bar = 100 - t1_bar;
document.querySelector(".t1-throws-num").innerHTML = "<b>" + T1.throwIns + "</b>";
document.querySelector(".t2-throws-num").innerHTML = "<b>" + ... | [
"update() {\n\t\tconst deltas = this.inputs.map(input => input * sgrad(this.sum) * this.error);\n\t\tthis.weights.forEach((el, i) => this.weights[i] = this.weights[i] - deltas[i]);\n\t}",
"function updateEdges() {\n\n // this variable is used to control the amount of transaction per cycle\n // var a... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
member function add() adds the particle to the dynamic particle query | add(){
particles.push(this);
} | [
"addParticle(particle) {\n\t\tparticle.setup();\n\t\tthis.core.entities.push(particle);\n\t}",
"addParticle(){\n this.particles.push(new Particle(this.origin.x, this.origin.y));\n }",
"addParticle() {\n this.particles.push(new Particle(this.origin, this.startingColour, this.acceleration));\n }",
... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Find a node of type. | function findNode(nodes, type, name) {
for(let i = 0; i < nodes.length; i++) {
const node = nodes[i];
if(node.nodeType === type && node.name === name) return node;
}
return null;
} | [
"function find_in_tree(node, tag, type, class_name)\n{\n\tvar result, element, i = 0, length = node.childNodes.length;\n\n\tfor (element = node.childNodes[0]; i < length; element = node.childNodes[++i])\n\t{\n\t\tif (!element || element.nodeType != 1) continue;\n\n\t\tif ((!tag || is_node_name(element, tag)) && (!t... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Write a function `isSubstring` that takes in two strings, `searchString` and `subString`. The function should return `true` if `subString` is a part of the `searchString`, `false` otherwise. Write two versions of this function, using conditionals and without using conditionals Examples: isSubstring("The cat went to the... | function isSubstring(searchString, subString) {
return searchString.indexOf(subString) > -1;
} | [
"function isSubstring(searchString, subString) {\n \n}",
"function isSubstring(searchString, subString) {\n return searchString.includes(subString)\n}",
"function isSubstring(searchString, subString) {\n return searchString.includes(subString);\n}",
"function isSubstring(searchString, subString) {\n if ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Switches the name to use dashes instead of underscores and puts the desired namespace in front of the name | function _HtmlName(name) {
// TODO
return (MY_NAMESPACE + '_' + name).replace(/_/g, '-');
} | [
"function nameSpace(name) {\n var nsName = name;\n\n if (currentNameSpace) {\n //nsName = camelCase(currentModule) + '.' + name;\n nsName = currentNameSpace + '_' + name;\n }\n\n return nsName;\n }",
"function namespaceName(stage, name) {\n return `${stage.s... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Associated with initials box check box, the below function clears and disables all associated inputs under selected step. | function initialsCheckboxValidation(initials_checkboxes) {
for (let i = 0; i < initials_checkboxes.length; i++) {
$('#' + initials_checkboxes[i].id).click(function () {
// if the checkbox is clicked,
if ($('#' + initials_checkboxes[i].id).is(':checked')) {
// 'P... | [
"function clearInputs(inputsInCurrentStep) {\r\n for (let j = 0; j < inputsInCurrentStep.length; j++) {\r\n if ($(inputsInCurrentStep[j])[0].id.indexOf('selectID_') > -1) {\r\n // set to 'Select\r\n $(inputsInCurrentStep[j]).val('Select');\r\n } else if ($(inputsInCurrentStep[... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Returns a stream with an export of the entries for the specified completed email validation job, with the goal of generating a humanreadable representation of the results according to the requested output file format. While the output schema (columns / labels / data format) is fairly complete, you should always conside... | function exportEmailValidationEntries(restClientFactory, id, contentType, cancellationToken) {
return tslib.__awaiter(this, void 0, void 0, function () {
var restClient, restResponse;
return tslib.__generator(this, function (_a) {
switch (_a.label) {
case 0:
... | [
"function mkOutput() {\n logger.debug(\"[contactsOpDlGET] Generating the CSV file.\");\n var now = Date.now();\n var data = JSON.parse(JSON.stringify(contacts));\n csv()\n .from(data)\n .toPath... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Decodes a JSON string, returning the objec or null if an error occurred. | function decodeJson(s)
{
try
{
// Requires Firefox 3 or later
var json = Components.classes["@mozilla.org/dom/json;1"].createInstance(Components.interfaces.nsIJSON);
return json.decode(s);
}
catch (ex)
{
message(0, "decodeJson() exception. Need FireFox 3+: error: " + formatException(ex), MT_ERROR);
retur... | [
"function decoder(jsonStr){\n try {\n return JSON.parse(jsonStr);\n } catch (e) {\n console.log(e);\n return false;\n }\n }",
"function json_decode(str_json) {\n // example 1: json_decode('[ 1 ]');\n // returns 1: [1]\n\n va... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Add to the "paramsEx" property of the parent node | function addParamsEx(node, parent, isProp, isSub) {
var exPropsName = isSub ? 'propsExS' : 'paramsEx';
if (!parent[exPropsName]) {
var exPropsNode = void 0;
if (isProp || isSub) {
exPropsNode = {
type: 'nj_ex',
ex: 'props',
content: [node]
};
} else {
exPropsNod... | [
"function addChildParameter(parentParamUniqueId) {\n var p = getParameter(parentParamUniqueId);\n if (p !== null) {\n var pNew = newParameter();\n if(!p.dict){\n \tp.dict = newDict();\n }\n p.dict.params.push(pNew);\n return pNew.unique... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
zone_ids computed: true, optional: false, required: false | get zoneIds() {
return this.getListAttribute('zone_ids');
} | [
"zonesMutation(state, value){\n state.zones = []\n state.zones = value\n }",
"buildAvailableZones() {\n const mapData = this.map.mapData;\n const directions = mapData.directions;\n const zones = new Array();\n zones.push('Z5');\n if (directions[2] === true) {\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Invoked when a slide is and we're in the overview. | function onOverviewSlideClicked(event) {
// TODO There's a bug here where the event listeners are not
// removed after deactivating the overview.
if (eventsAreBound && isOverview()) {
event.preventDefault();
var element = event.target;
while (element && !el... | [
"function onOverviewSlideClicked( event ) {\n\n\t\t\t// TODO There's a bug here where the event listeners are not\n\t\t\t// removed after deactivating the overview.\n\t\t\tif( eventsAreBound && isOverview() ) {\n\t\t\t\tevent.preventDefault();\n\n\t\t\t\tvar element = event.target;\n\n\t\t\t\twhile( element && !ele... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Resets the castles health to max | resetCastle(){
this.health = this.maxHealth;
} | [
"function restoreHealth() {\n playerHealth += hero.wis * 3;\n if (playerHealth > playerMax) {\n playerMax = playerHealth\n }\n}",
"restoreAllHealth() {\n this.hitpoints = this.maxHitpoints;\n }",
"reset() {\n this.hp = this.maxHp;\n this.specialCooldownCount = this.maxSpe... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Custom tracking for Downloads | function trackDownload(txt) {
var s = s_gi(s_account);
s.linkTrackVars='prop18,eVar18,event17';
s.linkTrackEvents='event17';
s.eVar18=s.prop18=txt;
s.events='event17';
s.tl(this,'d',prop18);
} | [
"get downloadStatus() { return this._downloadStatus; }",
"function trackDownloads(downloadType, fileType, fileName){\n\t\t\n\t\ttry{\n\t\t\tif(fileType!=undefined && fileType!=null && fileType!=''){\n\t\t\t\triaTrackDownloadsLink(fileType+\" : \"+downloadType, fileName);\n\t\t\t}else{\n\t\t\t\triaTrackDownloadsLi... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Take closest form (or form by id) and submit it, optional: prevent page refresh if done passed as function | function smart_submit(done, form_id) {
// use form id or take closest form to the event target
var f = typeof form_id === "string" ? $(form_id) : $(event.target).closest("form");
console.log("smart_submit found form to use", f);
if (typeof f === "undefined") {
console.log("smart_submit event target", event... | [
"function recursive_gform_submission_handler() {\n\tif ( jQuery( '.gform_wrapper' ).find( 'form' ).attr( 'target' ) && jQuery( '.gform_wrapper' ).find( 'form' ).attr( 'target' ).indexOf( 'gform_ajax_frame' ) > -1 ) {\n\t\tjQuery( '.gform_wrapper' ).find( 'form' ).submit( function( event ) {\n\t\t\tsetTimeout(\n\t\t... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
paint Called by the mouseover event handler on each pixel. Changes the pixel's color and sets a timer for it to revert. | function paint(e) {
// e.target contains the specific element moused over so let's
// save that into a variable for clarity.
let pixel = e.target;
// Change the background color values randomly
let r = Math.random() * 255;
let g = Math.random() * 10;
let b = Math.random() * 255;
// Apply these change to... | [
"function paint(e) {\n // e.target contains the specific element moused over so let's\n // save that into a variable for clarity.\n let pixel = e.target;\n // Change the background color of the element to white\n pixel.style.backgroundColor = PAINT_COLOR;\n // Set a timeout to call the reset function after a ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Ejecuta el Request con el metodo Post, el resource, parametros y header indicado, con la Web Api XMLHttpRequest | static async post(resource, params, header) {
loading.addL();
return new Promise((resolve, reject) => {
console.log("%crestXHR.post", "color:blue");
// defaults
let rBody;
let rHeader;
if (params && typeof params === 'object') {
... | [
"function postResource() {\n var xhr = new XMLHttpRequest();\n xhr.open('POST', 'https://5tg521dz44.execute-api.us-east-2.amazonaws.com/dev/realgood');\n xhr.onreadystatechange = function(event) {\n console.log(event.target.response);\n }\n xhr.setRequestHeader('Content-Type', 'application/json');\n xhr.se... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Notify the user (once) when changing a dataset URL or resource that saving the changes will clear all columns and filters. | handleNotificationOfChanges() {
const { value } = this.props;
const { changesNotified } = this.state;
// Don't notify if it's already been done once, or if we're just creating the page
if (changesNotified || !value || value.length === 0) {
return;
}
// eslint-disable-next-line no-alert
... | [
"removeAll() {\n this.source = [];\n this.editData = [];\n this.filterData = [];\n this.onDataChange(new CollectionEvent(CollectionEvent.REMOVE_ALL, []));\n this.refresh();\n }",
"onEventClearChanges() {\n this.refresh();\n }",
"function reset() {\n\t\tdata = [];\... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
RUNS WHEN TRADE BLOWS IS CLICKED | TRADE_BLOWS({dispatch, commit, getters, rootState}){
if (!rootState.gameData.combatLocked) {
//LOCK COMBAT
commit('gameData/toggle', {property:'combatLocked'}, {root: true});
//ROLL FOR DAMAGE
dispatch('ROLL_DAMAGE')
//DEAL THAT DAMAGE
di... | [
"function mousePressed() {\n\tgood = checkDur();\n\tcanBreak = !overLink;\n}",
"triggerTest() {\n if (\n this.this.isAboveThreshold &&\n this.this.isTimerActive &&\n this.getCurr().length < MAX_TRIGGER_AMOUNT\n ) {\n this.triggerAction();\n console.log('ACTION');\n }\n }",
"fu... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
This function takes an object and will compile all of its enumerable properties into functions of the same name prefixed with "f". | function functionalTransform(o) {
for(var prop in o) {
if(o.hasOwnProperty(prop) && typeof o[prop] !== 'function')
o['f'+prop] = new Function(o[prop]);
}
} | [
"function stringsToFunctions (obj) {\n for (var p in obj) {\n var val = obj[p];\n\n // Loop through object properties\n if (typeof val == 'object') {\n obj[p] = stringsToFunctions(val);\n }\n // Convert strings back into functions\n else if (typeof val == 'str... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
render tabs and weather data | function renderWeather(weatherData) {
addTabs(weatherData, 'Air');
displayWeather(weatherData);
} | [
"function tabPaneContentTemplate(city){\n console.log(city);\n const data = city.data;\n //let name = capitalizeIFirstLetter(city.name.split(',')[0]);\n let name = data['name'];\n let country = data['sys']['country']; // country code e.g. 'GB' for england\n let timeStamp = unixTimeConverter(data['... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Function to update ourlatest post with newest content after a certain amount of time | function setLatestPostTimer(){
window.clearTimeout(window.latestPostRefresh);
window.latestPostRefresh = setTimeout(function() {
var url = "/widget/recent/";
$.getJSON(url,{} ,function(data){
if ($(data.output)... | [
"function fetchLatestContent() {\n fetchAndDisplayContent();\n var timer = setInterval(fetchAndDisplayContent, 30000);\n}",
"function updatePosts () {\n var turf_id = $(\"#current_turf\").attr(\"data-turfid\");\n if ($(\".post_ind\").length > 0) {\n var after_id = $(\".a_post:first-chil... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
labels the axes, if they are specified in the attributes of the graph | function labelAxes(svg, coords, attributes) {
if ('x-label' in attributes) {
svg.append('text')
.attr('x', coords['x'] + coords['width'] / 2)
.attr('y', coords['y'] + coords['height'])
.attr('text-anchor', 'middle')
.style('font-family', style('axisFont'))
... | [
"function drawAxesLabels() {\n plotContainer.append('text')\n .attr('x', (msm.width - 2 * msm.marginAll) / 2 - 130)\n .attr('y', msm.marginAll / 2 + 10)\n .style('font-size', '14pt')\n .text(\"Pokemon: Special Defense vs Total Stats\");\n\n plotContainer.append('text')\n .at... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Function that sets all game boxes to initial state. | function resetGameBoxes() {
for(const box of divs.game_boxes) {
box.setAttribute('state', 0);
}
} | [
"function resetGame() {\n // Clear the main boxes and the minimap boxes\n for(var rIndex = 0; rIndex < NUM_ROWS; rIndex++) {\n for(var cIndex = 0; cIndex < NUM_COLS; cIndex++) {\n // Clear main boxes\n boxes[rIndex][cIndex].classList.remove(xClass, oClass);\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
create function to add sum of all stores sales by hour and add to the grand total | function sumHourlyTotals(){
for (var i = 0; i < storesHours.length; i++){
var hourlySum = 0;
for (var j = 0; j < allStores.length; j++){
hourlySum += allStores[j].hourlySales[i];
}
hourlyTotals[i] = hourlySum;
grandTotal += hourlySum;
}
} | [
"function sumAllTimes(){\n\n allSalesHourly = [];\n for (var hrIndex = 0; hrIndex < openHours.length; hrIndex++){\n var salesByTime = 0;\n for (var storeIndex = 0; storeIndex < allStores.length; storeIndex++){\n salesByTime += allStores[storeIndex].cookieSales[hrIndex];\n }\n allSalesHourly.push(... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Returns whether the first float is smaller than the second float or equals to it in a range of epsilon. | function smallerTo(aFloat1, aFloat2, aEpsilon)
{
return aFloat1 <= (aFloat2 + aEpsilon);
} | [
"function compareFloat($lhs, $rhs, $epsilon) {\n\tif ($epsilon === undefined) {\n\t\treturn Math.abs($lhs - $rhs) < EPSILON_DEFAULT;\n\t} else {\n\t\treturn Math.abs($lhs - $rhs) < $epsilon;\n\t}\n}",
"function floatEq(a, b) {\n return Math.abs(a - b) <= utils.epsilon;\n }",
"function epsilonE... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Unfold Lines to Rotating Home | function unFoldun() {
d3.keys(slined).forEach(function(ni) {
d3.selectAll('.'+ni).data(slined[ni].p)
.transition().duration(1000)
.attr('transform',function(d) {return rotati(d,0,false);})
.on('end', function() {
d3.selectAll('.'+ni)
... | [
"function undo(){ \n if(!canTouch) return;\n else startTouchButtonTimeout();\n //Cut off the last line to be drawn\n lines = lines.slice(0, -1);\n //Reset the painting, but with special conditions.\n resetPainting(true);\n //Reset each lines iterator variables.\n lines.map(line => line.rese... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
function for submitting the drilldown browse section. | function submitDrillDownBrowse(ddobj,ddtype,entity)
{
//get the selected dropdown value.
if (ddtype == 'category')
{
inCategory = ddobj.options[ddobj.selectedIndex].value;
//loop the forms array and get the drilldown browse form.
for (ii=0; ii <= document.forms.length-1; ii++)
{
if (documen... | [
"function handleBrowse() {\n console.log('browse clicked');\n }",
"function get_browse(){\n $.mortar_data.api.get_browse(\n get_browse_by(), //quantity \n get_current_index(), //index to start browse\n get_browse_from(), //directory to browse by \n fire_reload_table,\n function(){\... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Get the policy for the user. | function getPolicy(user, context, cb) {
request.post({
url: EXTENSION_URL + "/api/users/" + user.user_id + "/policy/" + context.clientID,
headers: {
"x-api-key": "0bce7e8cf6a89bdc2b913d51b39324dbb72fbcbcca1e800c82b30da137faf3b9"
},
json: {
connectionName: context.connection |... | [
"function getPolicy(user, context, cb) {\n request.post({\n url: EXTENSION_URL + \"/api/users/\" + user.user_id + \"/policy/\" + context.clientID,\n headers: {\n \"x-api-key\": API_KEY\n },\n json: {\n connectionName: context.connection || user.identities[0].connection,\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Operator implementations. The $inc operator increments the value of a field by a specified amount. | function inc(document, update) {
var fields, i;
if (update.$inc) {
fields = Object.keys(update.$inc);
for (i = 0; i < fields.length; i++) {
if (isNaN(update.$inc[fields[i]])) {
// Validate the field; throw an exception if it is not a nu... | [
"function fieldInc(doc, field, value) {\n // Requires(doc !== undefined)\n // Requires(field !== undefined)\n // Requires(typeof(value) == 'number')\n\n fieldSet(doc, field, value, function (oldValue) {\n if (oldValue === undefined)\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
generate a list of request data objects | function requestList(api_key, user, page_count){
var requests = [];
for(var page = 1; page <= page_count; page++){
requests.push(requestData(api_key, user, page))
}
return requests
} | [
"function getGeoCodeRequestObjects () {\n\t//console.log (\"inside getGeoCodeRequestObjects\");\n\tvar requestObjects = [];\n\tvar loopLen = LFL.destinations.length, i;\n\tvar api_url = 'https://maps.googleapis.com/maps/api/geocode/json';\n\t\n\tfor(i=0; i < loopLen; i++)\n\t{\n\t\t//console.log (\"requesting for \... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Help method to inizialized Mock dataset, adds 10 test blocks to the blocks array | initializeMockData() {
if (this.blocks.length === 0) {
for (let index = 0; index < 10; index++) {
let blockAux = new Block(`Test Data #${index}`);
blockAux.height = index;
blockAux.hash = SHA256(JSON.stringify(blockAux)).toString();
thi... | [
"initializeMockData() {\n if(this.blocks.length === 0){\n for (let index = 0; index < 10; index++) {\n\t\t\t\tthis.addNewBlock(`Test Data #${index}`);\n }\n }\n }",
"initializeMockData() {\n if (this.blocks.length === 0) {\n for (let index = 0; index < 10; ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Returns an empty buffer. | function emptyBuffer() {
if (emptyBuff) {
return emptyBuff;
}
return emptyBuff = Buffer.alloc(0);
} | [
"function emptyBuffer() {\n if (emptyBuff) {\n return emptyBuff;\n }\n return emptyBuff = Buffer.alloc(0);\n }",
"function emptyBuffer() {\n\t if (emptyBuff) {\n\t return emptyBuff;\n\t }\n\t return emptyBuff = Buffer.alloc(0);\n\t}",
"function empty(){\n buff... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
global set_pos set_size make_battleground create_castel draw_unit | function make_game()
{
/*global Isomer*/
var iso = new Isomer(document.getElementById("art"));
var color = Isomer.Color;
var Point = Isomer.Point;
var Path = Isomer.Path;
var Shape = Isomer.Shape;
// couleur
var Color = new Object();
Color.green = new color(76, 187, 23... | [
"function drawUnit(type, teamColour, id, light=false, placed=true, moveable=false){\n\t\n\tvar unit;\n\n\tif (placed === false){\n\n\t\t$(\"#map >div\").append(\"<svg id='unit-\"+id+\"' class='unit moving' onclick='unitMenuOpen(this)'></svg>\")\n\n\t\tunit = $(\"#unit-\"+id+\".unit\")\n\t}else{\n\t\tunit = $(\"#uni... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
returns permit image depending on whether or not the user has a permit | function permit( ){
console.log(userPermit)
if (userPermit === true){
return <img src={require("../../images/castle-pass.png")} className="invtImg" alt="Castle Pass" />
} else {
return <img src={require("../../images/empty.png")} className="invtImg" alt="Empty" />
}
... | [
"function permit( ){\r\nconsole.log(userPermit)\r\n if (userPermit === true){\r\n return <img src={require(\"../../images/castle-pass.png\")} className=\"invtImg\" alt=\"Castle Pass\" />\r\n } else {\r\n return <img src={require(\"../../images/empty.png\")} className=\"invtImg\" alt=\"Empty\" />... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
pre: moveGetters is an array of functions that return a move. width, height are integers representing the dimensions of the board. victoryCondition is an integer representing the number of pieces in a row needed to win. post: Constructs a Game with the given parameters | constructor(moveGetters, width, height, victoryCondition) {
this.board = new Board(width, height);
this.victoryCondition = victoryCondition;
this.players = [];
this.turnToPlay = 1;
for (let i = 0; i < moveGetters.length; i++) {
this.players.push(new Player(i + 1, move... | [
"function GameBoardSpecs(width, height) {\r\n \"use strict\";\r\n \r\n // Properties\r\n this.width = width;\r\n this.height = height;\r\n this.centerX = width / 2;\r\n this.centerY = height / 2;\r\n \r\n // Methods\r\n \r\n // Returns true if hitting or about to hit the top wall\r\... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Add passenger to plane | addPassenger(passenger) {
this.passengers.push(passenger);
} | [
"addPassenger(passenger) {\n this.passengers.push(passenger);\n }",
"addPlane(plane) {\n this._planes.push(plane);\n this._planeCount++;\n }",
"addPlane(plane) {\n\t\tthis.planes.push(plane)\n\t}",
"function add_actor( actor ){\n\twrap_plane.add_actor( actor );\n}",
"@action.bound\n addPas... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Topologically sort a directed acyclic graph. Returns a list of graph nodes such that, by following edges, you can only move forward in the list, not backward. | function topologicalSort(graph) {
// We can't use a standard sorting algorithm because
// often, two packages won't have any dependency relationship
// between each other, meaning they are incomparable.
verifyGraph(graph);
const sorted = [];
while (sorted.length < Object.keys(graph).length) {
// Find n... | [
"getTopologicalSort() {\n let list = new LinkedList();\n let visited = new Set();\n for (let node of this.getNodes()) {\n if (!visited.has(node)) {\n this.getTopologicalDependents(node, visited, list);\n }\n }\n return list;\n }",
"functio... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Determines whether Modal should be closed when backdrop is clicked. See more on [GitHub]( | get shouldBackdropClose() {
return this._shouldBackdropClose;
} | [
"function backdropOpen(element) {\n return element.style.display !== 'none' && element._isOpen;\n }",
"closeModal() {\n this.isModalOpen = false;\n }",
"function outsideClick(e){\n if(e.target == modal){\n closeModal();\n }\n}",
"backdropClick() {\n return this._overlayRef.backdropCl... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
The threshold of the gate in decibels | get threshold() {
return gainToDb(this._gt.value);
} | [
"function getOutputThreshold(){\n var value;\n value = currentStep*constConfig.OUTPUT_COMPRESS_THRESHOLD_STEP_VALUE - 40;\n if (value === 20){\n value = 'OFF';\n } else {\n value = value.toFixed(1);\n }\n return value;\n}",
"function getThreshold() {\n// TODO: Update the newThresho... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Get the background image from the body | function getBackground() {
if ( $( 'body' ).css( 'backgroundImage' ) ) {
return $( 'body' ).css( 'backgroundImage' ).replace( /url\("?(.*?)"?\)/i, '$1' );
}
} | [
"function getBackground() {\r\n if ( $( 'body' ).css( 'backgroundImage' ) ) {\r\n return $( 'body' ).css( 'backgroundImage' ).replace( /url\\(\"?(.*?)\"?\\)/i, '$1' );\r\n }\r\n }",
"function getBackground() {\n\t\tif ( $( 'body' ).css( 'backgroundImage' ) ) {\n\t\t\treturn $( 'body' )... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
function deal use getcards getsuit shuffle fade cards | function deal(){
//shuffel the array of deck to catch new arr
shuffle(card);
getCards();
} | [
"function dealShuffledDeck() {\n self.reset();\n self.shuffle();\n self.dealAll();\n }",
"function deal() {\n\tvar randCard = deck.getCards()[Math.floor(Math.random() * 52)];\n\treturn randCard;\n}",
"dealCards() {\n newDeck.deal(this.cardsInHand);\n }",
"deal(numCards) {\n if... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
====== setRangeOptions ====== setRangeOptions_colors | function setRangeOptions_colors(){
var range = SpreadsheetApp.getActiveSpreadsheet().getActiveRange();
Sheeter().setRangeOptions(range, 'color', 'red');
} | [
"function colorRange (options) {\n\n var colorRange = options.colorRange || {},\n dataMin = options.dataMin,\n dataMax = options.dataMax,\n autoOrderLegendIcon = options.sortLegend || false,\n mapByCategory = options.mapByCategory || false,\n defaultColo... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
plays the given door's opening animation, then removes its collider | openDoor(door) {
if(!door.opened) {
game.time.events.add(1 * Phaser.Timer.SECOND, function() {this.animations.play('open');}, door);
game.time.events.add(1.5 * Phaser.Timer.SECOND, function() {
if(!door.opened)
{
door.body.destroy();
... | [
"function doorOpen(data) {\n // console.log(\"door open\");\n var doorDel = Q.stage().locate(data.doorX, data.doorY, Q.SPRITE_DOOR);\n doorDel.destroy();\n}",
"function OnTriggerExit (other : Collider){\nif(other.tag == \"Player\"){\n\taudio.PlayOneShot(doorSound);\n\ttransform.parent.renderer.material.mainTex... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
function that makes the refresh button to show new links | function refreshButton() {
let location = document.getElementById('saved_url');
let reButton = document.createElement('button');
reButton.innerHTML = "click to show new links";
reButton.addEventListener('click', function () {
chrome.tabs.reload();
})
location.appendChild(reButton)... | [
"function refreshLinks() {\n var linkTable = document.getElementById('feed');\n\n // Remove all current links.\n while (linkTable.hasChildNodes()) {\n linkTable.removeChild(linkTable.firstChild);\n }\n\n showLoading();\n buildPopupAfterResponse = true;\n updateFeed();\n updateLastRefreshTime();\n}",
"f... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Get the point on the UI border where an indicator should be drawn to properly point to the Indicator's target point. Returns an object with x,y properties. indicator: Indicator instance screenW: Screen width screenH: Screen height cameraPos: An object with x,y properties for where the camera is in the game | function getIndicatorBorderPoint(indicator, screenW, screenH, cameraPos) {
let x = 0;
let y = 0;
let toTarget = V.mul(V.sub(indicator.point, cameraPos), 1000);
let borders = [
{ x: MARGIN, y: MARGIN, tX: screenW - MARGIN, tY: MARGIN },
{ x: screenW - MARGIN, y: MARGIN, tX: screenW - MA... | [
"function getIndicatorPos(indicator, screenW, screenH, cameraPos) {\n let target = indicator.point;\n let onScreen = (\n (Math.abs(target.x - cameraPos.x) <= (screenW / 2 - MARGIN)) &&\n (Math.abs(target.y - cameraPos.y) <= (screenH / 2 - MARGIN))\n );\n\n if (!onScreen) {\n return ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Returns a ValidityState object that represents the validity states of the text field. | get validity() {
return this.getInput().validity;
} | [
"getValidStatus() {\n this.checkInput();\n return this.state.isValid;\n }",
"get getInvalidState() {\n const state = this.input ? this.input.control.invalid : false;\n state && this.input.control.touched\n ? this.input.element.classList.add('is-invalid')\n : this.input.e... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
so I can use recipeID anywhere in the app | function setRecipeID(id) {
setID(id);
} | [
"function getId(){\n $.getJSON('/recipes/getid', function(data){\n recipeId = {\n id: data[0].view_id\n };\n getRecipes(recipeId);\n });\n}",
"loadRecipeEntry (recipeID) {\n\t\treturn Api().get(`/recipes/${recipeID}`);\n\t}",
"function findRecipeId(response) {\n const { results } = response;\... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Will be called for each of my 16 checkboxes to check if a sound should be played. This function also check if a recording has been requested. The recording will start when looptime hits 0 and end when looptime hits 31 | function repeat(time) {
// step is used to check every input checkbox
let step = checkbox % 16;
// looptime is used for recording sound.
let looptime = checkbox % 32;
let selectedSound1 = document.querySelector(`.top input:nth-child(${step + 1})`);
let select... | [
"function checkRecordingDuration () {\n\n if (dutyCheckBox.checked) {\n\n const duration = durationInput.getValue(recordingDurationInput);\n checkMinimumTriggerTime(duration);\n\n }\n\n}",
"function checkAudioLength() {\n audioRecordingTime = new Date() - audioRecordingStartTime;\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Hide/show layer. ID: Layer to be hidden/shown. | function toggleLayer(id) {
var layer = map.getLayer(id);
layer.setVisibility(!layer.visible);
} | [
"function toggleLayer(layerID) \n{\n\tlayer = Ext.get(layerID);\n\ttry {\n\t\tif (layer.isDisplayed()) {\n\t\t\tlayer.setDisplayed(false);\n\t\t} else {\n\t\t\tlayer.setDisplayed(true);\n\t\t}\n\t} catch (e) {\n\t\talert(e.message);\n\t}\n}",
"function showHideLayer(layerdiv){\n\tvar obj=document.getElementById(l... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Factory for cost center REST API | function costCentersResource(projectConfig, $log, $resource, measure) {
var baseUrl = projectConfig.baseUrl + '/costcenters';
var version = "1.0";
var service = {
getVersion: getVersion,
findById: findById,
listAll: listAll,
create: create,
... | [
"constructor(endpoint = 'https://swapi.dev/api') {\n //endpoint de la base de datos del catalogo\n this.endpoint = endpoint\n }",
"function Demand()\n{\n this.apiEndpoint = '/demands';\n}",
"function CarpoolAPI(credentials, options) {\n return _super.call(this, credentials, options) |... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Extract translatable messages from an html AST | function extractMessages(nodes,interpolationConfig,implicitTags,implicitAttrs){var visitor=new _Visitor$2(implicitTags,implicitAttrs);return visitor.extract(nodes,interpolationConfig);} | [
"function extractMessage(ast) {\n return printMessage(sanitize(validateMessage(ast)));\n}",
"function extractMessages(nodes,interpolationConfig,implicitTags,implicitAttrs){var visitor=new _Visitor(implicitTags,implicitAttrs);return visitor.extract(nodes,interpolationConfig);}",
"function extractMessages(node... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
1. Make the above code have a function called checkDriverAge(). Whenever you call this function, you will get prompted for age. Use Function Declaration to create this function. Notice the benefit in having checkDriverAge() instead of copying and pasting the function everytime? | function checkDriverAge() {
var age = prompt ("How old are you?");
if (Number(age) < 21) {
alert("You are underage to drive.Power off!!");
} else if (Number(age) > 21 ) {
alert("Start to drive");
} else if (Number(age) === 21) {
alert("Good luck in your experience");
}
} | [
"function checkDriverAge() {\n\tvar age = prompt(\"What is your age?\");\n\tif (age < 18) {\n\t\talert(\"Sorry, you are too young to drive this car. Powering off\");\n\t} else if (age > 18) {\n\t\talert(\"Powering On. Enjoy the ride!\");\n\t} else if (age === 18) {\n\t\talert(\"Congratulations on your first year of... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Get an existing ScalingPlan resource's state with the given name, ID, and optional extra properties used to qualify the lookup. | static get(name, id, state, opts) {
return new ScalingPlan(name, state, Object.assign(Object.assign({}, opts), { id: id }));
} | [
"static get(name, id, state, opts) {\n return new ResourcePolicy(name, state, Object.assign(Object.assign({}, opts), { id: id }));\n }",
"static get(name, id, state, opts) {\n return new Stage(name, state, Object.assign(Object.assign({}, opts), { id: id }));\n }",
"static get(name, id, state... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Reads the component's children. Adds component's primitives children to the graph scene. | readingChildren(childrenElem) {
//taking care of componentref
var components = childrenElem.getElementsByTagName('componentref');
for (let component of components) {
this.componentsRefId.push(this.reader.getString(component, 'id'));
}
var primitives = children... | [
"setupChildrenComponents() {\n for (let i = 0; i < this.componentObject.children.components.length; i++) {\n this.children.push(this.graph.components[this.componentObject.children.components[i]]);\n }\n }",
"collectPrimitives(node) {\n if (node.isMesh()) {\n this.prim... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Utility function used to set id of the new row It is assumed that id is placed as an id attribute of that that surround the cell ( tag). E.g.: ............ | function _fnSetRowIDInAttribute(row, id) {
row.attr("id", id);
} | [
"function _fnSetRowIDInAttribute(row, id) {\n row.attr(\"id\", id);\n }",
"function _fnSetRowIDInAttribute(row, id) {\r\n\t\t\trow.attr(\"id\", id);\r\n\t\t}",
"function create_id_cell(id) {\n return $(\"<td>\", {\n class: \"objects-id\",\n }).append(\n $(\"<span>\", {\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Checks if a method is supported on runtime platform. | function supports(method) {
if (IS_ANDROID_WEBVIEW) {
// Android support check
return !!(androidBridge && typeof androidBridge[method] === 'function');
}
else if (IS_IOS_WEBVIEW) {
// iOS support check
return !!(iosBridge && iosBridge[method... | [
"function supports (method) {\n return method &&\n typeof method === 'string' &&\n methods.indexOf(method.toLowerCase()) !== -1\n}",
"function isSupportedMethod(method) {\n var supported = [ 'GET', 'PUT', 'POST', 'DELETE' ];\n return supported.indexOf(method) > -1;\n }",
"isSupportedOnCurren... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
makes a pop up box on click and changes the color of the table on mousemover | function addEvents(){
//when the table is mousedover make it change color
$('table').mouseover(function(){
//set the color variable
var color = "rgb(";
//loop to add different commponents to color variable
for (var i=0; i<3; i++){
var random = Math.round(Math.random() * 255);
color += rand... | [
"function addEvents($this){\n //Trigger an event when viewer \"mousesover\" the table\n $('table').mouseover(function(){\n //define string variable with a CSS color code using loop\n var color = \"rgb(\";\n //Loop to generate three random numbers to feed into .css()\n for (var i=0;... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
insert rateHTML after an element of given ID | function insertAfterID(id, currency, rate) {
document.getElementById(id).insertAdjacentHTML("afterend", rateHTML(currency, rate));
} | [
"specialRate() {\r\n let section = document.querySelector('section');\r\n let h4 = document.createElement('h4');\r\n let newRate = this.type + ' for this rental is ' + this.rate() + ' $/night';\r\n h4.innerHTML = newRate;\r\n section.appendChild(h4);\r\n }",
"function cardRat... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Extracting dayIndex from given day Eg. wed will give 3 | function dayIndex(day, days) {
for (var i = 0; i < 7; i++) {
if (days[i] === day) {
day = i;
break;
}
}
return day;
} | [
"function get_day_index(day) {\n if (day == \"Monday\") return 0;\n if (day == \"Tuesday\") return 1;\n if (day == \"Wednesday\") return 2;\n if (day == \"Thursday\") return 3;\n if (day == \"Friday\") return 4;\n if (day == \"Saturday\") return 5;\n if (day == \"Sunday\") return 6;\n}",
"fun... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Writing a function that welcome a user when given the correct username and password | function welcomUser(username,password){
if (username === "alaa" && password === 1234567){
return "Welcom " + username;
}
return "Access denied";
} | [
"function welcomeUser(credentials){\n console.log('welcome ' + credentials.user.email);\n}",
"function logIn(username, password) {\n if (username === 'Boba Fett' && password === 'spongebobsquarepants') {\n console.log('Welcome, Boba Fett.');\n }\n}",
"function validateUser(username,password){\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Add an Event to the events object Parameters: eventFile The exported contents of the event file to add. | function addEvent(eventFile) {
if (validate(eventFile)) {
events[eventFile.event] = {
run: eventFile.run
};
} else {
Log.error(`Command file ${file} is invalid.`);
throw `Command file ${file} is invalid.`;
}
} | [
"addEvent(eventName, eventDescription, eventDate) {\n const event = new Events(eventName, eventDescription, eventDate);\n this.events.push(event);\n }",
"function pushEvent(newEvent) {\n Events.push(newEvent);\n}",
"function addEvent(eventName) {\n \n // get the timestamp\n var timestamp = ne... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
update iFrame height and width when clicked on | function updateFrame() {
var iframe = parent.document.getElementById("iframeHelp");
var helpModule = iframe.contentWindow.document.getElementById("help-module");
// console.log("running updateframeHeight");
var newHeight = helpModule.offsetHeight + "px";
var newWidth = helpModule.offsetWidth ... | [
"function updateFramesize() {\n\n\t// get window width\n\tvar width = $( '#leframe' ).width(),\n\t\theight = $( '#leframe' ).height();\n\n\t// set\n\t$( '.framesize' ).html( width+\"x\"+height);\n}",
"function sizeFrame(){\r\nvar frameWidth = $('.slide iframe').width();\r\nvar aspect = (frameWidth * 0.75)\r\n$('.... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
CARASEL PLUGIN DEFINITION ========================== | function Plugin(option) {
return this.each(function () {
var $this = $(this)
var data = $this.data('bs.carasel')
var options = $.extend({}, Carasel.DEFAULTS, $this.data(), typeof option == 'object' && option)
var action = typeof option == 'string' ? option : optio... | [
"function Plugin () {\n }",
"function SamplePlugin(){}",
"function Plugin() {\n}",
"function CharbaJsPluginHelper() {}",
"pluginConstructor() {}",
"function Plugin() {\n /// <summary>Plugin constructor</summary>\n\n this.init();\n }",
"function CarouselModuleInitialize() {\n$( document ).on( '... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Reports an error if the actual variable do not have the same type as the expected. | assertType(expected, actual)
{
Tester.valid(expected, 'string')
Tester.valid(actual, 'mixed')
this._assertionsCounter++
var trace = Tester.getBacktrace(new Error(), 2)
if (Tester.type(actual) !== expected) {
this._errors.push('Error: ' + trace)
this... | [
"function assert_eq_type(a, b, msg) {\n let msg_total = \"\";\n\n if (typeof a !== typeof b) {\n console.error(\"error: incorrect types in assert_eq_type: a: \" + typeof a + \"b: \" + typeof b);\n }\n\n if (a.constructor.name !== b.constructor.name) {\n console.error(\"error: two classes d... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
GMT:00:00:00 > 09:00:00 today.setMonth(0); console.log(today.getDay()); | function setCal(yyyy, mm) {
let today = new Date(yyyy + '-' + mm)
today = new Date(yyyy, mm, 0);
console.log(today.getDate());
} | [
"getDayOfMonthNoTZ() {}",
"monday() {\n return new Date(this.time - (this.day() - 1) * 86400000)\n }",
"function dateForToday() {\n return new Date().toMidnight();\n}",
"function getFirstMonthsDay(dt){\n return new Date(dt.getFullYear(), dt.getMonth(), 1).getDay();\n //return new Da... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Animate bar chart creation. | function animateBarChart(context) {
if (context.type === 'bar') {
context.element.animate({
y2: {
begin: Math.floor(Math.random() * 800),
dur: 400,
from: context.y1,
to: context.y2,
easing: Chartist.Svg.Easing.easeOutQuart
}
... | [
"function buildBarChart(data) {\n // Remove any existing svg\n d3.select('svg').remove();\n\n // Append the main svg for the chart to the page\n var svg = d3.select('body')\n .append('svg')\n .attr('width', w)\n .attr('height', h);\n\n // Append the ba... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Compresses bins of bin size 1 into bins of 0, 1, 24, 510, 1130, and so on bins an array of objects with bin label and count, expects bin size of 1 and max bin size of 100 | function compress_long_tail_bins(bins) {
var new_bins = [
{bin: "0", count: 0},
{bin: "1", count: 0},
{bin: "2 - 4", count: 0},
{bin: "5 - 10", count: 0},
{bin: "11 - 30", count: 0},
{bin: "31 - 50", count: 0},
{bin: "51 - 70", count: 0},
{bin: "71 - 90", count: 0},
{bin: "91 - 100... | [
"computeBins(numCategorias) {\n let x = d3.extent(this.dataTransf, d => {\n return d.x;\n });\n\n let catego = numCategorias;\n let larg = (x[1] - x[0]) / (numCategorias - 1); // tamanho de cada bin do eixo x (max - min )/ (categorias -1)\n // o -1 é para ter um \"espaço nos limites\"\n // sa... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Change a user's assigned school. restriction: 'admin' | static updateSchool(userId, schoolId) {
const req = new Request(`/api/users/${userId}/assignment`, {
method : 'PUT',
headers : this.requestHeaders(),
body : this.requestBody({assignment: schoolId})
});
return fetch(req).then(res => this.parseResponse(res))
.catch(err => {
thr... | [
"function setSchool(schl)\n{\n\tthis.school = schl;\n}",
"function changeSchool(newSchoolID) {\n console.log(User);\n var oldSchool;\n if (User.school) {\n oldSchool = User.school;\n }\n db.collection(\"users\").doc(User.uid).update({\n school: newSchoolID\n })\n .then(function() {\n //Rem... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
[END set_modify_parameter] [START set_modify_parameter_group] | function setOrModifyParameterGroup(template) {
// Set new_menu parameter group
template.parameterGroups['new_menu'] = {
description: 'Description of the group.',
parameters: {
pumpkin_spice_season: {
defaultValue: {
value: 'A Gryffindor must love a pumpkin spice latte.'
},
... | [
"canSetParameter(name, value) {\n return true;\n }",
"onParamGroupWorksetCopy (groupName) {\n if (!groupName) {\n console.warn('Unable to copy parameters group from workset, group name is empty')\n return\n }\n // count parameters from the group which are already exist in ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Expands all dataNodes in the tree. To make this working, the `dataNodes` variable of the TreeControl must be set to all root level data nodes of the tree. | expandAll() {
this.expansionModel.clear();
const allNodes = this.dataNodes.reduce((accumulator, dataNode) => [...accumulator, ...this.getDescendants(dataNode), dataNode], []);
this.expansionModel.select(...allNodes);
} | [
"expandAll() {\n this.expansionModel.clear();\n const allNodes = this.dataNodes.reduce((accumulator, dataNode) => [...accumulator, ...this.getDescendants(dataNode), dataNode], []);\n this.expansionModel.select(...allNodes.map(node => this._trackByValue(node)));\n }",
"expandAll() {\n th... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Presents a notification to the user that they have been checked in Called by the ServerCommunicator when it has successfully checked in the user | checkInComplete() {
if (GoogleSignin.currentUser() != null) {
StorageController.getCheckinNotifPreference().then((value) => {
if (value) {
console.log('Notifying...');
PushNotification.localNotification({
title:'Checked In',
message: 'Just checked you into t... | [
"function showAlertChecklist() {\n\t\tnavigator.notification.alert(\n\t\t\t'Bitte Checkliste überprüfen', // message\n\t\t\talertDismissed, // callback\n\t\t\t'Achtung!', // title\n\t\t\t'OK' // buttonName\n )\n }",
"showSuccessNotification (message) {\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Loads and caches the numbers fields for a given `locale` because loading and transforming the data is expensive. | function getNumbers(locale) {
let numbers = cache[locale];
if (numbers) {
return numbers;
}
if (hasNumbersFields(locale)) {
numbers = cache[locale] = loadNumbers(locale);
return numbers;
}
} | [
"function findLocaleWithNumbersFields(locale) {\n // The \"root\" locale is the top level ancestor.\n if (locale === 'root') {\n return 'root';\n }\n\n if (hasNumbersFields(locale)) {\n return locale;\n }\n\n // When the `locale` doesn't have numbers f... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Input: Single data value Output: Class number that the value falls into (from 1 to n) | function get_class(value) {
for (var i = 1; i < classBreaks.length - 1; i++) { // breaks[0] = dataMin
if (value <= classBreaks[i]) {
return i;
}
}
return classBreaks.length - 1;
} | [
"function coverageClass(n) {\n if (n >= 75) return 'high';\n if (n >= 50) return 'medium';\n if (n >= 25) return 'low';\n return 'terrible';\n}",
"classification() {\n let classes = new Map();\n classes.set(100, \"tiny\");\n classes.set(500, \"small\");\n classes.set(1000, \"normal\");\n classe... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Delete a beta group and remove beta tester access to associated builds. | function deleteBetaGroup(api, id) {
return api_1.DELETE(api, `/betaGroups/${id}`)
} | [
"function removeAccessForBetaGroupsForBuild(api, id, body) {\n return api_1.DELETE(api, `/builds/${id}/relationships/betaGroups`, { body })\n}",
"function removeBetaTesterFromBetaGroups(api, id, body) {\n return api_1.DELETE(api, `/betaTesters/${id}/relationships/betaGroups`, {\n body,\n })\n}",
... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Parse single node in FBXTree.Objects.Geometry | function parseGeometry( FBXTree, relationships, geometryNode, skeletons ) {
switch ( geometryNode.attrType ) {
case 'Mesh':
return parseMeshGeometry( FBXTree, relationships, geometryNode, skeletons );
break;
case 'NurbsCu... | [
"function parseGeometry(FBXTree, relationships, geoNode, deformers) {\n switch (geoNode.attrType) {\n case 'Mesh':\n return parseMeshGeometry(FBXTree, relationships, geoNode, deformers);\n //break;\n case 'NurbsCurve':\n return parseNurbsGeometry(geoNode);\n }\n}",
... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Can be used to transform the file (for example, resize an image if necessary). The default implementation uses `resizeWidth` and `resizeHeight` (if provided) and resizes images according to those dimensions. Gets the `file` as the first parameter, and a `done()` function as the second, that needs to be invoked with the... | transformFile (file, done) {
if ((this.options.resizeWidth || this.options.resizeHeight) && file.type.match(/image.*/)) return this.resizeImage(file, this.options.resizeWidth, this.options.resizeHeight, this.options.resizeMethod, done);
else return done(file);
} | [
"function resizeImage(container, file, maxWidth, done) {\n\n console.log(file)\n\n let reader = new FileReader(),\n ext = file.name.split('.').pop();\n \n reader.readAsDataURL(file)\n reader.onloadend = function() {\n \n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Process the table rows to make it "square", ie all columns are the same width | _make_square()
{
let width = this.width;
return this.rows.map(function(row)
{
if (row.type != 'data') { return row; }
// Make a copy of the row, padding if it is too short
return {
type: 'data',
data: row.data.concat(Array(width - row.data.length).fill('')),
align: row.align + 'l'.repeat(wi... | [
"function squareRows(rows) {\n const splitRows = [];\n const segments = rows[0].length / rows.length;\n\n rows.forEach(row => {\n let offset = 0;\n for (let index = 0; index < rows.length; index++) {\n splitRows.push(row.slice(offset, offset + segments));\n offset += segments;\n }\n });\n\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |