query stringlengths 9 34k | document stringlengths 8 5.39M | negatives listlengths 19 20 | metadata dict |
|---|---|---|---|
Changes the list on the slide | function changeSlideList(slideToChange, listObj, listObjID) {
slideToChange.data.list[listObjID] = listObj.value;
runUpdateTimer();
} | [
"emitSlideList() {\n this.emit(STORES_PRES_VIEW.SLIDE_LIST);\n }",
"set list(list){\n this._list = list;\n this.render()\n }",
"function updateLi(slideCurrent){\n slideCurrent.classList.add('visable');\n}",
"function updateActiveList(list){\n \n glob.activeListTitle = list.title;... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Get an array of all the summoner names of the players on a team | function getTeamPlayers(match, teamId) {
// since the participantIdentities portion doesn't track teamId
// we determine it by looking at participants to find out the teamId
// NOTE: it looks like participants is always in participantId sorted order
var pOnTeam = [];
var summoners = [];
for(i = 0; i <... | [
"function teamNames() {\n return [homeTeam().teamName, awayTeam().teamName];\n}",
"getPlayerNames() {\n let res = [];\n\n this._playerData.forEach((value, key, map) => {\n res.push(value.name);\n })\n\n return res;\n }",
"createPlayerNameArray() {\n\t\tconst names = []... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Reset the writable text of colosium | function resetWritable (){
if(idTimer !== undefined){
clearInterval(idTimer);
}
counter = 0;
document.getElementById("written-text").innerHTML = "";
idTimer = setInterval(writeColosseum, 200);
} | [
"function resetText(){\n\n}",
"function resetContent() { setContent(''); }",
"clearLcd() {\n // clear lcd by writing spaces to it\n for (var i = 0; i < 2; i++) {\n this.writeLcd(\" \".repeat(16), i, 0);\n }\n }",
"resetText() {\n this.codeMirror.getDoc().setValue(this.classes[this.classI... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Injects the One Google Bar into the page. Called asynchronously, so that it doesn't block the main page load. | function injectOneGoogleBar(ogb) {
var inHeadStyle = document.createElement('style');
inHeadStyle.type = 'text/css';
inHeadStyle.appendChild(document.createTextNode(ogb.inHeadStyle));
document.head.appendChild(inHeadStyle);
var inHeadScript = document.createElement('script');
inHeadScript.type = 'text/java... | [
"function injectOneGoogleBar(ogb) {\n var inHeadStyle = document.createElement('style');\n inHeadStyle.type = 'text/css';\n inHeadStyle.appendChild(document.createTextNode(ogb.inHeadStyle));\n document.head.appendChild(inHeadStyle);\n\n var inHeadScript = document.createElement('script');\n inHeadScript.type ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
if in a specific position in grid, will remove these classes | removeObject(pos, classes) {
this.grid[pos].classList.remove(...classes);
} | [
"function removeItemFromGrid(position) {\n cells[position].setAttribute('class', 'grid-div')\n }",
"function removeClasses(){\n\tfor(i = 1; i<=3; i++){\n\t\tvar current = \"#pos\" + i.toString();\n\t\t$(current).removeClass(\"winner\");\n\t\t$(current).removeClass(\"loser\");\n\t}\n}",
"function removeFrog(... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Main Combat Simulation Loop | function doCombatSimulation() {
// Fleet initialization
combat.fleets.attacker.combat = {};
combat.fleets.defender.combat = {};
combat.fleets.attacker.enemy = "defender";
combat.fleets.defender.enemy = "attacker";
_.each(combat.fleets,function(fleet,key) {
fleet.combat.loseCount = 0;
fleet.combat.unitCount = ... | [
"function simulation() {\n catsMoving();\n catsOverlap();\n stackCats();\n noStackCats();\n cloudsMovement();\n display();\n}",
"function startSimulation() {\n\t\t// Clear outputs\n\t\tclock = 0;\n\t\tObject.keys(outputs).forEach(function (o) {\n\t\t\toutputs[o].value = 0;\n\t\t});\n\t\tpickupsCompleted = 0... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
submit function for custom pizza builder gets the order, and all values from the form goes through each element in the toppings list and adds it to the pizza adds the pizza to the order and puts the order in session storage | function buildSubmit() {
order = getStorage();
var size = document.querySelector('input[name="size"]:checked').value;
var crust = document.querySelector('input[name="crust"]:checked').value;
var sauce = document.getElementById("sauce").value;
var cheese = document.getElementById("cheese").value;
var toppin... | [
"function orderUpdate(form) {\n extraToppings = [];\n price = 0;\n pizza_size = form.pizza_size.value;\n pizza_crust = form.crust_type.value;\n pizza_type = form.pizza_type.value;\n pizza_toppings = [];\n custom_toppings = document.getElementsByClassName(\"ptoppings\");\n extraToppingsPrice ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
The shuffle_play is used to display the toast on the bottom of the screen | function shuffle_play() {
if (document.querySelector('ons-toast').style.display == "none") {
document.querySelector('ons-toast').show();
}
document.getElementById("play_icon").classList.remove("fa-play-circle-o");
document.getElementById("play_icon").classList.add("fa-pause-circle-o");
} | [
"function amplitude_shuffle_playlist(){\n\t//If the shuffle button is activated when clicked, turn it off.\n\tif( amplitude_active_config.amplitude_shuffle ){\n\t\tamplitude_active_config.amplitude_shuffle = false;\n\t\tamplitude_active_config.amplitude_shuffle_list = {};\n\t\t\n\t}else{\n\t\tamplitude_active_confi... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
build a menu list based on an array of text add a prefix to the return word using prefix automatically sorts alphabetically, set sort=false to disable automatically capitalizes first letter of every word fill the markAsNew array with elements you want marked green | function createMenuFromArray(arr,prefix,sort,markAsNew){
markAsNew=[].concat(allNewItems, allNewItems2, allNewItems3, (markAsNew||[]));
sort=(sort==null)?true:sort;
var ret={};
if (arr) {
//clone the array before sorting
arr2=arr.slice(0);
if (sort) arr2=arr2.sort();
for (var i=0,len=arr2.le... | [
"function createMenuFromArray(arr,prefix,sort,markAsNew,markWithColors){\r\n\t\tmarkAsNew=markAsNew||newItems;\r\n\t\tmarkWithColors=markWithColors||newItemColors;\r\n\t\tsort=(sort==null)?true:sort;\r\n\t\tvar ret={};\r\n\t\tif (arr) {\r\n\t\t\t//clone the array before sorting\r\n\t\t\tarr2=arr.slice(0);\r\n\t\t\t... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
end transaction write items. | function transWriteItems(params){
return new Promise(function(resolve, reject) {
ddb.transactWrite(params, function(err, data) {
if (err) reject(err);
else resolve(data);
})
});
} | [
"function doBatchWriteItem(err, data) {\n batchCount--;\n\t if (err) {\n\t console.log(err); // an error occurred\n\t if (batchCount === 0) {\n\t\t callback(err, data);\n\t }\n\t } else {\n\t console.dir(data);\n\t \tif (('UnprocessedItems' in data) && (table in data... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Provided data Calculate TOTAL SALES and TOTAL TAX PER COMPANY | function calculateSalesTax(salesData, taxRates){
var comp = {};
for (obj in salesData){
if (comp[salesData[obj].name]){ //IF company name already exists, add totalSales and totaltaxes to existing values
comp[salesData[obj].name].totalSales += salesData[obj].sales.reduce(function (a, b) {
return a + b;
}, 0);//... | [
"function calculateSalesTax(salesData, taxRates) {\n var totalInfo = {};\n for (var i = 0; i < salesData.length; i++) {\n var companyData = salesData[i];\n var companyName = companyData.name;\n if (!totalInfo[companyName]) {\n totalInfo[companyName] = {\n totalSales: 0,\n totalTax: 0\n... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Recalculate terminal position in percents to pixels | function calcTermPixels(percentX, percentY) {
return [
window.innerWidth * percentX,
window.innerHeight * percentY
]
} | [
"posToPerc(x, y) {\n const storytellerBounds = document.getElementById('storyteller-view').getBoundingClientRect();\n const viewLeft = storytellerBounds.left;\n const viewTop = storytellerBounds.top;\n const viewSize = storytellerBounds.width;\n\n // Round to one decimal\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
make the data to be used in the request that triggers the message | makePostData (callback) {
const stream = this.useStream || this.teamStream;
const toEmail = `${stream.id}.${this.team.id}@${this.apiConfig.email.replyToDomain}`;
this.data = {
to: [{ address: toEmail }],
from: { address: this.users[1].user.email },
text: this.postFactory.randomText(),
mailFile: 'somef... | [
"_generateMessageObj (data) {\n let id = data.id || moment().format('x');\n let from = data.from || '';\n let to = data.to || '';\n let type = data.type || 'chat'; // chat, error, normal, groupchat, or headline\n let body = data.body || '';\n let time = data.time || moment().valueOf();\n let un... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Sets the daf (page number) of the Daf Yomi | setDaf(daf) {
this.daf = daf;
} | [
"setPage(number) {\n if(number > 0) this._currentDirectoryPage = number;\n this._ensureCurrentDirectoryPage();\n }",
"set_pagecount(n) {\n if (this.pagecount !== n) {\n this.pagecount = n;\n this.draw();\n }\n }",
"set numPages(value) {\n if (ty... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Implements nsIImportSettings. The actual importing is delegated to nsSeamonkeyProfileMigrator. | function SeamonkeyImportSettings() {
this.migrator = Cc[
"@mozilla.org/profile/migrator;1?app=mail&type=seamonkey"
].createInstance(Ci.nsIMailProfileMigrator);
this.sourceProfileName = null;
this.sourceProfileLocation = null;
} | [
"async function ImportSettings(module, newAccount, error) {\n var setIntf = module.GetImportInterface(\"settings\");\n if (!(setIntf instanceof Ci.nsIImportSettings)) {\n error.value = gImportMsgsBundle.getString(\"ImportSettingsBadModule\");\n return false;\n }\n\n // determine if we can auto find the se... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Provides: caml_hash_string Requires: caml_hash | function caml_hash_string(str) { return caml_hash(10,100,0,str); } | [
"function caml_hash_string(s) {\n var h = caml_hash_mix_string_str(0, caml_bytes_of_string(s));\n h = FINAL_MIX(h)\n return h & 0x3FFFFFFF;\n}",
"function caml_hash_mix_string_str(h, s) {\n var len = s.length, i, w;\n for (i = 0; i + 4 <= len; i += 4) {\n w = s.charCodeAt(i)\n | (s.charCodeAt(i+1) ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Clear container of its video and set it up for the iframe API | function clearContainer() {
$('.youtube-embed-container > *').empty();
$('.youtube-embed-container').append($('<div id="player"/></div>'));
} | [
"function clearVideoIframe() {\n videoContainer.innerHTML = '';\n}",
"function emptyVideoContainer() {\n $videoMessage.empty();\n $videoCountdown.empty();\n}",
"function destroyVideoContainer(my_video_id) {\n var my_video_container = document.getElementById(\"video_container_\" + my_video_id);\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
funciton for deleting items from the order get the order if the item is a number (custom pizza index) splice the array else delete the element from the object put new order in the session storage and reload the page | function deleteItem(item) {
var order = JSON.parse(sessionStorage.getItem("order"));
if (typeof item == "number") {
order["custom"] = order["custom"].splice(1, item);
} else {
delete order[item];
}
sessionStorage.setItem("order", JSON.stringify(order));
document.location.reload(true);
} | [
"delete(item) {\n let arr = this.get('items')\n let elementIndex = arr.findIndex(obj => {\n return obj.id === item.id\n })\n\n let quantity = arr[elementIndex].ordered_quantity\n if (elementIndex !== -1) {\n arr.removeAt(elementIndex)\n }\n this... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Reindex data in the time model. | reindex() {
this.reindexFlag_ = false;
if (this.timeModel_) {
this.timeModel_.removeDimension(this.id_);
if (this.binMethod) {
var valueFn = this.binMethod.getValue.bind(this.binMethod);
// add dimension that will handle an array of keys
var isArray = this.binMethod.getBinT... | [
"reindexTimeModel_() {\n this.getSource().reindexTimeModel();\n }",
"function reindex()\n\t\t{\n\t\t\tfor (var name in _indexes)\n\t\t\t\t_indexes[name].rebuild();\n\t\t}",
"syncIndices(action, added = emptyArray$5, removed = emptyArray$5, replaced) {\n const me = this,\n replacedCount = replace... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Compute the application load state. | function callBackToComputeLoadState() {
if (!loadStatus) {
showIncorrectPasswordPage();
return;
}
if (filesRead !== maxFiles) {
filesRead++;
}
if (filesRead === maxFiles) {
if (loadStatus) {
hidePasswordInput();
... | [
"function getLoadState() {\n return loadRunning;\n }",
"get loadState() {\n return this._loadState;\n }",
"function printLoadStates() {\r\n console.groupCollapsed(`[APEResource] Resource Manager Load States`);\r\n console.log('Audio');\r\n console.log(APEResources.audio.... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Given two strings, a and b, that may or may not be of the same length, determine the minimum number of character deletions required to make a and b anagrams. Any characters can be deleted from either of the strings. | function getDeleteCountUsingIndexOf() {
var aChars = a.split("");
var bChars = b.split("");
if (aChars.length > bChars.length) {
var outer = aChars;
var inner = bChars;
} else {
var outer = bChars;
var inner = aChars;
}
var outerIndex = outer.length-1;
while (in... | [
"function isAnagram (a, b) {\n\t// turn each string into arrays to check for equality\n\tlet stringAArray = a.split('');\n let stringBArray = b.split('');\n\n // have a counter variable to keep track of how many characters match\n let numberOfMatches = 0;\n\n // check which string is smaller to loop through tha... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
blink(t, d): returns true if t is within the on interval. | function blink(t, d)
{
return ((t % d) < d/2);
} | [
"function blink() { blink_rate = 1.5; }",
"function blink() {\n if((typeof interval) !== \"undefined\") {\n clearInterval(interval);\n }\n pwm(activeLed, 0, 500);\n if(activeLed == LED1) {\n activeLed = LED2;\n } else if(activeLed == LED2) {\n activeLed = LED3;\n } else {\n activeLed = LED1;\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Tries to add an event data to the batch if permitted by the batch's size limit. NOTE: Always remember to check the return value of this method, before calling it again for the next event. | tryAdd(eventData, options = {}) {
var _a;
throwTypeErrorIfParameterMissing(this._context.connectionId, "tryAdd", "eventData", eventData);
options = convertTryAddOptionsForCompatibility(options);
// check if the event has already been instrumented
const previouslyInstrumented = Bo... | [
"tryAdd(eventData, options = {}) {\n throwTypeErrorIfParameterMissing(this._context.connectionId, \"tryAdd\", \"eventData\", eventData);\n // check if the event has already been instrumented\n const previouslyInstrumented = Boolean(eventData.properties && eventData.properties[TRACEPARENT_PROPER... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Update the State and SuperGroup selectors based on the given Policy Benefit ID. | function updateBasedOnPolicyBenefitId(member) {
var filter = {
pb_id : member.policyBenefitId
};
superGroupSearchService.findStateAndSuperGroup(filter, populateStateAndPbGroup);
} | [
"function updateStateAndPbGroup(currentSettings)\n{\n // First, select the state. This will populate the SuperGroup list with the associated SuperGroups.\n if (currentSettings.location != null)\n {\n $(\"#PB_GROUPXLOCATION\").val(currentSettings.location).attr(\"selected\", \"selected\");\n }\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
delete data O(1) // O(n) if there is collison | delete(key){
const address = this._hash(key);
if(this.data[address]){
for (let i = 0; i < this.data[address].length; i++) {
let currenctBucket = this.data[address][i];
if (currenctBucket) {
if (currenctBucket[0] === key) {
... | [
"*applyDeleteSet(ds){var deletions=[];for(var user in ds){var dv=ds[user];var pos=0;var d=dv[pos];yield*this.ds.iterate(this,[user,0],[user,Number.MAX_VALUE],function*(n){// cases:\n// 1. d deletes something to the right of n\n// => go to next n (break)\n// 2. d deletes something to the left of n\n// => create de... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
functions for lmfit returns the inverse of A using QR decomposition | function inverse(A){
var qr = JSON.parse(JSON.stringify(A))
var m = qr.length
var n = qr[0].length
var rdiag = new Array(n);
var i, j, k, s;
var X = new Array(m).fill(0).map(_ => new Array(m).fill(0))
for(let i =0; i<m;i++) X[i][i] = 1.0
for (k = 0; k < n; k++) {
var nrm = 0;
... | [
"inv()\n\t{\n\t\tvar rdet = this.det();\n\t\tif(rdet === 0)\n\t\t\treturn false;\n\t\t\n\t\trdet = 1 / rdet;\n\t\tvar tmp = __mjs_tmpMat1.val;\n\t\tvar val = this.val;\n\t\t\n\t\ttmp[M00] = val[M12] * val[M23] * val[M31] - val[M13] * val[M22] * val[M31] + val[M13] * val[M21] * val[M32] -\n\t\t\t\tval[M11] * val[M23... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Toggles the highlighting of a node. | function toggleNodeHighlight(node) {
if (node.css(node_highlight_property) === node_highlight_default) {
node.css(node_highlight_add);
} else {
node.css(node_highlight_remove);
}
} | [
"function toggleHighlight() {\n // console.log(\"clicked!\");\n}",
"toggleHighlight() {\n\t\tthis.setState({\n\t\t\tcheckHighlighted: !this.state.checkHighlighted\n\t\t});\n\t}",
"function toggleNodeSelected() {\n if (isSelectable(nodeModel) && [SelectionMode.Single, SelectionMode.Multiple].includes(selecti... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Evaluate the last column of a row in the truth table. That is, given a propositional formula and the truth values of the variables, evaluate the result of the formula. Takes in the formula in RPN. | function evaluate(formula, truthValues) {
const stack = [];
// Go along the formula, when an operator is found, pop the required number of
// operands off the stack, then push the result of the operation onto the stack.
for (const token of formula) {
if (isOperator(token)) {
getOperator(token).eval(st... | [
"function evalFormula(formula) {\n // Obviously in practice would need to choose the scratch cell more carefully than this.\n var scratchCell = SpreadsheetApp.getActiveSheet().getRange(20, 10);\n scratchCell.setFormula(formula);\n return scratchCell.getValue();\n}",
"function calculateFormula(row, columnName,... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Constructs a new V1IO. | constructor() {
V1IO.initialize(this);
} | [
"constructor() {\n\n V1Operation.initialize(this);\n }",
"constructor() {\n\n V1Component.initialize(this);\n }",
"constructor() {\n\n V1Build.initialize(this);\n }",
"constructor() {\n\n V1Status.initialize(this);\n }",
"constructor() {\n\n V1ConnectionType.in... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Updates existing session based on the provided event | _updateSessionFromEvent(session, event) {
let crashed = false;
let errored = false;
const exceptions = event.exception && event.exception.values;
if (exceptions) {
errored = true;
for (const ex of exceptions) {
const mechanism = ex.mechanism;
if (mechanism && mechan... | [
"_updateSessionFromEvent(session$1, event) {\n let crashed = false;\n let errored = false;\n const exceptions = event.exception && event.exception.values;\n\n if (exceptions) {\n errored = true;\n\n for (const ex of exceptions) {\n const mechanism = ex.mechanism;\n if (mechanism ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
function to get a pair at once from dirtyPile | function getTwoDirty() {
const arr = []
for (const key in dirtyPileObj) {
if(dirtyPileObj[key] % 2 === 0 && dirtyPileObj[key] > 0) {
arr.push(key)
} else if ( dirtyPileObj[key] > 2) {
cleanPileObj[key] ? cleanPileObj[key] += 2 : cleanPileObj[key] = 2
... | [
"function checkPair() {\n let pair = 0\n for (const key in cleanPileObj) {\n pair += pairs(cleanPileObj[key])\n }\n\n return pair\n }",
"function nakedPair() {\n return nakedCandidates(2);\n}",
"function hiddenPair() {\n return hiddenLockedCandidates(2);\n}",
"function cou... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Add an event listener for the "return to game" button, which resets board and group table to latest state, disables analysis mode, and refreshes view. | function returnToGameHandler() {
var btn = document.getElementById("return-to-game-btn");
btn.addEventListener("click", function() {
analysisMode.disable();
// reset board and group table to latest state
board.state = analysisMode.mainBoard.state;
groupTable.table = analysisMo... | [
"function _newGameButtonClickHandler() {\n _reset();\n }",
"function resetGameboardDOM(){\n $('.gameboard-grid-item').removeClass('disabled');\n $('#variable-value-overlay').text(\"\");\n $('#gameboard-active-question span').children().remove(); \... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Makes a new PI Controller | function makePIController(kp, ki, start, min, max) {
var pic = array(5)
pic[0] = kp
pic[1] = ki
pic[2] = start
pic[3] = min
pic[4] = max
return pic
} | [
"async function autoCreateController() {\n try {\n await poly.addNode(\n new ControllerNode(poly, 'controller', 'controller', 'ST-RadioRA2')\n );\n } catch (err) {\n logger.error('Error creating controller node');\n }\n\n // Add a notice in the UI for 5 seconds\n poly.addNoticeTemp('newController... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
attach event listener to each folder path | function bindCurrentFolderPath() {
const load = (event) => {
const folderPath = event.target.getAttribute('data-path');
loadDirectory(folderPath)();
};
// all folders and their paths
const paths = document.getElementsByClassName('path');
// attach click event to each folder
for(let i = 0; i < paths.length; i... | [
"function attachFolderListeners(folders) {\n for (let i = 0; i < folders.length; i++) {\n const folder = folders[i];\n folder.addEventListener(\"click\", () => {\n toggleBookmarks(folder, folder.id); \n });\n }\n}",
"onFolderAdded() {}",
"findEvents(dir) {\n fs_1.rea... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
returns a list of all deliveries placed in a Neighborhood Neighborhood has deliveries | deliveries() {
return store.deliveries.filter(
function(delivery) {
return delivery.neighborhoodId === this.id;
}.bind(this));
} | [
"deliveries(){\n const deliveriesInNeighborhood = [];\n for(const delivery of store.deliveries){\n if(delivery.neighborhoodId === this.id){\n deliveriesInNeighborhood.push(delivery)\n }\n }\n return deliveriesInNeighborhood;\n }",
"deliveries() {\n r... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
A helper function that creates a dropdown component for the plugin containing all the transform options defined in the editor configuration. | _registerImageTransformDropdown(transforms) {
const editor = this.editor;
const t = editor.t;
const originalSizeOption = {
name: 'transformImage:original',
value: null,
};
const options = [
originalSizeOption,
...transforms.map((transform) => ({
label: transform.name,... | [
"generateOptions() {\n let options = this.props.options;\n let optionsComponent = [];\n Object.keys(options).forEach((key,index) => optionsComponent.push(<option key={index} value={key}>{options[key]}</option>))\n return optionsComponent;\n }",
"makeOptions() {\n // If the dropdo... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
================================================== Folding Multi Wiki Tabs (experimental) ================================================== | function foldingTabsMulti() {
var len=0;
ftsets = getElementsByClassName(document, 'div', 'foldtabSet'); //global object array thingy
if(ftsets.length==0) return
for(var i=0;i<ftsets.length;i++) {
ftsets[i].head = getElementsByClassName(ftsets[i], 'div', 'foldtabHead')[0];
ftsets[i].links = ftsets[i... | [
"function foldingTabsMulti() {\n var len=0;\n ftsets = getElementsByClassName(document, 'div', 'foldtabSet'); //global object array thingy\n if(ftsets.length==0) return\n \n for(var i=0;i<ftsets.length;i++) { \n ftsets[i].head = getElementsByClassName(ftsets[i], 'div', 'foldtabHead')[0];\n ftsets[i].lin... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Displays the category name or an alias if it's "All". | getAllDisplayName(category) {
return category === 'All' ? 'Todos los lugares' : category;
} | [
"getAllDisplayName(category) {\n return category === 'All' ? 'Todas las actividades' : category;\n }",
"displayCategory(categoryName) {\n this.getCategory(categoryName).display();\n }",
"function getCategoryToDisplay(itemCategory){\n return currentLanguage === 'en' ? (\n itemCategory\n... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Sets the number of squares on the board based on predetermined dimensions | function setNumSquaresFromDimensions() {
while (numSquaresX * xIncrement + xIncrement < boardWidth) {
numSquaresX++;
}
while (numSquaresY * yIncrement + yIncrement < boardHeight) {
numSquaresY++;
}
} | [
"function setDimensionsFromNumSquares() {\n boardWidth = numSquaresX * xIncrement;\n headerWidth = boardWidth;\n boardHeight = numSquaresY * yIncrement;\n}",
"function setSizes(){\n var boardWidth = magicWidth;\n var gridWidth = boardWidth / PUZZLE.numRows;\n boardWidth += (PUZZLE.numRows * 2);\n\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
This function calculates the spots that Population 2 takes up | function calculatePop2(){
let area = (dims.value)*(dims.value);
let pop2 = area-(calculateV()+calculatePop1());
return Math.floor(pop2);
} | [
"function markOccupiedSpots() {\n \n\t\tif(!spotsInitialized || playersInitialized < 2) {\n \n\t\t\treturn null;\n \n } // end if statement\n\t\n\t\tfor(var i = 0; i<10; i++) {\n \n\t\t\tfindClosestSpot(myMarbles[i].x, myMarbles[i].y).isEmpty = false;\n\t\t\tfindClosestSpo... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Determine whether this is a HTML or SVG component based on if the provided Component is a string and a recognised SVG tag. A potentially better way to do this would be to offer a `motion.customSVG` function and determine this when we generate the `motion.circle` etc components. | function isSVGComponent(Component) {
return typeof Component === "string" && svgTagNames.has(Component);
} | [
"function isSVGElement(tagName) {\n const isIt = (tagName.toUpperCase() == 'SVG' || (me instanceof SVGElement));\n return isIt;\n }",
"function isComponentNode(node) {\n return isElementNode(node) && node.tagType === 1;\n}",
"function isValidReactComponent(Component) {\n return ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Sync children of one element to another | static syncChildrenElement(sourceElement, targetElement) {
const me = this,
sourceNodes = arraySlice.call(sourceElement.childNodes),
targetNodes = arraySlice.call(targetElement.childNodes);
while (sourceNodes.length) {
const sourceNode = sourceNodes.shift(),
targetNode = targetNodes.s... | [
"function moveChildren(fromEl, toEl) {\n\t\t\t\t\tvar curChild = fromEl.firstChild;\n\t\t\t\t\twhile (curChild) {\n\t\t\t\t\t\tvar nextChild = curChild.nextSibling;\n\t\t\t\t\t\ttoEl.appendChild(curChild);\n\t\t\t\t\t\tcurChild = nextChild;\n\t\t\t\t\t}\n\t\t\t\t\treturn toEl;\n\t\t\t\t}",
"function moveChildren(... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Changes audio source if zone number changes. Interval is currently set to 10000ms (10s), but can be adjusted if a more frequent update rate is preferred. Refresh will not do anything if the updated zone has not changed. Since nonlocalization zone definitions are static, this means that refresh() is functionally inactiv... | function refresh() {
if(localDebug){
console.log("refresh?");
}
setInterval(function() {
// zone_no = get_zone_no(tag_no); // used for HAIP localization zone definitions
var old_zone_no = zone_no; // used for non-localization zone definitions
if (old_zone_no != zone_no) {
audio.pause();
pick_stream(zon... | [
"function changeSource()\n{\n\tif (!alarmRinging)\n\t{\n\n\t\taudio.src = 'audio/alarm.mp3'\n\n\t\talarmRinging = true;\n\t}\n}",
"function updateAudioSource(){\n quality = $(\"#cmbQualities\").val();\n var source = \"/website/listenTo?id=\" + $(\"#txtChannelId\").val() + \"&quality=\" + quality;\n \n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Process data , emit event | processData(socket, data) {
rideProcess.listen(socket, data);
} | [
"function onData(data) {\n emitter.emit('data', data);\n }",
"emit(event, data) {\n const { allListeners , listeners } = this;\n // Only do something if there are event handlers with this name existing\n if (listeners.has(event)) {\n listeners.get(event).forEach((listene... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
add Playlist modal controller | function CreatePlaylistController($scope, $log, YouTubeUtils) {
var $ctrl = this;
$ctrl.reset = reset;
$ctrl.update = update;
$ctrl.changeStatus = changeStatus;
$ctrl.status = YouTubeUtils.getInitialStatus();
$ctrl.master = {title:'', description:''};
function reset(){
... | [
"function addPlaylistToViewclientButtonClicked(viewclientid)\n{\n $(\"#addPlaylistModal\").modal(\"show\");\n}",
"function createPlaylistModal(){\n // Show modal\n $('#createPlaylist').show();\n\n // Create button onclick listener\n $('#createPlaylist button').unbind('click').click(function(){\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Receive a payment ack from the server. Waitin until here to increment time_purchased lets us keep a little closer to the server's timer | function receive_payment_ack() {
var purchase_amount = last_increment / price_per_second;
console.log("Increasing time purchased by " + last_increment + " / " + price_per_second + " = " + purchase_amount);
time_purchased += purchase_amount;
total_time_purchased += purchase_amount;
total_paid += last_incr... | [
"function update_payment() {\n var date = new Date();\n var now = date.getTime()/1000.0;\n var delta = now - last_payment_update_time;\n last_payment_update_time = now;\n time_spent += delta;\n total_time_spent += delta;\n console.log('Time spent:' + time_spent);\n //console.log('Total time spent:' ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Workaround to prevent pressing SPACE on busy state. Preventing click event still makes the toggle flip and revert back. So on CSS side, the input has "pointerevents: none" on busy state. | function bindEventsToInput(element) {
element._input.addEventListener('keydown', function (e) {
if (element.busy && e.keyCode === _keyCode2.default.SPACE) {
e.preventDefault();
}
});
// prevent toggle can be trigger through SPACE key on Firefox
if (navigator.userAgent.toLower... | [
"function bindEventsToInput(element) {\n element._input.addEventListener('keydown', function (e) {\n if (element.busy && e.keyCode === AJS.keyCode.SPACE) {\n e.preventDefault();\n }\n });\n // prevent toggle can be trigger through SPACE key on Firefox\n if (navigat... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
======================================================= parameters: num the number to get bounds d the sigificant digit where the slop will be applied to get the boundary numbers. The current rules in the homework system for the "slop" value are: 0 is exact 1 is +/ 1 on the 1st sig digit 2 is +/ 1 on the 2nd sig digit ... | function getBounds(num, d)
{
var slop = d > 1 ? d - 1 : d; // slop factor is d-1 for 2 or greater
var exponent = d - 1;
num = Number(num);
strExp = num.toExponential();
if (strExp != "")
{
var matches = ePattern.exec(strExp);
if (matches)
{
var pow10 = Math.pow(10, parseInt(matches[1], 10));
nu... | [
"function getBounds(num, digit)\n{\n var d = Math.min(digit, 3); // capped at 3\n\n var slop = d > 1 ? 2 : d; // sig digit is 2 or greater: slop factor = 2\n // sig digit is 0: slop factor = 0\n // sig digit is 1: slop factor = 1\... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
if handle is present define the dragHandle and reapply style for cursor | setDragHandle(elem) {
if (this._dragHandle) {
return;
}
this._dragHandle = elem;
this._element.style.cursor = "auto";
this._dragHandle.style.cursor = "move";
} | [
"_applyDragCursor() {\n\n // Attempt to set the cursor to 'grab'\n this._targetNode.style.cursor = 'grab';\n\n // Provide multiple fall-backs for if the target Node's cursor isn't set in its style Object, meaning the cursor\n // isn't supported.\n if ( !this._targetNode.style.cursor ) this.... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Update the list of scout items. | function refreshScouts() {
scoutDB.fetchScouts(function(scouts) {
var scoutList = document.getElementById('scout-items');
scoutList.innerHTML = '';
for(var i = 0; i < scouts.length; i++) {
// Read the scout items backwards (most recent first).
var scout = scouts[(scouts.length - 1 - i)];
... | [
"function update()\r\n\t{\r\n\t\tfor(var id in items)\r\n\t\t\tupdateItem(id);\r\n\t\tupdateConfirm();\r\n\t}",
"function updateItems(newList) {\n setItems(newList);\n calcTotal();\n }",
"function updateListOfItems(items){\n\t$('#listOfItems').val(JSON.stringify(items));\n\t\n\tvar html = '<ul ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Add an existing relationship to the form. | function addExistingRelationshipToForm(relationship) {
var renderControlAlias;
var json;
if (relationship) {
renderControlAlias = spFormBuilderService.getRelationshipRenderControlAlias(relationship);
if (renderControlAlias) {
... | [
"function addRelationship(){\n\n if(vm.relationshipFrom ==undefined || vm.relationshipTo == undefined || vm.relation == undefined){\n logError('All fields should be selected to create a relationship'); \n return; \n }\n datacontext.createRelationshi... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Is Old Enough to Drink | function isOldEnoughToDrink(age) {
if (age >= 21) {
return true;
} else {
return false;
}
} | [
"function isOldEnoughToDrive(age) {\n return (age >= 16);\n}",
"function isOldEnoughToDrink(age) {\n return (age >= 21);\n}",
"function isOldEnoughToDrink(age) {\n if (age >= 21) {\n return true;\n } else {\n return false;\n }\n}",
"function isOldEnoughToDrink(age) {\n if(age >= 21){\n return... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Get the priority of a media type. | function $LYXh$var$getMediaTypePriority(type, accepted, index) {
var priority = {
o: -1,
q: 0,
s: 0
};
for (var i = 0; i < accepted.length; i++) {
var spec = $LYXh$var$specify(type, accepted[i], index);
if (spec && (priority.s - spec.s || priority.q - spec.q || priority.o - spec.o) < 0) {
... | [
"function getMediaTypePriority(type,accepted,index){var priority={o:-1,q:0,s:0};for(var i=0;i<accepted.length;i++){var spec=specify(type,accepted[i],index);if(spec&&(priority.s-spec.s||priority.q-spec.q||priority.o-spec.o)<0){priority=spec;}}return priority;}",
"function getMediaTypePriority(type, accepted, index... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
adds another input field to poll creation called from 'addOptionButton' event listener | function addInput() {
var div = document.createElement('div');
div.innerHTML = '<label>Option </label><input type="text" name="option">';
optionsField.insertAdjacentElement('beforeend', div);
} | [
"function addOptionField() {\n let options = document.getElementsByClassName('option');\n const optionsAmount = options.length + 1;\n\n var textInput = document.createElement(\"input\");\n textInput.setAttribute('type', 'text');\n textInput.setAttribute('class', 'option');\n textInput.setAttribute... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Gets recent transactions based on user id | getRecentTransactions() {
const userId = this._userService.loggedInUserId;
this.subscription.add(this._transactionService.getRecentTransactions(userId).subscribe((recentTransactions) => {
this.recentTransactions = [];
recentTransactions.sort((a, b) => {
return b -... | [
"getRecentTransactions(userId) {\n const transactionIndex = this.transactions.findIndex((transaction) => {\n return transaction.userId === userId;\n });\n if (transactionIndex !== -1) {\n return Object(rxjs__WEBPACK_IMPORTED_MODULE_2__[\"of\"])(this.transactions[transactio... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
changes the ivs of the first array to match the second. | function changeIVs(iv, newIV) {
for (var i = 0; i < iv.length; i++) {
iv[i] = newIV[i];
};
return iv;
} | [
"function computeArrayinversion(source, target) {\n inversion = [];\n for (var i = 0; i < source.length; i++) {\n var tagname = source[i];\n var j = 0;\n while (target[j] != tagname) j++;\n inversion.push(j);\n }\n return inversion;\n}",
"_swapIndices(i1: number, i2: number): void {\n const tem... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
replaces the body in the expected manner which means the entire body content is refreshed however also the body attributes must be transferred keeping event handlers etc... in place | replaceBody(shadowDocument) {
const shadowBody = shadowDocument.querySelectorAll(Const_1.HTML_TAG_BODY);
if (!shadowBody.isPresent()) {
return;
}
const shadowInnerHTML = shadowBody.innerHTML;
const resultingBody = ExtDomQuery_1.ExtDomQuery.querySelectorAll(Const_1.HTM... | [
"function updateBody(strHtml) {\n jQuery.get( strHtml, \"\" ,( function( data ) {\n $( \".body\" ).html( data );\n }), \"html\");\n}",
"function do_full_update() {\n const rendered_dom = exports.render_tag(new_dom);\n replace_content(rendered_dom);\n }",
"flushBody() {\n while... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
createHashPwd create a password salt and hash it. args: pass > password string, callback>callback with password and salt argument | function createHashPwd(pass,callback)
{
var salt=crypto.randomBytes(128).toString('base64');
crypto.pbkdf2(pass, salt , 100, 512, function(err,hashPass){
if (err) console.log("create hash error ",err);
callback(hashPass.toString('base64'),salt.toString('base64'));
});
} | [
"function hashPwd(password, salt, callback) {\n\tvar iterations = 1500;\n\tvar keylen = 256;\n\tcrypto.pbkdf2(password, salt, iterations, keylen, function(err, derivedKey) {\n\t\tvar key = derivedKey.toString('base64');\n\t\tif (typeof(callback) === 'function') {\n\t\t\tcallback(key);\n\t\t}\n\t});\n}",
"function... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Log an error if the modal is rejected | function rejectModal(err) {
console.error('Modal reject: ', err);
} | [
"handleNoErrorEncountered() {\n this.removeModalState();\n }",
"function errorModal(err) {\n modal.style.display = \"block\";\n errorContent.innerHTML = JSON.stringify(err.status) + \" error occured. Please re-enter your city name or choose a different city.\";\n }",
"function showErr... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Enable svgpanzoom on the graph | function enablePanZoom() {
var graph = svgPanZoom('#graph svg', {
zoomEnabled: true,
dblClickZoomEnabled: false,
controlIconsEnabled: true,
customEventsHandler: eventHandler
});
// Add deselect to reset control
... | [
"function initializeZoom() {\n if (!hasZoom || !window.svgPanZoom || !$svg.length) {\n return;\n }\n var options = $.extend({\n }, Drupal.webform.webformOptionsCustomPanAndZoom.options);\n var panZoom = window.svgPanZoom($svg[0], options);\n $(window)... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
2. Menyusun Barisan Bintang Dengan Nested Looping | function barisanBintangNested(rows2){
for(i = 0; i < rows2; i++){
var tampung = '';
for(j = 0; j < rows2; j++){
tampung += "*";
}
console.log(tampung)
}
} | [
"function nested_barisan_bintang(){\n var rows2 = 5;\n var result = \"\";\n for(let i = 1; i <= rows2; i++)\n {\n for(let j = 1; j <= rows2; j++)\n {\n result += \"*\"\n }\n result += \"\\n\"\n }\n console.log(result)\n}",
"function loop(restaurants) {\n\n for (let i = 0; i < restaurants... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Show a list of all transactions. GET transactions | async index () {
const transactions = await Transaction.all();
return transactions;
} | [
"async function getAllTransactions() {\n try {\n const res = await fetch('/api/v1/transactions');\n const response = await res.json();\n\n dispatch({\n type: 'GET_ALL_TRANSACTIONS',\n payload: response.data,\n });\n } catch (err) {}\n }",
"function getAllTransactions(req, ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
get all the blocked sites from the local storage | function loadBlockedSites() {
return browser.storage.local.get();
} | [
"function loadBlockedSites() {\n chrome.cookies.getAll({ url: \"http://example.com/\" }, function(cookies) {\n // if (cookies.length == 0) {\n blockedSites = [];\n // } \n for (var i = 0; i < cookies.length; i++) {\n var cookieStr = JSON.stringify(cookies[i]);\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
drawGhosts : [Listof Ghost] > void draws the ghosts | function drawGhosts(listOfGhosts) {
for (var i = 0; i < listOfGhosts.length; i++) {
listOfGhosts[i].draw();
}
} | [
"function drawGhosts() {\n ALL_GHOSTS.forEach(function (element){\n if (element !== undefined)\n drawGhost(element);\n });\n}",
"function drawGhosts() {\n\n\t// draw ghosts\n\tvar length = ghost.length;\n\tfor (var i = 0; i < length; i++) {\n\t\tctx.save();\t// this lets just affect the tr... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Adds an entity instance in the system. Extracts the name and objectId | addEntityInstance(entityName, instanceObj) {
this.entityManager.addEntityInstance(entityName, instanceObj);
} | [
"addEntity(entity) {\n this.entities.set(entity.entityID, entity);\n }",
"addEntity (entity) {\n console.log('added entity');\n this.entities.push(entity);\n }",
"addEntity (entity) {\n this.entities.push(entity);\n }",
"addEntity(entity) {\n this.entities.p... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
If global variable seconds hits zero, showNextSlide Check the time every 50 miliseconds If a dot is clicked, timer is reset and slideIndex is set Will showNextSlide after maximum 50 miliseconds | function startSlideShow(n){
seconds = slideTimer;
setInterval(function(){
seconds--;
if ( seconds <= 0 ) {
showNextSlide();
seconds = slideTimer;
}
}, 10)
} | [
"function setTimer(){\n\t\t\t\t\n\t\t\t\t\tstartProgress();\n\t\t\t\t\n\t\t\t\t\ttimer = setInterval(function(){ \n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\tstartProgress();\n\t\t\t\t\t\t\tslide('next');\n\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t}, es_options.slideShowInterval);\n\n\t\t\t\t}",
"function showNextItem() \n{\n $nextIt... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Function to Fix Pages Height | function fixPagesHeight() {
$('.swiper-pages').css({
height: $(window).height()
})
} | [
"function setSlideHeight() {\n var tallestSlideHeight = 0;\n\n $pages.each(function() {\n tallestSlideHeight = Math.max($(this).height(), tallestSlideHeight);\n });\n\n if (opts.viz === true) {\n //This fixes the bad padding given to lazyload... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Watch active peer chat room | function watchActivePeerChatRoom(action) {
var receiverId, authedUser, uid;
return _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_1___default.a.wrap(function watchActivePeerChatRoom$(_context9) {
while (1) {
switch (_context9.prev = _context9.next) {
case 0:
receiverId = action.payl... | [
"function liveChat() {\r\n console.log('Popping up the live chat window'); // Popup the live chat window code here.\r\n}",
"function refreshChatuserActive(){\n\tFormaT.app(\"POST\", \"messenger\", {\"update_connection\":\"true\"}, function(r){ if(r.error === false){ console.log(\"Session Actualizada.\");... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
people.js | Copyright (c) 2019 IGN Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sub... | function parsePeopleCSVfile() {
// Open a new connection, using the GET request on the URL endpoint
var url = "/lastig_data/people.csv";
// var url = "http://localhost/lastig/lastig_data/people.csv";
var myInit = { method: 'GET'};
fetch(url,myInit)
.then(function(response) {
return response.ok ? respons... | [
"function csvHandler(){\n fs.readFile('115th-Congress-House-seeds.csv', function (err,data) {\n if (err) {\n return console.log(err);\n }\n //Convert and store csv information into a buffer.\n bufferString = data.toString();\n //Store information for each individual person in an array index. Split it by ev... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Sort and list teams for a selection | function listTeams() {
teamList.sort(function(obj1, obj2) {
if(obj1.teamName > obj2.teamName) {
return 1;
}
if(obj1.teamName < obj2.teamName) {
return -1;
}
return 0;
});
teamList.forEach(function(team) {
$("#team-list1").append('<option value=' + team.logo + '>' + ... | [
"function sortTeams() {\n \tvar sortedTeams = $('.team').sort(function (a, b) {\n \t\tvar $teamA = $(a);\n \t\tvar $teamB = $(b);\n\n \t\tvar favoriteOrder = $teamB.data('is-favorite') - $teamA.data('is-favorite');\n \t\tvar nameOrder = $teamA.data('team-name') > $teamB.data('team-name') ? 1 : -1;\n\n \t\tif ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
`joy serve` serve function will run a very small, pure node http server on the local machine | function serve() {
var http = require('http');
http.createServer(function(req, res){
fs.readFile(html_source, 'utf8', function(err, data) {
if (err) {
res.send(err);
console.log(err);
}
res.end(data.toString());
});
}).listen(port);
console.log("\nRunning ".yellow + "jo... | [
"function serve() {\n const server = fractal.web.server({\n sync: true\n })\n\n server.on('error', err => logger.error(err.message));\n\n return server.start().then(() => {\n logger.success(`Fractal server is now running at ${server.url}`);\n });\n}",
"function serve() {\n connect().use(serveStatic(... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Generates and writes report and report data to disk. Notifies all connected websockets. Continues doing so periodically. | async writeFull() {
const MAX_BRANCHES_PER_TYPE = 500;
const MAX_BRANCHES_PER_FAILED = 1000;
this.reportTime = new Date();
// Generate report data file
let reportData = 'onReportData(String.raw`' + utils.escapeBackticks(JSON.stringify({
tree: this.tree.serialize(MAX... | [
"report() {\n // Get all the metrics\n let allMetrics = this.getMetrics();\n for (let metrics of [\n allMetrics.counters,\n allMetrics.gauges,\n allMetrics.meters,\n allMetrics.timers,\n allMetrics.histograms\n ]) {\n if (metrics.length > 0) {\n for (let m of metrics... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Clears all the routes and clear the history of intercepted API calls. | reset() {
this.router.clear();
this.calls.clear();
} | [
"function purgeRoutes() {\n delegate.unbind();\n routes = {};\n trackedRoutes = [];\n notifyRoutes = [];\n }",
"deleteRoutes() {\n const {\n app,\n api: {\n utils: { debug },\n },\n } = this;\n let startIndex = null;\n let endIndex = null;\n app.... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
save an object to S3 | function saveObjToS3(data, fileName, bucket, callback){
console.log("saveObjToS3", data);
//save data to s3
var params = {Bucket: bucket, Key: fileName, Body: data, ContentType: 'text/plain'};
s3.putObject(params, function(err, data) {
if (err) {
console.log("saveObjToS3 err", err);
} else {
... | [
"saveObject(inputData,targetBucket,targetKey){\n console.log(\"Saving data\");\n\n let uploadParams = {\n Bucket: targetBucket,\n Key: \".metadata/objects.json\",\n Body: JSON.stringify(inputData)\n //ContentType: 'application/json; charset=utf-8'\n }... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
save messages to state | async saveMessages() {
try {
await AsyncStorage.setItem(
'messages',
JSON.stringify(this.state.messages)
);
} catch (error) {
console.log(error.message);
}
} | [
"async saveMessages() {\n\t\ttry {\n\t\t\tawait AsynStorage.setItem('messages', JSON.stringify(this.state.messages));\n\t\t} catch (error) {\n\t\t\tconsole.log(error.message);\n\t\t}\n\t}",
"async saveMessages() {\n try {\n await AsyncStorage.setItem('messages', JSON.stringify(this.state.message... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Creates band type data for bounce chart from aggregates | function getBandTypes({ countInbandBounce, countOutofbandBounce }) {
return [
{ name: 'In-Band', count: countInbandBounce },
{ name: 'Out-of-Band', count: countOutofbandBounce }
];
} | [
"function buildDatasetB() {\nvar d = [0,0,0];\n\nreturn [\n {value: d[0], init:0, index: .712, text: pText(d[0]), type:\"b\", count: 1},\n {value: d[1], init:0, index: .512, text: pText(d[1]), type:\"b\", count: 3},\n {value: d[2], init:0, index: .312, text: pText(d[2]), type:\"b\", count: 5},\n];\n}",
... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Step 3: button (income text field) | function setIncome()
{
//When the Step3 button is pushed we know the user had finished setting the Income Threshold text box
//Initialize next step
outputDivString += "  Income Set!<br />";
$('#outputDiv').html(outputDivString);
$('#step3').hide();
$('#step4').show();
} | [
"function addBudget(event) {\n event.preventDefault();\n\n const value = budgetEnter.val();\n let budget = budgetAmount.html();\n let balance = balanceAmount.html();\n\n if (value > 0) {\n //Enter\n //Entering budget amount\n budget += `+ ${value}`;\n budgetAmount.html(eval(budget));\n\n //Enter... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Pega Valor Rage e imprime no campo vrange | function valueRange(){
try {
//Pega valor de segurança do input range
vrange = document.getElementById('iRange').value;//pega valor do input range
//Se valor igual "0" range fica off
if(vrange == 0){var segrang = 'Off';}else{var segrang = vrange+' mt';}
document.getElementById('vrang... | [
"function valueRange(){\r\n try {\r\n//Pega valor de segurança do input range \r\n \tvRange = document.getElementById('iRange').value;//pega valor do input range\r\n//Se valor igual \"0\" range fica off\r\n if(vRange == 0){var segrang = 'Off';}else{var segrang = vRange+' mt';}\r\n documen... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
findMaxNode() find the node in the linked list with the highest value and return that node the node itself, not its value if you find two or more nodes tied for that value, return the first one you find. do not modify the linked list/contents in any way this is nondestructive. (again, we want to reuse this code later m... | findMaxNode() {
if (this.head == null && this.tail == null) {
return undefined;
}
var runner = this.head
var temp = runner
while (runner != null) {
if ( temp.value < runner.value ){
temp = runner
}
runner = runner.n... | [
"findMaxNode() {\n if (this.head == null) {\n return null;\n }\n\n var runner = this.head;\n var currentMax = runner;\n while (runner != null) {\n\n if (runner.value > currentMax.value) {\n currentMax = runner;\n }\n\n run... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Stop listening to new message events | stopListening() {
// If this object doesn't have a uid it could potentially create problematic queries, so return.
if (this.uid === undefined) return;
// Remove all handlers for this messenger
Fetch.getMessagesReference(this.uid).off();
} | [
"stop() {\n\t\tthis.bot.removeListener('messageCreate', this.messageHandler);\n\t}",
"stop () {\n this.recipients = [];\n window.removeEventListener('message', this.receive, false);\n }",
"function stopEventListen() { \n //Stop listening for events \n stopEventListen(); \n}",
"stop() {\n this.... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
============================================= Crear tabla consecutivo_ascensores ============================================== | function crearTablaConsecutivoAscensores(){
db.transaction(function (tx) {
tx.executeSql('CREATE TABLE consecutivo_ascensores (k_codusuario, k_consecutivo unique, n_inspeccion)');
}, function (error) {
console.log('transaction error: ' + error.message);
}, function () {
console.log('transaction creada... | [
"function crearTablaAuditoriaInspeccionesAscensores(){\n db.transaction(function (tx) {\n tx.executeSql('CREATE TABLE auditoria_inspecciones_ascensores (k_codusuario,k_codinspeccion,o_consecutivoinsp,o_estado_envio,o_revision,v_item_nocumple,k_codcliente,k_codinforme,k_codusuario_modifica,o_actualizar_inspeccio... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Write a function called hasCertainKey which accepts an array of objects and a key, and returns true if every single object in the array contains that key. Otherwise it should return false. | function hasCertainKey(arr, key) {
return arr.every(function(obj) {
return obj[key];
})
} | [
"function hasCertainKey(arr, key, ) {\n return arr.every(function(val) {\n return key in val;\n });\n }",
"function hasCertainKey(arr, key){\n return arr.every(function(val){\n return key in val\n })\n }",
"function hasCertainKey(arr, key){\n return arr.e... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
User Input for Max number of Results returned for hiking trails | function getMaxTrailResults() {
var userIn = formMaxTrailResults.val();
if (userIn === "" || userIn === undefined) {
sessionStorage.setItem("maxTrailResults", defaultMaxTrailResults);
} else {
userIn = parseInt(userIn);
if (userIn < 0) {
invalidInput(
formMaxTrailResults,
"Invali... | [
"function handleResults(response) {\n hikesReturned = response.trails; // store for use when user clicks selection\n resultsEl.empty(); // clear results section\n\n let numResults = response.trails.length; // if there are results, there will always be at least one\n let numPages = Math.ceil(numResults/5); // 5 ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Create guards for the typed arguments of the function. | function createArgumentGuards(node) {
var genericTypes = arguments.length <= 1 || arguments[1] === undefined ? [] : arguments[1];
return node.params.reduce(function (guards, param) {
if (param.type === "AssignmentPattern" && param.left.typeAnnotation) {
guards.push(createDefaultArgumentGuard(para... | [
"function createArgumentGuard (param: Object, types: Array<Object|string>, genericTypes: Array = []): ?Object {\n if (types.indexOf('any') > -1 || types.indexOf('mixed') > -1) {\n return null;\n }\n if (param.optional) {\n types = types.concat(\"undefined\");\n }\n const test = createIfTest... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Returns import path for given package. Since there can be multiple matches, this returns an array of matches | getPackageImportPath(input) {
const matchingPackages = [];
this.pkgsList.forEach((info, pkgPath) => {
if (input === info.name) {
matchingPackages.push(pkgPath);
}
});
return matchingPackages;
} | [
"getPackagePathFromLine(line) {\n const pattern = /(\\w+)\\.$/g;\n const wordmatches = pattern.exec(line);\n if (!wordmatches) {\n return [];\n }\n const [_, pkgNameFromWord] = wordmatches;\n // Word is isolated. Now check pkgsList for a match\n return thi... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
beginAttrName() must have been called before this point There is an active attribute in attrnamebuf (but not attrvaluebuf) | function attribute_name_state(c) {
switch(c) {
case 0x0009: // CHARACTER TABULATION (tab)
case 0x000A: // LINE FEED (LF)
case 0x000C: // FORM FEED (FF)
case 0x0020: // SPACE
case 0x002F: // SOLIDUS
case 0x003E: // GREATER-THAN SIGN
case -1: // EOF
reconsume(c, after_attribute_name_... | [
"function attribute_name_state(c) {\n switch (c) {\n case 9: // CHARACTER TABULATION (tab)\n\n case 10: // LINE FEED (LF)\n\n case 12: // FORM FEED (FF)\n\n case 32: // SPACE\n\n case 47: // SOLIDUS\n\n case 62: // ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Get previous text inline | getPreviousTextInline(inline) {
if (inline.previousNode instanceof TextElementBox) {
return inline.previousNode;
}
if (inline.previousNode instanceof FieldElementBox && HelperMethods.isLinkedFieldCharacter(inline.previousNode)) {
if (inline.previousNode.fieldType === 0 ||... | [
"function textPrevButton (str, el) {\n el.closest('li').find('li.back').text(str).prepend(self.options.prev);\n return el.closest('li').find('li.back').find('> *').addClass('js-prev ' + prevButtonClass);\n }",
"function getPreviousContent () {\n const myParagraphs = document.quer... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Stream loading f2d data and prepare parseable data frames. | function doStreamF2D(loadContext) {
var _this = loadContext.worker;
_this.postMessage({progress:0.01}); //Tell the main thread we are alive
//Get the metadata and manifest first.
var metadata;
var manifest;
var doneFiles = 0;
var accumulatedStream = new Uint8Array(65536);
var accumul... | [
"async _streamData() {\n this.currentChart = \"DISCO WORM\";\n let xVals = [];\n let yVals = [];\n\n let self = this;\n dataService.startStreaming(5, function(x, y) {\n xVals.push(x);\n yVals.push(y);\n self.graphPoints = self._convertGraphPoints(xVals, yVals);\n self._generateTab... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
/ Recreates the QuadTree spacial partiion used internally by this system. This should be done after / adding or removing any static colliders used by the system and before updating it for the next simulation. | RebuildSpacialTree()
{
console.log("Starting Collision Tree Rebuild...");
let start = performance.now();
//create the tree with max world AABB needed
let bounds = new Rect(0, 0, 1, 1);
for(let col of this.#StaticColliders)
{
let trans = col.Entity.GetComponent(WorldPos);
bounds.Encapsulate(col.Wor... | [
"_rebuildQuadtree() {\n\t\t\t\tthis.p.quadTree.clear();\n\t\t\t\tfor (let s of this) {\n\t\t\t\t\tif (!s.removed && s.collider) {\n\t\t\t\t\t\tthis.p.quadTree.insert(s);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}",
"split()\n {\n if(this.depth >= this.maxDepth)\n {\n return;\n }\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Conf: an Object to describe a configuration file; | function Conf(filePath) {
this.filePath = filePath;
this.document = new Document();
} | [
"constructor ({\n conf,\n confFilePath = path.resolve(osenv.home(), \".temail.json\"),\n log\n }) {\n if(log && log.streams) {\n this.log.streams = log.streams;\n this.log.level(log.level());\n }\n\n if(conf === undefined || conf === null || conf === {}) {\n this.conf = this.readCo... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Load and regsiter middleware files from a specified path | loadMiddlewareFiles(mwPath) {
let files = Util.glob.sync(path.join(mwPath, '*.js'), {nodir: true});
files.forEach(file => this.registerMiddleware(path.basename(file, '.js'), require(file)));
} | [
"loadMiddlewaresFrom(dir) {\n let files = glob.sync(path.join(dir, \"*.js\"), { nodir: true });\n files.forEach((file) => this.registerMiddlewareFactory(path.basename(file, \".js\"), require(file)));\n }",
"loadMiddlewaresFrom(dir) {\n let files = glob.sync(path.join(dir, '*.js... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Decrements the pairing total and turns the names back to green. Called from the green "UNPAIR" button. | function unpair() {
pairOrUnpair(false, false);
} | [
"function onUnpairBtnClick() {\n var classList = pageElement.classList;\n\n if (classList.contains('state-unpairing')) {\n return;\n }\n\n classList.add('state-unpairing');\n app.model.destroyBonding(currentDeviceAddress, onUnpairSuccess,\n onUnpairError);\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
This method loads the global footer by always making a service call. | function loadFooterService(options, callback) {
services.loadFooter(options, function (err, footerResponse) {
if (err || !footerResponse) {
return callback(err);
}
// Wrap the footer response with an object that we can add
// new methods to
callback(null, new Foo... | [
"function loadFooter() {\n\t$(\"#footer\").load(\"footer.html\");\n}",
"initiateExtoleOnFooter() {\n // Zone creation for follwoing tag\n // <span id='extole_zone_global_footer'></span>\n const extoleData = {\n name: 'global_footer',\n element_id: 'extole_zone_global_footer',\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Creates a [[HighPrecisionLine]] or [[HighPrecisionWireFrameLine]] object. | function createLine(linePositions, params) {
const lineWidth = params.lineWidth !== undefined ? params.lineWidth : 5;
const addCircles = params.addCircles !== undefined ? params.addCircles : false;
const wireFrame = params.wireFrame !== undefined ? params.wireFrame : false;
const positio... | [
"function createLine() {\n const lineElem = document.createElement('div');\n lineElem.classList.add('osd-guide-line');\n return lineElem;\n}",
"function Line() {}",
"function line() {\n this.stObjParentGuid = '';\n this.stObjGuid = '';\n this.endObjGuid = '';\n this.endObjParentGuid = '';\n th... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
returns TRUE if the FormControl is valid | isValid(name) {
var e = this.getFormControl(name);
return e && e.valid;
} | [
"function getFormIsValid() {\n return interactedWith && !getFieldErrorsString()\n }",
"isValid() {\n return this._form.valid;\n }",
"isFormValidated() {\n\t\tvar treatmentName = this.state.formTreatmentData.treatmentName;\n\t\tif( treatmentName && this.state.treatmentComponents.length > 0 ) {\n\t\... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Test address for copper eligibility | testAddress() {
if (this.isReseller) {
// If current offer is a reseller offer,
// launch eligibility test address for partners (reseller)
return this.OvhApiConnectivityEligibility.v6().testAddressPartners(
this.$scope,
{
streetCode: this.address.street.streetCode,
... | [
"copperEligibilityByAddress() {\n return this.testAddress()\n .then(({ result }) => ({ result }))\n .catch((error) => {\n this.loading = false;\n this.TucToast.error(error);\n });\n }",
"function checkAddress(address) {\n if (address.oracle==oracle.name) {\n return true;... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Method to get current endOf day timestamp | function getCurrentEndOfDayTimeStamp() {
var endOfDayTimeStamp = moment().utc().endOf('day');
return Number(endOfDayTimeStamp);
} | [
"getEndOfDay() {\n const endOfDay = new UniversalDate(this.date);\n endOfDay.date.setUTCHours(23);\n endOfDay.date.setUTCMinutes(59);\n endOfDay.date.setUTCSeconds(59);\n endOfDay.date.setUTCMilliseconds(999);\n\n return endOfDay;\n }",
"function weekEnd() {\r\n var today = new Date().getDat... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Initialize App ====================================================================================== Description: Establishes the user's starting location, the current date, the starting countriesInfo object and sets up the map and footer | async function initializeApp() {
// ===== Establish starting countriesInfo object for localStorage =====
loadingScreen.updateStatusMessage('Setting Up Location Information...');
// Should contain REST, countryBorders and currencies data
let countriesInfo = countriesInfoFunctions.return... | [
"function initApp() {\n\n getCurrentLatitudeAndLongitude(function (latLng) {\n getCurrentLocationName(latLng.lat, latLng.lng)\n showWeather(latLng.lat, latLng.lng)\n })\n}",
"function initialize() {\r\n createMap();\r\n getGeoLoc();\r\n createAutoComplete();\r\n handleLocationFormS... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Click the Race List Tab | clickRaceListTab(){
this.raceListTab.waitForExist();
this.raceListTab.click();
} | [
"click_raceMeeting_RaceOverview(){\n this.raceOverviewTab.waitForExist();\n this.raceOverviewTab.click();\n }",
"clickUpcomingRacesTab(){\n this.upcomingRacesTab.waitForExist();\n this.upcomingRacesTab.click();\n }",
"click_myBlackbookAcceptedList_1stRace(){\n this.m... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
install packages via npm | function installPackages(packages) {
spawn.sync('npm', [
'install',
'-D',
...packages
], { stdio: 'inherit' });
} | [
"function npmInstall(packages, opts) {\n if (packages.length == 0 || !packages || !packages.length) { Promise.reject(\"No packages found\"); }\n if (typeof packages == \"string\") packages = [packages];\n if (!opts) opts = {};\n var cmdString = \"npm install \" + packages.join(\" \") + \" \"\n + ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |