query stringlengths 9 34k | document stringlengths 8 5.39M | negatives listlengths 19 20 | metadata dict |
|---|---|---|---|
Returns a unique index key for the roleaction pair. | _getIndexKey(role, action){
return role + '-' + action;
} | [
"static nodeKey(layer, nodeIndex) {\n return layer.name + '_ib-' + nodeIndex.toString();\n }",
"function buildCacheKey$g(recordId,relatedListRecordIds,formFactor,sections,actionTypes){{assert$1(recordId,\"A non-empty recordId must be provided\");assert$1(relatedListRecordIds.length,\"A non-empty related... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Level up, propagates to all units | levelUp() {
this.getActiveUnits().forEach(unit => {
unit.levelUp();
});
} | [
"levelUp(){\n this.max_health = this.base_health + (this.stamina * 10);\n this.level += 1;\n }",
"function levelUp(){\n\tLV += 1;\n\tupdateLVText();\n\tupdateXPText();\n\tupdateXPBar();\n\n\treqXP = reqXP + (reqXP/2);\n\tupdateReqXPText();\n\tunspentPoints += 5;\n\tupdateUnspentPointsText();\n\tc... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Function that checks nearby mines. Checking is done by comparing the id:s of the buttons with mines to the pressed buttons id. Mine on the left would have id one smaller than the buttons id, one on the right one greater. Mine on top of the button would have the first digit one smaller, or buttons id minus 10. | function nearbyMines(id){
var i = 0;
var numero = parseInt(id);
var temp = (numero-1).toString();
if(mines.includes(temp)){i++}
var temp = (numero+1).toString();
if(mines.includes(temp)){i++}
var temp = (numero-10).toString();
if(mines.includes(temp)){i++}
var temp = (numero+10).toString();
... | [
"function checkMines(x,y) {\n\tnumMines = 0;\n\tallPos2 = [];\n\tpos2 = [x,y];\n\tpos2[0] = Math.floor(pos2[0]);\n\tpos2[1] = Math.floor(pos2[1]);\n\tposit2 = pos2;\n\n\t// checks the square clicked and 8 surround squares for mines.\n\tfor (var iCM = -1; iCM < 2; iCM++) {\n\t\tposit2[0] = posit2[0] + iCM;\n\n\t\tfo... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Display the present and future weather | function showWeather() {
giveCity()
preForecast()
futureFore()
} | [
"function displayWeather( data ){\r\n $('#Weather').html(\r\n 'Right now it\\'s ' + Math.round(data.currently.temperature) + '° F'\r\n +'<br>The current possibility of precipitation is '+ data.currently.precipProbability*100\r\n +'%<br>The current conditions are ' + data.currently.ico... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
event listener function to throw away object reference, remove event listeners, and disable entry | function disableEntry(event) {
if (this.getAttribute("id") == "toRemove") {
this.removeEventListener("click", expandOrCollapse, false);
this.setAttribute("id", "");
if (instanceOf(obj, Match)) {
clearAll(chromeWindow, obj);
this.removeEventListener("click", highlightMat... | [
"function disableEntry(event) {\r\n if (this.getAttribute(\"id\") == \"toRemove\") {\r\n this.removeEventListener(\"click\", expandOrCollapse, false);\r\n this.setAttribute(\"id\", \"\");\r\n if (instanceOf(obj, Match)) {\r\n clearAll(chromeWindow, obj);\r\n this.removeEv... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
gets current largest chunk ID for each collection | function getMaxChunkIds(allKeys) {
var maxChunkIds = {};
allKeys.forEach(function (key) {
var keySegments = key.split(".");
// table.chunk.2317
if (keySegments.length === 3 && keySegments[1] === "chunk") {
var collection = keySegments[0];
var chunkId = parseInt(k... | [
"nextFreeId() {\n let prefix = this.parentImgContainer.parentClass.id + '_plh_';\n let maxNr = 0;\n for (let item of this.items) {\n let nr = Number(item.id.slice(prefix.length));\n if (nr > maxNr) {\n maxNr = nr;\n }\n };\n maxNr++;... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Computes cross product of A and B Only defined for A and B to 1D vectors of length at least 3 Only first 3 elements of A and B are used | function cross(A, B) {
if (A.shape.length !== 1 || B.shape.length !== 1) {
throw new Error('A or B is not 1D');
}
if (A.length < 3 || B.length < 3) {
throw new Error('A or B is less than 3 in length');
}
var a1 = A.getN(0);
var a2 = A.getN(1);
var a3 = A.getN(2);
var b1 =... | [
"function arr3_cross(cross, vA, vB) {\n cross[0] = vA[1]*vB[2] - vA[2]*vB[1];\n cross[1] = vA[2]*vB[0] - vA[0]*vB[2];\n cross[2] = vA[0]*vB[1] - vA[1]*vB[0];\n}",
"function crossProduct(A, B, C) {\n var ab = vec3.create();\n var ac = vec3.create();\n var crs = vec3.create();\n vec3.subtract(a... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Binds the firebase data to a field in the AngularJS scope. | function bindFirebase($scope, $firebaseObject, ref) {
var metroRef = ref.child("easy-nmc/metropolis/" + $scope.metropolis_id);
var parishIdRef = metroRef.child("/parish-id/" + $scope.parish_id);
parishIdRef.child("name").on("value", function(snap) {
$scope.parish_name = snap.val();
}, function(error) {
... | [
"bindData(fieldNode) {\n this._field = fieldNode;\n if (this._field) {\n this._field.addEventListener('field-value-changed', () => {\n this._updateValue();\n });\n\n this._updateValue();\n }\n }",
"function bindPersonId() {\r\n $scope.persoonId = $scope.person.persoonId;\r\n... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Exit a parse tree produced by Grammar19Parsera58. | exitA58(ctx) {
} | [
"exitParse(ctx) {\n\t}",
"exitA38(ctx) {\n\t}",
"exitNestedExpressionAtom(ctx) {\n\t}",
"exitBinaryExpressionAtom(ctx) {\n\t}",
"exitA39(ctx) {\n\t}",
"function translator_terminate()\n{\n this.parser.terminate();\n}",
"endParsing() {\n\n\t\t// Skip ending whitespace\n\t\tthis.skipWhitespace();\n\n\t\t... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
============================================================================== Sets the attack time, according to a slider in the GUI theSlider : the slider return the actual value of the attack time (in msec) | setAttackTimeFromGui( theSlider )
{
/// the value of the fader
const valueFader = parseFloat( theSlider.value );
// get the bounds of the fader (GUI)
const minFader = parseFloat( theSlider.min );
const maxFader = parseFloat( theSlider.max );
// get t... | [
"setAttackTimeFromGui( theSlider )\n {\n /// the value of the fader\n const valueFader = parseFloat( theSlider.value );\n \n // get the bounds of the fader (GUI)\n const minFader = parseFloat( theSlider.min );\n const maxFader = parseFloat( theSlider.max );\n \n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Gets the command dispatcher instance associated with this container's DOM. If there are no items displayed in this container, null is returned. | get _commandDispatcher() {
if (this._cachedCommandDispatcher) {
return this._cachedCommandDispatcher;
}
let someElement = this._widget.getItemAtIndex(0);
if (someElement) {
let commandDispatcher = someElement.ownerDocument.commandDispatcher;
return this._cachedCommandDispatcher = comma... | [
"get() {\n return dispatcher;\n }",
"get dispatcher() {\n return this._dispatcher;\n }",
"getDispatcher(componentName)\n {\n return this.container_.getDispatcher(componentName);\n }",
"get dispatcher() {\n return this.mDispatcher;\n }",
"get _focusedEl... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Given a dataset, populate patient information attributes for visible | function populatePatientInformation(data) {
visible.patientFirstName = data.patientFirstName;
visible.patientLastName = data.patientLastName;
visible.patientAge = data.patientAge;
visible.patientGender = data.patientGender;
visible.nihiiOrg = data.nihiiOrg;
} | [
"function populatePatientInformation(dataset) {\r\n var data = DATASETS[dataset];\r\n visible.patientFirstName = data.patientFirstName;\r\n visible.patientLastName = data.patientLastName;\r\n visible.patientAge = data.patientAge;\r\n visible.patientGender = data.patientGender;\r\n... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
======== 013a: DRAW INTRO ========= // nonlinear narrative | function drawIntro() {
// 015 creamos el botón exactamente donde se sitúa el texto y lo ponemos más arriba (se sitúa debajo del punto 014)
fill(255, 0, 0);
ellipse(startCenterX, startCenterY, startButtonSize, startButtonSize);
// 014 especificaciones de la pantalla intro
fill(255);
noStroke();
text("Woul... | [
"function C006_Isolation_Intro_Run() {\n\t\n\t// Paints the background\n\tDrawImage(CurrentChapter + \"/\" + CurrentScreen + \"/Background.jpg\", 0, 0);\n\tDrawPlayerTransition();\n\n\t// Write the chapter introduction\n\tDrawText(GetText(\"Intro1\"), 450, 150, \"White\");\n\tif ((TextPhase >= 1) && (C006_Isolation... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Adds all of our default dust helpers to the dust object | function add_default_dust_helpers() {
this.add_dust_helpers({
url : dust_url.bind(null, this.options),
counter : dust_counter
});
} | [
"function add_dust_helpers(helpers) {\n\t_.each(helpers, function(v, k) {\n\t\tdust.helpers[k] = v;\n\t});\n}",
"function _registerHelpers() {\n Handlebars.registerHelper('json', (value) => {\n if (value === undefined || value === null) {\n return new Handlebars.SafeString(null);\n } else if (_notAJso... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Return a string representing the value of BigNumber n in fixedpoint or exponential notation rounded to the specified decimal places or significant digits. n: a BigNumber. i: the index of the last digit required (i.e. the digit that may be rounded up). rm: the rounding mode. id: 1 (toExponential) or 2 (toPrecision). | function format(n, i, rm, id) {
var c0, e, ne, len, str;
if (rm == null) rm = ROUNDING_MODE;else intCheck(rm, 0, 8);
if (!n.c) return n.toString();
c0 = n.c[0];
ne = n.e;
if (i == null) {
str = coeffToString(n.c);
str = id == 1 || id == 2 && (ne <= TO_EXP_NEG || ne >... | [
"function format(n, i, rm, id) {\n var c0, e, ne, len, str;\n if (rm == null) rm = ROUNDING_MODE;else intCheck(rm, 0, 8);\n if (!n.c) return n.toString();\n c0 = n.c[0];\n ne = n.e;\n\n if (i == null) {\n str = coeffToString(n.c);\n str = i... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
clear google map history markers | function clearHistoryMarkers() {
for(key in historyMarkers) {
$.each( historyMarkers[key] , function( i, marker ) {
marker.setMap(null);
});
}
map.controls[google.maps.ControlPosition.TOP_RIGHT].clear();
} | [
"function clear() {\n for (var i = 0; i < markers.length; i++) {\n markers[i].setMap(null);\n }\n markers = [];\n myplaces = [];\n count = 0;\n }",
"cleanMap() {\n this.savedMarker.forEach(marker => {\n marker.setMap(null... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
import deprecated components from 'umi' | function importDeprecatedComponent(j, root) {
let hasChanged = false;
// import { connect } from 'dva';
// import { injectIntl } from 'react-intl';
root
.find(j.Identifier)
.filter((path) => {
return (
deprecatedComponentNames.includes(path.node.name) &&
path.par... | [
"function deprecatedSince1811() {\n angular__WEBPACK_IMPORTED_MODULE_0__[\"module\"]('permissionServiceInterfaceModule', ['legacySmarteditCommonsModule']);\n angular__WEBPACK_IMPORTED_MODULE_0__[\"module\"]('FetchDataHandlerInterfaceModule', ['genericEditorServicesModule']);\n angular__WEBPACK_IMPORTED_MOD... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Create a new instance of ModSet with the same mods | copy() {
return new ModSet(this.mods());
} | [
"replaceSlots(slots, modSet) {\n for (let slot of slots) {\n this[slot] = modSet[slot];\n }\n\n return this;\n }",
"clone() {\n return new PowerSet(this.pSet);\n }",
"function Set_clone() {\n 'use strict';\n var i, clonedSet = new Set();\n for (i = 0; i < this.s.length; i += 1) {\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Find the name of the unoccupied seat that is closest to the given Point. This returns null if no seat is available at this table. | function findClosestUnoccupiedSeat(node, pt) {
if (isPerson(node)) { // refer to the person's table instead
node = node.diagram.findNodeForKey(node.data.table);
if (node === null) {
return;
}
}
var guests = node.data.guests;
var closestseatname = null;
var closestseatdist = Inf... | [
"function getNextClosestPoint() {\n var shortestDistance = -1;\n var locatedPoint = \"none\";\n // Find the cloest point that hasn't been checked off (confirmed not shortest path)\n for (var name in pointsChecklist) {\n //console.log(\"Searching index \" + index);\n if (pointsChecklist[name].n... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
The breadcrumb is an array of parents include the document itself. It only gets added to the document there are actual parents. | function addBreadcrumbData(url, document) {
const parents = [];
const split = url.split("/");
let parentURL;
// If the URL was something like `/en-US/docs/Foo/Bar` when you split
// that, the array becomes `['', 'en-US', 'docs', 'Foo', 'Bar']`
// And as length, that's `[1, 2, 3, 4, 5]`. Therefore, there's n... | [
"getBreadcrumbParentPart() {\n let breadcrumb = [];\n let parent_links = this.getParentPaths(this.$route.name, this.$route.path);\n\n for(let item in parent_links) {\n let parent_link = parent_links[item];\n let name = parent_link.ur... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
recursive method extract the raw node | function getRawNode(node,position) {
if(__.isArr(node)) {
var pos = !position ? 0 : node.length-1;
return getRawNode(node[position],pos);
} else {
return node;
}
} | [
"getNode() {\n return null;\n }",
"getNativeNode() {}",
"function ExampleFlatNode() { }",
"function getNodeValue(obj,tag){\n return obj.getElementsByTagName(tag)[0].firstChild.nodeValue\n }",
"getNodeAtIndex(index) {}",
"_decodeNode() {\n\n // if the most significant... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
normalize the given object to a function if the input is undefined, then a passthru function is generated. if the input is a scalar, then a function returns that scalar. if the input is an object, then a function receives a key and returns the property value if it exists, otherwise return the key (passthru). | function normalize(obj) {
var result = obj;
if (typeof obj !== "function") {
if (typeof obj !== "undefined") {
if (typeof obj !== "object") {
result = (function(value) { return function() { return value; }; })(obj);
} else {
result = (function(o) { return function(key) {
if... | [
"function objectToFunc (obj) {\n var match = {}\n\n for (var key in obj) {\n match[key] = typeof obj[key] === 'string'\n ? defaultToFunc(obj[key])\n : toFuncton(obj[key])\n }\n return function (val) {\n if (typeof val !== 'object') return false\n for (var key in match) {\n if (!(key in v... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Generic card image object | function Img(container, ext, name, nb) {
var alt = '['+ext+']'+name ;
if ( isn(nb) )
alt += ' ('+nb+')' ;
var img = create_img('', '['+ext+']'+name, name) ;
img.cardname = alt ;
img.width = img_width ;
img.classList.add('card') ;
img.addEventListener('contextmenu', function(ev) {
window.open('http://magiccar... | [
"function CardObject(imgSrc, value) {\n this.imgSrc = imgSrc;\n this.value = value;\n}",
"function newCardImage(card,id)\r\n{\r\n\tvar c = new Image();\r\n\tvar src = fnCard(card);\r\n\tc.src = src;\r\n\tc.id = id;\r\n\tc.className = 'card';\r\n\treturn c;\r\n}",
"function MemoryCard(image) {\n\n this.im... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Detect calls to functions with the incorrect number of parameters | diagnosticDetectFunctionCallsWithWrongParamCount(file, callableContainersByLowerName) {
//validate all function calls
for (let expCall of file.functionCalls) {
let callableContainersWithThisName = callableContainersByLowerName.get(expCall.name.toLowerCase());
//use the first item... | [
"diagnosticDetectFunctionCallsWithWrongParamCount(file, callableContainersByLowerName) {\n //validate all function calls\n for (let expCall of file.functionCalls) {\n let callableContainersWithThisName = callableContainersByLowerName.get(expCall.name.toLowerCase());\n //use the f... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
get index of nearest point in pointlist next to vec2 mp check only every stepsize point | function getNIdx (mp, points, stepsize) {
var i, dist, nIdx;
var min = Infinity;
for (i=0; i < 8; i+=stepsize) {
dist = vec2.dist(mp, points[i]);
if (dist < min) {
min = dist;
nIdx = i;
}
}
return nIdx;
} | [
"static nearestPt(pts, pt) {\n let _near = Number.MAX_VALUE;\n let _item = -1;\n for (let i = 0, len = pts.length; i < len; i++) {\n let d = pts[i].$subtract(pt).magnitudeSq();\n if (d < _near) {\n _near = d;\n _item = i;\n }\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Callback for when a mouseup event occurs anywhere. Triggers the 'revisionSelected' event with the new revisions. Removes event handlers used during the drag operation. Args: ev (Event): The mouseup event. | _onHandleMouseUp(ev) {
console.assert(this._mouseActive);
ev.stopPropagation();
ev.preventDefault();
this._mouseActive = false;
this._activeHandle = null;
document.removeEventListener('mouseup', this._onHandleMouseUp, true);
document.removeEventListener('mousem... | [
"function mouseUpHandler(event)\n {\n $(document).stopObserving('mouseup', mouseUpHandler);\n if (selectionInterval != null)\n {\n clearInterval(selectionInterval);\n selectionInterval = null;\n }\n\n setSelectionPos(selecti... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
FUNCION QUE DEVUELVE EL NOMBRE DEL ICONO DE ACUERDO AL ARCHIVO | function verifExtensionArchIcono(extension) {
var data = {
icono: "fa fa-file",
color: "#95A5A6",
descripcion: "Archivo"
};
var archivos = {
jpg: "fa fa-file-image&#F1C40F&Imagen",
jpeg: "fa fa-file-image&#F1C40F&Imagen",
png: "fa fa-file-image&#F1C40F&Imagen"... | [
"function solicitar_archivos_thumnail(idFalla){\n // Se modifica el estado del thumnail durante la carga\n $(\"#imagenThumb\").attr(\"src\",\"app/views/res/generandoArchivos.svg\");\n window.nameSpaceCgi.transformarNubePtos(idFalla);\n }",
"function pegarArchivo() {\n try{\n if... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
print items from local storage | function printFromStorage() {
// get array from local storage
let itemsLS = getFromStorage();
// for every item in array
itemsLS.forEach(function(item) {
// create item in cart
const row = document.createElement('tr');
row.innerHTML = `
<td>
<img src="${item.image}">
</td>
<td>
${item.title... | [
"function displayItemsFromLocalStorage() {\n let items = getItemsFromLocalStorage();\n items.forEach(function (item) {\n addItemToDom(item);\n });\n}",
"print() {\n console.log(`Storage for ${this.getDomain()}`);\n const keys = Object.keys(localStorage);\n for (l... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Callback to change customer password | function on_customer_password(username) {
console.debug("Changing password for: " + username);
} | [
"changeUserPassword (callback) {\n\t\tconst passwordData = {\n\t\t\texistingPassword: this.data.password,\n\t\t\tnewPassword: RandomString.generate(12)\n\t\t};\n\t\tthis.data.password = passwordData.newPassword; // use this for the login request\n\t\tthis.doApiRequest(\n\t\t\t{\n\t\t\t\tmethod: 'put',\n\t\t\t\tpat... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Deletes a transaction from the database with a given id, then reloads transactions from the db | function deleteTransaction(id) {
transaction.deleteTransaction(id)
.then(res => loadTransactions())
.catch(err => console.log(err));
} | [
"static removeTransaction(id) {\n const transactions = Store.getTransations();\n\n transactions.forEach((transaction, index) => {\n if (transaction.id === id) {\n transactions.splice(index, 1);\n }\n });\n localStorage.setItem(\"transactions\", JSON.stringify(transactions));\n }",
"f... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Doubles p, h1, h2, h6 tags text, and also reverts it | function doubleTextSize(){
var x = document.querySelectorAll('p, h1, h2, h3, h4, h5, h6');
var text = "";
var style1 = "";
var size = "";
var i;
//If they are not doubled in size make them double in size.
if(!switched)
{
for(i = 0; i < x.length; i++)
{
text = x[i];
st... | [
"function format_html_output() {\r\n var text = String(this);\r\n text = text.tidy_xhtml();\r\n\r\n if (Prototype.Browser.WebKit) {\r\n text = text.replace(/(<div>)+/g, \"\\n\");\r\n text = text.replace(/(<\\/div>)+/g, \"\");\r\n\r\n text = text.replace(/<p>\\s*<\\/p>/g, \"\");\r\n\r\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Returns true if both chat items are acknowledgeable, have no acknowledgments, and were created within 60 seconds of eachother | isContiguousWith(chatItem) {
if (chatItem instanceof AcknowledgableChatItem_1.AcknowledgableChatItem && this instanceof AcknowledgableChatItem_1.AcknowledgableChatItem) {
if (chatItem.acknowledgments.length > 0 || this.acknowledgments.length > 0)
return false;
const { dat... | [
"function userShouldReceiveFollowupMessage(user) {\n const followUpAppointment = user.follow_up_date;\n if (followUpAppointment && new Date(followUpAppointment).valueOf() < Date.now()) {\n return true;\n }\n return false;\n}",
"_areGatherableActivities(a, b) {\n let delta = new Date(a.eventDate) - new D... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Function loadDate() inserts the current year, month, and day into the Year of Census, Month of Census, and Day of Census fields. | function loadDate() {
var date = new Date();
year = date.getFullYear();
month = date.getMonth();
month = month + 1;
day = date.getDate();
/*
document.getElementById('yearofmd').value = year;
document.getElementById('monthofmd').value = month;
document.getElementById('dayof... | [
"function checkyearofcensus() {\r\n \r\n loadDate();\r\n\r\n}",
"function loadStartDates() {\r\n\t\tthis.eng_start_year = 1943;\r\n\t\tthis.eng_start_month = 4;\r\n\t\tthis.eng_start_date = 14;\r\n\r\n\t\tthis.nep_start_year = 2000;\r\n\t\tthis.nep_start_month = 1;\r\n\t\tthis.nep_start_date = 1;\r\n\r\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
the picture should be covered with same image when you hover on the picture ,it flip to uncovered the picture in the back click on it to see the hidden image hover on another one and click on it if it's a match , the picure in the back disapear and the front one stay on both side now you know where's the other image cl... | function game(){
//create a counter to count the clicks of the matched clicks
var counter=0
//create an accumulator to push the source of the image clicked
var arr =[]
//on event click i will target the images and push their source into the accumulator
$(".p").click(function(){
arr.push(this.src)
//console.lo... | [
"function checkImg()\n{\n\tif (item.firstImage.src == item.secondImage.src){\n\t\titem.pairsFlipped++;\n\t\t//alert(\"Same images! Num of pairs flipped: \" + item.pairsFlipped);\n\t\t//remove midlayer images\n\t\tsetTimeout (function () {\n\t\t\titem.firstImage.src = \"\";\n\t\t\titem.secondImage.src = \"\";\n\t\t}... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Copyright (c) Microsoft Corporation. Licensed under the MIT license. Generate SasIPRange format string. For example: "8.8.8.8" or "1.1.1.1255.255.255.255" | function ipRangeToString(ipRange) {
return ipRange.end ? `${ipRange.start}-${ipRange.end}` : ipRange.start;
} | [
"function ipRangeToString(ipRange) {\n return ipRange.end ? ipRange.start + \"-\" + ipRange.end : ipRange.start;\n}",
"generate_ip_range(range) {\n var result = [];\n\n // split range and determine prefix and range\n var pos = range.lastIndexOf(\".\");\n var prefix = range.substr(0, pos);\n var ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
The RecorderController is responsible for toggling the recording in the content process and getting the data. It also manages a list of past recordings and allows to get them as stringified json for exporting. | function RecorderController(toolbox) {
this.mm = toolbox.target.tab.linkedBrowser.messageManager;
this.mm.loadFrameScript(FRAME_SCRIPT_URL, false);
this.onRecord = this.onRecord.bind(this);
this.mm.addMessageListener("PageRecorder:OnChange", this.onRecord);
this.sessions = [];
} | [
"onRecording() {\n recorder.start();\n }",
"startRecording() {\n\n\t\tconst onDataAvailable = blob => {\n\t\t\tconsole.info(\"New record available\", blob)\n\n\t\t\t// = GET URL = const url = URL.createObjectURL(blob)\n\n\t\t\t// Save file\n\t\t\tsaveAs(blob, new Date().getTime() + \".webm\")\n\t\t}\... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
replace_const_with_let, isNoConstAssignMessage, has_const_reassignment, & generate_const_reassignment_error directly based on rewire/lib/moduleEnv.js | function replace_const_with_let(src) {
// This is a poor man's version of a parser:
// we want to replace all `const` declarations
// with `let`, in order to be able to __set__ them.
// This method with a regex is not perfect, but works well enough,
// although it doesn't cover one use case: the reassignment of a
... | [
"function constant () {\n const say = \"Hello\";\n say = \"World\"; // throws TypeError \"Assignment to constant variable\"\n}",
"function constFun() {\n const a = 'temp';\n // a = 'notTemp' you cannot reassign constant variable!\n console.log(a)\n}",
"_optimizeConstants(start, end) {\n let n =... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
update photo by id | update(req, res) {
Photo.findByIdAndUpdate(req.params.id, req.body).then(result => {
res.json(result);
})
.catch(err => {
res.json(err);
});
} | [
"function updatePhoto(id, updates) {\n return photodb('photos').where({ id }).update(updates);\n}",
"async function replacePhotoById(id, photo) {\r\n photo = extractValidFields(photo, PhotoSchema);\r\n const [ result ] = await mysqlPool.query(\r\n 'UPDATE photos SET ? WHERE id = ?',\r\n [ photo, id ]\r\n... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Start Intro Video on call | function playVidintroVideo (event) {
vidIntroVideo.play();
} | [
"function PlayExpandedIntroVideo () {\r\ncreative.dom.video1.vid.play();\r\ncreative.dom.video1.vid.currentTime = 0;\r\n}",
"function startIntro() {\n\ttour.init();\n\ttour.restart();\n\ttour.goTo(0);\n}",
"async playIntro() {\n this.intro = new Intro();\n await this.intro.play();\n this.buildGameCompo... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Handle learn more section animation | function animateLearnMore() {
const learnMoreOffsetHeight = document.getElementById('more-info').offsetTop
if (window.pageYOffset + window.innerHeight <= learnMoreOffsetHeight) { return }
const buttons = document.querySelectorAll('.learn-more-link a')
const animations = ['animated', 'bounceIn', 'slow']
... | [
"function learnMore(){\n\t\thideButton3();\n\t\t$(\"#learn-more-text\").slideDown();\n\t}",
"notifyLearnMoreClicked() {}",
"function readMore() {\n\t$('.update-text').readmore({\n\t\tmaxHeight: 190,\n\t\tmoreLink: '<a href=\"#\">'+ReadMore+'</a>',\n\t\tlessLink: false,\n\t\tsectionCSS: 'display: block; width: 1... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
event listeners added to tray icon so that it can toggle the visibility of the main window bounds are of 2 types a)the coordinates eg click events and b) for windows for eg: ydirection windows bounds = height xdirection windows bounds = width | onClick(e, bounds) {
console.log(bounds.x, bounds.y);
//click event bounds
const { x, y } = bounds;
//window height and width
const { height, width } = this.mainWindow.getBounds();
if (this.mainWindow.isVisible()) {
this.mainWindow.hide();
} else {
... | [
"function taskbar_on_window_click(e)\n{\n\tif(this.classList.contains(\"aktive\"))\n\t{\n\t\ttoggle_min(this.target);\n\t}else if(this.classList.contains(\"minimized\"))\n\t{\n\t\ttoggle_min(this.target);\n\t}\n\tset_window_on_top(this.target);\n}",
"function clicked (e, bounds) {\n // checks for alt,shift,c... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
read basket Id from cookies | readbasketId(){
var basketId = VueCookie.get('basketId');
if (basketId == null) {
basketId = randString(20);
VueCookie.set('basketId',basketId, 300);
}
this.commit('basket/setBasketId', basketId);
this.dispatch('basket/readBasket');
} | [
"function getIdFromCookies() {\n var cookiesString = document.cookie;\n var cookie = cookiesString.split(';');\n var pos = cookie[0].indexOf('=');\n return cookie[0].slice(pos + 1);\n }",
"function readIdCookie() {\n\t\tvar nameEQ = \"JATOS_IDS=\";\n\t\tvar ca = document.cookie.spli... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Ensures the incoming response follows the expected schema and parses for a JSON RPC payload ID. | function standardizeResponse(requestPayload, event) {
var _a;
var id = (_a = event.data.response) === null || _a === void 0 ? void 0 : _a.id;
var requestPayloadResolved = getRequestPayloadFromBatch(requestPayload, id);
if (id && requestPayloadResolved) {
// Build a standardized response object
... | [
"function standardizeResponse(requestPayload, event) {\n var _a;\n var id = (_a = event.data.response) === null || _a === void 0 ? void 0 : _a.id;\n var requestPayloadResolved = getRequestPayloadFromBatch(requestPayload, id);\n if (id && requestPayloadResolved) {\n // Build a standardized respons... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
getMoreData Fetches more data from the API Server. | function getMoreData() {
//so long as we are getting listings, continue...
if (response.features.length > 0) {
let percent = (lastFID / 15000) * 100;
percent = Math.floor(percent);
if (percent > 100) {
percent = 100;
}
document.getElementById('loaderText').textContent = "Loading " + perce... | [
"function getMore() {\n self.filter.page_num += 1;\n self.filter.page_size = page_size;\n self.dataReceived = false;\n plaintiffMailingListHelper.getListData(self.filter)\n .then(function (response) {\n\n _.forEach(response[1].data, funct... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Create an impulse in a buffer of length sampleFrameLength | function createImpulseBuffer(context, sampleFrameLength) {
var audioBuffer = context.createBuffer(1, sampleFrameLength, context.sampleRate);
var n = audioBuffer.length;
var dataL = audioBuffer.getChannelData(0);
for (var k = 0; k < n; ++k) {
dataL[k] = 0;
}
dataL[0] = 1;
return aud... | [
"function createImpulseBuffer(context, sampleFrameLength) {\n let audioBuffer =\n context.createBuffer(1, sampleFrameLength, context.sampleRate);\n let n = audioBuffer.length;\n let dataL = audioBuffer.getChannelData(0);\n\n for (let k = 0; k < n; ++k) {\n dataL[k] = 0;\n }\n dataL[0] = 1;\n\n return... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Gets if the provided structure is a ShorthandPropertyAssignmentStructure. | static isShorthandPropertyAssignment(structure) {
return structure.kind === StructureKind_1.StructureKind.ShorthandPropertyAssignment;
} | [
"static isPropertyAssignment(structure) {\r\n return structure.kind === StructureKind_1.StructureKind.PropertyAssignment;\r\n }",
"static isSpreadAssignment(structure) {\r\n return structure.kind === StructureKind_1.StructureKind.SpreadAssignment;\r\n }",
"static isShorthandPropertyAssignmen... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Constructs a new Fiber ID using current time and global increment | function newFiberId() {
return FiberID(new Date().getTime(), _fiberCounter.getAndIncrement());
} | [
"function newID() {\n return (Date.now() + ( (Math.random()*100000).toFixed()));\n}",
"function _getNewID(){\n \n // Rendiamo il nostro id univoco\n var now = new Date().getTime();\n \n return signature + now;\n \n }",
"function generateIdNumber() {\n var date = ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
creating base constructor function Alert's prototype is Object | function Alert(title) {
console.log(" [ Alert ] - constructor function");
this.title = title || "Default Alert";
} | [
"function SuperObject(obj){\n\n}",
"function AlertDialog() {\n\t\tthis.core = new AlertDialogCore(this);\n\t}",
"constructor(destroyCB) {\n super();\n this.isAlertVisible = false;\n this.message = '';\n //! type of alert - success, warning or error (required)\n this._type = ''... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Generate a Set of truly Random DecimalNumbers with precision from a REST call to random.or which uses the atmospheric noise | function GetRandomDecimal(numberSamples, precision, key, callback) {
key = key || module.exports.key;
this.request_id = this.request_id || 1 ;
this.request_id++;
var post_data =
{
"jsonrpc": "2.0",
"method": "generateDecimalFractions",
"params": {
"apiKey": key... | [
"function generateDecimalRandom(max, min){\n return parseFloat((Math.random() * (max-min) + min)).toFixed(2);\n }",
"function decimalRand(min, max, decimals) {\n // Set multiplier\n let mult = '1';\n for (let i = 0; i < decimals; i++) {\n mult += '0';\n }\n mult = parseInt(mult);... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Get the path of the currently executing workflow. | async function getWorkflowPath() {
const repo_nwo = getRequiredEnvParam("GITHUB_REPOSITORY").split("/");
const owner = repo_nwo[0];
const repo = repo_nwo[1];
const run_id = Number(getRequiredEnvParam("GITHUB_RUN_ID"));
const apiClient = api.getActionsApiClient();
const runsResponse = await apiCl... | [
"async function getWorkflowPath() {\n if (util_1.isLocalRun()) {\n return getRequiredEnvParam(\"WORKFLOW_PATH\");\n }\n const repo_nwo = getRequiredEnvParam(\"GITHUB_REPOSITORY\").split(\"/\");\n const owner = repo_nwo[0];\n const repo = repo_nwo[1];\n const run_id = Number(getRequiredEnvPa... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Function: getCountriesAsHtml Paramaters: cntry(String) Returns: String of HTML () | function getCountriesAsHtml(cntry) {
return `<li>I have been to ${cntry}</li>`;
} | [
"function htmlCountryList() {\n if (typeof covidData !== \"undefined\") {\n let htmlCountryString = `<datalist id=\"countryList\">`\n for (let i = 0; i < covidData.length; i++) {\n htmlCountryString += `<option value=\"${covidData[i][1].location}\"></option>`\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Calls the 'algorithm' to get position for each users canvas based on the script of the canvas. | function calculateCanvasImagePositions(response, canvas) {
// BEGIN CALLBACK //
//Get the positions for each user.
var pos = algorithm1.getPositionJSON(canvas.usersInfo, canvas.script, canvas.portrait, canvas);
// console.log("Positions determined:::\n\t" + JSON.stringify(pos, 0, 4));
//Create the html file using... | [
"function getPositions() {\n displayPositions();\n}",
"mousePosition() {\n for (let i = 0; i < this.tracks.length; i++) {\n this.tracks[i].mousePosition();\n }\n }",
"function update_canvas_offsets(){\n // Set initial svg canvas offset\n var container = getById('svg_container');\n var to... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
this is the function which i have listed in the html file for fetching the dataset using the dataframe.js library | function fetch(){
let DataFrame = dfjs.DataFrame;
var vals = document.getElementById("datasets");
currentLoadedData = vals.options[vals.selectedIndex].value;
DataFrame.fromCSV(currentLoadedData).then(df =>
{
data = df.toJSON('HousingJSON.json');
datasetToDisplay = data;
verticalSelecti... | [
"function getAnonAndSourceDataset(){\n \n $(\"#spinner\").show();\n $.ajax({\n url: \"http://localhost/action/checkdatasetsexistence\",\n type: \"POST\",\n success : function(result) {\n \n if(result.algorithm == \"clustering\" || result.diskData == \"true\"){\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Implements the PouchDB API for dealing with CouchDB instances over HTTP | function HttpPouch(opts, callback) {
// The functions that will be publicly available for HttpPouch
var api = this;
// Parse the URI given by opts.name into an easy-to-use object
var getHostFun = getHost;
// TODO: this seems to only be used by yarong for the Thali project.
// Verify whether or not it's st... | [
"function HttpPouch(opts, callback) {\n\n // Parse the URI given by opts.name into an easy-to-use object\n var host = getHost(opts.name, opts);\n\n // Generate the database URL based on the host\n var db_url = genDBUrl(host, '');\n\n // The functions that will be publically available for HttpPouch\n var api =... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Return an object with the count of all brick types that we need counts of (just normal breakable bricks and diamonds) | function countBricks () {
var brickIds = Crafty("Brick");
counts = {normals: 0, diamonds: 0};
for (var i = 0; i < brickIds.length; i++) {
if (brickIsNormal(Crafty(brickIds[i]).type)) {
counts.normals++;
}
if (brickIsDiamond(Crafty(brickIds[i]).type)) {
counts.diamonds++;
}
}
retu... | [
"getCount(category) {\n let count = [];\n let types = this.getAllPossible(category);\n let slot = this.getCategoryNumber(category);\n\n types.forEach(() => {\n count.push(0);\n });\n\n mushroom.data.forEach((mushroom) => {\n types.forEach((type, index)... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Write bill info to the bill info window and show highlighted text | function writeBillInfo(d, baseText) {
var highlightString = makeHighlightHTML(baseText, d.docAstart, d.docAend, d.textA, d.textB);
var highlight = baseText;
highlight = highlight.slice(0,d.docAstart) + "<span style='background-color: " + highlightColor + "'>" + /*highlight.slice(d.docAstart,d.docAend)*/high... | [
"function showInfo(text) {\n var infoPanel = myDocker.addPanel('Info Panel', wcDocker.DOCK.MODAL, null);\n infoPanel.layout().$table.find('span').text(text);\n }",
"function addBillInfo(data = {}) {\n\t$('#billId').innerText = '#129736';\n\t[...$$('p[name=\"bill-phone\"]')].forEach((elem) => {\n\t\te... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Realiza el desplazamiento por direccion: direccion:Integer, es la direccion a desplazar, 0 a la izquierda, 1 a la derecha | function index_desplazamiento_direccion(direccion) {
clearTimeout(index_galeria_timer);
var padre = $(".galeria");
var hijos = padre.find(".desplazamiento .bloque").length;
var posActual = parseInt(padre.find(".desplazamiento").attr("data-pos"));
var posSiguiente = posActual;
direccion = parseInt(direccion);
i... | [
"function direccionaSerp(){\nif(direccion==1){\nserpF[0]=serpF[0]-1//movimiento hacia arriba\n}else if(direccion==2){\nserpC[0]=serpC[0]+1//movimiento hacia derecha\n}else if(direccion==3){\nserpF[0]=serpF[0]+1//movimiento hacia abajo\n}else{\nserpC[0]=serpC[0]-1//movimiento hacia izquierda\n}\n}",
"function dese... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Select one layer. Native JS is broken if multiple layers are already selected. If passed a number, select by index. Potential DOM FIX | function selectOneLayer(doc, layer)
{
var desc = new ActionDescriptor();
var ref = new ActionReference();
app.activeDocument = doc;
if (typeof layer === "number") {
// Add offset; see TLayerElement::Make
var offset = hasBackgroundLayer() ? 0 : 1;
ref.putIndex( classLayer, layer + offset );
}
else
{
if (... | [
"select_neuron(layer, index) {\n this.selected_layer = parseInt(layer, 10);\n this.selected_index = parseInt(index, 10);\n this.paint();\n }",
"function makeLayerActiveByIndex(index) {\n selectLayersByIndexes([index]);\n}",
"function select(layer) {\n layer.select_byExtendingSelection(true, true)\... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Validate Creating a cart | create(data) {
return new Promise((resolve, reject) => {
joi.validate(data, lib.Schemas.cart.cart, (err, value) => {
if (err) {
return reject(new Errors.ValidationError(err))
}
return resolve(value)
})
})
} | [
"function checkCart(form)\n{\n\tvar validationMsg = \"\";\n\tcalcTotal( form );\n\t\n\tif( total <= 0 )\n\t{\n\t\tvalidationMsg += \"Error: You did not select any items to purchase!\";\n\t}\n\treturn validationMsg;\n}",
"create(data) {\n return new Promise((resolve, reject) => {\n joi.validate(data, lib.S... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Al ingresar un valor de input, mapea segun la funcion de pertenencia el valor resultante. max_member_value > valor en el cual la pertenencia es maxima (1) left_range > desde el valor del punto de pertenencia maxima, cuantas unidades a la izquierda son necesarias para que el valor de pertenencia llegue a 0. Si este valo... | function get_membership_value(input_value, max_member_value, left_range = 0, right_range = 0, min_f_value = 0, max_f_value = Number.POSITIVE_INFINITY){
let y = 0
// las funciones pueden tener mas de un peak
if (typeof max_member_value != "number") {
const max_array = [...max_member_value]
co... | [
"_getValuesMinMax(valueMin,valueMax) {\n var hasMin = (valueMin != null && valueMin >= this.min && valueMin <= this.max);\n var hasMax = (valueMax != null && valueMax >= this.min && valueMax <= this.max);\n\n if(!hasMin && !hasMax) { return [this.valueMin,this.valueMax]; }\n\n var valueNowMin = ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Create a function filterRange (arr, a, b) that takes an array of numbers arr and returns a new array that contains only numbers from the arr range from a to b. The function should not change the arr. | function filterRange(arr, a, b) {
const newArr = arr.filter(item => item >= a && item <= b);
return newArr;
} | [
"function filterRange(arr, a, b){\r\n const newArr = [];\r\n for(let i = 0; i < arr.length; ++i){\r\n if(arr[i] >= a && arr[i] <= b) newArr.push(arr[i]);\r\n }\r\n return newArr;\r\n}",
"function filterRange(arr, a, b) {\n return arr.filter(range => (a <= range && range <= b));\n}",
"function filterRang... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Process each model, returning an object keyed by model name, whose values are simplified descriptors for models. | function processModels(swagger, options) {
var name, model, i, property;
var models = {};
for (name in swagger.definitions) {
model = swagger.definitions[name];
var parents = null;
var properties = null;
var requiredProperties = null;
var additionalPropertiesType = false;
var example = mod... | [
"function genModel( model ) {\n let dest = Object.assign({}, model);\n for (var clz in dest.classes) {\n dest.classes[clz] = updateClass( dest.classes[clz])\n }\n return dest;\n}",
"normalize(body, modelName) {\n // sometimes mirage doesn't include a modelName, so we extrapolate it from\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
API test for 'EnumMacTable', Get MAC address table | function Test_EnumMacTable() {
return __awaiter(this, void 0, void 0, function () {
var in_rpc_enum_mac_table, out_rpc_enum_mac_table;
return __generator(this, function (_a) {
switch (_a.label) {
case 0:
console.log("Begin: Test_EnumMacTable");
... | [
"getMacAddress() {\r\n var interfaces = require('os').networkInterfaces();\r\n for (var devName in interfaces) {\r\n var iface = interfaces[devName];\r\n \r\n for (var i = 0; i < iface.length; i++) {\r\n var alias = iface[i];\r\n if (alias.family === 'IPv4'... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
sums all the elements in arr, given range: min = mininum starting index max = ending index | function sum_arr(arr, min = 0, max = -1) {
if (max === -1) {
max = arr.length - 1;
}
let ret = 0;
for (let i = min; i <= max; i++) {
ret += arr[i];
}
return ret;
} | [
"function sumAll(arr) {\n range = []\n max = Math.max.apply(null, arr)\n min = Math.min.apply(null, arr)\n while (min <= max) {\n range.push(min++)\n }\n return range.reduce(function(prev, next){\n return prev + next\n })\n}",
"function sumOfRange(arr) {\n var min = Math.min(arr[0], arr[1]),\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Responsible for all of the actions related to boys | function boysReducer(action) {
switch (action.type) {
case boyActions.ADD_BOY:
boys = [ ...boys, { id: Math.random(), name: action.payload } ]
all = [ ...boys, ...girls ]
rebuild(boys, all, "boy")
break
case boyActions.REMOVE_FIRST_BOY:
boys.shift()
all = [ ...boys, ...girl... | [
"function doAction(bric, brixObjects, brixActions, eventManager) {\n\t\tvar actions = {\n\t\t\t'append' : appendAction,\n\t\t\t'createFn' : createFnAction,\n\t\t\t'seedFn' : seedFnAction,\n\t\t\t'subscribe' : subscribeAction\n\t\t\t//, add other actions here\n\t };\n\t \n\t if (typeof actions[bric.ty... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Remove the access token from the storage | async removeAccessToken() {
await AsyncStorage.removeItem(`${this.namespace}:${storegeKey}`);
} | [
"async removeAccessToken() {\n await AsyncStorage.removeItem(`${this.namespace}`);\n }",
"async removeToken() {\n try {\n await AsyncStorage.removeItem(ACCESS_TOKEN);\n this.getToken();\n }\n catch (error) {\n console.log(\"Oops... could not remove token.\");\n }\n }",
"static re... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Unbinds the event listeners from the elements | unbindEvents() {
this.toggleListeners.forEach(toggleListener => toggleListener.destroy());
this.openListeners.forEach(openListener => openListener.destroy());
this.closeListeners.forEach(closeListener => closeListener.destroy());
this.radioOpenListeners.forEach(radioOpenListener => radio... | [
"unbindEvents() {\n this.toggleListeners.forEach(toggleListener => toggleListener.destroy());\n this.openListeners.forEach(openListener => openListener.destroy());\n this.closeListeners.forEach(closeListener => closeListener.destroy());\n }",
"function unbindEventListeners(){\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
appends the player's choice to history data | function addToHistory(id, choice, history) {
if (!history[id]) {
history[id] = {};
history[id].coins = 0;
history[id].choices = [];
}
history[id].choices.push(choice);
console.log(id + choice);
} | [
"function logPlayerChoices() {\r\n\r\n\r\n // Log to database so other players are aware of our choice\r\n player.time = moment().format(\"X\");\r\n player.status = \"active\";\r\n\r\n // Log to session storage -- use for screen refreshes and downstream pages\r\n sessionStorage.setItem('player', JSON... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
SOME and EVERY Write a function called hasAZero which accepts a number and returns true if that number contains at least one zero. Otherwise, the function should return false | function hasAZero(num) {
return num.toString().split("").some(function(val) {
val === '0';
})
} | [
"isZero($number) {\n return $number === 0;\n }",
"function isZero(number){\n if (number === 0)\n return true;\n else\n return false;\n}",
"function hasAZero(num) {\n return num.toString().split('').some(function(val) {\n return val === '0';\n }); \n }",
"functio... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Fragments on composite type Fragments use a type condition to determine if they apply, since fragments can only be spread into a composite type (object, interface, or union), the type condition must also be a composite type. | function FragmentsOnCompositeTypesRule(context) {
return {
InlineFragment: function InlineFragment(node) {
var typeCondition = node.typeCondition;
if (typeCondition) {
var type = (0, _typeFromAST.typeFromAST)(context.getSchema(), typeCondition);
if (type && !(0, _definition.isComposi... | [
"function FragmentsOnCompositeType(context) {\n\t return {\n\t InlineFragment: function InlineFragment(node) {\n\t var typeName = node.typeCondition.value;\n\t var type = context.getSchema().getType(typeName);\n\t var isCompositeType = type instanceof _typeDefinition.GraphQLObjectType || type ins... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
A map of function statements, indexed by fullynamespaced lower function name. | get functionStatementLookup() {
if (!this._functionStatementLookup) {
this._functionStatementLookup = new Map();
for (const stmt of this.functionStatements) {
this._functionStatementLookup.set(stmt.getName(ParseMode.BrighterScript).toLowerCase(), stmt);
}
... | [
"getDistinctFunctionDeclarationMap() {\n const result = {};\n for (const file of this.files) {\n for (const func of file.functionDefinitions) {\n //skip the special function names\n if (this.nonPrefixedFunctionMap[func.name.toLowerCase()]) {\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Return random colour name from colourNames array using randomNumber() | function randomColour() {
return colourNames[randomNumber(0, colourNames.length - 1)];
} | [
"function randomColor(array) {\r\n var color = array[Math.floor(Math.random()*array.length)];\r\n return color;\r\n}",
"pickColour() {\n var colours = [\"red\", \"green\", \"blue\", \"yellow\"];\n var colorIdx = Math.floor(Math.random() * colours.length);\n return colours[colorIdx];\n }",
"genera... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Logic of appending a new table container jQuery object where we will append our table (NOTE: a collectable 'div' is used for each table in the script for memory optimization, it should be passed here) trs array of objects (non jQuery) for our new table isLastBatch passed as 'true' if we have tr's left over from process... | function appendTable(container, trs, isLastBatch) {
if (trs.length === 0) {
container.append(breaker.clone());
currentPageZero += breaker.outerHeight();
return;
}
var splitTable = templateTable.clone();
var splitTableBody = splitTable.find('tbody');
splitT... | [
"addRows() {\n if (this._data.constructor !== Array)\n throw TypeError('data property of table is not an array');\n\n this._data.forEach((item) => {\n\n if (item.constructor !== this._rowItemType)\n throw TypeError('invalid item type for table row');\n\n let $tr = $('<tr>');\n\n for... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Form fields do not have autocomplete with empty value. See also: hasFieldsWithValidAutocompleteAttributes() and hasNoFieldsWithAutocompleteOff(). | function hasNoFieldsWithEmptyAutocomplete() {
const problemFields = inputsSelectsTextareas
.filter(field => field.autocomplete === '')
.map(field => stringifyElement(field));
if (problemFields.length) {
const item = {
// description: 'Autocomplete values must be valid.',
details: 'Found form... | [
"function hasNoFieldsWithAutocompleteOff() {\n const problemFields = inputsSelectsTextareas\n .filter(field => field.autocomplete === 'off')\n .map(field => stringifyElement(field));\n if (problemFields.length) {\n const item = {\n // description: 'Autocomplete values must be valid.',\n details... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Check each item of the array for arrays or objects. | function checkArray(errors, style, obj) {
for (const item of obj) {
if (item instanceof Array) {
checkArray(errors, style, item);
} else if (item instanceof Object) {
checkObject(errors, style, item);
}
}
} | [
"function isArrayable(item){\n if(item instanceof Object && !(item instanceof String)){\n var stuff = _.keys(item);\n var stuffToCheck = _.chain(stuff).map(function(value){\n return _.parseInt(value);\n })\n .filter(function(value){\n return !_.isNaN(value);\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
This is responsible for creating and adding the toolbar to the DOM. Returns the element so we can bind events on it | createToolbar() {
const toolbar = document.createElement("div");
toolbar.className = this.options.className;
toolbar.style.visibility = "hidden";
const buttonsContainer = document.createElement("div");
buttonsContainer.className = `${this.options.className}__buttons`;
this.options.buttons.map(... | [
"function createToolbarElement() {\n var toolbar = new Element('div', { 'class': 'editor_toolbar' });\n this.editor.insert({before: toolbar});\n return toolbar;\n }",
"function createToolbarElement() {\n var toolbar = $('<div class=\"editor_toolbar\"></div>');\n // editor.before(toolbar);\n if(... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
change map zoom level based on screensize | function mapZoom (){
var d = [3, 4]
if (window.innerWidth > 600) {return d[1]}
else {return d[0]}
} | [
"function responsive() {\n width = $(window).width();\n height = $(window).height();\n if (width < 768) {\n // set the zoom level to 3\n map.setZoom(3);\n } else if (width > 1500) {\n // set the zoom level to 5\n map.setZoom(5);\n } else {\n map.setZoom(4);\n }... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Check rate limits and quit the app if we're about to get blocked | function checkRateLimit (){
console.log("Checking rate limits");
checkRateLimitInterval = setTimeout(checkRateLimit, config['rate_limit_update_time']*1000);
if (ratelimit[2] < config['min_ratelimit']){
console.log("Ratelimit too low -> Cooldown (" + str(ratelimit[2]) + "%)")
clearTimeout(checkRateLimitInterval)... | [
"async function rateLimitCheck() {\n numRequests ++;\n if (numRequests % 100 !== 0) {\n return\n }\n const rateLimit = (await octokit.misc.getRateLimit({})).data.rate\n if (rateLimit.remaining < 150) {\n const timeToSleep = (rateLimit.reset + 5) * 1000 - Date.now()\n const timeTo... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Gets the given |fieldName| from the |nickname|'s data in the database. Custom fields will be preprocessed before being returned. | async getPlayerField(nickname, fieldName) {
const fields = this.getSupportedFields();
if (!fields.hasOwnProperty(fieldName))
throw new Error(`${fieldName} is not a field known to me. Please check !supported.`);
const field = fields[fieldName];
const result = await t... | [
"async _getPlayerFieldQuery(nickname, fieldName, field) {\n const query = `\n SELECT\n ${fieldName}\n FROM\n ${field.table}\n WHERE\n user_id = (\n SELECT\n user_id\n FRO... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Initialize an instance for `PdfDictionaryProperties` class. | function DictionaryProperties(){/**
* Specifies the value of `Pages`.
* @private
*/this.pages='Pages';/**
* Specifies the value of `Kids`.
* @private
*/this.kids='Kids';/**
* Specifies the value of `Count`.
* @private
*/this.count='Count';... | [
"function DictionaryProperties() {\n /**\n * Specifies the value of `Pages`.\n * @private\n */\n this.pages = 'Pages';\n /**\n * Specifies the value of `Kids`.\n * @private\n */\n this.kids = 'Kids';\n /**\n * Specifies the v... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Increments the correct counter in the checkin habits data table. Pass in a date. | function increment_checkin_habits_counter(timestamp, place_name, place_id) {
// Get the row to modify.
var row = timestamp.getDay();
// Get column to modify.
var column;
switch (timestamp.getHours()) {
case 0:
case 1:
column = 1;
break;
case 2:
case 3:
column = 2;
break;
case 4:
case 5:
... | [
"function incrementDate() {\n setDate(addDays(date, 1));\n setPage(1);\n }",
"incDay() { if (this.day <= this.days)\n this.day++; }",
"incrementDay() {\n this._data.current.setDate(this._data.current.getDate() + 1);\n }",
"async function dailyIncrement () {\n\tconst now = new Date();\n... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
function to get the xy coords of where the minutehand should be getMinuteCoords([Time]) | function getMinuteCoords(t){
var ret = [];
ret[0] = rad + (rad * 0.85) * Math.cos(6 * t * Math.PI / 180); //x
ret[1] = rad + (rad * 0.85) * Math.sin(6 * t * Math.PI / 180); //y
return ret;
} | [
"minutePosition() {\n return this.frameCount % this.framesPerMin;\n }",
"function getHourCoords(t){\n\t\tvar ret = [];\n\t\tret[0] = rad + (rad * 0.60) * Math.cos(30 * t * Math.PI / 180); //x\n\t\tret[1] = rad + (rad * 0.60) * Math.sin(30 * t * Math.PI / 180); //y\n\t\treturn ret;\n\t}",
"function getMinute... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Load the given PDF file in the given target window. | function loadPDF(path, targetWindow) {
if(!targetWindow) {
throw new Error("No target window given");
}
let fileMeta = fileRegistry.registerFile(path);
console.log("Loading PDF via HTTP server: " + JSON.stringify(fileMeta));
targetWindow.loadURL(`http://${DEFAULT_HOST}:${WEBSERVER_PORT}/... | [
"function loadPdf(windowId, url) {\n PDFJS.getDocument(url).then(function (pdf) {\n //PDFJS.disableWorker = true;\n var data = { \"masterPosition\":infos.position, \"pdf\": pdf, \"currentPosition\": 1, \"total\": pdf.numPages};\n createCanvas(windowId, \"PDF\", 400, 300, \"pdf\", true, true,... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
get all jobs count | getJobsCount(){
var query = 'select count(*) as COUNT from "Jobs.ScheduleDetails"';
return new Promise((resolve,reject) => {
this.client.exec(query,(err,rows) => {
if(err){
return reject(err);
}
return resolve(rows);
});
});
} | [
"function countActiveJobs () {\r\n return state.jobs.reduce((count, job) => {\r\n if (job.state === 'active') {\r\n count++;\r\n }\r\n return count;\r\n }, 0);\r\n}",
"static async _count() {\n let agendaWrapper = await AgendaWrapper.instance();\n let agenda = agendaWrapper.agenda;\n cons... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
this method is used to reset the user prof course model | function resetCourse() {
$scope.profCourse = {};
} | [
"function _resetUser() {\n vm.objUserNew = {\n strGender : 'male',\n strFirstName : 'Marco',\n strLastName : 'Schaule',\n strUsername : 'MarcoSchaule',\n strEmail : 'marco.schaule@net-design... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
emit event with theme | emit() {
this.Theme.next(this.getTheme());
} | [
"function themeChangedEventListener(event)\r\n{ \r\n\tchangeThemeColor();\r\n}",
"[osThemeUpdateHandler]() {\n const info = this.generateSystemThemeInfo();\n this.arcApp.wm.notifyAll('system-theme-changed', info);\n }",
"checkThemeMode() {\n this.changeThemeMode.emit();\n }",
"function handl... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
problem 59 xor decryption | function xorDecryption(encryptedData) {
var SPACE = ' '.charCodeAt(0);
var EXCLUDE = [
'~'.charCodeAt(0),
'|'.charCodeAt(0),
'%'.charCodeAt(0),
'{'.charCodeAt(0),
'}'.charCodeAt(0),
'^'.charCodeAt(0)
];
var a = 'a'.charCodeAt(0);
var z = 'z'.charCodeAt... | [
"function xorEncode(key) {\n \n}",
"function xorBytes(input, secret)\r\n{\r\n\tvar output = \"\";\r\n\toutput += String.fromCharCode(input.charCodeAt(0));\r\n\tvar spos = input.charCodeAt(0) % 10;\r\n\tfor (var pos = 1; pos < input.length; ++pos)\r\n\t{\r\n\t\tvar xr = input.charCodeAt(pos) ^ secret.charCodeAt... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
predict value with kriging for this specific point (x, y); variogram is calculated on the top | function predict_point(x, y, variogram) {
var i, k = Array(variogram.n);
for(i=0;i<variogram.n;i++)
k[i] = variogram.model(Math.pow(Math.pow(x-variogram.x[i], 2)+
Math.pow(y-variogram.y[i], 2), 0.5),
variogram.nugget, variogram.range,
variogram.sill, variogram.A);
return matrix_mul... | [
"function kriging(id) {\r\n /* Output testing */\r\n var o = document.getElementById(\"output\");\r\n\r\n /* Global vars */\r\n var canvaspad = 50;\r\n var pixelsize = 1;\r\n var yxratio = 1;\r\n\r\n /* Canvas element */\r\n var canvasobj = document.getElementById(id);\r\n this.canvas = document.getElement... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Attaches rollover animation to small navigation boxes. | function attachHovers() {
$('.sml-media-box a').live('mouseenter', function() {
$($(this).children('.media-box-rollover'))
.stop().animate({left: -160, top: -160}, 250);
}).live('mouseleave', function() {
$($(this).children('.media-box-rollover'))
.stop().animate({left: 0, top: 0}, 200);
});
} | [
"function animNav(){\n $('#menu-primary .menu-item a').each(function(i){\n $(this).addClass('__color-nav');\n\n var nb = Math.floor(Math.random() * 41);\n $(this).mouseenter(function(){\n $(\"#illu-nav polygon\").addClass('__color-nav');\n $('#illu-nav #t'+nb).addClass('__tcolor');\n });\n\n $(this).mousele... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
6. square_root write a function named "square_root" that takes in one parameter and returns their result | function square_root(x) {
return Math.sqrt(x);
} | [
"function square_root(x) {\n return x * x;\n}",
"function doubleSquareRootOf(num) {\n // your code here\n}",
"function square_root(x) {\n return Math.sqrt(x);\n }",
"function squareRootFn(square){\n\n //we're going to be guessing at what the squareroot is\n let guess = square/3;\n\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Author: [A.A] Name: _bindDataMetrics Description: Binding list metrics Params: No one Return: No one | function _bindDataMetrics(metrics) {
WinJS.UI.setOptions(lvMetrics.winControl, {
itemDataSource: new WinJS.Binding.List(metrics).dataSource,
oniteminvoked: _lvMetricsItemInvoked
});
} | [
"updateAddableMetrics_() {\n this.setAddableMetrics_(this.selectableMetrics_, this.selectedMetrics_);\n }",
"addData(thedatalist) {\n \n for (i = 0; i < thedatalist.length ; i++) {\n //add new data points to the storage array\n\n this.data.push(thedatalist[i]); \n\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
default config for a copy button | get copyButton() {
return {
command: "copy",
icon: "content-copy",
label: "Copy",
shortcutKeys: "ctrl+c",
type: "rich-text-editor-button",
};
} | [
"get copyButton() {\n return {\n ...super.copyButton,\n label: this.t.copyButton,\n };\n }",
"_bindCopyButton(settingsKey) {\n const copyButton = this._builder.get_object('copy-' + settingsKey);\n if (copyButton) {\n copyButton.connect('clicked', () => {\n this._copyToHover(sett... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Stops the motor by setting its speed to 0 | stop() {
this._speed = 0;
this._applySpeed();
} | [
"stop() {\n this.move.v = { x: 0, y: 0 };\n this.rotspeed = 0;\n }",
"async stopMotor() {\n this.serial.set({ dtr: true });\n this.motorState = MOTOR_STATES.OFF;\n\n return wait(5);\n }",
"function stop_motor(index)\r\n{\r\n\tmotor_states[index] = 's';\r\n\tsend_motor_no... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
track(flow, as) : updates flow to include tracking; returns the flow obj | function track(flow, as) {
flow.tracked = [].concat(as);
return flow;
} | [
"function trackAction(flow, type, action, formId) {\n var flowPath = flow.flowPath ? flow.flowPath : \"\";\n\n //_trackPageview()\n\n //construct a URI that will be sent to google analytics' _trackPageview() method.\n\n var trackUrl = \"/userTracking/\";\n\n trackUrl += (flowPath ? flowPath + \"/\" : \"\") + t... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Initializes blocked sites array | function blockWebsites(sites) {
sites.forEach(function(site) {
blockedSites.push(site);
});
} | [
"static async block(urls) {\n return new Promise((resolve, reject) => {\n if (!this._validParameters(urls, resolve, reject)) { return }\n\n var sitesToBlock = urls.map((item) => {\n var httpStrippedUrl = item.replace(/^(http:\\/\\/)|(https:\\/\\/)/, \"\");\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Called when the migration is being migrated. The migrate method is called to build the blueprints from the user input. All blueprints are then turned into SQL statements and executed in the transaction. | execute(transaction){
let sqlStatement = '';
this.migrate();
this.blueprints.forEach(blueprint => {
sqlStatement += blueprint.getSQL();
});
transaction.executeSql(sqlStatement);
this.insertMigrationRow(transaction);
} | [
"alter(schemaName, callable){\n const blueprint = new AlterBlueprint(schemaName);\n callable(blueprint);\n\n this.blueprints.push(blueprint);\n }",
"migrate(...args) {\n throw new nano_errors_1.BaseError('Database has no support for schema migration');\n }",
"function migration... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Build all packages inside the `packages/` folder | async function buildAll() {
for (const { package, folder } of metadata) {
await buildSinglePackage(package, folder);
}
console.log('All packages have been built and copied to "node_modules" successfully');
} | [
"function makeAll(options, cb) {\n findPackages(options.srcFolder, function (err, packages) {\n if (err) {\n return cb(err);\n }\n processMultiplePackageDetails(options, packages, cb);\n });\n}",
"get buildPackages() {\n const packages = ['pkg-config', 'build-essential', t... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Create objects in MultipleViewsHandler & if exists already, then just update it. | function createOrUpdateMultipleViewsObject(oValue) {
var oPathToProperty = oTemplatePrivateModel.getProperty(PATH_TO_PROPERTIES);
if (!oPathToProperty) {
oPathToProperty = {};
oPathToProperty[oCurrentSection.key] = oValue;
} else if (oPathToProperty && !oPathToProperty[oCurrentSection.key]) {
... | [
"function createViewsIfNecessary() {\n return Q.allSettled(views.map(function(view) {\n\n var deferred = Q.defer();\n\n var viewDef = {};\n viewDef[view.name] = _.pick(view,'map','reduce');\n\n var designName = '_design/' + view.name;\n\n function create... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
' Name : handleBpSubmitPaymentGroupOnSucess ' Return type : none ' Input Parameter(s) : response ' Purpose : This method is used to call submit payment on success . ' History Header : Version Date Developer Name ' Added By : 1.0 19 Apr 2014 UmamaheswaraRao ' | function handleBpSubmitPaymentGroupOnSucess(response){
triggerCheckCartStatus();
$('#addPaymentCardForm').remove();
} | [
"function HandleResponse(){\n\tvar afterpayPaymentInstrument, paymentInstrument, cart, iter, paymentStatus,\n\tredirectURL, PreapprovalResult, placeOrderResult, productExists;\n\t\n\t\n\tcart = Cart.get();\n\t\n\titer = cart.object.getPaymentInstruments().iterator();\n\twhile (iter.hasNext()) {\n\t\tafterpayPaymen... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Gets splitted widget for paragraph. | getSplittedWidgetForPara(bottom, paragraphWidget) {
let lineBottom = paragraphWidget.y;
let splittedWidget = undefined;
for (let i = 0; i < paragraphWidget.childWidgets.length; i++) {
let lineWidget = paragraphWidget.childWidgets[i];
if (bottom < lineBottom + lineWidget.h... | [
"function splitP(p, sizeLeft){\n\t\tvar words = p.html().split(\" \"), p1 = \"\", p2 = \"\", classe = \"\", firstText = \"\";\n\t\t$(\"#flowColumnTmpPar, #flowColumnTmpParP\").html(\"\");\n\t\t\n\t\tif(p.attr(\"class\") != undefined)\n\t\t\tclasse = \" class='\"+p.attr(\"class\")+\"'\";\n\t\t\n\t\t$('#flowColumnTmp... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |