query
stringlengths
9
14.6k
document
stringlengths
8
5.39M
metadata
dict
negatives
listlengths
0
30
negative_scores
listlengths
0
30
document_score
stringlengths
5
10
document_rank
stringclasses
2 values
validation middleware: if a status is included when posting a new reservation, the only status allowed is "booked"
function statusBooked(req, res, next) { const { status } = req.body.data; if (status) { if (status === "booked") { return next(); } else { return next({ status: 400, message: `status cannot be set to ${status} when creating a new reservation.`, }); } } else { ret...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function statusIsValid(req, res, next) {\n const { status } = req.body.data;\n const validValues = [\"booked\", \"seated\", \"finished\", \"cancelled\"];\n if (validValues.includes(status)) {\n res.locals.status = status;\n return next();\n } else {\n return next({\n status: 400, \n message:...
[ "0.71509004", "0.7113611", "0.6758683", "0.67563176", "0.67308074", "0.6632218", "0.6358373", "0.63179755", "0.6193814", "0.61695683", "0.61680555", "0.5989317", "0.59588265", "0.59588265", "0.58806384", "0.5865458", "0.5831799", "0.5783486", "0.57468945", "0.57407326", "0.57...
0.8277817
0
validation middleware: checks that status type is valid
function statusIsValid(req, res, next) { const { status } = req.body.data; const validValues = ["booked", "seated", "finished", "cancelled"]; if (validValues.includes(status)) { res.locals.status = status; return next(); } else { return next({ status: 400, message: `invalid status: ${st...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function validateStatus(req, res, next) {\n const order = res.locals.order;\n const { data: { status } = {} } = req.body;\n if (\n status === \"pending\" ||\n status === \"preparing\" ||\n status === \"out-for-delivery\" ||\n status === \"delivered\"\n ) {\n return next();\n }\n next({\n st...
[ "0.73311424", "0.7019745", "0.70040417", "0.6859799", "0.6859799", "0.66423535", "0.65463805", "0.6257898", "0.6190758", "0.61447614", "0.61091614", "0.60880446", "0.60405815", "0.5980127", "0.59768665", "0.59358823", "0.59255654", "0.5921194", "0.5903026", "0.5890986", "0.58...
0.76597404
0
validation middleware: checks that status is not currently finished
function statusIsNotFinished(req, res, next) { const { reservation } = res.locals; if (reservation.status === "finished") { return next({ status: 400, message: "A finished reservation cannot be updated.", }); } else { return next(); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function validateStatus(req, res, next) {\n const order = res.locals.order;\n const { data: { status } = {} } = req.body;\n if (\n status === \"pending\" ||\n status === \"preparing\" ||\n status === \"out-for-delivery\" ||\n status === \"delivered\"\n ) {\n return next();\n }\n next({\n st...
[ "0.65189654", "0.6376729", "0.63615966", "0.63469505", "0.63469505", "0.6275568", "0.62117636", "0.6186074", "0.61578757", "0.6108092", "0.59523153", "0.59091187", "0.58866084", "0.58567023", "0.58567023", "0.5810932", "0.58101255", "0.5810082", "0.5810082", "0.5756525", "0.5...
0.65130615
1
updates a reservation status
async function updateStatus(req, res) { const { reservation, status } = res.locals; const updatedReservationData = { ...reservation, status: status, } const updatedReservation = await service.update(updatedReservationData); res.json({ data: updatedReservation }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "async function updateStatus(req, res, next) {\n const newStatus = req.body.data.status;\n const validStatus = [\"booked\", \"seated\", \"finished\", \"cancelled\"];\n const { reservation } = res.locals;\n const { reservation_id } = reservation;\n let { status } = reservation;\n\n if (!validStatus.includes(ne...
[ "0.72774005", "0.7182836", "0.66571236", "0.65943176", "0.6319088", "0.6283144", "0.6240037", "0.62361646", "0.62120634", "0.61988044", "0.61923534", "0.61588335", "0.61107", "0.6075848", "0.607255", "0.6053225", "0.60367066", "0.6027318", "0.6021669", "0.59619844", "0.594684...
0.7423212
0
DUN files contain information for arranging the squares of a TIL file. Multiple DUN files can be pieced together to form entire levels. For example, the 'town' level is a combination of 4 DUN files. In addition, DUN files also provide information regarding dungeon monsters and object ids.
function DunFile(startCoord, rawPillarData, dunName) { this.startCol = startCoord[0]; this.startRow = startCoord[1]; this.fileName = dunName; this.rawPillarData = rawPillarData; this.rawColCount = this.rawPillarData.length; this.rawRowCount = (this.rawColCount > 0) ? this.rawPillarData[0].lengt...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function genDic(filename,type){\r\n\t//Get the file content.\r\n\tvar file = fs.readFileSync(filename, 'latin1').split(/\\r?\\n/);\r\n\tfile = file.filter(e => e[0] !== '#');\r\n\tfile = file.map(e => e.split('\\t'));\r\n\tfile = file.filter(e => (e[0] !== undefined) && (e[1] !== undefined));\r\n\tfile.map((e) => ...
[ "0.5218847", "0.5091938", "0.50360346", "0.5000852", "0.4918196", "0.48591742", "0.47545293", "0.4719868", "0.470542", "0.46913093", "0.4686201", "0.46554467", "0.465523", "0.46510303", "0.46436304", "0.46423844", "0.4634888", "0.45817974", "0.45598328", "0.4518608", "0.45027...
0.5820322
0
helper for createing throttled get/set functions (good to create time/volumeslider, which are used as getter and setter)
function createGetSetHandler(get, set) { var throttleTimer; var blockedTimer; var blocked; return { get: function() { if (blocked) { return; } return get.apply(this, arguments); }, set: function() { clearTimeout(thro...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "get speed() {\n return MULTIPLIER\n }", "fireChangeEvent_() {\n this.changeThrottle_.fire();\n }", "function throttle(method) {\n return _throttleHelper(method);\n}", "function get(getter) {\n \n}", "function throttle(func,ms){var isThrottled=false,savedArgs,savedThis;function wrapper(){if(isTh...
[ "0.6178165", "0.60993886", "0.5948129", "0.5786913", "0.57735604", "0.5624487", "0.55444247", "0.5539089", "0.55361307", "0.54751796", "0.5473125", "0.54658514", "0.54260504", "0.542575", "0.54244894", "0.5421207", "0.5421207", "0.54202956", "0.541625", "0.5408663", "0.538485...
0.6858377
0
Lines object stores & manipulates lines (line = array of characters/strings)
function Lines() { this.lines = []; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function Lines(){}", "function Rem_Lines() {\n this.initialize.apply(this, arguments);\n}", "function Line() {}", "function Line() {}", "function Line() {}", "function Line(){}", "function Line(){}", "constructor(row, line) {\n this.row = row;\n this.line = line;\n }", "function...
[ "0.7569488", "0.7089403", "0.7012468", "0.7012468", "0.7012468", "0.69635767", "0.69635767", "0.66357833", "0.6625214", "0.6590429", "0.6587839", "0.65596145", "0.65447456", "0.64866793", "0.64525217", "0.64525217", "0.64525217", "0.64525217", "0.64069736", "0.6399706", "0.63...
0.7653701
0
Delete Contact Confirm Dialog
function deleteContactConfirm(ev) { var confirm = $mdDialog.confirm() .title('Are you sure want to delete the contact?') .htmlContent('<b>' + vm.contact.name + ' ' + vm.contact.lastName + '</b>' + ' will be deleted.') .ariaLabel('delete contact') ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "delete(){\n // trigger closure action so that appropriate controller function can make request\n this.callDelete();\n document.getElementById('dialogOverlay').style=\"display: none;\";\n document.getElementById('confirmationDialog').style=\"display: none;\";\n }", "function confirmDelete()...
[ "0.71762824", "0.69841343", "0.68646693", "0.6838242", "0.67956084", "0.67928267", "0.67416906", "0.66606337", "0.6593988", "0.6586221", "0.6574769", "0.65349936", "0.6529737", "0.65270996", "0.6519892", "0.65145075", "0.6489477", "0.64883983", "0.6477551", "0.6453697", "0.64...
0.76149243
0
Default logic for adding the layer to the container
addToContainer() { this.args.parent._layer.addLayer(this._layer); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "addLayer(layer) {\r\n this._layers.push(layer);\r\n }", "function createLayer() {}", "addLayer() {\n const layer = new Layer(this, this.layers.length + 1);\n this.layers.push(layer);\n return layer;\n }", "appendLayer(Layer, ...layerArgs) {\n let layer = new Layer(this, ...layerArgs);\...
[ "0.7501324", "0.74506646", "0.7145281", "0.70786107", "0.68229896", "0.68101764", "0.68018955", "0.6788832", "0.6774588", "0.6745005", "0.66428167", "0.66192013", "0.66122675", "0.6604239", "0.658939", "0.6566935", "0.65489084", "0.65267444", "0.6496665", "0.6493411", "0.6483...
0.80658704
0
Default logic for removing the layer from the container
removeFromContainer() { this.args.parent._layer.removeLayer(this._layer); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "removeLayer(layer) {\n this.layers = _.without(this.layers, layer);\n layer.disposeEventListeners();\n layer.delete();\n }", "_removeHandler() {\n this._delegate && this._delegate.remove()\n this._state = DC.LayerState.REMOVED\n }", "removeLayer() {\n if (this.__shown) {\n const map = ...
[ "0.7805782", "0.7430608", "0.74197483", "0.73679996", "0.73057246", "0.72800535", "0.7274298", "0.72044134", "0.7200964", "0.7116191", "0.7013801", "0.69511366", "0.69385356", "0.6917098", "0.6800596", "0.6786542", "0.6786097", "0.670742", "0.67023265", "0.6687475", "0.665249...
0.770866
1
draw user as a ladybug code adapted from
function displayUser() { push(); strokeWeight(6); stroke(41, 25, 31); fill(255, 0, 0); ellipse(user.x, user.y, user.size); line(user.x - user.size/2+10, user.y - user.size/4, user.x + user.size/2-10, user.y - user.size/4); line(user.x, user.y + user.size/2, user.x, user.y - user.size/4); fill(41, 25, 31...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function displayUser() {\n push();\n fill(255);\n ellipse(user.x, user.y, user.size);\n pop();\n}", "function draw(){\n\n //show the game piece\n user.show();\n\n}", "function draw() {\n // background(220);\n\n for (let i = 0; i < users.length; i++) {\n let user = users[i];\n //text(user, 30,...
[ "0.69002867", "0.6775685", "0.6395454", "0.62663245", "0.6149358", "0.6149358", "0.6142008", "0.6076323", "0.6015617", "0.60141516", "0.5989034", "0.5985007", "0.5985007", "0.5977125", "0.5977125", "0.59735495", "0.5956256", "0.59552515", "0.59392935", "0.5909658", "0.5901938...
0.69133556
0
draw one leaf code adapted from
function displayLeaf(leafX, leafY) { push(); strokeWeight(9); arc(leafX, leafY, 500, 900, -90, 90); arc(leafX, leafY, 500, 900, 90, -90); line(leafX, leafY-450, leafX, leafY+450); line(leafX-115, leafY-400, leafX, leafY-200); line(leafX+115, leafY-400, leafX, leafY-200); line(leafX-180, leafY-300, ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function drawLeaves() {\n push();\n fill(7, 99, 29);\n stroke(0, 139, 70);\n rotate(PI/6);\n displayLeaf(420, 80);\n pop();\n\n push();\n fill(0,159,90);\n stroke(7, 89, 29);\n translate(100, height/2);\n displayLeaf(0, 0);\n pop();\n\n push();\n fill(0,159,90);\n stroke(7, 99, 29);\n translate(wid...
[ "0.74697393", "0.73725486", "0.73104066", "0.72978866", "0.6764821", "0.6752901", "0.66893214", "0.66538376", "0.6567737", "0.65171295", "0.6483309", "0.6459155", "0.6445546", "0.643595", "0.6321695", "0.6301163", "0.6253821", "0.6229821", "0.6112113", "0.6107174", "0.6061381...
0.74425036
1
Test saving login information and setting a master password
function testSetMasterPassword() { persisted.nextTest = "testInvokeMasterPassword"; tabBrowser.closeAllTabs(); // Go to the sample login page and perform a test log-in with input fields controller.open(TEST_DATA); controller.waitForPageLoad(); var userField = findElement.ID(controller.tabs.activeTab, "un...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function setup (ctx, login, password) {\n\t var setup = makeSetup(ctx, login.dataKey, login.username, password)\n\n\t var request = login.authJson()\n\t request['data'] = setup.server\n\t return ctx.authRequest('PUT', '/v2/login/password', request).then(function (reply) {\n\t login.userStorage.setItems(setu...
[ "0.6953179", "0.6530669", "0.64171183", "0.62864316", "0.6286202", "0.6264556", "0.6262555", "0.62562054", "0.62353414", "0.6226776", "0.6108657", "0.6079874", "0.6054161", "0.59887123", "0.59222454", "0.59217703", "0.59207994", "0.5919519", "0.5896604", "0.5887301", "0.58855...
0.7793659
0
Test invoking master password dialog when opening password manager
function testInvokeMasterPassword() { persisted.nextTest = "testRemoveMasterPassword"; // Call preferences dialog and invoke master password functionality prefWindow.openPreferencesDialog(controller, prefDialogInvokeMasterPasswordCallback); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function testSetMasterPassword() {\n persisted.nextTest = \"testInvokeMasterPassword\";\n\n tabBrowser.closeAllTabs();\n\n // Go to the sample login page and perform a test log-in with input fields\n controller.open(TEST_DATA);\n controller.waitForPageLoad();\n\n var userField = findElement.ID(controller.tab...
[ "0.7944908", "0.7517333", "0.7055315", "0.65511674", "0.6439271", "0.6286121", "0.6259356", "0.6193234", "0.6147411", "0.6146229", "0.6132469", "0.6117075", "0.61169124", "0.60719293", "0.6070897", "0.6067656", "0.6064213", "0.60446954", "0.6032831", "0.6031361", "0.6029644",...
0.8210067
0
Test removing the master password
function testRemoveMasterPassword() { // Call preferences dialog and invoke master password functionality prefWindow.openPreferencesDialog(controller, deleteMasterPassword); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function testInvokeMasterPassword() {\n persisted.nextTest = \"testRemoveMasterPassword\";\n\n // Call preferences dialog and invoke master password functionality\n prefWindow.openPreferencesDialog(controller, prefDialogInvokeMasterPasswordCallback);\n}", "function testSetMasterPassword() {\n persisted.nextT...
[ "0.71004903", "0.6294911", "0.62833446", "0.6183924", "0.6057988", "0.6008215", "0.5962996", "0.58735865", "0.58183545", "0.5787555", "0.5782753", "0.5756987", "0.5670093", "0.56502926", "0.564461", "0.56323534", "0.5614078", "0.5580226", "0.5554398", "0.55380946", "0.5505898...
0.77749705
0
Swap the new temporary file into place of the actual data file. Create a backup first, that we can use to restore from if something goes wrong,
swapTmpJsonToActual() { return new Promise((resolve, reject) => { this.initWaypointFile() .then((res) => { this.backupWaypointFile() .then((message) => { let removed = nova.fs.remove(this.waypointFilePath) nova.fs.copy(this.waypointTempFilePath, this.w...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "restoreState() {\n if (fs.existsSync(this.options.tmpFile)) {\n const data = fs.readFileSync(this.options.tmpFile);\n this.state = JSON.parse(data);\n }\n }", "async rollback() {\n const initialPath = path.join(initialState.dir, initialState.filename);\n const fil...
[ "0.62347126", "0.5652154", "0.5628585", "0.56072605", "0.5556247", "0.55217415", "0.54471475", "0.54244715", "0.53420025", "0.53235495", "0.5296529", "0.5274919", "0.52240133", "0.5220559", "0.5196406", "0.5113004", "0.50716275", "0.5063595", "0.50025344", "0.4994097", "0.499...
0.61416817
1
Restore backup waypoint data file to actual data file.
restoreBackupWaypointFile() { return new Promise((resolve, reject) => { try { // TODO - copied is always undefined? let copied = nova.fs.copy( this.waypointFilePath + ".bck", this.waypointFilePath ) resolve(true) } catch (_err) { log("STORAGE E...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function restoreData() {\n /* set the flag to read in the data */\n bRestore = true;\n\n /* read in the savedata file */\n saveFrame.location.href = nameToURL(\"savedata.htm\");\n}", "restoreState() {\n if (fs.existsSync(this.options.tmpFile)) {\n const data = fs.readFileSync(this.o...
[ "0.63515925", "0.6044814", "0.5872262", "0.5773248", "0.57469547", "0.57431126", "0.5671201", "0.5636216", "0.5612024", "0.55849266", "0.5576434", "0.55558115", "0.5538333", "0.5272792", "0.523415", "0.51841336", "0.51833105", "0.51501006", "0.5126616", "0.5105847", "0.509479...
0.68228245
0
Backup waypoint data file.
backupWaypointFile() { return new Promise((resolve, reject) => { try { this.clearBackupWaypointFile() .then((message) => { // TODO - copied is always undefined? let copied = nova.fs.copy( this.waypointFilePath, this.waypointFilePath + ".bck...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "restoreBackupWaypointFile() {\n return new Promise((resolve, reject) => {\n try {\n // TODO - copied is always undefined?\n let copied = nova.fs.copy(\n this.waypointFilePath + \".bck\",\n this.waypointFilePath\n )\n resolve(true)\n } catch (_err) {\n ...
[ "0.6528169", "0.6493722", "0.6043842", "0.5891699", "0.5459316", "0.54482067", "0.5416619", "0.5409536", "0.53493834", "0.5341274", "0.53116906", "0.5308295", "0.529157", "0.5289241", "0.52857333", "0.5235756", "0.52305925", "0.5228854", "0.52152276", "0.52119696", "0.5191114...
0.6514989
1
make card darker blue and use incorrect text as placeholder
function renderIncorrectCard(index) { $(".quiz-card").eq(index).removeClass("correct").addClass("incorrect"); var incorrectVal = $(".quiz-card").eq(index).find('input[type="text"]').val(); $(".quiz-card").eq(index).find('input[type="text"]').attr("placeholder", "".concat(incorrectVal)); $(".quiz-card")....
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function disableAllCardsColor(){\n\n $(\".newCard\").removeClass(\"bg-dark text-light\");\n\n }", "displayDefaultMessage() {\n return (\n <CardContent>\n <Typography variant=\"body2\" color=\"textSecondary\" component=\"p\">\n Please select a jockey.\n </Typogra...
[ "0.5980914", "0.5938713", "0.5907707", "0.580449", "0.5792099", "0.577217", "0.57385796", "0.570131", "0.5700927", "0.5667302", "0.56562805", "0.56228065", "0.561281", "0.5606732", "0.55895233", "0.5553501", "0.54662323", "0.5454902", "0.54450625", "0.5405598", "0.5401959", ...
0.60044837
0
check if all the cards have correct class on them, highlight end button
function HighlightFinishButton() { var counter = 0; $.each($(".quiz-card"), function (index, item) { if ($(item).hasClass("correct")) { counter += 1; } if (counter === $(".quiz-card").length) { $(".focused-card").removeClass("focused-card"); $("#finishButton").focus();...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "checkCompleted() {\n return [...document.querySelectorAll(DOM.card)].every(card => {\n return card.classList.value.includes('completed-card');\n });\n }", "function checkMatch() {\n if (clickedCard.firstElementChild.classList[1]\n === prevCard.firstElementChild.classList[1]) {\n lock...
[ "0.6810907", "0.6761176", "0.66988254", "0.66214", "0.6534682", "0.6433768", "0.64163995", "0.63900274", "0.6370202", "0.63665503", "0.6366154", "0.6333085", "0.6328411", "0.6326613", "0.63056916", "0.6305576", "0.62993467", "0.6298967", "0.62936175", "0.6289632", "0.6277621"...
0.69478476
0
count all elements with .quizcard class
function countAllCards() { var cardNumber = 0; $(".quiz-card").each(function () { cardNumber += 1; }); return cardNumber; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "countCorrectAnswers(){\n let numCorrect = 0;\n let quiz = document.getElementById(\"main-quiz\");\n \n //tracks which question we're on\n let num = 0;\n\n for (let question of quiz.children){\n let name = question.className.replace('q...
[ "0.7504879", "0.73097426", "0.72861785", "0.7070352", "0.7043062", "0.6612381", "0.65775746", "0.65143436", "0.6501438", "0.6466901", "0.6441165", "0.63659734", "0.62850827", "0.6256753", "0.62429255", "0.6234724", "0.62023216", "0.6179367", "0.61735123", "0.61696404", "0.615...
0.81338793
0
Helper used to replace code in a script tag based on a search regex. To inject code without erasing original string, using capturing groups; e.g. ```js inject(/(some string)/,'injected before $1 injected after'); ```
function inject$1(searcher, replacer) { // find the relevant script tag var scriptTags = document.getElementsByTagName('script'); var scriptTag; var code = ''; for (var i = 0; i < scriptTags.length; ++i) { scriptTag = scriptTags[i]; if (!scriptTag.textContent) continue; ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function inject(searcher, replacer) {\n // find the relevant script tag\n var scriptTags = document.getElementsByTagName('script');\n var scriptTag;\n var code = '';\n for (var i = 0; i < scriptTags.length; ++i) {\n scriptTag = scriptTags[i];\n if (!scriptTag.textContent)\n ...
[ "0.7367709", "0.7367709", "0.7367709", "0.7367709", "0.5907837", "0.58481944", "0.58019674", "0.5750514", "0.5645262", "0.56309146", "0.5618468", "0.5587406", "0.54711384", "0.5426365", "0.540334", "0.5370753", "0.53481835", "0.53481835", "0.53189", "0.53189", "0.53189", "0...
0.7507528
1
get palette from palette map for room at provided position, falling back to current room palette
function getPaletteAt(x, y) { x = getPosition(x, 'x'); y = getPosition(y, 'y'); var room = paletteMap[bitsy.curRoom]; var row = room && room[y]; var col = row && row[x]; return (col !== '-' && col) || bitsy.getRoom().pal; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function _random_from_palette() {\n if (opts.palette instanceof Array) {\n return opts.palette[Math.floor(rand()*opts.palette.length)];\n }\n\n var keys = Object.keys(opts.palette);\n return opts.palette[keys[Math.floor(rand()*keys.length)]];\n }", "function ExtractPalette(dv, position) {\n ...
[ "0.61250883", "0.61193806", "0.5981634", "0.5920697", "0.58534443", "0.57603705", "0.57125604", "0.5668542", "0.56507933", "0.56249464", "0.56245625", "0.55957365", "0.5578454", "0.54587895", "0.5452942", "0.53599775", "0.53452957", "0.53436965", "0.53296703", "0.53296703", "...
0.6712487
1
Add Item with product and quantity to cart.
addItem(product, quantity) { if (!(product instanceof Product)) { throw new Error(MESSAGES.INSTANCE_OF_ERROR('Product')); } if (!(helpers.isGreaterThanZero(quantity) && helpers.isInteger(quantity))) { throw new Error(MESSAGES.INVALID_QUANTITY); } // Cart...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function addItem(item, quantity) {\n // revisa si existe el producto\n let obj = cart.find(o => o.item.id === item.id);\n if (obj === undefined) {\n setQuantityItems(Number(quantityItems) + Number(quantity));\n updateLocalStorage([...cart, { item, quantity }]);\n ...
[ "0.80814034", "0.7958913", "0.79221964", "0.7889606", "0.7882865", "0.7851823", "0.7754868", "0.773085", "0.77095366", "0.7671657", "0.76440305", "0.76275903", "0.7441686", "0.7407496", "0.7391471", "0.7387784", "0.7384279", "0.7373235", "0.73551095", "0.73385566", "0.7329274...
0.81947136
0
Get Item via product from cart.
getItem(product) { return this.items.find((item) => item.product === product); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "static findProductInCart(productId, user) {\n return user.cart.find((product => product.id == productId))\n }", "function axiosFetchProduct(cartItem) {\n axios.get(`/api/products/${cartItem.productId}`)\n .then(res => res.data)\n .then((productInfo) => {\n cartItem.product = productInfo;\n })\...
[ "0.73569804", "0.71735805", "0.71573645", "0.7044922", "0.70084596", "0.67935365", "0.67476964", "0.6740809", "0.6717866", "0.6684831", "0.6648602", "0.66315925", "0.6599598", "0.65616214", "0.6521884", "0.6493921", "0.6479442", "0.64791626", "0.6476112", "0.646834", "0.64341...
0.74733704
0
Calculate Delivery Cost via cart number of delivery and product.
calculateDeliveryCost() { const numberOfDeliveries = this.distinctCategories.length; const numberOfProducts = this.items.length; return Delivery.calculateCost({ numberOfDeliveries, numberOfProducts }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "getTotalCost(cart, products) {\n let totalCost = 0;\n for (let productName in cart) {\n totalCost += (cart[productName] * products[productName].price);\n }\n return totalCost;\n }", "function deliveryCost(tShirtQuantity) {\n //for invalid inputs\n if ((typeof tShirtQuantity != 'number') |...
[ "0.727647", "0.6853201", "0.67917985", "0.6741288", "0.65807605", "0.65674126", "0.64266276", "0.64127564", "0.6407111", "0.63937026", "0.63638526", "0.6355869", "0.6334749", "0.63120854", "0.63069475", "0.62846756", "0.6272608", "0.6250494", "0.6234433", "0.62121874", "0.621...
0.79152465
0
Apply coupon to cart. Attention! Business logic depends on Coupon Class.
applyCoupon(coupon) { if (!(coupon instanceof Coupon)) { throw new Error(MESSAGES.INSTANCE_OF_ERROR('Coupon')); } if (this.appliedCoupon) { throw new Error(MESSAGES.COUPON_ALREADY_USED_IN_CART); } this.appliedCoupon = coupon; this.couponDiscountPr...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "onCouponApplied() {\n this.couponApplied = true;\n }", "onCouponApplied() {\n Event.fire('applied', this.coupon);\n }", "onCouponApplied(){\n this.couponApplied = true\n //alert('Coupon was applied.')\n }", "onCouponaApplied() {\n this.cou...
[ "0.721878", "0.7036009", "0.69593036", "0.6900883", "0.68350786", "0.6820983", "0.6693313", "0.5871352", "0.5784913", "0.56656194", "0.563723", "0.5502332", "0.54689586", "0.5459567", "0.5459154", "0.5454781", "0.53737706", "0.53628886", "0.53537744", "0.53465444", "0.5196855...
0.80894744
0
Apply campaign to cart. Attention! This function checks all campaigns is satisfied for cart items so input must be empty.
applyCampaigns() { // Find all applicable campaigns for cart items. const { applicableCampaigns } = this; // There is no applicable campaigns. if (!applicableCampaigns.length) { return; } // Check same campaign is used before!. if (this.applicableCamp...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "addAllToCart(data) {\n const that = this;\n const lineItems = [];\n\n // Create lineItems data to be sent in request\n data.forEach((item) => {\n // Set first variant for each product as the default so that adding products\n // with multiple variants to the cart do...
[ "0.56480867", "0.547479", "0.5457851", "0.53857553", "0.5353939", "0.5319974", "0.5275436", "0.5257301", "0.5210652", "0.51789105", "0.5168445", "0.5167241", "0.5157796", "0.5152363", "0.51109976", "0.5102354", "0.50702626", "0.5069545", "0.50685894", "0.506057", "0.5055424",...
0.7214841
0
Check if results exists then renders the view
function checkResults (results) { let errors = [] let success = undefined if (results.length === 0) { errors = [{ msg : 'No se encontraron resultados' }] success = false } else { success = true errors = false } mo...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function render (results) {\n if (results.length === 0) {\n var resultsOutput = document.getElementById(options.results_output);\n resultsOutput.style.display = 'none'; // to hide\n return appendToResultsContainer(options.noResultsText);\n }\n for (var i = 0; i < results.length;...
[ "0.69389755", "0.65908676", "0.6490676", "0.64589113", "0.63861436", "0.6283077", "0.6245856", "0.6226512", "0.6196857", "0.6138331", "0.611048", "0.61074483", "0.61037916", "0.6078224", "0.6034325", "0.60301715", "0.6018736", "0.5989722", "0.5950558", "0.59431475", "0.593799...
0.71701926
0
Prevents exposing the actual name of the 'private' domain, replacing it with the 'private' string
sanitizeDomain(game, domain) { if (domain === `${game.appid}.${game.apisecret}`) { return 'private'; } else { return domain; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function toPublicName(internalName){return internalName.toUpperCase().replace(/[^A-Z0-9_]/g,\"_\")}", "get privateDnsName() {\n return this.getStringAttribute('private_dns_name');\n }", "get privateDnsName() {\n return this.getStringAttribute('private_dns_name');\n }", "function toPublicN...
[ "0.64162767", "0.6235554", "0.6235554", "0.61169386", "0.61169386", "0.61169386", "0.61169386", "0.61169386", "0.61169386", "0.5998902", "0.5998902", "0.58230996", "0.57581264", "0.5608543", "0.5606375", "0.5599003", "0.54919934", "0.54898745", "0.5329974", "0.5329974", "0.53...
0.6833675
0
07. Find Variable Names in Sentences
function findVariableNames(str) { let res = []; let pattern = /\b_{1,1}([a-zA-Z0-9]+)\b/g; let match; while (match = pattern.exec(str)) { res.push(match[1]); } console.log(res.join(',')); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function getKeywords() {\n return ['var'];\n}", "function getVariables(postfix) {\n let variables = [];\n\n for (let token of postfix) {\n if (token.match(new RegExp(ATOMS)) && !variables.includes(token)) {\n variables.push(token);\n }\n }\n\n return variables;\n}", "fun...
[ "0.598089", "0.59192663", "0.59171313", "0.59100646", "0.58869624", "0.5866805", "0.5826957", "0.5819849", "0.5694621", "0.5603178", "0.5581142", "0.55494976", "0.5513902", "0.55038077", "0.5458484", "0.5455285", "0.5407935", "0.5369515", "0.5359933", "0.5359933", "0.5359933"...
0.67128134
0
sql code, which raise error on freeze function
static getCheckFreezeFunctionSql(func, errorText, actionOnFreeze = "error") { let funcIdentifySql = CreateFunction.function2identifySql( func ); let sqlOnFreeze; if ( actionOnFreeze === "error" ) { sqlOnFreeze = `raise exception ${wrapText(errorText)};`; } else if ( ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "execute() {}", "execute() {}", "execute() {}", "function fnPreExecuteQuery() {\n var execute = true;\n debugs(\"In fnPreExecuteQuery\", \"A\");\n return execute;\n}", "execute() { }", "async function dbtx(data, next) {\r\n const { db } = data.req\r\n try {\r\n await db.query('BEGIN')\r\n ...
[ "0.60373336", "0.60373336", "0.60373336", "0.5706879", "0.55409145", "0.5530782", "0.537517", "0.5352232", "0.52915096", "0.52721673", "0.52526516", "0.52526516", "0.52526516", "0.5225952", "0.5178719", "0.5170501", "0.5167767", "0.516248", "0.51562756", "0.51470613", "0.5146...
0.6254961
0
CommonService.populateDataToGrid(templateUrl, title, vm.gridOptions, vm, popupId,searchtype);
function populateDataToGrid(templateUrl, gridTitle, gridOptions, caller, popupId, searchType, isMultiSelect) { modalInstance = $kWindow.open({ options : { modal : true, title : gridTitle, visible : false, width : '800', height : '550',...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function populateDataToGridCT(templateUrl,\n\t\t\t\t\t\t\t\t\tgridTitle, gridOptions, caller, popupId,\n\t\t\t\t\t\t\t\t\tsearchType, isMultiSelect) {\n\t\t\t\t\t\t\t\tmodalInstance = $kWindow.open({\n\t\t\t\t\t\t\t\t\toptions : {\n\t\t\t\t\t\t\t\t\t\tmodal : true,\n\t\t\t\t\t\t\t\t\t\ttitle : gridTitle,\n\t\t\t\t...
[ "0.77358323", "0.6347586", "0.63032985", "0.62870884", "0.6217545", "0.6122381", "0.6096079", "0.60955006", "0.6081318", "0.6075259", "0.602662", "0.6012512", "0.6005434", "0.59824294", "0.5973718", "0.5957622", "0.5930402", "0.59170616", "0.5910304", "0.5900913", "0.5885025"...
0.7691788
1
A forum submition callback for players to choose explore, sit tight and go look.
function formSubmit(callback){ $('form').submit(function() { //initiate submit listener var pass = $('#action').val().toLowerCase(); // grab the value of the submit forum in lowercase if ( pass !== ""){ switch (pass) { case 'sit tight': textDialogue(player, (player.name +": I think t...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function C101_KinbakuClub_Lauren_Ask() {\n\tif (ActorGetValue(ActorLove) < 0) OverridenIntroText = GetText(\"AskLetGo\");\n\tif (ActorGetValue(ActorLove) >= 5) OverridenIntroText = GetText(\"AskEnjoy\");\n\tif (ActorGetValue(ActorSubmission) >= 5) OverridenIntroText = GetText(\"AskBeGentle\");\n\tif (ActorGetValue...
[ "0.58729833", "0.5795278", "0.5696249", "0.5677285", "0.56633735", "0.56100917", "0.5585426", "0.55620897", "0.55495495", "0.5535031", "0.5522186", "0.54946834", "0.5474397", "0.54529035", "0.5436632", "0.5411209", "0.53934395", "0.5392162", "0.537033", "0.5351521", "0.533925...
0.5938197
0
Defer current action from current state to destination state
deferUntilTransition() { const queued = { type: NEXT_TRANSITION, args: this.currentActionArgs }; this.eventQueue.push( queued ); this.emit.call( this, DEFERRED, { state: this.state, queuedArgs: queued } ); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "transitionTo(state) {\n logger.debug(`Transaction state transition ${currentState} --> ${state}`)\n\n if (!VALID_STATE_TRANSITIONS[currentState].includes(state)) {\n throw new KafkaJSNonRetriableError(\n `Transaction state exception: Invalid transition ${currentState} --> ${state}`\n ...
[ "0.55678785", "0.5476186", "0.54025763", "0.5291909", "0.52884233", "0.52879536", "0.52736366", "0.5265069", "0.5241138", "0.5240978", "0.5190841", "0.51842666", "0.51827025", "0.51805127", "0.5177643", "0.5170586", "0.5138483", "0.5131519", "0.5118139", "0.5113651", "0.51114...
0.65132624
0
Call the InitData servlet to post and create some organizations, users and sensors
function initData(callback) { console.log("\n\n=========================================="); console.log("GETing INIT_DATA command."); console.log("------------------------------------------"); client.post("http://localhost:8080/AMT_Project/InitData", function(data, response) { console.log("INIT response status c...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function createUserData() {\n\n // Saves data for application storage\n EcwidApp.setAppStorage(initialConfig.private, function (value) {\n console.log('Initial private user preferences saved!');\n });\n\n // Saves data for public app config\n EcwidApp.setAppPublicConfig(initialConfig.public, ...
[ "0.5870927", "0.57044065", "0.5586971", "0.5560707", "0.55573916", "0.55540645", "0.5546412", "0.5453409", "0.54328465", "0.540378", "0.53529704", "0.5314108", "0.5310963", "0.5300665", "0.5282375", "0.52602446", "0.52524585", "0.5252161", "0.5232467", "0.5188758", "0.5161917...
0.6012392
0
POST observation requests in parallel
function postObservationRequestsInParallel(callback) { console.log("\n\n=========================================="); console.log("POSTing observation requests in parallel"); console.log("------------------------------------------"); var numberOfUnsuccessfulResponses = 0; async.parallel(requests, function(err, r...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function sendRequests(nb) {\n for (var i=0; i<nb; i++) {\n\n // Pick a random device and its corresponding SAS key\n deviceid = Math.floor((Math.random() * 100));\n devicename = deviceprefix + deviceid;\n device_sas = device_tokens[deviceid];\n\n // Assemble BSON payload\n payload.Temperature++;...
[ "0.6283857", "0.59420604", "0.5900379", "0.5871457", "0.58649844", "0.5815629", "0.57650685", "0.5728663", "0.5700451", "0.56719685", "0.5651468", "0.56383723", "0.5614118", "0.5606638", "0.55914587", "0.5573117", "0.55553216", "0.55441964", "0.55274147", "0.5515029", "0.5500...
0.7421902
0
Listen to feed changes in realtime The access token at the end is only needed for client side integrations
subscribeRealTime(userId) { const tToken = this.client.feed('timeline', userId).getReadOnlyToken(), timeline = this.client.feed('timeline', userId, tToken); timeline.subscribe(data => { this.dispatch(StreamActions.timeline(data)) }).then(() => { //console.log...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function onRefreshed(token) {\n refreshSubscribers.map(cb => cb(token))\n }", "function pullFeed () {\n worker.postMessage({url: `${api.getUrl()}/user/feed`, newest: newest, token: getToken(), user: myself.username});\n}", "function onListening() {\n var addr = server.address();\n var bind = typeof ad...
[ "0.6038037", "0.60282755", "0.59938973", "0.5982947", "0.59330976", "0.58994186", "0.5898478", "0.58719", "0.58268404", "0.5761735", "0.56655383", "0.56499565", "0.56296885", "0.56269073", "0.56234366", "0.5623279", "0.5611137", "0.5608212", "0.55878806", "0.55782706", "0.554...
0.6341973
0
getVersionIDByName gets the list of versions for a product and calls back with the version ID that matches ver.
function getVersionIDByName(prodID, callback) { var prodIDpath = '/rest/api/2/project/' + prodID +'/version'; var zapioptions = { url:params.jiraBaseUrl+ prodIDpath, auth: { user:params.userName, pass:params.passwd, sendImm...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function getVersionIDByName(prodID, callback) {\n var prodIDpath = '/rest/zapi/latest/util/versionBoard-list?projectId=' + prodID;\n\n var zapioptions = {\n host: params.zapiHost,\n port: params.zapiPort,\n path: prodIDpath,\n auth: params.zapiAuth,\n ...
[ "0.73656625", "0.62206846", "0.58725166", "0.5791818", "0.5557957", "0.54077005", "0.52735656", "0.52182376", "0.518197", "0.5171241", "0.5138578", "0.5125614", "0.51220745", "0.5065354", "0.5010468", "0.498859", "0.49871105", "0.498702", "0.49656746", "0.49565998", "0.493878...
0.73610085
1
getCycleID gets the Cycle ID for the cycle that matches the version ID and cycle name built during onPrepare;
function getCycleID(prodID,versionID, callback) { var cyclePath = '/public/rest/api/1.0/cycles/search?projectId='+ prodID + '&versionId=' + versionID; var token = JwtClient.generateJWT('GET', params.zephyrBaseUrl + cyclePath, JWT_EXPIRE); var zapioptions = { url: params.zep...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function getCycleID(versionID, callback) {\n var cyclePath = '/rest/zapi/latest/cycle?versionId=' + versionID;\n\n var zapioptions = {\n host: params.zapiHost,\n port: params.zapiPort,\n path: cyclePath,\n auth: params.zapiAuth,\n method: 'GET'\n...
[ "0.6416504", "0.507996", "0.5077272", "0.49487147", "0.4914266", "0.4898724", "0.47297385", "0.47297385", "0.47297385", "0.47297385", "0.47297385", "0.46533847", "0.46533847", "0.46533847", "0.46287665", "0.46193346", "0.4588453", "0.45533532", "0.45415112", "0.45415112", "0....
0.614274
1
reverse the execution list
function reverseExecutions(executions, callback){ var deferred = protractor.promise.defer(); var executionList = []; var num = 0; var j = executions.length; for(var i in executions){ executionList[i] = executions[j-1]; j = j-1; num++;...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "revert () {\n const reversedActions = [...this.actions].reverse()\n for (const action of reversedActions) {\n action.revert()\n }\n }", "revert() {\n this.defaultTask.splice(this.defaultTask.length - 1, 1);\n this.currentTaskIndex--;\n this.learntTask = null;\n }", "rever...
[ "0.63695365", "0.63205224", "0.6308201", "0.61480564", "0.60583436", "0.59670854", "0.5940802", "0.5901575", "0.58615965", "0.58538353", "0.57838815", "0.5775696", "0.5761791", "0.574427", "0.57256126", "0.5722541", "0.5704124", "0.5682804", "0.5671952", "0.56646043", "0.5661...
0.73127717
0
aggregate all executions getting from getExecutionData calls by batch.
function aggExecutions(callback){ var deferred = protractor.promise.defer(); var pnum = 0; // counts returned promises. //var offset = 0; var executionsList = []; var array = []; exList.splice(0,exList.length); getExecutionList(function(err,totalcount){ ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function executionSummaries()\n{\n var summaries = [];\n\n for (var i = 0; i < executions.length; i++) {\n var currExec = executions[i];\n\n var summaryIndex = summaries.findIndex( summary => { return (summary.ticker == currExec.ticker) ? true : false } );\n\n if (summaryIndex == -1) {\n...
[ "0.6594266", "0.5755694", "0.5612675", "0.53464264", "0.53372467", "0.5284418", "0.51462317", "0.51462317", "0.5079193", "0.5066998", "0.5059696", "0.50525147", "0.5040009", "0.49892008", "0.49766546", "0.4969671", "0.4968647", "0.49570146", "0.4941698", "0.49408257", "0.4919...
0.65383327
1
getExecutionIdByKey finds the Execution ID that matches the test case key, which is the Jira/Zephyr key.
function getExecutionIdByKey(key) { for (var i in params.executions.executions) { if (params.executions.executions[i].issueKey == key) { return params.executions.executions[i].execution.id; } } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function getExecutionIdByKey(key) {\n for (var i in params.executions.executions) {\n if (params.executions.executions[i].issueKey == key) {\n return params.executions.executions[i].id;\n }\n }\n }", "function getIssueIdFromExecutionByKey(key){\r\n for...
[ "0.8045318", "0.7838444", "0.69982475", "0.6971519", "0.65127367", "0.6478761", "0.58372647", "0.5831706", "0.5776307", "0.55197084", "0.5298726", "0.5288413", "0.52763987", "0.5162952", "0.5034683", "0.49833497", "0.48702028", "0.48025793", "0.47904307", "0.4769141", "0.4732...
0.8057493
0
getExecutionIndexByKey finds the Execution ID that matches the test case key, which is the Jira/Zephyr key.
function getExecutionIndexByKey(key) { for (var i in params.executions.executions) { if (params.executions.executions[i].issueKey == key) { return i; } } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function getExecutionIndexByKey(key) {\n for (var i in params.executions.executions) {\n if (params.executions.executions[i].issueKey == key) {\n return i;\n }\n }\n }", "function getExecutionIdByKey(key) {\r\n for (var i in params.executions.execution...
[ "0.7994588", "0.7507052", "0.74218065", "0.7369146", "0.5856749", "0.58202046", "0.5785844", "0.5595584", "0.5506126", "0.54263455", "0.53803563", "0.5359095", "0.52847195", "0.5234909", "0.51888436", "0.51019", "0.50875914", "0.5014671", "0.49539435", "0.49409196", "0.493512...
0.80017406
0
getIssueIdFromExecutionByKey finds the Issue ID that matches the test case key, which is the Jira/Zephyr key.
function getIssueIdFromExecutionByKey(key){ for (var i in params.executions.executions) { if (params.executions.executions[i].issueKey == key) { return params.executions.executions[i].execution.issueId; } } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function getExecutionIdByKey(key) {\r\n for (var i in params.executions.executions) {\r\n if (params.executions.executions[i].issueKey == key) {\r\n return params.executions.executions[i].execution.id;\r\n }\r\n }\r\n }", "function getExecutionIdByKey(key) {\...
[ "0.80298996", "0.80075216", "0.6970341", "0.6946143", "0.65762645", "0.6542714", "0.5954371", "0.5925925", "0.53638875", "0.52171904", "0.51998514", "0.5112607", "0.5073838", "0.49200633", "0.4891671", "0.48893875", "0.485252", "0.4793652", "0.47919995", "0.47906741", "0.4780...
0.8433502
0
wip sets a test case to work in progress by key
function wip(key, callback) { var deferred = protractor.promise.defer(); var expath = params.zephyrBaseUrl + '/public/rest/api/1.0/execution/' + getExecutionIdByKey(key); // encode var token = JwtClient.generateJWT('PUT', expath, JWT_EXPIRE); //console.log(expath); ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function wipStep(stepNum) {\n var deferred = protractor.promise.defer();\n\n var index = getExecutionIndexByKey(jasmine.getEnv().currentSpec.description);\n\n var testSteps = params.executions.executions[index].testSteps;\n\n for (var i in testSteps) {\n if (testSteps[i].orde...
[ "0.56076425", "0.5607412", "0.535014", "0.5252181", "0.51938385", "0.51481825", "0.51054895", "0.50812024", "0.5028443", "0.49190533", "0.489799", "0.489087", "0.48872167", "0.48250332", "0.47914457", "0.47905904", "0.47655183", "0.47398394", "0.47390625", "0.47246832", "0.47...
0.57555145
0
unExecute sets a test case to unexecuted by key
function unExecute(key, callback) { var deferred = protractor.promise.defer(); console.log(">>unExecute " + key); var expath = params.zephyrBaseUrl + '/public/rest/api/1.0/execution/' + getExecutionIdByKey(key); // encode var token = JwtClient.generateJWT('PUT', expath, ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function unExecute(key, comment, callback) {\n\n var expath = '/rest/zapi/latest/execution/' + getExecutionIdByKey(key) + '/execute';\n\n var exbody = '{ \\\"status\\\": \\\"-1\\\", \\\"comment\\\": ' + JSON.stringify(comment.substring(0, 750)) + ' }';\n\n var zapioptions = {\n ho...
[ "0.64427596", "0.5966111", "0.59558433", "0.5301199", "0.51923275", "0.5172227", "0.51597047", "0.50845927", "0.505811", "0.5047031", "0.49953976", "0.49809542", "0.49809542", "0.49809542", "0.4978124", "0.49342486", "0.49044454", "0.49015743", "0.48965636", "0.4886336", "0.4...
0.6174127
1
Blocked sets a test case to unexecuted by key
function blocked(key, callback) { var deferred = protractor.promise.defer(); var expath = params.zephyrBaseUrl + '/public/rest/api/1.0/execution/' + getExecutionIdByKey(key); // encode var token = JwtClient.generateJWT('PUT', expath, JWT_EXPIRE); console.log(expath); ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "async onDeny(request, id) {\n let requests = this.state.requests;\n let index = requests.indexOf(request);\n requests.splice(index, 1);\n this.setState({ requests });\n\n await membership.denyRequest(id);\n }", "deactivateApproach() {}", "function on_internal_disable()\n {\n return sy...
[ "0.5454339", "0.53374815", "0.5321715", "0.5225067", "0.5218383", "0.5218383", "0.5218383", "0.5218383", "0.5154802", "0.5147066", "0.5088286", "0.50858593", "0.5085538", "0.5085538", "0.5085538", "0.5085538", "0.5085538", "0.5085538", "0.5085538", "0.5085538", "0.5085538", ...
0.5546444
0
getExecutionAttachmentIds gets the attachments associated with a test execution
function getExecutionAttachmentIds(executionId, callback) { var deferred = protractor.promise.defer(); // console.log('>>getExecutionAttachmentIds ...'); //var executionId = getExecutionIdByKey(key); var expath = '/public/rest/api/1.0/attachment/search/execution?entityId=' + ex...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function getExecutionAttachmentIds(key, callback) {\n\n var expath = '/rest/zapi/latest/attachment/attachmentsByEntity?entityId=' + getExecutionIdByKey(key) + '&entityType=EXECUTION';\n\n var zapioptions = {\n host: params.zapiHost,\n port: params.zapiPort,\n path: ex...
[ "0.74259865", "0.6208999", "0.60994893", "0.60413104", "0.5823121", "0.56413096", "0.55484563", "0.54829574", "0.5346827", "0.5295774", "0.51517123", "0.51517123", "0.51517123", "0.51517123", "0.51334906", "0.5122642", "0.5114526", "0.49393326", "0.48615545", "0.4861231", "0....
0.7330992
1
deleteAllExecutionAttachments deletes all attachments that belong to a test execution
function deleteAllExecutionAttachments(attachments) { var deferred = protractor.promise.defer(); if (attachments.length == 0) { deferred.fulfill(true); } var num = 0; for (var i in attachments) { deleteExecutionAttachment(attachments[i]).then(...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function deleteAllExecutionAttachments(attachments) {\n var deferred = protractor.promise.defer();\n\n if (attachments.data.length == 0) {\n deferred.fulfill(true);\n }\n\n var num = 0;\n\n for (var i in attachments.data) {\n deleteExecutionAttachment(attach...
[ "0.7916981", "0.72363687", "0.7187178", "0.69189006", "0.67384315", "0.6307974", "0.6294444", "0.6191124", "0.6127654", "0.5887099", "0.5444239", "0.5411177", "0.5406615", "0.53772527", "0.5284415", "0.5237874", "0.5228357", "0.51976156", "0.5197057", "0.51941067", "0.5170912...
0.7969669
0
attachScreenshotToExecution attaches a screenshot to a test execution.
function attachScreenshotToExecution(key, stream, screenShotName, comment,callback) { //console.log(">>attachScreenshotToExecution..."+ screenShotName); //var deferred = protractor.promise.defer(); var zurl = params.zephyrBaseUrl + '/public/rest/api/1.0/attachment?comment='+comment+'&cycleI...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function attachScreenshotToExecution(key, stream, screenShotName) {\n var deferred = protractor.promise.defer();\n\n var zurl = 'http://' + params.zapiAuth + '@' + params.zapiHost + '/rest/zapi/latest/attachment?entityId=' + getExecutionIdByKey(key) + '&entityType=EXECUTION';\n var request = r...
[ "0.67930245", "0.549986", "0.5253562", "0.5212387", "0.5082406", "0.5071418", "0.5038802", "0.49968904", "0.4953976", "0.49166453", "0.49022597", "0.48862743", "0.4840754", "0.4834711", "0.4765447", "0.4731692", "0.47099525", "0.470431", "0.46836814", "0.4614764", "0.45948637...
0.5958915
1
getZapiIDs gets the product ID, Version ID, and Cycle ID
function getZapiIDs(callback) { getProductIDByName(function (err, ProdID) { params.zProdID = ProdID; getVersionIDByName(ProdID, function (err, VerID) { params.zVerID = VerID; getCycleID(VerID, function (err, CycleID) { params.zCyc...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function getZapiIDs(callback) {\n getProductIDByName(function (err, ProdID) {\n params.zProdID = ProdID;\n getVersionIDByName(ProdID, function (err, VerID) {\n params.zVerID = VerID;\n getCycleID(VerID, function (err, CycleID) {\n params...
[ "0.8153892", "0.60112214", "0.6008893", "0.5807534", "0.57186973", "0.57019776", "0.5601941", "0.5549967", "0.53234065", "0.5301972", "0.5139809", "0.5043317", "0.50402707", "0.5022963", "0.49969065", "0.4975341", "0.49674582", "0.49367496", "0.48991022", "0.48721597", "0.486...
0.8164868
0
onPrepare does the following: Gets all the internal Zephyr IDs (cycle, version, product, and execution IDs) and sets them in browser.params Sets all executions in the cycle to work in progress, and removes old attachments from executions. Gets all execution test steps, saves them for each execution as executions[i].tes...
function onPrepare(specs) { console.log(">> onPrepare specs=" + specs); var deferred = protractor.promise.defer(); var time = new Date().getTime();; console.log("Retrieving ZAPI IDs..."); //getZapiIDs(function (err, callback) { getProductIDByName(function (e...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function onPrepare() {\n var deferred = protractor.promise.defer();\n var time = new Date().getTime();;\n\n getZapiIDs(function (err, callback) {\n // Then get the executions for the cycle\n console.log(\"Retrieving ZAPI IDs...\");\n getExecutionData(function (...
[ "0.7456148", "0.6700061", "0.6687003", "0.6482851", "0.64370656", "0.5733159", "0.57301086", "0.5677136", "0.5620835", "0.5598693", "0.5441931", "0.5342511", "0.53163886", "0.52683944", "0.5257962", "0.5227742", "0.51562685", "0.51312643", "0.51192194", "0.51172924", "0.51041...
0.71259296
1
prepareTestSteps does the following: Gets all execution test steps, saves them for each execution as executions[i].testSteps. For each test step, it delete existing attachments and sets it to unexecuted. Should be ran in Jasmine's onPrepare(); This should finish executing before beforeEach starts.
function prepareTestSteps() { var deferred = protractor.promise.defer(); num = 0; for (var i in params.executions.executions) { //console.log("params.executions " + i + " " + JSON.stringify(params.executions.executions[i])); prepareTestStepAttachments(params.execut...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function prepareTestSteps() {\n var deferred = protractor.promise.defer();\n\n num = 0;\n for (var i in params.executions.executions) {\n //console.log(\"params.executions \" + i + \" \" + JSON.stringify(params.executions.executions[i]));\n prepareTestStepAttachments(para...
[ "0.7247282", "0.6902719", "0.6785754", "0.6355318", "0.58080983", "0.5806912", "0.5790533", "0.56221884", "0.5565066", "0.5540171", "0.5466439", "0.5454146", "0.53931344", "0.53705454", "0.5214048", "0.5137539", "0.5084183", "0.50301856", "0.5007241", "0.50017387", "0.4995562...
0.7246382
1
prepareTestStepAttachments cycles through the list of TestSteps of an execution to set them to unexecute and remove attachments.
function prepareTestStepAttachments(testExecution, callback) { console.log('>>prepareTestStepAttachments....'); var deferred = protractor.promise.defer(); var num = 0; var testSteps = testExecution.testSteps; var expected = testSteps.length; if (expected == 0) { ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function prepareTestStepAttachments(testExecution, callback) {\n var deferred = protractor.promise.defer();\n var num = 0;\n var testSteps = testExecution.testSteps;\n var expected = testSteps.length;\n\n if (expected == 0) {\n deferred.reject(\"ZAPI.JS ERROR: No Test ...
[ "0.7476685", "0.64647484", "0.64631957", "0.6397651", "0.63077986", "0.62601906", "0.6252324", "0.6021742", "0.5131372", "0.49438816", "0.49097437", "0.48128077", "0.47956392", "0.47908184", "0.4742846", "0.46908695", "0.44760412", "0.44664314", "0.4461329", "0.4442657", "0.4...
0.72436833
1
deleteTestStepAttachments deletes any attachments for the test step
function deleteTestStepAttachments(testStep, callback) { var deferred = protractor.promise.defer(); var numDeleted = 0; getStepResultAttachments(testStep, function (err, attachments) { if (attachments.data.length == 0) { deferred.fulfill(true); ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function deleteTestStepAttachments(testStep, callback) {\n var deferred = protractor.promise.defer();\n\n var numDeleted = 0;\n getStepResultAttachments(testStep, function (err, attachments) {\n if (attachments.data.length == 0) {\n deferred.fulfill(true);\n ...
[ "0.7772162", "0.6924347", "0.6813294", "0.67645353", "0.6725384", "0.66838706", "0.66171986", "0.6468742", "0.6135861", "0.6092274", "0.6048263", "0.5823032", "0.5740804", "0.57162833", "0.56854326", "0.5314689", "0.53139925", "0.51227814", "0.50608236", "0.50366294", "0.4972...
0.7816563
0
countAttachments returns the number of attachments. there is not a length attribute for attachment data.
function countAttachments(attachments, callback) { var numAttachments = 0; for (var i in attachments.data) { if (attachments.data[i].fileId) { //console.log(attachments.data[i].fileId); numAttachments++; } } callback...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function countAttachments(attachments, callback) {\n\n var numAttachments = 0;\n\n for (var i in attachments.data) {\n\n if (attachments.data[i].fileId) {\n //console.log(attachments.data[i].fileId);\n numAttachments++;\n }\n }\n\n cal...
[ "0.7847944", "0.73826367", "0.6269962", "0.54347503", "0.53559923", "0.5352823", "0.5328036", "0.5319257", "0.5317194", "0.52922785", "0.52922785", "0.52922785", "0.52922785", "0.528735", "0.52870214", "0.52531403", "0.5210826", "0.5187639", "0.51697606", "0.5161976", "0.5132...
0.7901547
0
afterEach passes or fails the current test in Zephyr, it also adds comments with the browser version and platform. On failure it gets the stack trace information, logs it to a file, and uploads it as an attachment to the test execution.
function afterEach() { var deferred = protractor.promise.defer(); var spec = jasmine.getEnv().currentSpec; var attachmentName = spec.description + '_' + browser.browserName.split(' ').join('_') + '_log.txt'; var comment = 'Browser Version: ' + browser.browserVersion + ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function afterEach() {\n var deferred = protractor.promise.defer();\n\n var spec = jasmine.getEnv().currentSpec;\n var attachmentName = spec.description + '_' + browser.browserName.split(' ').join('_') + '_log.txt';\n var comment = 'Browser Version: ' + browser.browserVersion +\n ...
[ "0.732937", "0.61624086", "0.60589725", "0.6019155", "0.59725", "0.59089214", "0.58105725", "0.57853746", "0.569051", "0.56403476", "0.55444527", "0.54762495", "0.5335908", "0.53262717", "0.5265062", "0.52398324", "0.5230255", "0.52160597", "0.519331", "0.5187324", "0.5185883...
0.7519903
0
getAllTestSteps gets the test steps for each execution in the cycle returns a promise once test steps for every execution has been set via setexecutionTestStpes;
function getAllTestSteps() { var deferred = protractor.promise.defer(); var pnum = 0; // counts returned promises for (var i in params.executions.executions) { setExecutionTestSteps(i).then(function (prom) { if (prom) { pnum++; ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function getAllTestSteps() {\n var deferred = protractor.promise.defer();\n var pnum = 0; // counts returned promises\n\n for (var i in params.executions.executions) {\n setExecutionTestSteps(i).then(function (prom) {\n if (prom) {\n pnum++;\n ...
[ "0.85981035", "0.7305713", "0.72753227", "0.7170324", "0.7112645", "0.6412404", "0.6329507", "0.6219731", "0.5930251", "0.59137017", "0.5714618", "0.5709109", "0.56775594", "0.56506854", "0.5650046", "0.5627524", "0.56061494", "0.5582001", "0.55441934", "0.55406785", "0.55179...
0.86180186
0
setExecutionTestSteps sets all exectuion steps to execution.testSteps
function setExecutionTestSteps(index) { var deferred = protractor.promise.defer(); getStepsOfExecution(params.executions.executions[index].issueKey,params.executions.executions[index].execution.issueId,params.executions.executions[index].execution.id, function (err, orderedTestSteps) { ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function setExecutionTestSteps(index) {\n var deferred = protractor.promise.defer();\n\n\n getStepsOfExecution(params.executions.executions[index].id, function (err, orderedTestSteps) {\n if (err) {\n console.log('');\n console.log(err);\n conso...
[ "0.69873667", "0.61838096", "0.61517316", "0.5105442", "0.50754255", "0.49115983", "0.4838003", "0.48301545", "0.47938046", "0.4776916", "0.4759903", "0.4729139", "0.46959403", "0.46858376", "0.46719807", "0.4671962", "0.46620113", "0.46151474", "0.46005327", "0.45814547", "0...
0.68983716
1
beforeEach() sets up variables needed to pass each test step, and takes a screenshot.
function beforeEach() { //console.log(">> beforeEach"); var deferred = protractor.promise.defer(); spec = jasmine.getEnv().currentSpec; spec.startTime = new Date().getTime(); spec.failures = 0; //console.log('Current spec is: '+ spec.description); brows...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function beforeEach() {\n var deferred = protractor.promise.defer();\n \n \n spec = jasmine.getEnv().currentSpec;\n spec.startTime = new Date().getTime();\n spec.failures = 0;\n\n browser.controlFlow().execute(function () {\n deferred.fulfill(takeScreensh...
[ "0.725951", "0.59474313", "0.58891904", "0.5886894", "0.5883457", "0.5745622", "0.56747574", "0.55704033", "0.5563561", "0.55600405", "0.55567753", "0.55437046", "0.5513396", "0.5499133", "0.54731923", "0.54213667", "0.54182327", "0.526795", "0.5221792", "0.52200586", "0.5156...
0.69952005
1
getStepsOfExecution gets all of the test steps and returns them in the proper order. params executionId The ID of the execution.
function getStepsOfExecution(issueKey,issueID,executionId, callback) { var deferred = protractor.promise.defer(); getTestStepsFromIssue(issueID, function (err, testSteps) { if(params.updateStepResultsOpt != stepResultsOpt.ignoreResults.id){ getStepResultsByExecutionId(e...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function getStepsOfExecution(executionId, callback) {\n var deferred = protractor.promise.defer();\n\n\n getIssueIDbyExecutionID(executionId, function (err, issueID) {\n getTestStepsFromIssue(issueID, function (err, testSteps) {\n getStepResultsByExecutionId(executionId, fun...
[ "0.8252505", "0.67923826", "0.6787266", "0.6730345", "0.6190396", "0.5838972", "0.58353376", "0.5290264", "0.5183931", "0.518123", "0.5165199", "0.51118016", "0.51058173", "0.5095388", "0.5039408", "0.5017162", "0.49821183", "0.49815878", "0.4966972", "0.49396348", "0.4922237...
0.73798525
1
getIssueID gets the issue ID of an Test in Zephyr params callbackThe callback function.
function getIssueIdOfCurrentSpec(callback) { var zpath = '/rest/zapi/latest/execution/' + getExecutionIdByKey(jasmine.getEnv().currentSpec.description) + '/'; var zapioptions = { host: params.zapiHost, port: params.zapiPort, path: zpath, auth: pa...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function getIssueIdOfCurrentSpec(callback) {\n var zpath = '/rest/zapi/latest/execution/' + getExecutionIdByKey(jasmine.getEnv().currentSpec.description) + '/';\n\n\n var zapioptions = {\n host: params.zapiHost,\n port: params.zapiPort,\n path: zpath,\n aut...
[ "0.64696985", "0.6352634", "0.60768175", "0.6031939", "0.578009", "0.5530395", "0.5317433", "0.52788067", "0.52332324", "0.5229774", "0.5169271", "0.51032996", "0.50140303", "0.49829298", "0.49788767", "0.4943649", "0.49287948", "0.48945045", "0.48778242", "0.4842375", "0.482...
0.65356505
0
getIssueIDbyExecutionID gets the issue ID of an Test in Zephyr
function getIssueIDbyExecutionID(executionId, callback) { var zpath = '/rest/zapi/latest/execution/' + executionId + '/'; var zapioptions = { host: params.zapiHost, port: params.zapiPort, path: zpath, auth: params.zapiAuth, method: 'GE...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function getIssueIDbyExecutionID(executionId, callback) {\n var zpath = '/rest/zapi/latest/execution/' + executionId + '/';\n\n var zapioptions = {\n host: params.zapiHost,\n port: params.zapiPort,\n path: zpath,\n auth: params.zapiAuth,\n method...
[ "0.73727363", "0.6983932", "0.6856027", "0.6849464", "0.67028683", "0.6702802", "0.5929348", "0.5911199", "0.5906873", "0.58906806", "0.5870402", "0.5734834", "0.56487226", "0.5622748", "0.55435425", "0.5531558", "0.5518138", "0.5411108", "0.53964025", "0.53964025", "0.539640...
0.7413304
0
getTestStepsFromIssue gets the test steps from a test case in Zephyr. These may not be in order.
function getTestStepsFromIssue(issueID, callback) { // console.log(">>getTestStepsFromIssue..." +issueID); var zurl = '/public/rest/api/1.0/teststep/' + issueID + '?projectId='+params.zProdID; var c_path = 'GET&'+ zurl; CANONICAL_PATH = c_path.replace('?','&'); jwt_payload...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function getTestStepsFromIssue(issueID, callback) {\n var zpath = '/rest/zapi/latest/teststep/' + issueID + '/';\n var zapioptions = {\n host: params.zapiHost,\n port: params.zapiPort,\n path: zpath,\n auth: params.zapiAuth,\n method: 'GET',\n ...
[ "0.74968016", "0.5805955", "0.5754183", "0.5714276", "0.56241083", "0.5615453", "0.54563177", "0.5403696", "0.5312207", "0.5249438", "0.5228176", "0.52054477", "0.52054477", "0.5139546", "0.51359284", "0.5078402", "0.4976498", "0.4976498", "0.4976498", "0.4976498", "0.4921586...
0.7580826
0
getStepResultsByExecutionId returns the step results from an execution, this JSON contains the test step order.
function getStepResultsByExecutionId(executionId,issueId, callback) { //console.log(">>getStepResultsByExecutionId..."); var expath = '/public/rest/api/1.0/stepresult/search?executionId=' + executionId + '&issueId=' + issueId ; var c_path = 'GET&'+ expath; CANONICAL_PATH = c_path....
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function getStepResultsByExecutionId(executionId, callback) {\n var expath = '/rest/zapi/latest/stepResult?executionId=' + executionId;\n\n var zapioptions = {\n host: params.zapiHost,\n port: params.zapiPort,\n path: expath,\n auth: params.zapiAuth,\n ...
[ "0.75862813", "0.68607074", "0.66275245", "0.5422952", "0.5313131", "0.52487415", "0.52048826", "0.5104007", "0.5095031", "0.5072327", "0.5055532", "0.5021027", "0.49820724", "0.4978399", "0.49498662", "0.49459955", "0.48881406", "0.48515096", "0.48375356", "0.4835712", "0.47...
0.70519453
1
mergeStepsAndResults Creates a new array that has the test step IDs and order so we can have useful data
function mergeStepsAndResults(stepRes, testSteps, callback) { //console.log(">>mergeStepsAndResults..."); var steps = []; for (var i in stepRes.stepResults) { for (var j in testSteps) { if (stepRes.stepResults[i].stepId == testSteps[j].id) { ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function mergeStepsAndResults(stepResults, testSteps, callback) {\n var steps = [];\n\n for (var i in stepResults) {\n for (var j in testSteps) {\n if (stepResults[i].stepId == testSteps[j].id) {\n\n var step = {\n id: stepResults[i]...
[ "0.7777474", "0.5504172", "0.5427443", "0.5295646", "0.52861726", "0.52654666", "0.52532405", "0.52504367", "0.5179338", "0.5099098", "0.5098499", "0.50862616", "0.4958994", "0.4953386", "0.4917132", "0.4865042", "0.4825081", "0.48243597", "0.48243597", "0.48153862", "0.48130...
0.7335376
1
passStep finds the step result ID for the test by its stepnum, calls passStepByStepResultID to do the passing.
function passStep(stepNum) { var deferred = protractor.promise.defer(); var index = getExecutionIndexByKey(jasmine.getEnv().currentSpec.description); var testSteps = params.executions.executions[index].testSteps; for (var i in testSteps) { if (testSteps[i].orderId ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function passStep(stepNum) {\n var deferred = protractor.promise.defer();\n\n var index = getExecutionIndexByKey(jasmine.getEnv().currentSpec.description);\n\n var testSteps = params.executions.executions[index].testSteps;\n\n for (var i in testSteps) {\n if (testSteps[i].ord...
[ "0.78029585", "0.6085431", "0.6024347", "0.597578", "0.5877093", "0.5824286", "0.56773907", "0.56004566", "0.55253553", "0.55082893", "0.5504344", "0.5503836", "0.5495842", "0.5475793", "0.5378271", "0.5333653", "0.5322987", "0.5317983", "0.5313799", "0.53062755", "0.52583015...
0.779771
1
failStep finds the step result ID for the test by its stepnum, calls failStepByStepResultID to do the failing.
function failStep(stepNum) { var deferred = protractor.promise.defer(); var index = getExecutionIndexByKey(jasmine.getEnv().currentSpec.description); var testSteps = params.executions.executions[index].testSteps; for (var i in testSteps) { if (testSteps[i].orderId ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function failStep(stepNum) {\n var deferred = protractor.promise.defer();\n\n var index = getExecutionIndexByKey(jasmine.getEnv().currentSpec.description);\n\n var testSteps = params.executions.executions[index].testSteps;\n\n for (var i in testSteps) {\n if (testSteps[i].ord...
[ "0.780982", "0.6552446", "0.63063264", "0.6261172", "0.6169437", "0.616846", "0.58986163", "0.5635289", "0.55985975", "0.559219", "0.54738784", "0.5467916", "0.54543674", "0.53825694", "0.531108", "0.5271374", "0.52326804", "0.5201348", "0.5165072", "0.51571405", "0.5143229",...
0.78156066
0
blockStep finds the step result ID for the test by its stepnum, calls failStepByStepResultID to do the failing.
function blockStep(stepNum) { var index = getExecutionIndexByKey(jasmine.getEnv().currentSpec.description); if(index == -1) { return; } var deferred = protractor.promise.defer(); var testSteps = params.executions.executions[index].testSteps; for(v...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function failStep(stepNum) {\r\n var deferred = protractor.promise.defer();\r\n\r\n var index = getExecutionIndexByKey(jasmine.getEnv().currentSpec.description);\r\n\r\n var testSteps = params.executions.executions[index].testSteps;\r\n\r\n for (var i in testSteps) {\r\n if (...
[ "0.66475606", "0.6621749", "0.6084518", "0.60469884", "0.58150774", "0.57995373", "0.5384161", "0.51371694", "0.51306313", "0.51258135", "0.5055191", "0.5041182", "0.50196886", "0.49719736", "0.49549255", "0.49247435", "0.49192634", "0.4900686", "0.48720297", "0.48402077", "0...
0.7374835
0
wipStep finds the step result ID for the test by its stepnum, calls wipStepByStepResultID to do the failing.
function wipStep(stepNum) { var deferred = protractor.promise.defer(); var index = getExecutionIndexByKey(jasmine.getEnv().currentSpec.description); var testSteps = params.executions.executions[index].testSteps; for (var i in testSteps) { if (testSteps[i].orderId =...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function wipStep(stepNum) {\n var deferred = protractor.promise.defer();\n\n var index = getExecutionIndexByKey(jasmine.getEnv().currentSpec.description);\n\n var testSteps = params.executions.executions[index].testSteps;\n\n for (var i in testSteps) {\n if (testSteps[i].orde...
[ "0.7467135", "0.64986455", "0.6460614", "0.63478494", "0.62992364", "0.62378824", "0.622908", "0.5991844", "0.59113777", "0.56604356", "0.5573124", "0.5476801", "0.5470992", "0.5312691", "0.53082454", "0.5269847", "0.52587295", "0.5221087", "0.5067184", "0.49993348", "0.47995...
0.746043
1
unExecuteStep finds the step result ID for the test by its stepnum, calls unExecuteStepByStepResultID to do the failing.
function unExecuteStep(stepNum) { var deferred = protractor.promise.defer(); var index = getExecutionIndexByKey(jasmine.getEnv().currentSpec.description); var testSteps = params.executions.executions[index].testSteps; for (var i in testSteps) { if (testSteps[i].ord...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function unExecuteStep(stepNum) {\n var deferred = protractor.promise.defer();\n\n var index = getExecutionIndexByKey(jasmine.getEnv().currentSpec.description);\n\n var testSteps = params.executions.executions[index].testSteps;\n\n for (var i in testSteps) {\n if (testSteps[i...
[ "0.7774901", "0.6666926", "0.66010994", "0.6057201", "0.6005599", "0.541559", "0.51534855", "0.5144197", "0.5127571", "0.50367177", "0.48890352", "0.4868598", "0.48635325", "0.48159492", "0.4777883", "0.4777883", "0.47765306", "0.4739754", "0.46941456", "0.46695215", "0.46568...
0.7744661
1
passStepByStepResultID sends the http request to pass a test step
function passStepByStepResultID(stepResultId,issueId,executionId, callback) { //console.log(">>passStepByStepResultID..."+stepResultId); var deferred = protractor.promise.defer(); var expath = params.zephyrBaseUrl + '/public/rest/api/1.0/stepresult/' + stepResultId ; // encode ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function wipStepByStepResultID(stepResultId,issueId,executionId, callback) {\r\n console.log(\">>wipStepByStepResultID...\");\r\n var deferred = protractor.promise.defer();\r\n\r\n var expath = params.zephyrBaseUrl + '/public/rest/api/1.0/stepresult/' + stepResultId ;\r\n\r\n\r\n // enc...
[ "0.7508411", "0.741821", "0.7383389", "0.73210084", "0.7230102", "0.6745556", "0.67432016", "0.63165796", "0.61382574", "0.6138148", "0.58807635", "0.58659846", "0.5837309", "0.57345235", "0.5734055", "0.57014626", "0.5593956", "0.5584573", "0.55769306", "0.5526123", "0.53723...
0.78864837
0
failStepByStepResultID sends the http request to fail a test step
function failStepByStepResultID(stepResultId,issueId,executionId, callback) { //console.log(">>failStepByStepResultID..."+stepResultId); var deferred = protractor.promise.defer(); var expath = params.zephyrBaseUrl + '/public/rest/api/1.0/stepresult/' + stepResultId ; // encode ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function failStepByStepResultID(stepResultId, callback) {\n var deferred = protractor.promise.defer();\n\n var expath = '/rest/zapi/latest/stepResult/' + stepResultId + '/quickExecute';\n\n var exbody = \"{ \\\"status\\\": \\\"2\\\" }\"\n\n var zapioptions = {\n host: params...
[ "0.73922414", "0.73131406", "0.73029417", "0.6906048", "0.6829791", "0.6724985", "0.6185701", "0.61190975", "0.6096542", "0.60846627", "0.6068605", "0.603546", "0.59846365", "0.5696988", "0.5632247", "0.56267667", "0.5587991", "0.5583432", "0.5536696", "0.5516592", "0.5471382...
0.7746606
0
wipStepByStepResultID sends the http request to wip a test step
function wipStepByStepResultID(stepResultId,issueId,executionId, callback) { console.log(">>wipStepByStepResultID..."); var deferred = protractor.promise.defer(); var expath = params.zephyrBaseUrl + '/public/rest/api/1.0/stepresult/' + stepResultId ; // encode var toke...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function wipStep(stepNum) {\n var deferred = protractor.promise.defer();\n\n var index = getExecutionIndexByKey(jasmine.getEnv().currentSpec.description);\n\n var testSteps = params.executions.executions[index].testSteps;\n\n for (var i in testSteps) {\n if (testSteps[i].orde...
[ "0.74694663", "0.7455885", "0.7195434", "0.7133943", "0.66111034", "0.64517033", "0.6368374", "0.6312222", "0.6307363", "0.58247226", "0.57632667", "0.5706208", "0.56828356", "0.54165095", "0.5409839", "0.5367097", "0.5357408", "0.53486675", "0.5341207", "0.5312072", "0.52378...
0.7737039
0
getBrowserstackBuildId gets build id from browserstack.
function getBrowserstackBuildId(callback){ var url = '/builds.json' request({ method: 'GET', url: params.broswerstackHost + url, auth: { user:params.browserstackUser, pass:params.browserstackKey, sendImmediatel...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function getBrowserstackSessionId(buildId,sessionName,callback){\r\n var url = '/builds/'+ buildId + '/session.json?status=running'\r\n request({\r\n method: 'GET',\r\n url: params.broswerstackHost + url,\r\n auth: {\r\n user:params.browserstackUser,\...
[ "0.6950454", "0.6344305", "0.58447003", "0.5509753", "0.5305923", "0.5281586", "0.5224005", "0.52161205", "0.52105546", "0.5018068", "0.49629974", "0.49629974", "0.49472812", "0.4931399", "0.49158096", "0.49141175", "0.49107987", "0.4904378", "0.48776883", "0.48680437", "0.48...
0.8524843
0
getBrowserstackSessionId gets session id from browserstack.
function getBrowserstackSessionId(buildId,sessionName,callback){ var url = '/builds/'+ buildId + '/session.json?status=running' request({ method: 'GET', url: params.broswerstackHost + url, auth: { user:params.browserstackUser, ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function getSessionId() {\n\tvar jsId = document.cookie.match(/sessionid=[^;]+/);\n\tif (jsId != null) {\n\t\tif (jsId instanceof Array)\n\t\t\tjsId = jsId[0].substring(10);\n\t\telse\n\t\t\tjsId = jsId.substring(10);\n\t}\n\treturn jsId;\n}", "get zkSessionId() {\n if (!this.zkClient) {\n return;\n }...
[ "0.6634486", "0.6617285", "0.6529435", "0.5832185", "0.58280325", "0.57436115", "0.5727526", "0.5612242", "0.55746055", "0.5446913", "0.54379725", "0.54296416", "0.54135233", "0.5343414", "0.5315855", "0.529389", "0.52320904", "0.51114744", "0.5098896", "0.5075788", "0.507295...
0.789312
0
function recursionOutput(10) > 12345678910
function recursionOutput(num) { if (num == "1") { return num; } else { return recursionOutput(num - 1) + `${num}`; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function printNumber(n) {\n if (n<=10) {\n return\n };\n console.log(n);\n \n printNumber(n+1);\n}", "function recursive(n = 15){\n console.log(\"recursive \"+ n);\n if(n > 0){\n recursive(n - 1);\n }\n return;\n}", "function recurse (s) { /...
[ "0.6649812", "0.6420213", "0.6393252", "0.6384902", "0.6317009", "0.6295469", "0.62792355", "0.62298024", "0.6186373", "0.6181829", "0.6181298", "0.6090837", "0.60754544", "0.6039133", "0.60061324", "0.5991757", "0.5980183", "0.5933852", "0.5922647", "0.59150726", "0.59097517...
0.69949
0
on button click fetch data
function ButtonClick() { fetch(URL).then(function(response) { response.json().then(function(text) { cats(text); }); }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "handleClick() {\n this.fetchData();\n }", "function getData() {\n var indeedAPI = getIndeedAPIUrl()\n $('.api_call').click(function(event) {\n event.preventDefault();\n $.ajax({\n url: indeedAPI,\n dataType: 'jsonp'\n })\n .done(function(response){\n results = response.results;\n...
[ "0.7239072", "0.6439327", "0.6358546", "0.63437575", "0.62969124", "0.61992717", "0.61730003", "0.61630857", "0.61547387", "0.6128811", "0.61140394", "0.61091197", "0.6097417", "0.60639286", "0.6060487", "0.6057888", "0.60550094", "0.60524684", "0.60438466", "0.6039778", "0.6...
0.6644196
1
get the input ellipsoids from the standard class URL
function getInputEllipsoids() { const INPUT_ELLIPSOIDS_URL = "https://ncsucgclass.github.io/prog1/ellipsoids.json"; // load the ellipsoids file var httpReq = new XMLHttpRequest(); // a new http request httpReq.open("GET",INPUT_ELLIPSOIDS_URL,false); // init the request httpReq.send...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "get ellipsoid() {\n return this.options.ellipsoid;\n }", "function loadEllipes(lights,eye) {\n // var inputTriangles = getJSONFile(INPUT_TRIANGLES_URL,\"triangles\");\n // var inputEcllipes = ellipesJson();\n\n var inputEcllipes = getJSONFile(INPUT_SPHERES_URL,\"ellipsoids\");\n\n if (inputEcllip...
[ "0.5885924", "0.53806007", "0.52947867", "0.52913135", "0.52418685", "0.503425", "0.49780872", "0.495252", "0.49443886", "0.48855582", "0.4858993", "0.4843237", "0.4831435", "0.47934908", "0.4784936", "0.47818184", "0.47629565", "0.47594118", "0.47594118", "0.4746545", "0.473...
0.6970071
1
get the input triangles from the standard class URL
function getInputTriangles() { const INPUT_TRIANGLES_URL = "https://ncsucgclass.github.io/prog1/triangles.json"; // load the triangles file var httpReq = new XMLHttpRequest(); // a new http request httpReq.open("GET",INPUT_TRIANGLES_URL,false); // init the request httpReq.send(null...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function loadTriangles() {\n var inputTriangles = getJSONFile(INPUT_TRIANGLES_URL,\"triangles\");\n var accept_num = inputTriangles.length;\n if (inputTriangles != String.null) { \n var whichSetVert; // index of vertex in current triangle set\n var whichSetTri; // index of triangle in curren...
[ "0.586061", "0.5717929", "0.5601151", "0.55940175", "0.5496561", "0.54423505", "0.5376264", "0.53446573", "0.5273575", "0.5238312", "0.5208653", "0.5146922", "0.51428443", "0.50966716", "0.49969453", "0.4981022", "0.4964667", "0.4955152", "0.49509385", "0.4948941", "0.4905759...
0.68884534
0
put random points in the ellipsoids from the class github
function drawRandPixelsInInputEllipsoids(context) { var inputEllipsoids = getInputEllipsoids(); var w = context.canvas.width; var h = context.canvas.height; var imagedata = context.createImageData(w,h); const PIXEL_DENSITY = 0.1; var numCanvasPixels = (w*h)*PIXEL_DENSITY; if (inputElli...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function drawRandPixelsInInputEllipsoids(context) {\n var inputEllipsoids = getInputEllipsoids();\n var w = context.canvas.width;\n var h = context.canvas.height;\n var imagedata = context.createImageData(w,h);\n const PIXEL_DENSITY = 0.05;\n var numCanvasPixels = (w*h)*PIXEL_DENSITY; \n \n ...
[ "0.7088904", "0.705131", "0.6310659", "0.6287798", "0.6223502", "0.6209318", "0.61992705", "0.6159535", "0.6113679", "0.61095864", "0.6070117", "0.60407734", "0.60300386", "0.60073924", "0.5937795", "0.5931865", "0.59290624", "0.59248847", "0.59109896", "0.5900603", "0.589513...
0.70957667
0
draw BlinnPhong shaded triangles using raycasting
function rayCasting(context) { var inputTriangles = getInputTriangles(); var w = context.canvas.width; var h = context.canvas.height; var imagedata = context.createImageData(w,h); if (inputTriangles != String.null) { var n = inputTriangles.length; // the number of input files ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "show(w) {\n // Initialize variables to highlight the walls in the visual field\n // \"highlight\" is an array of fragments\n // A \"fragment\" is a series of points on the same wall\n // Each \"fragment\" will be rendered as a white stroke (with vertices)\n let highlight = [];\n let fragmentId = ...
[ "0.6544861", "0.64169616", "0.6411866", "0.6271838", "0.621649", "0.6097609", "0.6064539", "0.60559386", "0.6015057", "0.600091", "0.5955107", "0.5918525", "0.5918123", "0.5908599", "0.59083974", "0.5892429", "0.58589256", "0.58309835", "0.58269006", "0.58159095", "0.57969546...
0.6549926
0
Show all species on the map and table
function showAll() { // Get all the observations from our data.js and format them so we can work with the data const observations = getAllObservations(); // Update the map and table updateMap(observations, map); updateTable(observations); updateTableTitle(`All Species (${observations.length})`); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function getSpecies(){\n return Plant_Species.findAll({\n attributes: ['species_id', 'common_name', 'botanical_name'],\n order: [\n ['common_name', 'ASC'],\n ]\n })\n}", "function getShelters(state, map) {\n\t\n\t// Axios request to real world data\n\taxios.get('https://serv...
[ "0.63785625", "0.60413814", "0.592389", "0.592389", "0.58809507", "0.58671737", "0.5856206", "0.5737553", "0.5733736", "0.57323366", "0.57212985", "0.5709624", "0.5706912", "0.5706912", "0.5706912", "0.5706912", "0.5706912", "0.5704376", "0.5675199", "0.5655343", "0.5651765",...
0.7521913
0
Show native species on the map and table
function showOnlyNative() { // Get all the observations from our data.js and format them so we can work with the data const observations = getAllObservations(); // Filter out any that aren't native species const native = filterOnlyNative(observations); // Update the map and table updateMap(native, map); ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function showMouseLocationOnMap() {\n entityLocation.label.show = true;\n}", "function showAll() {\n // Get all the observations from our data.js and format them so we can work with the data\n const observations = getAllObservations();\n\n // Update the map and table\n updateMap(observations, map);\n upd...
[ "0.61045045", "0.60076904", "0.5968497", "0.575883", "0.5700648", "0.56391066", "0.5635249", "0.56323653", "0.56323653", "0.56222385", "0.5559853", "0.5557149", "0.5539988", "0.55388033", "0.5515241", "0.5506539", "0.55020916", "0.5495066", "0.5490138", "0.54634225", "0.54618...
0.71483594
0
Show introduced species on the map and table
function showOnlyIntroduced() { // Get all the observations from our data.js and format them so we can work with the data const observations = getAllObservations(); // Filter out any that aren't introduced species const introduced = filterOnlyIntroduced(observations); // Update the map and table updateMap(i...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function showAll() {\n // Get all the observations from our data.js and format them so we can work with the data\n const observations = getAllObservations();\n\n // Update the map and table\n updateMap(observations, map);\n updateTable(observations);\n updateTableTitle(`All Species (${observations.length})`)...
[ "0.6283051", "0.5904032", "0.5843358", "0.57998234", "0.5735036", "0.56803817", "0.55987436", "0.5583394", "0.556018", "0.55568856", "0.5537523", "0.5535856", "0.5531325", "0.5528514", "0.5524361", "0.5524233", "0.55210733", "0.55100524", "0.5491484", "0.54850143", "0.5476643...
0.5980852
1
Returns the listener by resolving the namespace from the IoC container
getReferenceListener(handler) { return (...args) => { return this.containerResolver.call(handler, this.listenersBaseNamespace, args); }; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function Listener(eventName) {\n return listenerFunc.bind(this, eventName);\n}", "function Listener(eventName) {\n return listenerFunc.bind(this, eventName);\n}", "function Listener(eventName) {\r\n return listenerFunc.bind(this, eventName);\r\n}", "namespace(namespace) {\n this.listenersBase...
[ "0.56787837", "0.56787837", "0.5610944", "0.55340177", "0.53754264", "0.53754264", "0.53754264", "0.53754264", "0.53754264", "0.53754264", "0.53754264", "0.53754264", "0.53754264", "0.53754264", "0.53754264", "0.53754264", "0.53754264", "0.53754264", "0.53754264", "0.53754264",...
0.6343392
0
Returns all handlers for a given event.
getHandlersFor(event) { if (!this.eventHandlers.has(event)) { this.eventHandlers.set(event, new Map()); } return this.eventHandlers.get(event); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "listEventHandlers() {\n return updateMethods.listEventHandlers(this);\n }", "function getEventHandlers(context) {\n var vnode = context.$vnode;\n var handlers = {};\n var attachedVnodes = [];\n while (vnode) {\n attachedVnodes.push(vnode);\n vnode = vnode.parent;\n }\n attac...
[ "0.6712717", "0.6227168", "0.6158731", "0.61469203", "0.6026089", "0.60055244", "0.58186895", "0.5733447", "0.5733447", "0.5733447", "0.5733447", "0.5733447", "0.5733447", "0.5733447", "0.5733447", "0.5733447", "0.5733447", "0.5733447", "0.5733447", "0.5733447", "0.5733447", ...
0.8181871
0
Define custom namespace for Event listeners
namespace(namespace) { this.listenersBaseNamespace = namespace; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function EventHandlers(){}", "function create_event_listeners(){}", "function EventHandlers() {}", "function EventHandlers() {}", "function EventHandlers() {}", "function EventHandlers() {}", "function EventHandlers() {}", "function EventHandlers() {}", "function EventHandlers() {}", "function Ev...
[ "0.6681382", "0.6636197", "0.65845174", "0.65845174", "0.65845174", "0.65845174", "0.65845174", "0.65845174", "0.65845174", "0.65845174", "0.65845174", "0.65845174", "0.65845174", "0.65845174", "0.65845174", "0.65845174", "0.65845174", "0.65845174", "0.64381313", "0.64381313", ...
0.7517136
0
Removes the event handler from the tracked list and also returns it back.
removeEventHandler(event, handler) { const handlers = this.getHandlersFor(event); const eventHandler = handlers.get(handler); if (eventHandler) { handlers.delete(handler); return eventHandler; } return null; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "off(event, handler) {\n const handlers = this.handlers.get(event);\n if (handlers) {\n const index = handlers.indexOf(handler);\n if (index != -1) handlers.splice(index, 1);\n }\n }", "function removeEventHandler(eventHandler) {\n if (eventHandler) {\n eventHandler.remove();...
[ "0.6417047", "0.64105767", "0.6401251", "0.6331905", "0.63174444", "0.6316302", "0.62714505", "0.62659186", "0.62589556", "0.61802953", "0.6145933", "0.60985804", "0.6091669", "0.6070272", "0.6068994", "0.60600865", "0.6048383", "0.6013938", "0.5948419", "0.59365183", "0.5917...
0.6776899
0
Returns Event handler for wildcard events. Adding the same handler for multiple times is a noop.
getAnyHandler(handler) { if (this.anyHandlers.has(handler)) { return this.anyHandlers.get(handler); } const eventHandler = this.getReferenceListener(handler); this.anyHandlers.set(handler, eventHandler); return eventHandler; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "removeAnyHandler(handler) {\n const anyHandler = this.anyHandlers.get(handler);\n if (anyHandler) {\n this.anyHandlers.delete(handler);\n return anyHandler;\n }\n return null;\n }", "on(event, handler) {\n const handlers = this.handlers.get(event);\n if ...
[ "0.5802762", "0.57983243", "0.57340515", "0.5677", "0.55908376", "0.55740285", "0.556843", "0.55282766", "0.54510677", "0.5432592", "0.54154044", "0.5409991", "0.5409991", "0.5409991", "0.5409991", "0.5409991", "0.5409991", "0.5409991", "0.5409991", "0.5409991", "0.5409991", ...
0.6478554
0
Removes and returns the handler for a string reference.
removeAnyHandler(handler) { const anyHandler = this.anyHandlers.get(handler); if (anyHandler) { this.anyHandlers.delete(handler); return anyHandler; } return null; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "removeEventHandler(event, handler) {\n const handlers = this.getHandlersFor(event);\n const eventHandler = handlers.get(handler);\n if (eventHandler) {\n handlers.delete(handler);\n return eventHandler;\n }\n return null;\n }", "function remove(handler,...
[ "0.57825315", "0.5492084", "0.5473287", "0.53378105", "0.53246635", "0.5231435", "0.5184252", "0.5176428", "0.50627124", "0.5035223", "0.5034313", "0.5029868", "0.49816865", "0.49356905", "0.49304703", "0.4929933", "0.4922642", "0.49086735", "0.48978016", "0.4890156", "0.4863...
0.5930691
0
Loads the camera. The containerDiv argument tells us where the container is where we need to look up elements for camera stream ingestion.
function loadCamera(container, presetWidth) { width = presetWidth; startup(container); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function cameraLoad() {\n navigator.mediaDevices\n .getUserMedia(constraints)\n .then(function (stream) {\n track = stream.getTracks()[0];\n cameraView.srcObject = stream;\n })\n .catch(function (error) {\n console.error(\"Oops. Algo deu errado.\", error);\n });\n}", "initCameras()...
[ "0.6722872", "0.5992152", "0.58224493", "0.5803582", "0.57947266", "0.5707713", "0.5640119", "0.55874634", "0.5428361", "0.54150033", "0.54095775", "0.54058933", "0.5388461", "0.53822196", "0.53770226", "0.53729063", "0.53729063", "0.5369212", "0.53680867", "0.5367245", "0.53...
0.6592017
1
Generate synonyms for currency conversion tables
function generateSynonym() { // open db connection var conn = $.db.getConnection(); var i = 0; var body = ''; var query = ''; var pstmt; var tableArray = [ "T006", "T006A", "TCURC", "TCURF", "TCURN", "TCURR", "TCURT", "TCURV", "TCURW", "TCURX" ]; for (i = 0; i < tableArray.length; i++) { try ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function makeSyll(syll, c, v, nasal, palatalization) {\n let onset = \"\"\n let nucleus = \"\"\n let syllable = \"\"\n // generate onset\n onset = randomPhone(c) \n nucleus = randomPhone(v)\n if (palatalization==\"palatalization\" && nucleus==\"i\" && onset==\"k\") {\n syllable += \"...
[ "0.5379164", "0.5311958", "0.5175543", "0.5128532", "0.5103234", "0.5054178", "0.48673946", "0.4839757", "0.475393", "0.46704558", "0.46577898", "0.46273315", "0.46240202", "0.45889446", "0.45725027", "0.45332775", "0.45276582", "0.44900334", "0.44868386", "0.44744134", "0.44...
0.67916995
0
Update airport in DB
airportUpdate( context, data ) { return fetch( `/api/airports/${data.id}`, { headers: { 'X-Requested-With': 'XMLHttpRequest', 'X-CSRF-token': window.token, 'Content-Type': 'application/json', 'Accept': 'application/json', 'Authorization': `Bearer ${sessionStorage.getItem('token')}` ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "updateBicycle(id, name, type, ppt, ppd, description, status, location, success) {\n connection.query('update Sykkel set navn=?, type=?, ppt=?, ppd=?, beskrivelse=?, status=?, sted=? where sykkel_id=?',\n [name, type, ppt, ppd, description, status, location, id], (error, results) => {\n if (error) return...
[ "0.6276806", "0.6218962", "0.61643016", "0.609065", "0.609065", "0.609065", "0.6039842", "0.596789", "0.5965164", "0.575079", "0.5746516", "0.57293224", "0.571122", "0.5693927", "0.5666971", "0.5641044", "0.56367695", "0.5624282", "0.5581507", "0.55770236", "0.552449", "0.5...
0.7151032
0
Gets the wines by their ID
function getWinesById(id){ console.log('getWinesById(): id=' + id); let xhr = new XMLHttpRequest(); xhr.open('GET','api/wines/' + id); xhr.onreadystatechange = function(){ if(xhr.readyState === 4 ){ if(xhr.status === 200){ let wine = JSON.parse(xhr.responseText); console.log(wine.name)...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function getIronW(id) {\n console.log(myIronW);\n for (i in myIronW) {\n if (myIronW[i].ID == id)\n return myIronW[i];\n }\n return null;\n}", "function loadWines() {\n API.getWines()\n .then((res) => {\n setWines(res.data);\n setFullWinesList(res.data);\n ...
[ "0.6536601", "0.63864636", "0.6100214", "0.60424936", "0.60156345", "0.59570026", "0.5801001", "0.5754184", "0.573344", "0.57049215", "0.5666007", "0.565749", "0.5655838", "0.55815554", "0.55600077", "0.555967", "0.55278486", "0.5515546", "0.54644614", "0.54644614", "0.544856...
0.6571781
0
create a new Wine 'POST';
function postNewWine(event){ let addForm = document.newWineForm; let newWine = { name : addForm.name.value, type : addForm.type.value, color: addForm.color.value, flavor : addForm.flavor.value, description : addForm.description.value, rating : addForm.rating.value, cost : a...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "create(body, contentType, callback) {\n this.request(POST, `/pad/create`, {'Content-Type': contentType}, body, callback);\n }", "function create(){\n wiz.create();\n }", "function newWines(){\n $('form#new_wine').on('submit', function(e) {\n e.preventDefault();\n const $form = $(this);\n ...
[ "0.6603521", "0.64853257", "0.6409287", "0.64076114", "0.6087336", "0.59628737", "0.58899784", "0.5885298", "0.58605677", "0.5851629", "0.5848572", "0.58314216", "0.5798441", "0.57941395", "0.5758819", "0.5740667", "0.57054925", "0.5702533", "0.5672337", "0.56702477", "0.5669...
0.7153819
0
xhr.open('PUT', api/winetracker/wineId); xhr.send(JSON.stringify(updatedWine)) update the wine
function updatedWine(){ var updateForm = document.updateWineForm; var updatedWine = { name : updateForm.name.value, type : updateForm.type.value, color : updateForm.color.value, flavor : updateForm.flavor.value, description : updateForm.description.value, rating : updateForm.rating.value, ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function updateWire(id, attribute, newValue){\n const Url='http://localhost:8080/wires/update/'+id+'?attribute='+attribute+'&newValue='+newValue\n $.ajax({\n url: Url,\n async: false,\n type:\"PATCH\",\n headers: {\n authorization:\n sessionStorage.getIte...
[ "0.73358333", "0.68235505", "0.6750237", "0.6640156", "0.6620557", "0.66190064", "0.6591948", "0.65514624", "0.6543059", "0.64399093", "0.64246655", "0.6423863", "0.6398262", "0.63339686", "0.63305676", "0.6320111", "0.63074327", "0.6298632", "0.62949526", "0.62917995", "0.62...
0.8085073
0
xhr.open('DELETE', api/winetracker/' + wineId); xhr.send();
function deleteWineById(id){ var xhr = new XMLHttpRequest(); // let div = document.getElementById('wineData'); // div.textContent = ''; xhr.open('DELETE', 'api/wines/' + id); xhr.onreadystatechange = function(){ if(xhr.readyState === 4){ if(xhr.status === 204){ var div = document.getElementB...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function deleteWire(id){\n const Url='http://localhost:8080/wires/delete/' + id\n\n $.ajax({\n url: Url,\n async: false,\n type:\"DELETE\",\n headers: {\n authorization:\n sessionStorage.getItem(\"userSessionKey\"),\n },\n success: function(...
[ "0.77157795", "0.72521305", "0.70715255", "0.6908237", "0.6877132", "0.6876853", "0.68387383", "0.6812968", "0.67939913", "0.6782669", "0.67619866", "0.6761576", "0.6743421", "0.67130363", "0.66923213", "0.66832215", "0.66686076", "0.6667953", "0.6593193", "0.658904", "0.6586...
0.76142555
1
Run Git hooks based on command line arguments.
function init() { var out = '', hook = process.argv[2]; if (hooks.hasOwnProperty(hook)) { out = hooks[hook](); } if (out) { process.stdout.write(out); } process.exit(0); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function git(...args) {\n\treturn run('git', ...args);\n}", "function main() {\n const args = process.argv.slice(2)\n\n if (args.length === 0) return build()\n\n if (args[0] === 'bump') return bump(args[1] || 'patch')\n\n if (args[0] === 'publish') return publish()\n\n throw new Error('Found unpr...
[ "0.67690504", "0.57277477", "0.55751556", "0.5468464", "0.5390441", "0.5241215", "0.5241215", "0.5206328", "0.51756835", "0.5127583", "0.51241034", "0.5094541", "0.5077677", "0.50689137", "0.50630325", "0.50025195", "0.49938145", "0.4984791", "0.4937273", "0.49242193", "0.491...
0.6178831
1