query stringlengths 9 34k | document stringlengths 8 5.39M | negatives listlengths 19 20 | metadata dict |
|---|---|---|---|
Copies the file to the destination url. | copyTo(url, shouldOverWrite = true) {
return this.clone(File, `copyTo(strnewurl = '${url}', boverwrite = ${shouldOverWrite})`).postCore();
} | [
"copyTo(url, shouldOverWrite = true) {\n return spPost(this.clone(File, `copyTo(strnewurl='${escapeQueryStrValue(url)}',boverwrite=${shouldOverWrite})`));\n }",
"function copyFile(source, target){\n var ft = new FileTransfer();\n //source is the path of the original file inside the app folder\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Convert NLA tracks to events | function get_nla_events(nla_tracks, anim_slot_num) {
var nla_events = [];
for (var i = 0; i < nla_tracks.length; i++) {
var track = nla_tracks[i];
var strips = track["strips"];
if (!strips)
continue;
for (var j = 0; j < strips.length; j++) {
var strip... | [
"function getTrackEvents() {\n let result = '';\n for (const event of gTrackEvents) {\n if (event.receiver.track != event.track)\n throw new Error('RTCTrackEvent\\'s track does not match its receiver\\'s.');\n let eventString = 'RTCTrackEvent ' + event.track.id;\n event.streams.forEach(function(stre... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
==========================popup choose button action(show checkbox, del button) | function choose_mycontents(){
let bColor = $("#imagePopupLabel").css('border-color');
let wColor = $(".popup").css('background-color');
let popuplist = $('#popup_mylist').children();
let chooseText = $('#choosePopupBtn').val();
if(chooseText === "cancel"){
document.getElementById('deletePopupBtn').v... | [
"function onclick_btn_add_pro(){\n\t\t$('#form-new-property').show();\n\t\t$('#form-btn-default').hide();\n\t}",
"editButtonClick() {\n this.showPopup();\n }",
"function showHidePopupLaunchOptions() {\n var display_type = $(element).find('input[name=display_type]:checked').val();\n var display_typ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Creates model of a cube | function createModel(data) {
// Define the vertices for the cube.
// Each line represents one vertex
// (x, y, z, u, v)
var vertices = new Float32Array([
-1.0, -1.0, 1.0, 0.0, 1.0,
1.0, -1.0, 1.0, 1.0, 1.0,
1.0, 1.0, 1.0, 1.0, 0.0,
-1.0, ... | [
"function createCube () {\n\n var self = this,\n app = qlik.currApp( this );\n\n app.createGenericObject( {\n \"qHyperCubeDef\":{},\n \"qInfo\":{\"qType\":\"mashup\",\n \"qId\": 'id-' + Date.now() }\n }, function ( reply, app ) {\n app.getO... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
make sure the board is correctly formatted | function testLevelBoardIsCorrectSize(){
forEachLevel(function(stage, level){
var layout = StageController.getLevelLayout(stage, level);
if (layout.length !== 8){
throw Error("level layout not right on level: "+stage+", "+level);
}
for (var i = 0; i < layout.length; i++){
var row = layout[i];
if (row.l... | [
"_validateBoard() {\n if (\n !this.board || \n (this.board && this.board.length == 0) || \n (this.board && this.board.length < 3)\n ) throw new ApplicationError(ERROR.INVALID_BOARD);\n for (var i = 0; i < this.board.length; i++) {\n if (this.board[i].... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
It search sports facilities from the server by activity and suburb, and thn display on map. | function searchBySuburbAndActivityFromServer(allData, urlStr) {
clearTemporaryDataReturnedFromServer();
$.ajax({
url: urlStr,
type: "POST",
data: allData,
success: function (locData) { // Pop the location data on map
// if data is empty, show feedback to the user
... | [
"function findFacilities(loc, layer) {\n const query = layer.createQuery();\n query.returnGeometry = true; // return feature geometries\n query.distance = that.props.options.radius; // chosen in the Options component\n query.units = that.props.options.units; // chosen in the Opti... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
======================================================================= Remove an attribute of a field in a popup editor | function removeAttributeFromPopupField(fieldName, container, attribute) {
var fieldCol = $("input[name=" + fieldName + "]", container);
fieldCol.removeAttr(attribute);
} | [
"function removeAttr(){\n document.querySelector('#title').removeAttribute('readonly');\n document.querySelector('#doi').removeAttribute('readonly');\n document.querySelector('#authors').removeAttribute('readonly');\n document.querySelector('#journal_name').removeAttribute('readonly');\n document.que... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Determines if the specified range is "on" (i.e. that it is immediately preceded by and immediately followed by the contents of "match" but not by the contents of "badMatch"). | function _isOn(editor, match, badMatch, start, end) {
return _match(editor, match, start, end) &&
!_match(editor, badMatch, start, end);
} | [
"includes(range, target) {\n if (Range.isRange(target)) {\n if (Range.includes(range, target.anchor) || Range.includes(range, target.focus)) {\n return true;\n }\n var [rs, re6] = Range.edges(range);\n var [ts, te4] = Range.edges(target);\n return Point.isBefore(rs, ts) && Point.i... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
1. Return new array with everyone's name that's at least than 20 y/o | function peopleAtLeast20(arrObj){
newArrObj = []
for(var i =0; i<arrObj.length; i++){
if(arrObj[i]['age']>=20){
newArrObj.push(arrObj[i]['name']);
}
}
return newArrObj;
} | [
"function peopleAtLeast20(arrObj){\r\n newArrObj = []\r\n for(var i =0; i<arrObj.length; i++){\r\n if(arrObj[i]['age']>=20){\r\n newArrObj.push(arrObj[i]['name']);\r\n }\r\n }\r\n return newArrObj;\r\n }",
"function moreThanFiveReboundsPerGame(){\n var playerArray = [];\n for(i... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
create initialize function reset user score, gemvalues and random target number | function init() {
userScore = 0;
$("#playerScore").html(userScore);
gemEmpty();
gemInit();
// empty the target score div, run target function to generate a new target score
// then populate the target score div
$("#gameTarget").empty();
target();
// if $("#gameTarget").html(randomT... | [
"function initialize() {\n\t\t// target number between 19 and 120\n\t\ttargetScore = Math.floor(Math.random() * ((120-19) + 1) + 19);\n\t\t// crystal numbers between 1 and 12\n\t\tcrystalOne = Math.floor(Math.random() * ((12 - 1) + 1) + 1);\n\t\tcrystalTwo = Math.floor(Math.random() * ((12 - 1) + 1) + 1);\n\t\tcrys... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
the first button makes reference to a function called firstClick in the onclick attribute | function firstClick() {
alert("you clicked the first button!");
} | [
"function firstClick(){\n alert(\"you clicked the first button!\");\n}",
"_firstButtonClickHandler() {\n const that = this;\n\n that.first();\n }",
"function firstClick(){\n btnMultiListener = clickedButton(\"multiListner\", strMessageFifth, NumberFifth, feetFifth); //information is passe... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Return the list of accounts ordered by last name | function sortAccountsByLastName(accounts) {
return accounts.sort((accountA, accountB) => accountA.name.last > accountB.name.last ? 1 : -1);
} | [
"function sortAccountsByLastName(accounts) {\r\n accounts.sort((nameA, nameB) => nameA.name.last < nameB.name.last ? -1 : 1)\r\n return accounts\r\n}",
"function sortAccountsByLastName(accounts) {\n const sortedAccounts = accounts.sort((accountA, accountB) => {\n return accountA.name.last < accountB.name.la... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Search Stat Code by Area Code | searchStatCode(areaCode, groupCode = "") {
switch (groupCode) {
case "#0=|":
this.propertyGroup = "All";
break;
case "#0=pt:2|":
this.propertyGroup = "Detached";
break;
case "#0=pt:8|":
this.propertyGroup = "Townhouse";
break;
case "#0=pt:4|":
... | [
"function searchFunction(string)\r\n{\r\n if (string.value==null)\r\n {\r\n return\r\n }\r\n // converting all strings to lower case\r\n string = string.value.toLowerCase();\r\n let localRoomList=[];\r\n for (let i=0;i<roomUsageList._roomList.length;i++)\r\n {\r\n if (roomUsage... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Gets the style names based on given style type. | getStyleNames(styleType) {
if (this.viewer) {
return this.viewer.styles.getStyleNames(styleType);
}
return [];
} | [
"getStyles(styleType) {\n if (this.viewer) {\n return this.viewer.styles.getStyles(styleType);\n }\n return [];\n }",
"function getStyleModulesFor(type) {\n return (type && TYPE_STYLE_MODULES.get(type)) || [];\n}",
"function getTypeStyles(type) {\n var camelCaseType = type... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
this function delete a column and all the task in the column | function deleteColumn(currentDiv){
var compteur = currentDiv.parentNode.childNodes[4].value;
for(i=0; i < arraycolumn.length; i++){
if(arraycolumn[i].id == compteur){
delete arraycolumn[i];
}
}
for (j=0; j < arraytasks.length; j++){
if(... | [
"deleteColumn(index){if(confirm(\"Delete entire column?\")){for(let i=0;i<this.data.length;i++){this.splice(\"data.\"+i,index,1)}}}",
"deleteColumn() {\n if (!this.selectedColumns.length) return;\n\n this.selectedColumns.forEach(col => {\n const index = col.cellIndex;\n const rows = this._table.ro... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Override existing apply method in PIXI.Filter | apply(filterManager, input, output, clear) {
let renderTarget = filterManager.getFilterTexture();
let renderTarget1 = filterManager.getFilterTexture();
this._blurFilter.apply(filterManager, input, renderTarget, true);
this._colFilter.apply(filterManager, renderTarget, renderTarget1, tru... | [
"function TVFilter()\n{\n PIXI.AbstractFilter.call(this,\n // vertex shader\n null,\n // fragment shader\n [\n 'precision mediump float;',\n\n 'uniform sampler2D uSampler;',\n 'varying vec4 vertColor;',\n 'varying vec2 vTextureCoord;',\n\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Object: Code, private, the object stores data on the element for highlighting and parameters In: String tag Element for highlighting In: Int bold value property ccs "fontweight" In: String color value property ccs "color" | function _Code(tag, bold, color, type){
this.tag = tag;
this.bold = bold;
this.color = color;
this.type = type;
} | [
"function highlight() {\n\tlet bold = getBold_items();\n\tfor (text of bold) {\n\t\tthis.style.color = \"blue\";\n\t}\n}",
"function sh_highlightElement(htmlDocument, element, language) {\n sh_addClass(element, \"sh_sourceCode\");\n var inputString;\n if (element.childNodes.length === 0) {\n return;\n }\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Get notes for selected month | function getMonthNotes(year, month) {
// Now we have current date ( or selected date ) so we can get all notes for that date
var query = {
from: self.date.year + '-' + (self.months.indexOf(self.date.month) + 1) + '-' + '00',
to : self.date.year + '-' + (self.mont... | [
"function tipsMonthData(){\n const month = [jan, feb, mar, apr, may, jun, jul, aug, sep, oct, nov, dec];\n const info = document.getElementById('apiarytips');\n const monthIndex = new Date().getMonth();\n if(info){\n info.innerHTML = month[monthIndex];\n }; \n}",
"function checkForNotes() ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
verifica si un atributo unique existe en la BD | function isUnique(id_div, modelo, atributo, valor){
elem = valor;
new Ajax.Updater(id_div, 'unique/'+modelo+'/'+atributo, {asynchronous:true, evalScripts:true, parameters:Form.Element.serialize(elem)});
} | [
"isUnique() {\n\t\treturn window.db[this._database].get(this._id)\n\t\t\t.catch(e => {\n\t\t\t\tif (e.status === 404) {\n\t\t\t\t\treturn true;\n\t\t\t\t}\n\t\t\t})\n\t\t\t.then(doc => {\n\t\t\t\tif (doc) {\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\t\t\t});\n\t}",
"isUnique() {\n for (let i = 0; i < this.users.len... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
genre selected event fetch product by selected category | function genreSelected(genreId) {
console.log(`Genre ID: ${genreId}`);
if (genreId) {
fetch(`http://curlyhairapp.christinab.dk/wp-json/wp/v2/posts?_embed&categories=${genreId}`)
.then(function(response) {
return response.json();
})
.then(function(products) {
console.log(product... | [
"function loadCategoryProducts(event) {\r\n let id = getFirstParentData(event.target, 'category');\r\n api(\r\n 'categories/' + id + '/products',\r\n (response, status) => {\r\n showProducts(response.products);\r\n },\r\n (response, status) => {\r\n console.lo... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Marks all the selected goals as being done | function markDoneSelectedGoals() {
for (var i = 0; i < vm.goals.length; i++) {
// If the goal is selected
if (vm.goals[i].selected === true) {
vm.goals[i].done = true;
vm.goals[i].selected = false;
tasks.updateTask(vm.goals[i]);
}
}
//vm.goals = tasks.saveTasks(vm.goals);
} | [
"setGoalAsDone (event) {\n const goalIndex = parseInt(event.currentTarget.getAttribute('data-index'), 10);\n let tempGoals = this.state.goals;\n tempGoals = tempGoals.map(\n (goal) => {\n if (goal.id === goalIndex) {\n goal.done = true;\n }\n return goal;\n }\n );... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Checks the program to find out nested functions which fulfills the first condition of hoistability | function check_program_trace_for_dependencies(){
var result = [];
// Works for global level hoisting
//Getting all the global function
/*var global_fun = [];
var i = 0;
while(true){
if(!program_stack[i].includes('declare_')){
break;
}
if(function_list.indexOf(program_stack[i].split('_').splice(-1)[... | [
"function checkNestedHoistablityFunc(){\n\n\tfor(var i = 0; i<funcHoistbleMap.length;i++){\n\t //If a non hoistable function is found make its parent also non hoistable recursively, if its parent is not the outer most or until its the\n\t //respAncestor for which the inner function became non hoistable\n\t ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
this function will be called after the JavaScriptApplet code has been loaded. | function jsmeOnLoad() {
//Instantiate a new JSME:
//arguments: HTML id, width, height (must be string not number!)
jsmeApplet = new JSApplet.JSME("appletContainer", "380px", "340px", {
//optional parameters
"options" : "query,hydrogens"
});
//Alternative method: the size is not specified: the applet ... | [
"function appletComplete() {\n\n}",
"function jalview_applet_ready_callback (applet_name, id, status, applet){\n console.log('jalview ready', applet_name+'', id+'', status+'', applet );\n layout_main();\n}",
"function CheckAppletReady (javaApltFullName, callback)\n{\n if(IsOpenUI())\n return fal... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Generic implementation of `replicateM` in terms of `bind_RIO`. | function replicateM_RIO(n, x) {
if(n == 0) {
return function() {};
} else {
return bind_RIO(x, function(_) {
return replicateM_RIO(n-1, x);
});
}
} | [
"function lReplicate(@n) { return function(@x) {\n\treturn ulReplicate(n, x);\n};}",
"function replicate(options){\n options.replicator = options.replicator || options.src || HOST_DEFAULT;\n options.src = options.src || options.replicator || HOST_DEFAULT;\n\n assert.ok(options.replicator, 'No value for: repli... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Publishes all FLAs in the given folder and all of its subfolders. | function publishFilesInThisFolder(folderURI)
{
var indexOfLastBackslash = folderURI.lastIndexOf("/");
if(indexOfLastBackslash != -1){
var shortFolderName = folderURI.substring(indexOfLastBackslash + 1, folderURI.length);
//Don't process this folder if it is a hidden folder
if(shortFolderName.charAt(0) != ".... | [
"function deployAll() {\n var m = package.read();\n var ver = package.nextUnpublishedVersion(m.name, m.version);\n cp.execLogSync(`tsc`);\n updateGithub();\n publishDocs(srcts);\n deployRoot(ver);\n // deploySub(ver);\n}",
"function publishPackages(dist_dir) {\n const paths = glob_1.default.sync(path.... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
updates the state of the players invincibility every update. | function UpdateInvincibility() {
//if the player has not recently been hit
if(this.recentHitTime + recentHitDuration < Time.time) {
this.recentHitInvincibility = false;
}
} | [
"updateInvincibility() {\n if (this.isHurt()) {\n this.currentInvincibility--;\n }\n }",
"resetInvincibility() {\n this.#player.resetInvincibility();\n }",
"function updateInventory() {\n for (let key in state) {\n if (!inventory[key]) {\n // Hoppa över ifall... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
This is a more complicated query than the ones used to get the team and player lists because for the "recent" query, we need to get the last 10 games for each team, then get the team and player stats corresponding to those games. For simplicity (and because we can cache these results), reuse the "recent" query to get t... | function queryStats(mode) {
var limit;
if (mode === "recent") {
limit = "LIMIT 10";
} else if (mode === "season") {
limit = "";
}
var queryStr = "SELECT stats.*, positions.first, positions.last, positions.positions, positions.game_ids"
+ " FROM ("
+ " SELECT s.team, s.player_id, s.strength_sit, s.... | [
"async function get30RecentGames(teamId) {\n var query = `\n WITH teamHomeXG AS(\n SELECT date, xG_Home AS team_xG, xG_Away AS team_xGA\n FROM Fixtures f\n JOIN team t ON t.name = f.home\n WHERE t.team_id = ${teamId} AND ((xG_Away + xG_Home) <> 0)\n ORDER BY date DESC\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Exports the Firestore namespace into the provided `exportObject` object under the key 'firestore'. This is used for wrapped binary that exposes Firestore as a goog module. | function configureForStandalone(exportObject) {
var copiedNamespace = Object(__WEBPACK_IMPORTED_MODULE_5__util_obj__["f" /* shallowCopy */])(firestoreNamespace);
// Unlike the use with Firebase, the standalone allows the use of the
// constructor, so export it's internal class
copiedNamespace['Firestore... | [
"function configureForStandalone(exportObject) {\n var copiedNamespace = (0, _obj.shallowCopy)(firestoreNamespace);\n // Unlike the use with Firebase, the standalone allows the use of the\n // constructor, so export it's internal class\n copiedNamespace['Firestore'] = _database.Firestore;\n exportObject['fires... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Creates a new module aHolderNodeHTMLElementThe element to add the module to aDataObjectThe dynamic data for the module | createModule(aHolderNode, aData) {
//console.log("oa.AdvancedSettingsModuleCreator::createModule");
//console.log(aHolderNode, aData);
var dataObject = new Object();
for(var objectName in aData) {
dataObject[objectName] = aData[objectName];
}
dataObject["availableModules"] = this._settingModules... | [
"function addModuletoDOM(module) {\r\n single_moduleEl.innerHTML = `\r\n <div class=\"single-module\">\r\n <h1>${module.moduleName}</h1>\r\n <h2>Course Code: ${module.moduleCode}</h2>\r\n <img src=\"nmu-logo.jpg\" alt=\"logo\" />\r\n <div class=\"single-module-info\">\r\n <p>Prescribed Textbook</... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
toRau is a function to convert various units to Rau. | function toRau(num, unit) {
return convert(num, unit, "multipliedBy");
} | [
"function fromRau(rau, unit) {\n return convert(rau, unit, \"div\");\n}",
"static convertFromMetersToAU(r){\r\n\t\tlet t=new Array();\r\n\t\t\r\n\t\tt[0]=r[0]/1.49597870691E+11;\r\n\t\tt[1]=r[1]/1.49597870691E+11;\r\n\t\tt[2]=r[2]/1.49597870691E+11;\r\n\t\t\r\n\t\treturn t;\r\n\t}",
"function pToR (percentage)... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Create operate function Calls basic math function dependent on the sign input | function operate(x, sign, y) {
sign === "+" ? output.textContent = add(x, y) :
sign === "-" ? output.textContent = subtract(x, y) :
sign === "*" ? output.textContent = multiply(x, y) :
sign === "/" ? output.textContent = divide(x, y) :
output.textContent = "Error"
} | [
"function operate(operator, num1, num2) {\n if (operator === '+') {\n return(add(num1, num2));\n }\n else if (operator === '-') {\n return(subtract(num1, num2));\n }\n else if (operator === 'x') {\n return(multiply(num1, num2));\n }\n else if (operator === '/') {\... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Usage: updateCart(type, btn) Pre: type is one of: 'increment', 'decrement' or 'remove'. btn is the pressed button, and corresponds to the type. Post: the appropriate function has been called. | function updateCart(type, btn){
switch(type){
case 'increment':
increment(btn);
break;
case 'decrement':
decrement(btn);
break;
case 'remove':
remove(btn);
break;
default:
break;
}
} | [
"function updateCart() {\n\n}",
"function doUpdateCart($button) {\n var pid = $button.attr('data-cart-pid');\n $.ajax({\n url: Drupal.settings.basePath + Drupal.settings.pathPrefix + 'cart/ajax',\n type: 'POST',\n data: {\n pid: pid\n },\n dataType: 'json',\n success: ca... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
;; camAllArtifactsPickedUp() ;; ;; Returns true if all artifacts managed by ```libcampaign.js``` ;; were picked up. ;; | function camAllArtifactsPickedUp()
{
// FIXME: O(n) lookup here
return __camNumArtifacts === Object.keys(__camArtifacts).length;
} | [
"areAllArtefactsTaken () {\n let areAllArtefactsTaken = true\n\n for (let key in this.players) {\n const player = this.players[key]\n\n areAllArtefactsTaken = areAllArtefactsTaken && (player.takenArtefactsCount === this.spectrum.artefactsToTakeCount)\n }\n\n return areAllArtefactsTaken\n }",
... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Private method to add a list of contributions | _setContributions(contributions){
this.contributions = contributions;
this.currentContribution = this.contributions.length - 1;
if(this.currentContribution > -1)
this._updateContent(this.contributions[this.currentContribution].content);
} | [
"function _addContributors() {\n\t\tconst contribs = $( '#5ftf-pledge-contributors' ).val();\n\t\tif ( ! contribs.length ) {\n\t\t\treturn;\n\t\t}\n\n\t\t// Clear the error message field.\n\t\t$( '#add-contrib-message' ).html( '' );\n\n\t\tsendAjaxRequest( {\n\t\t\tcontributors: contribs,\n\t\t\tmanage_action: 'add... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
creazione della traiettoria per l'oggetto dell'animazione | function createPoint (self) {
console.log('Creazione traiettoria');
//definizione key frames con un tap, giusto per provare
console.log('Hai creato un key frame, creati: ' + (targetObject.keyFrames.length + 1));
//salvataggio posizine come primo valore del key frame
let keyFrame = [{
name: '... | [
"function crear_tren(){\n var tren = new Objeto3D(null,null,null);\n var barra_1 = crear_tren_soporte();\n barra_1.set_color([0.1,0.1,0.1]);\n var barra_2 = crear_tren_soporte();\n barra_2.set_color([0.1,0.1,0.1]);\n var base = crear_tren_base();\n base.set_color([0.1,0.1,0.1]);\n barra_1.mo... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Returns a renderer for a certain viewport and response. | static getRenderer(viewport, response) {
// find the best matching renderer
var highest = {
score: -Infinity,
rendererClass: undefined
};
for (const registered of this.registry) {
const score = registered[0](response);
if (score > highest.s... | [
"function findRenderer() {\n var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};\n \n if (options.Renderer) return options.Renderer;\n var useVirtual = options.virtual || !_isInBrowser2['default'];\n return useVirtual ? _VirtualRenderer2['default'] : _DomRend... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Delete an existing guest | function deleteGuest(req, res) {
res.status(204).send(guestService.deleteGuest(req.params.guestId));
} | [
"function deleteGuest(req, res) {\n res.status(200).send(guestService.getById(req.params.guestId));\n}",
"deleteGuest(guestID) {\n this.guests.splice(guestID, 1);\n this.storeGuests();\n ui.displayGuests();\n }",
"deleteGuest(guest) {\n this.props.deleteGuest(this.props.party._id, guest);\n }... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Launch the Vivit Website. | function launchWebsite() {
var url = "http://vivit-worldwide.org/"
var target = "_blank";
var options = "location=yes,hidden=yes";
inAppBrowserRef = cordova.InAppBrowser.open(url, target, options);
inAppBrowserRef.addEventListener('loadstart', loadStartCallBack);
inAppBrowserRef.addEventListener('loadstop', lo... | [
"function openBrowser() {\n\t\tcreateService();\n\t\tvar spawn = require('child_process').spawnSync;\n\t\tspawn(GLOBAL.browser, ['http://localhost:8080']);\n\t}",
"function linkToVR() {\r\n\twindow.open('../vr/index.html');\r\n}",
"async launchBrowser() {\n const { headless } = this.options\n try {\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Fetches movie night lists from collection | async fetchMovieNightLists(ctx) {
if(auth.currentUser.uid != null) {
let collection = await db.collection(auth.currentUser.uid).get();
let respArr = [];
collection.forEach(doc => {
if(hasOwnProperty.call(doc.data(), 'movieNightList')) {
respArr.push(doc.data())
... | [
"async fetchAll() {\n try {\n const [filmworldResp, cinemaworldResp] = await Promise.all(\n this.sources.map(source => source.list()).map(reflect)\n );\n return {\n filmworldResp,\n cinemaworldResp,\n };\n } catch (err) {\n console.log('Movie class fetchall except... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Function to keep sending HALT Messages for Rover Wheels at fixed interval (in ms) | function wheelsHALT() {
wheelsHALTInterval = setInterval(function() {
wheels.publish(wheelsHALTMessage);
console.log(0);
}, 10000);
} | [
"function armHALT() {\n arm.publish(armHALTMessage);\n console.log(\"ARM HALT\");\n armInterval = setInterval(function() {\n arm.publish(armHALTMessage);\n console.log(\"ARM HALT\");\n }, 10000);\n}",
"tweenRounds() {\n\t\tlet timer = 5;\n\t\tthis.App.game.settings.blockUpdates = true;\n... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Checks for situations where nested strings can occurr. | _isNestedString() {
// No special nested string cases right now.
return false;
} | [
"NestedString(subdocument = {}) {\n\t\tif (subdocument.children) {\n\t\t\treturn {\n\t\t\t\tvalid: true,\n\t\t\t\tvalue: flattenNodeToPlainString(subdocument),\n\t\t\t};\n\t\t}\n\t\treturn {\n\t\t\tvalid: false,\n\t\t\tvalue: 'nested string should not be empty',\n\t\t};\n\t}",
"static validateTagParentheses(s) {\... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Save the value of the country code from child component to local state | onCountryPick(code) {
this.setState({ country_code: code})
} | [
"function countryChangeHandler(event) {\n setCountry(event.target.value)\n }",
"function handleCountryButtonClick(e) {\n console.log(e.target.innerText);\n\n let countrySelectedCode;\n\n countriesArray.forEach(countryEntry => {\n if (countryEntry[0] === e.target.innerText) {\n count... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Writes component definitions to disk. | function writeComponents(components, destination) {
console.log(`Writing ${Object.keys(components).length} component files to ${srcPath}.`);
let componentPath;
for (const Component in components) {
componentPath = path.join(destination, `${Component}.react.js`);
fs.mkdirSync(path.join(destin... | [
"function writeComponentInfoFiles(componentInfo) {\n for (var _iterator = _createForOfIteratorHelperLoose(componentInfo), _step; !(_step = _iterator()).done;) {\n var info = _step.value;\n\n var filePath = _path[\"default\"].join(outputPath, info.fileName);\n\n var content = JSON.stringify(info.def);\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Initializes the codemirror instance | setupCodemirror() {
this.destroyCodemirror();
const themes = this.props.theme.split(',').map(s => s.trim());
let theme = 'default';
for (let i = 0; i < themes.length; i++) {
if (THEMES.indexOf(themes[i]) === -1) {
theme = themes[i];
break;
}
}
const options = objectA... | [
"function initCodeElement()\n {\n var config = { mode: \"clojure\",\n lineNumbers: true,\n matchBrackets: true };\n\n $(this).data('editor', CodeMirror.fromTextArea(this, config));\n }",
"function initializeCodemirror() {\n if (document.locati... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
remove blocks of all the given keys without respecting refcounts | unwantBlocks (cids) {
this._log('unwant blocks: %s', cids.length)
this._addEntries(cids, true, true)
} | [
"unwantBlocks (keys) {\n log('unwant blocks:', keys.map((k) => mh.toB58String(k)))\n this._addEntries(keys, true, true)\n }",
"unwantBlocks (keys) {\n\t log('unwant blocks:', keys.map((k) => mh.toB58String(k)))\n\t this._addEntries(keys, true, true)\n\t }",
"removeLU(){\n \n // find lowest r... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Clear commands for a clientId | clearClientsCommands(clientId) {
const newCommands = pipe(
dotPath("all"),
reject(c => c.clientId === clientId)
)(this)
this.all.clear()
this.all.push(...newCommands)
} | [
"clearCommands() {\n this.commands = [];\n }",
"function CM_ClearCommands() {\r\n this.m_commands = new Array();\r\n this.m_commandData = new Array();\r\n}",
"clear() {\n // ˅\n this.pastCommands.length = 0;\n // ˄\n }",
"reloadClientCommands() {\n hotReloadClien... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Initializes form input fields with default constant values. | function initFormDefaults() {
$('#formCustomize input[type=number]').each(function() {
const id = $(this).attr('id');
const defaultVal = CONSTANTS[id];
$(this).val(defaultVal);
});
} | [
"function initValues() {\n\tNAME.value = \"\";\n\t\n\t// TEXT and PASSWORD type vars\n\tTP_CBOX_READONLY.checked = false;\n\tTP_MAXLEN.value = \"\";\n\tTP_TEXT.value = \"\";\n\tTP_MASK.value = \"\";\n\t\n\t// Button, Reset, Submit\n\tBSR_SUBMIT.checked = false;\n\tBSR_RESET.checked = false;\n\tBSR_NONE.checked = fa... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
list of blogs are approved | function blogsApproved(){
BlogPostService.blogsApproved().then(function(response){
$scope.listOfBlogsApproved=response.data //list<blogpost> approved
},function(response){
if(response.status==401)
$location.path('/login')
})
} | [
"function listapprovedBlogs()\n\t{\n\t\t\n\t\tBlogService.listapprovedBlogs().then(\n\t\t\tfunction(response)\n\t\t\t{\n\t\t\t\t\n\t\t\t\t$scope.approvedBlogs=response.data // approvedBlogs is a new variable in which we are storing responce.data.\n\t\t\t},function(response)\n\t\t\t{\n\t\t\t\tif(response.status==401... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Helper Functions Create a HTML element specified by parameter 'p_type' | function createSimpleElement(p_type,p_id,p_class) {
element = document.createElement(p_type);
if (p_id!=undefined)
element.id = p_id;
if (p_class!=undefined)
element.className = p_class;
return element;
} | [
"function createSimpleElement(p_type,p_id,p_class) {\n element = document.createElement(p_type);\n if (p_id!=undefined)\n element.id = p_id;\n if (p_class!=undefined)\n element.className = p_class;\n return element;\n}",
"function generateElement(parent, eleType, html = '') {\n const te... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Work horse for exporting layers | function exportLayers(){
// Loop through layers
for(var e = 0; e< doc.layers.length; e++){
// Set selected layer on
doc.layers[e].visible = true;
// Store layerName
var layerName = doc.layers[e].name;
// Function returns a new file name
targetFile = getNewName(layerName);
// Returns PNG options
p... | [
"function exportPngs(data) {\n for (var i = 0; i < data.layerSets.length ; i++) {\n exportPngs(data.layerSets[i]);\n }\n \n if (data.typename != \"LayerSet\") {\n return;\n }\n\n _xmlString += \"\\t\\t<Layer Name=\\\"\"+ data.name + \"\\\"> \\n\";\n _xmlString += \"\\t\\t\\t<Sprit... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Borders and Dropshadows: Here's the menu border and dropshadow functions we call above. Edit ot delete if you're not using them. Basically, they assign a string to pMenu.menu.menuName[0].extraHTML, which is written to the document with the menus as they are created the string can contain anything you want, really. They... | function addMenuBorder(mObj, iS, alpha, bordCol, bordW, backCol, backW)
{
// Loop through the menu array of that object, finding matching ItemStyles.
for (var mN in mObj.menu)
{
var mR=mObj.menu[mN], dS='<div style="position:absolute; background:';
if (mR[0].itemSty != iS) continue;
// Loop through the items i... | [
"function addMenuBorder(mObj, iS, alpha, bordCol, bordW, backCol, backW)\r\n{\r\n // Loop through the menu array of that object, finding matching ItemStyles.\r\n for (var mN in mObj.menu)\r\n {\r\n var mR=mObj.menu[mN], dS='<div style=\"position:absolute; background:';\r\n if (mR[0].itemSty != iS) continue;\r\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Created function to display remaining questions | function remainingQuestions () {
const questionsLeft = triviaQuestions.length - (currentQuestion + 1);
const totalQuestions = triviaQuestions.length;
return `Remaining Questions: ${questionsLeft}/${totalQuestions}`
} | [
"function loadRemainingQuestions(){\n \n var remainingQuestion = quizQuestions.length - (currentQuestion + 1);\n var totalQuestion = quizQuestions.length;\n\n return `Remaining Question: ${remainingQuestion}/${totalQuestion}`;\n}",
"function questionCountDisplay() {\n /*Default \"remainingQuestion\... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
one or the other or both spends is valid if both the hash and the index are valid. pays is valid if pays is valid | function isValidRequestInput(options) {
const {hash, index, pays} = options;
let isSpendsValid = false;
let isPaysValid = false;
if (
Buffer.isBuffer(hash)
&& hash.length === 32
&& typeof index === 'number'
&& (index >>> 0) === index
)
isSpendsValid = true;
// TODO: check for si... | [
"isIndexFulfilledBy(index1, index2) {\n // allow the other index to be equally large only. It being larger is an option but it creates a problem with scenarios of the kind PRIMARY KEY(foo,bar) UNIQUE(foo)\n if (index1.columnNames.length !== index2.columnNames.length) {\n return false;\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Returned value is used to display sidebar with assignments for the group | static async getGroupAssignments(group, visible) {
return (await group
.assignments()
.with('problem')
.where('visible', visible)
.fetch()
).toJSON()
} | [
"function createGroupSidebar() {\n\n var aside = document.getElementsByTagName(\"aside\")[0];\n \n if (aside == null) return alert(\"aside not found!\");\n \n aside.setAttribute(\"data-bind\", \"visible: subfeed() != 'group'\");\n \n var discussions = document.createElement(\"div\");\n discu... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Submit function retrieves the value from the form input, finds the matching object keyvalue pair in the locationsArray array, passes them to the setLocation function | function submit(evt) {
evt.preventDefault( );
var locationName = $( "#location" ).val();
var i = 0;
// This while loop loops throught the array, the for loop loops through the objects in each array element looking for a key value that matches var locationName and when it finds it it sets var coordinates e... | [
"function submit(evt) {\n evt.preventDefault( );\n \n var locationName = $( \"#location\" ).val();\n var i = 0;\n var coordinates;\n \n for(var i = 0; i <locationsArray.length; i++) { \n if (locationName == locationsArray[i].loc){ \n coordinates = locationsArray[i].coord; \n image1 = locationsAr... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
clear_st(st,request, callback) parameters: st: the session ticket, parsed from the CAS POST message request: the request object, which is needed for its link to the general session store for the web server callback: a function to call, will be passed any errors look in the redis db for the session associated with the g... | function clear_st(st,req,callback){
const redclient = redis.createClient({host:redishost});
logger.debug('clearing st: redclient created')
redclient.on("error", function (err) {
logger.error("Redis Client Error: " + err);
});
redclient.get(st
,function(err,sid){
... | [
"function deleteSessionSTO() {\n\tsessionStorage.clear();\n}",
"_handleClearSession() {\n Session.remove()\n location.reload()\n }",
"function clearSession(uid) {\n\t//var url = self.location.href;\n\tvar pid = $('#powermail_cond_pid_container').val();\n\tvar url = '/index.php';\n\tvar timestamp = Number... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Setup Schema for User | setupUserSchema() {
let userSchema = new mongoose.Schema({
userId: {type: String, required: true},
firstName: {type: String, required: true},
lastName: {type: String, required: true},
emailId: {type: String, required: true},
password: {type: String, re... | [
"static get UserSchema() {\r\n if (!_UserSchema) {\r\n log.info(`Define the schema for ${MODEL_NAME}`);\r\n _UserSchema = new mongoose.Schema({\r\n username: String,\r\n secret: String,\r\n email: String,\r\n dateCreated: { type: Date, default: Date.now },\r\n dateUpd... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
check if the title is the same as the original title | function checkTitle(object, context) {
if (object.title !== object.original_title) {
context.original_title = object.original_title;
}
} | [
"function isTitleDuplicate(title, $tabSet) {\n var $tabs = $tabSet.children(\".tab\");\n for (var i = 0; i < $tabs.length; i++) {\n if ($tabs.eq(i).text().trim() === title.trim()) {\n return true;\n }\n }\n return false;\n }",
"function checkNewT... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
displayKeywords(args) Given keyworsd and their counts, format them in a way that can be displayed. | function displayKeywords(args) {
var keywords = args['keywords'];
var output = '';
var showcount = $('#show-counts').is(':checked');
var separator = getKeywordCountSeparator();
var displaycounts = [];
$.each(keywords, function(key, value) {
var displaykeyword = value['key'];
if(showcou... | [
"function displayKeywords() {\n keywordData.sort();\n\tvar checked;\n\tvar keyword;\n\tvar str = genKeywordEntry(\" checked\", 'no_keyword_filter', NO_KEYWORD_FILTER, 0);\n\tfor (i in keywordData) {\n if (keywordData.hasOwnProperty(i)) {\n var keywordObj = keywordData[i];\n keyword =... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Formular get all existing formular names from db for formular filter | async function getFormularNames(req, res) {
var formulars = await pool.query("select * from formular");
res.header("Access-Control-Allow-Origin", "*");
return res.status(200).send(formulars.rows);
} | [
"function getEmpFilters() {\n return unqEmps.map(function(item) {\n return {\n text: `${item.firstName} ${item.lastName}`,\n value: item.lastName\n };\n });\n }",
"function getNames(field) { return field.name; }",
"_getFieldNames() {\n\n // varia... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Define a Display factory constructor function | function DisplayFactory() {
} | [
"function initDisplayObjects() {\n console.log(\"initDisplayObjects\");\n\n // == display object properties: name, yearsMenu, schoolsMenu, studentsMenu, buildingsMenu, geographyMenu\n displayObject = new Display(\"display1\");\n }",
"constructor(/*options*/) {\n // console.log('[Dis... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Smooth scrolling to 'position' | function smoothScrollTo(position) {
$('body,html').animate({scrollTop : position});
} | [
"function smoothScroll() {\r\n window.scrollBy(4, 700);\r\n}",
"function smoothScroll(el) {\n var pos = $(el).offset().top;\n $(\"body, html\").animate({ scrollTop: pos });\n}",
"function smoothScroll(e){\n let restar = 0;\n if(window.innerWidth>800) restar = 40;\n var posicion_ancla =... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Display Video Preview The purpose of this method is to display the preview for a video file. It shows the video window and hides any other display windows. It accepts paramaters for which windows (current or next) to hide/show as well as for the location of the video to show. | function displayVideoPreview(previewWindowName, filePath, filename)
{
$("#" + previewWindowName + "SlideVideo").attr('src', filePath + filename);
$("#" + previewWindowName + "SlideVideo").show();
$("#" + previewWindowName + "SlideImage").hide();
$("#" + previewWindowName + "SlideWebpage").hide();
$("#nextEr... | [
"function openPreview() {\n const file = this.id.replace(\"/home/pi/Final-Year-Project/static\", \"\")\n console.log(file)\n let previewWindow\n if (file.substr(-4) === \".mp4\" || file.substr(-5) === \".webm\" || file.substr(-4) === \".ogg\") {\n previewWindow = document.getElementById(\"previewVideo\");\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Yahoo Login Popup(Not in useopenYahooLoginRegPopup) | function openYahooLoginRegPopup() {
var e = "http://login.moneycontrol.com/social_user/Login_mc.php?ylogin&returl=";
mctop_setCookie("returl", location.href, 1);
var t = navigator.userAgent.match("MSIE (.)");
var n = t&&t.length>1?t[1]:"";
if(n != "" && n > 6){
yhLoginWindow = window.open(e... | [
"popupLogin() {\n console.log('opening popup window to login')\n this.popup=window.open('/api/b2access/login?next=/b2note/', 'B2Access', 'width=800');\n return false;\n }",
"function doModalLogin_() {\n\tcustomModalBox.htmlBox('yt-LoginContent_Popup', '', 'Log in'); \n\tloginClose_();\n}",
"function o... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
A DoubleSliderPopupMenuItem paired with a text label & two number labels | function DoubleSliderMenuItem() {
this._init.apply(this, arguments);
} | [
"function lcDisplayTypeMenu(itemArray) {\n actualArray = new Array();\n //the list does not include the first two items.\n for (i = 2; i < itemArray.length; i++) {\n actualArray[i-2] = itemArray[i];\n }\n new PopupMenu(\"Learning Curve Types\", \"LearningCurveTypes\", actualArray, mouse_x, mou... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
TODO(Igor) reloading now triggers a loadingData event, though it seems fine? | loadingData() {} | [
"onReload() {\n this.loadData();\n }",
"_onDataLoaded () {\n this._state = 'dataLoaded';\n this._needRefresh();\n }",
"function refreshData() {}",
"_handleLoadedDataEvent() {\n this.fireEvent(\"loadeddata\");\n }",
"function loadedData() {\n function onOk() {\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Swap two tiles in the level | function swap(x1, y1, x2, y2) {
var typeswap = level.tiles[x1][y1].type;
level.tiles[x1][y1].type = level.tiles[x2][y2].type;
level.tiles[x2][y2].type = typeswap;
} | [
"function swap(x1, y1, x2, y2) {\n var typeswap = level.tiles[x1][y1].type;\n level.tiles[x1][y1].type = level.tiles[x2][y2].type;\n level.tiles[x2][y2].type = typeswap;\n }",
"function swap(x1, y1, x2, y2) {\n var typeswap = level.tiles[x1][y1].type;... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Call const_missing if nothing else worked | function const_missing(cref, name) {
return (cref || _Object).$const_missing(name);
} | [
"function const_missing(cref, name, skip_missing) {\n if (!skip_missing) {\n return (cref || _Object).$const_missing(name);\n }\n }",
"function caml_raise_not_found () {\n caml_raise_constant(caml_global_data.Not_found); }",
"throwIfMissing() {\n throw 'Missing parameter.';\n }",
"function ve... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
opt: aspect ratio as a single number or a range (e.g. "1,2"); | function applyAspectRatio(opt, bounds) {
var range = String(opt).split(',').map(parseFloat),
aspectRatio = bounds.width() / bounds.height(),
min, max; // min is height limit, max is width limit
if (range.length == 1) {
range.push(range[0]);
} else if (range[0] > range[1]) {
range.rev... | [
"set ratio(input) {\n if (!this.isVideo) {\n this.debug.warn('Aspect ratio can only be set for video');\n return;\n }\n if (!is.string(input) || !validateAspectRatio(input)) {\n this.debug.error(`Invalid aspect ratio specified (${input})`);\n return;\n }\n this.config.ratio = redu... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Adds the tap particle emitter effect. | function addEmitterTap() {
// Destroy old tap emitter
destroyEmitterTap();
// Add emitter and make particles
spriteEmitterTap = game.add.emitter(0, 0, EMITTER_NUM_PARTICLES);
spriteEmitterTap.makeParticles('tap', [0, 1, 2]);
spriteEmitterTap.setAlpha(0.3, 0.8);
// Scale up emitter
var scale = RATIO * SPRITE_S... | [
"function ParticleEffect(spec){\n activeParticleEffects.push(MakeParticleEffect(spec));\n }",
"function mouseClicked(){\n createMightyParticles();\n}",
"addParticle() {\n this.particles.push(new Particle(this.origin, this.startingColour, this.acceleration));\n }",
"function particleBurst()\n{... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
wraps the initial state, if any, into the first snapshot | wrapInitialState(initialState) {
return orderedHistory.getInitialState(initialState)
} | [
"initializeState() {}",
"get defaultState() { return {}; }",
"fullState() {\n return Object.assign({}, this.state, this.internals)\n }",
"function SetInitialSnapshot(snap) {\n\tcg.snap = snap;\n\n\tBG.PlayerStateToEntityState(snap.ps, cg.entities[snap.ps.clientNum].currentState);\n\n\t// Sort out solid en... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Throw when already disposed. | __checkDisposed() {
if (this.__disposed) {
throw new Error("Already disposed");
}
} | [
"_errorIfDisposed() {\n if (this.isDisposed) {\n throw new Error('Kernel connection is disposed');\n }\n }",
"_verifyNotClosed() {\n if (this._closing) {\n throw new Error('BulkWriter has already been closed.');\n }\n }",
"function createDisposeGuard(dispo... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
diffs the dates in the appropriate way, returning a duration | function diffDates(date1, date0) { // date1 - date0
if (largeUnit) {
return diffByUnit(date1, date0, largeUnit);
}
else if (newProps.allDay) {
return diffDay(date1, date0);
}
else {
... | [
"function getDurationofDates(date1, date2) {\n var a1 = new GlideDateTime(date2);\n var b1 = new GlideDateTime(date1);\n return (date1 == date2) ? 0 : ((a1.getNumericValue() - b1.getNumericValue()) / 1000);\n}",
"function diffDates(date1, date0) { // date1 - date0\n\t\t\t\tif (largeUnit) {\n\t\t\t\t\tret... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Extracts and returns an image configuration from parameters of the specified jQuery article object. | function getImageConfig(article) {
var urlMask = article.attr("data-image-url");
var width = article.attr("data-image-width");
var height = article.attr("data-image-height");
var zoom = article.attr("data-image-zoom") || "10";
return {
url : urlMask,
width... | [
"function getPictureArticleSearch(article) {\n var baseURL = 'http://www.nytimes.com/';\n var pictures = article['multimedia'];\n\n for(var picture in pictures) {\n if(pictures[picture]['subtype'] !== 'thumbnail' && pictures[picture]['subtype'] !== 'wide') {\n return {\n 'url': baseURL + pictures[... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Check if an address already has a nickname attached to it | async function checkAddressAvailability(address) {
return new Promise(async (resolve, reject) => {
try {
const addressCashAddress = BITBOX.Address.toCashAddress(address);
const nicknameResult = await Nickname.findOne({ address: addressCashAddress }).exec();
if (!nicknameResult) {
resolve... | [
"function isAddressExist() {\n\t\treturn addresses.some(address => address.id === title.split(' ').join(''));\n\t}",
"function isAddressExists(cb) {\n\t\tself.iota.api.getAccountData(self.seed, {}, function(error, response) {\n\t\t\tif(!!response && !!response.addresses && response.addresses.length > 0) {\n\t\t\t... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
All regex matches against str. regexAllMatches(/regex/, str) > [ ['match', 'group' index: 20, input: 'inputstr'], ['match', 'group' index: 34, input: 'inputstr'] ] | function regexAllMatches(re, str){
const matches = [];
let match;
while((match = re.exec(str)) !== null){
matches.push(match);
}
return matches;
} | [
"function _matchAll(regex, string) {\n var res = [], m = regex.exec(string);\n while (m) {\n res.push({index: m.index, matches: m});\n m = regex.exec(string);\n }\n return res;\n }",
"static matchAll (string, regexp) {\r\n let matches = [];\r\n\r\n string... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
================================================== Segment Tree ================================================== | function SegmentTree() { this._initialize.apply(this, arguments); } | [
"function SegmentNode (id, segment, prev, total) {\n\n if (!segment.caption || !segment.caption.speaker) {\n // No text for this segment.\n segment.caption = { speaker: '' };\n }\n\n this.index = id + 1;\n this.total = total;\n this.id = 'segment_id_' + id;\n this.start = segment.sta... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
toggleLoader function $elem is the parameter | function toggleLoader($elem) {
// if the parameter has the class active
if($elem.hasClass(options.activeClass)) {
// remove the element
$(options.loaderClass, $elem).remove()
}
else {
// show the element with the class active
$elem.html(options.loaderHtml).addClass(options.activ... | [
"function toggleLoader() {\n loader.hidden = !loader.hidden;\n container.hidden = !container.hidden\n}",
"function toggleLoading( $ ) {\n $(\".loading-dashboard-block\").toggle();\n}",
"function toggleLoader(con){\r\n\tif(con){\r\n\t\t$('#mainLoader').show();\r\n\t}else{\r\n\t\t$('#mainLoader').hide();\r... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Subscribes to the entire collection. | subscribe() {
Meteor.subscribe(this.collectionName);
} | [
"subscribe() {\n if (Meteor.isClient) {\n Meteor.subscribe(this._collectionName);\n }\n }",
"subscribe() {}",
"subscribe() {\n this.subscriptionID = this.client.subscribe(this.channel, this.onNewData)\n this.currencyCollection.subscribe(this.render)\n this.currencyCollection.subscribe(this.... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
loop through all columns to inspect sorters & update backend service orderBy | updateSorters(sortColumns, presetSorters) {
let currentSorters = [];
const odataSorters = [];
if (!sortColumns && presetSorters) {
// make the presets the current sorters, also make sure that all direction are in lowercase for OData
currentSorters = presetSorters;
... | [
"setSortOrders () {\n // Reset sortKey\n this.sortKey = []\n\n let sortOrders = {}\n\n this.columns.forEach(function (column) {\n sortOrders[column.name] = \"\"\n })\n\n this.sortOrders = sortOrders\n }",
"function doSort() {\r\n statementTableDataStore.sort(getSorte... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Makes the input/operation/bank areas valid locations to drop blocks into | function makeAreasDropable(){
// When a block is dropped, check the value and type global data variables
// and append the appropriate block to that container.
var blockBank = document.getElementById("block-bank");
var inBlock1 = document.getElementById("input-block-1");
var opBlock = documen... | [
"function makeAreasDropable() {\r\n\t// When a block is dropped, check the value and type global data variables\r\n\t// and append the appropriate block to that container.\r\n\r\n\tconst blockBank = document.getElementById(\"block-bank\");\r\n\tconst inBlock1 = document.getElementById(\"input-block-1\");\r\n\tconst... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
load the next slice | function loadNextSlice(currentSlice, slices) {
if(currentSlice < (slices.length - 1)) {
currentSlice++;
localStorage.setItem("currentSlice", currentSlice);
loadSliceIntoTranscribePage(currentSlice);
}
else {
alert("You've done all the slices!");
}
} | [
"load()\n {\n\tvar cur = this._loadIdx % this._buffer.length;\n\tthis._loadIdx = (this._loadIdx + 1) \n\treturn this._buffer[cur];\n }",
"function loadNext() {\n if (nextIndex < images.length) {\n var image = images[nextIndex];\n load(image.img, image.Slide);\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
remove the item next of `list` | function pop(list) {
var next = list._idleNext;
remove(next);
return next;
} | [
"remove(item) {\n //if the list is empty\n if (!this.head) {\n return null;\n }\n //if the node to be removed is head, make the next node head\n if (this.head.value === item) {\n this.head = this.head.next;\n return;\n }\n //start at the head\n let currNode = this.head;\n /... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
decorateWithPermissions: binding > binding HACK! | function decorateWithPermissions(binding){
var bindingEntry = function(entry){return entry[0]===binding.id;},
filteredPermissions = this.declaredPermissions.filter(bindingEntry);
binding.updatePermissions(filteredPermissions.map(function(p){return p[1];}));
return binding;
} | [
"function decorateWithPermissions(binding) {\n\t var bindingEntry = function bindingEntry(entry) {\n\t return entry[0] === binding.name;\n\t },\n\t filteredPermissions = that.declaredPermissions.filter(bindingEntry);\n\t binding.permissions = filteredPermissions.map(function... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Handle Init We run the announced descriptor through a validation pipeline to verify 1. Health 2. Swagger 3. Docs Path If any of these checks fail for the descriptor, the descriptor does not make it into the registry. After handling the Announcement, We look up the Service Descriptor(s) the announcing service is interes... | handleInit(initMessage, socket) {
debug(initMessage);
let query = initMessage;
let descriptor = initMessage.descriptor;
// Validate Descriptor and verify that the service is 'kosher'
if(descriptor) {
async.waterfall(
startup.createValidationPipeline(descriptor),
(err, results) ... | [
"_init() {\n\t\tthis.logger.debug(`Service '${this.fullName}' is creating...`);\n\t\tif (isFunction(this.schema.created)) {\n\t\t\tthis.schema.created.call(this);\n\t\t} else if (Array.isArray(this.schema.created)) {\n\t\t\tthis.schema.created.forEach(fn => fn.call(this));\n\t\t}\n\n\t\tthis.broker.addLocalService(... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Returns the left value for an element based on the current mouse x and half of the window width. Follows the horizontal movement of the mouse. | function getLeftWithMouse(mouseX, halfWidth, defaultLeft, offset) {
if (mouseX < halfWidth) {
return defaultLeft + (mouseX / halfWidth * offset) - offset;
}
else {
return defaultLeft + ((mouseX - halfWidth) / halfWidth * offset);
}
} | [
"function xLeft(e, iX)\r\n{\r\n if(!(e=xGetElementById(e))) return 0;\r\n var css=xDef(e.style);\r\n if (css && xStr(e.style.left)) {\r\n if(xNum(iX)) e.style.left=iX+'px';\r\n else {\r\n iX=parseInt(e.style.left);\r\n if(isNaN(iX)) iX=xGetComputedStyle(e,'left',1);\r\n if(isNaN(iX)) iX=0;\r... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
function that draws the mandelbrot set based on current zoom, panX, panY and scale MANDELBROT | function mandelbrot(zm, panX, panY, scale){
//cncel run in some case
if(!running){
return;
}
if(scale === 1){
running = false;
}
scale = scale || 1;
//reset ticks
ticks = 0;
//px - Canvas x
//py - canvas y
//x - real x
//y - imaginary y
var px, py, x, y;
//loop from y's, then loop all x's
for(px = 0; px < a; px+... | [
"function drawMandelbrotSet() {\n var coordinateLimits = {ReMax: globals.mReMax, ReMin: globals.mReMin, ImMax: globals.mImMax, ImMin: globals.mImMin};\n createFractalImage(globals.canvasM, coordinateLimits, mandelbrotIterationFunction, setColor);\n}",
"function drawMandelbrotSet(){\n var RE_MAX = 1.1;\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Gets if the provided structure is a VariableDeclarationStructure. | static isVariableDeclaration(structure) {
return structure.kind === StructureKind_1.StructureKind.VariableDeclaration;
} | [
"static isVariableStatement(structure) {\r\n return structure.kind === StructureKind_1.StructureKind.VariableStatement;\r\n }",
"function is_var_definition(stmt) {\r\n return is_tagged_object(stmt, \"var_definition\");\r\n}",
"function isVariable(obj) {\n return isTerm(obj) && obj.termType === _ty... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Given the options that are actually given to the program when invoked, this async function determines if the expected ones are given. | async function parseCommandLine(options) {
console.log("parseCommandLine:start");
console.log("...options="+options);
let expectedOptions = [
"csvfile0",
"dbfile0",
"dbtable0",
"cwd0",
"csvfile1",
"dbfile1",
"dbtable1",
"cwd1",
"csvfile... | [
"function checkForArguments(allOptions) {\n console.log(chalk.bgYellow.red('Executing Backendless Database Schema comparison tool...'));\n\n if (!allOptions['username']) {\n console.log(chalk.red('Missing argument username of developers account for Backendless'));\n process.exit(-2)\n } else ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Display the appropriate text and location when a user taps/clicks on a match | function displayText(match) {
hide(matchesList);
infoElement.textContent = '';
queryInfoElement.textContent = '';
const query = queryInput.value;
// add history entry for the query when the user has tapped/clicked a match
history.pushState({isSearchResults: true, query: query}, null,
`${window.location.... | [
"function displayText(match) {\n hide(creditElement);\n hide(infoElement);\n hide(matchesList);\n hide(queryInfoElement);\n // match.l is a citation within a play or poem,\n // e.g. Ham.3.3.2, Son.4.11, Ven.140\n // scene title matches only have act and scene number, e.g. Ham.3.3\n history.pushState({type: ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
The pass that decides which recognizers can start emitting and which are canceled. | doPass_() {
const now = Date.now();
// The "most ready" recognizer is the youngest in the "ready" set.
// Otherwise we wouldn't wait for it at all.
let readyIndex = -1;
for (let i = 0; i < this.recognizers_.length; i++) {
if (!this.ready_[i]) {
if (this.pending_[i] && this.pending_[i]... | [
"function Sequence$cancel(){\n cancel();\n transformation && transformation.cancel();\n while(it = nextHot()) it.cancel();\n }",
"startSilently() {\n this.outputNode.gain.value = 0;\n this.oscillators.forEach((o) => o.start());\n }",
"drop() {\n this.passes.clear();\n }",
"async... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Lewis note: I think I got it. Tried it in console and it seemed to work. Seems way too lengthy or is it okay? Return sum of the last element of both arrays passed in Eg. If first parameter is [1, 2, 3] and second parameter is [5, 6, 7] the function should return 10, because it's 3 +7 Another eg. [2, 4, 5] and [1, 5, 10... | function getSumOfBothLastElements(arrOne, arrTwo) {
const lengthofArrOne = arrOne.length
const lastItemofArrOne = arrOne[lengthofArrOne-1];
const lengthofArrTwo = arrTwo.length
const lastItemofArrTwo = arrTwo[lengthofArrTwo-1];
const sumOfLastElements = lastItemofArrOne+lastItemofArrTwo
return sumOfLast... | [
"function sumOfTheFirstAndLastElement(arr) {\n let firtsElement = Number(arr[0]);\n let lastElement = Number(arr[arr.length - 1]);\n let sumOfThe2Elements = firtsElement + lastElement;\n\n return sumOfThe2Elements;\n}",
"function arrayPlusArray(arr1, arr2) {\n var newValue = 0 //this is the new numbe... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Look feed object in case this is a json encoded atom feed. Place these underlying keys onto the root object. | function findfeed(key) {
if (key === 'feed') {
feedJustFound = true;
parser.removeListener('openobject', findfeed);
parser.removeListener('key', findfeed);
}
} | [
"function findfeed(key) {\n if (key === 'feed') {\n feedJustFound = true;\n parser.removeListener('openobject', findfeed);\n parser.removeListener('key', findfeed);\n }\n }",
"function getAtomFeed(feedRoot) {\n var _a;\n var childs = feedRoot.children;\n var feed = {\n type: ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
First index point is what room we are in 0: Outside tutorial 1: Inside tutorial 2: Center Second index point is what actor the player is interacting with. index point 0 will have a list of actors and will be referenced by the function looking for keywords index point 1 will have default actions if the player did not in... | function findKeyWords(){
checkThisText = submittedText.value.toLowerCase();
if(!decidedOnTutorial || !didStandUp){
checkCertainActions();
}else{
const actors = textOptions[roomIndex][0]
submittedText.value = "";
let actorIndex = null;
let actionIndex = null;
let tooMan... | [
"function checkForMatch(text) {\n console.log(\"checking for match\");\n //your code here\n var result = false;\n for(var i = 0; i < commands.length; i++) {\n if(text == commands[i].toLowerCase()) {\n result = scene.results[i];\n }\n }\n return result;\n}",
"_find_keyword (event) {\n let [... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Reseller.get_snapshot [PRODUCTION] [See on api.ovh.com]( | DetailOfASnapshot(serviceName, snapshotId) {
let url = `/hosting/reseller/${serviceName}/snapshot/${snapshotId}`;
return this.client.request('GET', url);
} | [
"async snapshot() {\n const suite = suites.get(this);\n const dispatch = new dispatch_1.Dispatch(suite);\n const request = { userAgent: \"self\", url: \"/snapshot\", body: {}, headers: {} };\n return dispatch.internalRequest(request)\n .then((response) => response.body.data);\... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Get the manifest for an sqlite database if available | function getSqliteFileManifest (backup) {
return new Promise(async (resolve, reject) => {
backup.openDatabase('Manifest.db', true)
.then(db => {
db.all('SELECT fileID, domain, relativePath as filename from FILES', async function (err, rows) {
if (err) reject(err)
resolve(rows)
... | [
"function getSqliteFileManifest (backup) {\n return new Promise(async (resolve, reject) => {\n backup.openDatabase('Manifest.db', true)\n .then(db => {\n db.all('SELECT fileID, domain, relativePath as filename, file from FILES', async function (err, rows) {\n if (err) reject(err)\n\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Determines whether the given object is a function | function isFunction(object) { return typeof object === 'function'; } | [
"function isFunction( obj ){\n return Object.prototype.toString.call( obj ) == \"[object Function]\";\n }",
"function isFunction( obj ){\n return Object.prototype.toString.call( obj ) === \"[object Function]\";\n }",
"function isFunction(object) {\n return typeof object === \"function\";\... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Function to remove active styles from every percentage button | removeCurrentActiveStyles() {
this.percentageBtns.forEach(b => b.classList.remove("active"));
} | [
"function removeActiveClasses() {\n for(let i=0;i<percentButtons.length;i++) {\n percentButtons[i].classList.remove(\"active\");\n }\n}",
"function cleanAllButtonsActiveClasses(){\n btns.forEach( (button) => button.classList.remove('active'));\n}",
"removeActiveFromAligns(name){\n for (var ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Function that gets statistics from mailgun for devices | function getMailgunDeviceStats() {
return new Promise((resolve, reject) => {
mailGunJS.get('/'+mailConfig.MAILGUN.domain+'/tags/' + mailConfig.MAILGUN.developerTag + '/stats/aggregates/devices', function (error, body) {
if (error) {
resolve(false)
} else {
resolve(body)
}
... | [
"function getMailgunDeviceStats(req, res) {\r\n statsService.mailgunDeviceStats().then((result) => {\r\n res.json(result)\r\n }).catch((err) => {\r\n res.json(err) \r\n })\r\n}",
"function getMailgunMailboxStats(req, res) {\r\n statsService.mailgunMailboxStats().then((result) => {\r\n res.json(r... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Callback to be invoked when GameWorld is ready for use. | function _onGameWorldReady (map) {
// Switch to PlayState
jaws.switchGameState(_gameData.states.play, {}, _gameData);
} | [
"function onWorldLoaded() {\n\n}",
"load(onWorldLoad) {\n log.notice(`************ World ${this.id} ***********`);\n\n this.map = new Map(this);\n this.map.isReady(() => {\n this.loadGroups();\n this.spawnChests();\n this.spawnEntities();\n\n log.notice('The map has been successfully ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |