query
stringlengths
9
34k
document
stringlengths
8
5.39M
negatives
listlengths
19
20
metadata
dict
Returns the number of voters used for each election simulated
function getNumVotersPerElection() { return numVotersPerElection; } // getNumVoters
[ "function setNumVotersPerElection(aNumVoters) {\n numVotersPerElection = parseInt(aNumVoters);\n } // setNumVotersPerElection", "function election(votes) {\n for(var student in votes) { \n var votesCast = votes[student];\n \n var counter = 1;\n for(var officer in votesCast) { //targeting the off...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Get the last signature of the current version cla at current moment or at a pull request moment Params: user (mandatory) owner (mandatory) repo (optional) number (optional)
async getLastSignature(args, item) { if (!item) { item = await this._getLinkedItem(args.repo, args.owner) } args.gist = item.gist if (!item.gist) { return 'null-cla' } const gist = await this._getGistObject(args.gist, item.token, args.owner) ...
[ "function lastCommit(username){\n return fetch('https://api.github.com/users/' + username + '/events',{headers: {'Authorization': 'token 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'}} )\n .then(response => response.json())\n .then(user => console.log(\"Last push was: \" + user[0].created_at))\n ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
REQUETES UTILSATEUR : Onglet : Type de documents TAPEZ ICI LE CODE DE LA REQUETE DE MISE A JOUR
function User_Update_Type_de_documents_Type_de_documents0(Compo_Maitre) { var Table="typedocument"; var CleMaitre = Compo_Maitre.getCleVal(); var NomCleMaitre = DePrefixerChamp(Compo_Maitre.getCle()); var to_nom=GetValAt(229); if (!ValiderChampsObligatoire(Table,"to_nom",TAB_GLOBAL_COMPO[229],to_nom,false)) retu...
[ "function User_Insert_Type_de_documents_Type_de_documents0(Compo_Maitre)\n{\n\n/*\n***** INFOS ******\n\nNbr d'esclaves = 3\n\nId dans le tab: 229;\nsimple\nNbr Jointure: PAS DE JOINTURE;\n\nId dans le tab: 230;\nsimple\nNbr Jointure: PAS DE JOINTURE;\n\nId dans le tab: 231;\nsimple\nNbr Jointure: PAS DE JOINTURE;\...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Move to online _course page
function online_course() { window.location.href = "../onlineCourses/online_courses.html"; }
[ "function getCurrentCourse()\n{\n var foundcourse = null;\n var currenturl = window.location.href;\n courses.forEach(function(c) {\n if(currenturl.includes(c.id)){\n foundcourse = c;\n }\n });\n if (foundcourse == null) { console.log(\"Not on known course page\");}\n else ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Write a function called cubeAll that cubes each number in an array, and returns an array of all the numbers cubed using a for loop; then, refactor it to use each.
function cubeAll(arr) { return arr.map(num => Math.pow(num, 3)); }
[ "function arrFromCube(cube, num) {\n let newArr = [];\n if (num === 0) {\n for (let i = 0; i < 3; i += 1) {\n for (let j = 0; j < 3; j += 1) {\n newArr.push(cube[i][j]);\n }\n }\n }\n if (num === 1) {\n for (let i = 0; i < 3; i += 1) {\n for (let j = 3; j < 6; j += 1) {\n n...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
in all 3 cases missionDetails is called
function missionDetails(newMission){ hideEdit(); showEdit(); //create circle with icon if it is given for this misison $('.edit ul.mission-neutral').append($('<li class="circle-big">' + (newMission.icon ? '<img src='+ newMission.icon +'>' : "") + '</li>')) //creates empty form $('.edit').append(create...
[ "function createMissions() {\n rx = width * 0.5;\n ry = height * 0.5;\n rw = 700;\n rh = 750;\n\n //Frame, title and buttons of Mission Interface;\n push();\n missionFrame = new OnScreenFrame(\n rx,\n ry,\n rw,\n rh,\n false,\n Secondary,\n 15,\n ImageMissionInterfaceFrame\n );\n\n ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
input commonBounds: [xMin, yMin, xMax, yMax] output worldBounds: [minLong, minLat, maxLong, maxLat]
_commonToWorldBounds(commonBounds) { const [xMin, yMin, xMax, yMax] = commonBounds; const { viewport } = this.context; const bottomLeftWorld = viewport.unprojectPosition([xMin, yMin]); const topRightWorld = viewport.unprojectPosition([xMax, yMax]); return bottomLeftWorld.slice(0, 2).concat...
[ "_worldToCommonBounds(worldBounds, opts = {}) {\n const {useLayerCoordinateSystem = false} = opts;\n const [minLong, minLat, maxLong, maxLat] = worldBounds;\n const {viewport} = this.context;\n const {textureSize} = this.state;\n\n const size = (textureSize * RESOLUTION) / viewport.scale;\n\n let ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
sets the friend requests The user must already be logged in
function setFriendRequests() { LOG("Setting friend requests...") var ref = database.ref('friends').orderByChild('acceptor').equalTo(user.uid).limitToFirst(20); var requests = [] ref.once('value', function (snap) { var tree = snap.val() for (var prop in tree) { if (tree.has...
[ "async getVeteranFriendRequests() {\n const id = this.state.sessionUser.id;\n const route = APIRoutes.veteranFriendRequestsPath(id);\n try {\n let { json, headers } = await BaseRequester.get(route);\n this.setState({ friendRequests: json });\n } catch (error) {\n console.error(error);\n ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
this function is used to move east from your current location
function East() { props.setMoveLocation(true); props.setLocation((longMove += 0.002), latMove); }
[ "function moveEast() {\n currentLonPoint += 0.00050\n console.log(currentLonPoint)\n map.setView([currentLatPoint, currentLonPoint], 18)\n\n }", "function North() {\n props.setMoveLocation(true);\n props.setLocation((latMove += 0.002), longMove);\n }", "function South() {\n pro...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
This constructor is used to load the configuration file if it exists.
constructor(config_dir){ if(fs.existsSync(config_dir)){ if(typeof require(config_dir) == 'json' || typeof require(config_dir) == 'object'){ this.config = require(config_dir); // Load the access token key. if(this.config.mode == 'sandbox') this.config.token = this.config.keys.sandbox; ...
[ "async load() {\n await this.ensureExists();\n this.conf = await fs.readJSON(this.location);\n }", "function loadConfig() {\n\tconfig_file = fs.readFileSync(\"./config.json\");\n\tconfig = JSON.parse(config_file);\n}", "function Config(action) {\n trace(whoAmI,\"Constructor\",true);\n\n var f...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
time() toggles the timesretch functionality for all or individual playlist~ object time all followed by a 0 to 1 toggles all playlist~ objects' time stretching off or on time, file number, and 0 or 1 toggles an individual playlist~ object time stretching off or on
function time() { if(arguments[0] == "all") { for(i = 0; i < play_num; i++){ pl[i].message("timestretch", arguments[1]); } } else if (typeof arguments[0] == "number"){ pl[(arguments[0]-1)].message("timestretch", arguments[1]); } }
[ "function toggleSeconds(){\n\tif (secondsOn) {\n\t\tsecondsOn = false;\n\t} else {\n\t\tsecondsOn = true;\n\t\troundUp = false;\n\t}\n}", "setBakingTime() {}", "function timeUpdate() {\n var playPercent = timelineWidth * (music.currentTime / duration);\n playhead.style.marginLeft = playPercent + \...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
churchPlayback Adds playback functionallity to churchListen
function churchPlayback(audioelement) { this.audioelement = audioelement; churchListen.call(this); }
[ "onplay(song) { }", "function setPlaybackSource() {\n var activePlayer = GUI.libraryhome.ActivePlayer;\n // update the playback section\n $('#overlay-playsource-open button').text(activePlayer);\n $('#overlay-playsource a').addClass('inactive');\n var source = activePlayer.toLowerCase();\n $('#p...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
get query string val
function getQueryVal(query){ var url = new URLSearchParams(window.location.search); var param = url.get(query); return param; }
[ "function getQueryValue(name) {\n var query = window.location.search.substring(1);\n var vars = query.split('&');\n\n for (var i = 0; i < vars.length; i++) {\n var pair = vars[i].split('=');\n if (pair[0] == name) return pair[1];\n }\n\n return '';\n}", "function baynote_getUrlParamVa...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Conversion utility functions Remove the 'preamble' from the line, ie, the part that is put there by the IRC client. Unfortunately, that is not standard, which means that each client adds a different preamble. This function relies on a user option for the IRC log format. If not available it tries some heuristics among t...
function remove_preamble(line, config) { /** * Establish the size of the preamble to be removed; set the irc format in the config * in case that has not be set originally. * * @param the_line - The incoming IRC log line * @return the size of the preamble */ const preamble_size = (t...
[ "parseReplyText(line) {\r\n const isSupported = this.hasExtension('ENHANCEDSTATUSCODES');\r\n if (isSupported) {\r\n return line.substr(4).split(/[\\s](.+)?/, 2)[1];\r\n }\r\n else {\r\n return line.substr(4);\r\n }\r\n }", "function removeAutoLines(line...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
You can modify and use this source freely only for the development of application related Live2D. (c) Live2D Inc. All rights reserved. ============================================================ ============================================================ class L2DModelMatrix extends L2DMatrix44 ======================...
function L2DModelMatrix(w /*float*/, h /*float*/) { L2DMatrix44.prototype.constructor.call(this); this.width = w; this.height = h; }
[ "function L2DBaseModel() {\n\t this.live2DModel = null; // ALive2DModel\n\t this.modelMatrix = null; // L2DModelMatrix\n\t this.eyeBlink = null; // L2DEyeBlink\n\t this.physics = null; // L2DPhysics\n\t this.pose = null; // L2DPose\n\t this.debugMode = false;\n\t this.initialized = false;\n\t ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
perform scraping of external websites for server status based on json details
function update_server_status() { _statuslogging ="Game Status: "; $.each(_jsongames.games,function(index, item){ //only include if scrape property exists if(item.hasOwnProperty('scrape')) { var _status = ""; var _gameindex = index; var _game = item.name; var _propername = item.prop...
[ "function scrapeStatus() {\n return new Promise((resolve, reject) => {\n request(mtaStatusUrl, (err, response, responseHtml) => {\n if (err) {\n reject(err);\n }\n\n const $ = cheerio.load(responseHtml);\n\n let results = {\n subway...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Loads and parses an object from either the given string or the given filename
function loadParseObject(objString, objFilename) { let obj = {}; if (objString) { let d = yaml.safeLoad(objString, 'utf8'); if (typeof d !== 'object' || !d) throw new Error('Invalid JSON/YAML object'); objtools.merge(obj, d); } if (objFilename) { let str = fs.readFileSync(objFilename); let d = yaml.safeLo...
[ "function loadFile(filepath, defaultObj) {\n defaultObj = defaultObj || {};\n\n if (!isFile(filepath)) { return defaultObj; }\n\n var extension = path.extname(filepath).replace(/^\\./, '');\n var contents = supportedExtensions[extension](filepath);\n\n return assign({}, defaultObj, contents);\n}", "function ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Increase and decrese bets
function Increase(){ if (bankBallance > 0){ IncreaseBet(); if ( betAmmount > bankBallance){ canDouble = false; } } }
[ "function highBet(){\n\t\tbet += 10\n\t\talert(\"You have now bet \"+bet)\n\t}", "function adjustBet(hilo, baseBet, decks){\r\n var weight = decks >= 6? 2: 1;\r\n var weight = Math.floor(decks/2);\r\n if (this.runningBankroll>0){\r\n if (this.winScore()>=0){\r\n if (hilo >= 8*weight) this.hand.objHands...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Renders the AWS CloudFormation properties of an `AWS::AppMesh::VirtualNode.ListenerTlsValidationContext` resource
function cfnVirtualNodeListenerTlsValidationContextPropertyToCloudFormation(properties) { if (!cdk.canInspect(properties)) { return properties; } CfnVirtualNode_ListenerTlsValidationContextPropertyValidator(properties).assertSuccess(); return { SubjectAlternativeNames: cfnVirtualNodeSubj...
[ "function cfnVirtualGatewayVirtualGatewayListenerTlsValidationContextPropertyToCloudFormation(properties) {\n if (!cdk.canInspect(properties)) {\n return properties;\n }\n CfnVirtualGateway_VirtualGatewayListenerTlsValidationContextPropertyValidator(properties).assertSuccess();\n return {\n ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
find collisions with a unit
checkCollisions(unit, detectCollision) { // check neighborhood for collisions return this.searchNeighborhood(unit, (u) => { return u.id !== unit.id && detectCollision(unit, u); }); }
[ "collide(rect) {\n return (this.left < rect.right && this.right > rect.left &&\n this.top < rect.bottom && this.bottom > rect.top);\n }", "detectCollisions() {\n const sources = this.gameObjects.filter(go => go instanceof Player);\n const targets = this.gameObjects.filter(go => go.options.has...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
enableLog will set enabled value to true.
enableLog() { this.enabled = logCfg.enable; }
[ "function isLogEnabled () {\n return flags.DEBUG || flags.LOG_ENABLED\n }", "startLogging() {\n this.isLogging = true;\n this.debounceTime$\n .pipe(takeUntil(this.stopLogging$), switchMap((debounceTime) => this.periodicalLogging(debounceTime)))\n .subscribe(() => this.onPos...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
polyvecDecompress deserializes and decompresses a vector of polynomials and represents the approximate inverse of polyvecCompress. Since compression is lossy, the results of decompression will may not match the original vector of polynomials.
function polyvecDecompress(a, paramsK) { var r = polyvecNew(paramsK); var aa = 0; var t = new Array(4); for (var i = 0; i < paramsK; i++) { for (var j = 0; j < paramsN / 4; j++) { t[0] = (uint16(a[aa + 0]) >> 0) | (uint16(a[aa + 1]) << 8); t[1] = (uint16(a[aa + 1])...
[ "function decompPolygon(poly) {\n if (poly.length < 3) return;\n\n // Make sure the polygon has counter-clockwise winding. Skip this step if you know it's already counter-clockwise.\n decomp.makeCCW(poly);\n\n // Decompose into convex polygons, using the faster algorithm\n return decomp.quickDecomp(poly);\n}",...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Uncomment and edit to make your own Google Assistant intent handler // uncomment `intentMap.set('your intent name here', googleAssistantHandler);` // below to get this function to be run when a Dialogflow intent is matched
function googleAssistantHandler(agent) { let conv = agent.conv(); // Get Actions on Google library conv instance conv.ask('Hello from the Actions on Google client library!'); //Use Actions on Google library agent.add(conv); // Add Actions on Google library responses to your agent's response }
[ "function googleAssistantHandler(agent) {\n let conv = agent.conv(); // Get Actions on Google library conv instance\n conv.ask('Hello from the Actions on Google client library!') // Use Actions on Google library\n agent.add(conv); // Add Actions on Google library responses to your agent's respo...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
display table that determines what action to do execute on account
function showAccountTable() { actionTable.style.display = 'none'; accountTable.style.display = 'table'; back.style.display = 'inline-block'; }
[ "function showTablePolicy(table, name, options, _) {\n var showPolicySettings = createTablePolicySetting(options);\n showPolicySettings.resourceName = interaction.promptIfNotGiven($('Table name: '), table, _);\n showPolicySettings.policyName = interaction.promptIfNotGiven($('Policy name: '), name, _);\n ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Close forms opened through the method issueForm()
function closeIssueForm(elt) { var issueElt = $j(elt).closest('[data-issue-key]'); var actionsElt = issueElt.find('.code-issue-actions'); var formElt = issueElt.find('.code-issue-form'); formElt.addClass('hidden'); actionsElt.removeClass('hidden'); return false; }
[ "function closeForm(){\n\t//close the current form\n\tvar currentForm = openedFormList.pop();\n\t$(currentForm).css(\"display\", \"\");\n\tclrFields($(currentForm));\n\t\n\t//close the pop up window if there is no form in the opened form list\n\tif(!openedFormList.length){\n\t\tclosePopup();\n\t\treturn;\n\t}\n\t\n...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
This plays the logged out alarm.
doLoggedOutAlarm() { this.playSound('loggedOut',_, 'You are logged out.'); }
[ "function logout() {\n didAbandonGame = true;\n _send(messages.LOGOUT, main.username);\n }", "logout() {\n\t\tplaylistsContainer.innerHTML = '<iframe src=\"https://www.spotify.com/logout/\"></iframe>';\n\t\tplaylistsContainer.style.display = 'none';\n\t\tsetTimeout(() => window.location = [locati...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Hashtable of settings values Private functions ////////////////////////////////////////////////////////////////////////// Function Title: printCommandReference Description: This function prints the command reference. Parameters: None Preconditions: documentation.txt must exist within the same folder as codeDivider.js. ...
function printCommandReference() { var spathToDocumentation = process.argv[1].split(PATH.sep), scommands = '', i; spathToDocumentation.pop(); spathToDocumentation.push(PATH.sep + 'documentation.txt'); scommands = FS.readFileSync(spathToDocumentation.join(PATH.sep...
[ "function printHelp() {\n var spathToDocumentation = process.argv[1].split(PATH.sep), shelp;\n\n spathToDocumentation.pop();\n spathToDocumentation.push(PATH.sep + 'documentation.txt');\n shelp = FS.readFileSync(spathToDocumentation.join(PATH.sep),\n {'encoding': 'utf8'});\n ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
calculates lasers and changes state of the affected jets
function calculateLasers() { lasers = []; // init the future state the jet will go into after the hit calculations forEachJet((jet) => { jet.futureState = new Jet(jet.row, jet.col, jet.direction); jet.futureState.hit = false; }); // do the hit calculations forEachJet((jet) => { ...
[ "party__update(party){\n this.digimons = party.digimons;\n for(const index in party.configuration){\n this.digimons[party.configuration[index].id].start_time = this.elapsed;\n this.digimons[party.configuration[index].id].background = party.configuration[index].bkg;\n this.digimons[party.configuration[ind...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
random pick one user from the array
function randomUserSelect(users) { return users[Math.floor(Math.random() * users.length)]; }
[ "function getRandom() {\n\tvar l = tweets.length; // grab length of tweet array\n\tvar ran = Math.floor(Math.random()*l); // grab random user\n\n\treturn tweets[ran];\n}", "function getPerson() {\r\n return people[Math.floor(Math.random() * people.length)];\r\n}", "function getRandomMember(array) {\n\treturn...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Callback associated with control::getpositioninfo. This method populated the position information table and update the progress.
function onPositionInfo(data) { if ("Error" in data) { onError(data.Error); } else if ("Value" in data) { obj = data.Value; $("#track").text(obj.Track + "/" + queueSize); $("#track-duration").text(formatDuration(obj.TrackDuration)); $("#rel-time").text(formatDuration(obj.RelTime)); $("#title").text(obj.Ti...
[ "function handlePositionInfo(trackingInfo) {\n let logText = 'Tracking info : ';\n // Text instruction management\n if (trackingInfo.positionInfo) {\n logText = logText + 'Position info is ... ' + trackingInfo.positionInfo + '. ';\n switch (trackingInfo.positionInfo) {\n case 'TRAC...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
RB IMPLEMENTATION // CHECK IF NODE IS RED
isRed(node){ // EMPTY NODES ARE B if (!node) return false; return node.isRed; }
[ "get isError() {\n return (this.flags & 4) /* NodeFlag.Error */ > 0\n }", "function isDisconnected(node){return!node||!node.parentNode||node.parentNode.nodeType===11;}", "_validateNode(node) {\n if (node == null) {\n throw new Error('previous node cannot be null')\n }\n\n if (!(node in...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Adds a new RadixIdentity to the set of available identities
addIdentity(identity) { this.identities.set(identity.account.getAddress(), identity); return identity; }
[ "generateSimpleIdentity() {\n const address = RadixAddress.generateNew();\n const identity = new RadixSimpleIdentity(address);\n this.identities.set(address.getAddress(), identity);\n return identity;\n }", "async saveIdentity(identity) {\n if (identity && identity.token) {\n ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
This helper method takes an index and moves it up the heap, if it is less than it's parent node. It could be very helpful for the add method. Time complexity: O(log(n)), index is divided by two each time this method is called (n2)/(2^t) = c (where t is the number of times the method is called and c is a constant (the p...
heapUp(index) { if (index === 0) { return; } const childNode = this.store[index]; let parentIndex; if (index % 2 === 0) { parentIndex = (index - 2) / 2; } else { parentIndex = (index - 1) / 2; } const parentNode = this.store[parentIndex]; if (childNode.key >= paren...
[ "function _heap_increase_key(i){\n var parent = _parent(i);\n // swap with parent until max-heap or min-heap property is not satisfied.\n while(i > 1 && _compare(_array[parent], _array[i]) > 0 ){\n _swap(parent, i);\n i = parent;\n parent = _parent(i);\n }\n }", "insert(element) {\n ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Rotates chromosome labels by 90 degrees, e.g. upon clicking a chromosome to focus.
rotateChromosomeLabels(chr, chrIndex, orientation, scale) { var chrMargin, chrWidth, ideo, x, y, numAnnotTracks, scaleSvg, tracksHeight, chrMargin2; chrWidth = this.config.chrWidth; chrMargin = this.config.chrMargin * chrIndex; numAnnotTracks = this.config.numAnnotTracks; ideo = this; i...
[ "rotateBandLabels(chr, chrIndex, scale) {\n var chrMargin, scaleSvg,\n orientation, bandLabels,\n ideo = this;\n\n bandLabels = chr.selectAll('.bandLabel');\n\n chrWidth = this.config.chrWidth;\n chrMargin = this.config.chrMargin * chrIndex;\n\n orientation = chr.attr('data-orientation');\n...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Remove any tasks from the DOM and loop over every task in the table adding attributes and putting each value in its own table row.
function addToDOM(response) { $('#viewTasks').empty(); for (const taskObj of response) { // Make a jQuery object of a table row and add the task values to that row. const appendStr = '<tr></tr>'; const jQueryObj = $(appendStr); let appendRowStr = ''; // Loop over every task in the table and add ...
[ "function generateTaskListElements() {\n // getData();//For getting data\n var tabpr = document.getElementById('pr');//accessing parent table\n var newrw = document.createElement(\"tr\");//creating a new row\n var idrw = \"id\";\n var idname = \"fit\" + x;\n newrw.setAttribute(idrw, idname);//Id a...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Return an array of popularity for the albums's tracks.
function getTrackPopularities(tracksIds) { var str; for (var i = 0; i < tracksIds.length; i++) { if (i != 0) str = str + "%2C" + tracksIds[i]; else str = tracksIds[i]; } var sp = getService(); var url = "https://api.spotify.com/v1/tracks?ids=" + str; var response = refreshToken(sp, function() { ...
[ "function getPopularTrackCovers(tracks, limit = 4) {\n if (tracks.length > 0) {\n return [...tracks]\n .sort((a, b) => b.popularity - a.popularity)\n .slice(0, limit)\n .map(track => track.image);\n }\n}", "async retrieveTrackGenres(tracks) {\n let genres = {};\n for (let track of tracks...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
put field to table in dataset, new or merge on id
function field_put(dsid, tbid, field) { assert.ok(dsid && tbid && field, `dsid && tbid && field ${dsid} ${tbid} ${field}`); //console.log('field_put', dsid, tbid, field); const table = table_get(dsid, tbid); const newfields = (field.id) ? [ ...table.fields.map(f => f.id === field.id ? { ...f, ...field } : ...
[ "set(id, data) {\n let oldData = this.raw();\n oldData[id] = data;\n this._write(oldData);\n }", "function table_put(dsid, tb) {\n const fixid = a => a ? a.map((row, x) => ({ ...row, id: x+1, })) : [];\n\n const newtb = (tb.id) \n ? topStack().tables.map(t => t.id === tb.id ? { ...t, ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Set up the mouse and touch events for the navigator and scrollbar
function addEvents() { addEvent(chart.container, MOUSEDOWN, function(e) { e = chart.tracker.normalizeMouseEvent(e); var chartX = e.chartX, chartY = e.chartY, handleSensitivity = hasTouch ? 10 : 7, left, isOnNavigator; if (chartY > top && chartY < top + height + scrollbarHeight) { // we're ve...
[ "function setupEvents() {\n if (typeof window.ontouchstart !== 'undefined') {\n view.addEventListener('touchstart', tap);\n view.addEventListener('touchmove', drag);\n view.addEventListener('touchend', release);\n }\n view.addEventListener('mousedown', tap);\n ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Sum several RRDfiles together They must all have the same DSes and the same RRAs / sumfile_options, if defined, must be an object containing any of these treat_undefined_as_zero For backwards comatibility, if sumfile_options is a boolean, it is interpreted like the "old treat_undefined_as_zero" argument
function RRDFileSum(file_list,sumfile_options) { if (sumfile_options==undefined) { sumfile_options={}; } else if (typeof(sumfile_options)=="boolean") { sumfile_options={treat_undefined_as_zero:sumfile_options}; } this.sumfile_options=sumfile_options; if (this.sumfile_options.treat_undefin...
[ "function sumAllInstallments(){\n\tvar instlCount=$(\"#feeInstallments\").val();\n\tfor ( var i = 0; i < instlCount; i++) {\n\t\tvar instlSum=0;\n\t\tfor ( var headCount = 0; headCount < feeHeadCount; headCount++) {\n\t\t\tvar amt= jQuery.trim($(\"#feeHeads_\"+headCount+\"_installments_\"+i+\"_amount\").val());\n\t...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Update an existing scheduled task profile.
static update(id, scheduledTaskProfile){ let kparams = {}; kparams.id = id; kparams.scheduledTaskProfile = scheduledTaskProfile; return new kaltura.RequestBuilder('scheduledtask_scheduledtaskprofile', 'update', kparams); }
[ "static add(scheduledTaskProfile){\n\t\tlet kparams = {};\n\t\tkparams.scheduledTaskProfile = scheduledTaskProfile;\n\t\treturn new kaltura.RequestBuilder('scheduledtask_scheduledtaskprofile', 'add', kparams);\n\t}", "editSubtask (subtaskId, key, value) {\n console.log('editSubtask:', subtaskId, key);\n let...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
FUNCTION NAME : devSanityData AUTHOR : James Turingan DATE : January 3, 2014 MODIFIED BY : REVISION DATE : REVISION : DESCRIPTION : PARAMETERS :
function devSanityData(data){ var mydata = data; if(globalInfoType == "XML"){ var parser = new DOMParser(); var xmlDoc = parser.parseFromString( mydata , "text/xml" ); var row = xmlDoc.getElementsByTagName('MAINCONFIG'); var uptable = xmlDoc.getElementsByTagName('DEVICE'); var lowtable = xmlDoc.getElementsB...
[ "function accSanityData(data){\n\tvar accStat='';\n\tvar accSanityStat='';\n\tvar mydata = data;\n\tif(globalInfoType == \"XML\"){\n\t\tvar parser = new DOMParser();\n\t\tvar xmlDoc = parser.parseFromString( mydata , \"text/xml\" );\n\t\tvar row = xmlDoc.getElementsByTagName('MAINCONFIG');\n\t\tvar uptable = xmlDoc...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Turn normal unordered list of tags into a tag cloud list
function makeTagCloud() { $('span.postcount').hide(); var taglist = $('ul#taglist'); taglist.hide(); taglist.tagcloud({ type: 'list', sizemax: 24, sizemin: 12, colormax: '5b0909', colormin: '7c7c7c' }); taglist.addClass('tagcloud'); taglist.removeAttr('style'); taglist.children('li').each( ...
[ "function tag_cloud (data)\n { ftags = format_tags (data.tags, data.nct);\n\n $(\"#tag_cloud\").jQCloud(ftags, {width:640, height:280});\n $(\"#tag_cloud_container\").show();\n }", "function createTagBuckets( tagList ) {\n function SortByTagCount(a,b) { return b.tag_count - a.tag_co...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
set medium value in state variable and removing error value for medium
setMedium(name, data) { this.fieldTouched('medium'); if (data !== null) { const {qualification} = this.state; qualification.medium = data; this.setState({qualification, medium_error: ''}, () => { this.checkForErrors() }); } }
[ "function isMediumSet() {\n if (allUrlParameters.hasOwnProperty('utm_medium')){\n return allUrlParameters.utm_medium;\n } else {\n return '(not set)';\n }\n}", "reset() {\r\n\t\tthis.changeState(this.initial);\r\n\t}", "function checkState(value){\r\n\t\t\t//Checking if value updated violates the LO li...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
remove miner and clear its assignment
removeminer(id) { const idx = this.minerids.indexOf(id); if(idx == -1) return; this.minerids.splice(idx, 1); if(this.minerpool[id]) delete this.minerpool[id]; }
[ "resetEverything() {\n this.resetLoader();\n this.remove(0, Infinity);\n }", "function removeShrink(){\n\t\tvar rows = $b42s_header.find( '.fl-row-content-wrap' ),\n\t\t\tmodules = $b42s_header.find( '.fl-module-content' );\n\n\t\trows.removeClass( 'fl-theme-builder-header-shrink-row-bottom' );\n\t\trow...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
To restart our Game..
function restartGame(){ }
[ "function restartGame() {\n initAll();\n resetPlayer();\n toggleDice(false);\n}", "function restartGame() {\r\n level = 1;\r\n gamePattern = [];\r\n}", "function restart() {\n number = 60;\n start();\n }", "function replayGame() {\n resetGame();\n togglePopup();\n }", "f...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
This function deletes an Athlete when the user clicks the delete button
function deleteAthlete(event) { event.stopPropagation(); var id = $(this).data("id"); $.ajax({ method: "DELETE", url: "/api/athletes/" + id }).then(getAthletes); }
[ "function deleteVassalOnClick(e){\r\n // Remove the element\r\n g_vassals.splice(parseInt(e.currentTarget.parentNode.id.split('vassal_')[1]), 1);\r\n\r\n setVassals();\r\n setVassalTable();\r\n}", "function deleteButtonPressed(entity) {\n db.remove(entity);\n }", "function handleDelete(event) {\...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Allows you to add a metadata object and metadata content associated with Kaltura object.
static add(metadataProfileId, objectType, objectId, xmlData){ let kparams = {}; kparams.metadataProfileId = metadataProfileId; kparams.objectType = objectType; kparams.objectId = objectId; kparams.xmlData = xmlData; return new kaltura.RequestBuilder('metadata_metadata', 'add', kparams); }
[ "static add(metadataProfile, xsdData, viewsData = null){\n\t\tlet kparams = {};\n\t\tkparams.metadataProfile = metadataProfile;\n\t\tkparams.xsdData = xsdData;\n\t\tkparams.viewsData = viewsData;\n\t\treturn new kaltura.RequestBuilder('metadata_metadataprofile', 'add', kparams);\n\t}", "static addFromFile(metadat...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
A session store in memory.
function MemoryStore() { Store.call(this) this.sessions = Object.create(null) }
[ "function store(){\n amplify.store.sessionStorage( settings.historyStorageItemsName + \"-past\", past );\n amplify.store.sessionStorage( settings.historyStorageItemsName + \"-future\", future );\n }", "function storeToSession(key, value) {\n if (sessionStorage) {\n ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Question 1: sort extensions by "firstName" + "lastName" + "ext" ASC
function sortExtensionsByName(extensions) { // reserved the type of sort let type = String(arguments[1]).toLowerCase() === 'desc' ? 'desc' : 'asc'; if (Array.isArray(extensions)) { extensions.sort(function(a, b) { let firstLength = Math.max(a.firstName.length, b.firstName.length), lastLength =...
[ "function sortContactArray(firstname){\n\tvar sortOrder = 1;\n\t\n\tif(firstname[0] == \"-\") {\n\t\tsortOrder = -1;\n\t\tfirstname = firstname.substr(1);\n\t}\n\treturn function (a,b) {\n if(sortOrder == -1){\n return b[firstname].localeCompare(a[firstname]);\n }else{\n return a...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Handle search type change from user
handleSearchTypeChange(type) { // If the search text input is not empty, then update the applications list // else, just update the search type if (this.state.search_term != null && this.state.search_term != '') { api.fetchJobBySearch(this.state.search_term, type, this.state.search_order).then((resp) => { ...
[ "function set_search_type(type) {\n if (type == \"D\") {\n lastSearchType = \"D\";\n $('#search_diary_button').addClass('ui-priority-primary').removeClass('ui-priority-secondary');\n $('#search_epg_button').addClass('ui-priority-secondary').removeClass('ui-priority-primary');\n } else {\n ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Set the country restriction based on user input, also centers and zoomz the map on the given country. The restrictions are taken from 'myCountries' dropdown value.
function setAutocompleteCountry() { const country = document.getElementById("myCountries").value; if (country == "default") { autocomplete.setComponentRestrictions({ country: [] }); map.setCenter({ lat: 15, lng: 0 }); map.setZoom(2); ...
[ "function zoomToNeighborhood() {\n var geocoder = new google.maps.Geocoder();\n //obtain the user-input adress\n var neighborhood = $(\"#neighborhood\").val() + ' Chicago';\n //make sure the input value is not blank\n if (neighborhood == '') {\n window.alert ('You must enter an valid neighborh...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Formats the current user's data for printing.
formatUser() { const user = this.currentUser(); return ` Name (Client Email): ${user.name} Key (Client ID): ${user.key} API Key ID: ${user.api_key_id} API Secret: ${user.api_secret} Public Key: ${user.public_key} Private Key: ${user.private_key} Public Signing Key: ${user.public_signing_key} Private Signing Key: ${...
[ "printInfo() {\n return `Name: ${this.name}\\n Age: ${this.age}\\n Haircolor: ${this.haircolor}`\n\n }", "function getUserInfo() {\n return user;\n }", "function renderUser(user) {\n $usernameFld.val(user.username);\n $firstNameFld.val(user.firstName);\n $lastNam...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
CONCATENATED MODULE: ./src/HighSpeedTapeEncoder.ts Generate one cycle of a sine wave.
function generateCycle(length) { const audio = new Int16Array(length); for (let i = 0; i < length; i++) { const t = 2 * Math.PI * i / length; // -0.5 to 0.5, matches recorded audio. audio[i] = Math.sin(t) * 16384; } return audio; }
[ "function Instrument (options) {\n\tvar i, waveForm, array, mod;\n\toptions = options || {};\n\n\tif (options.context) {\n\t\tthis.context = options.context;\n\t} else if (options.destination) {\n\t\tthis.context = options.destination.context;\n\t} else {\n\t\tthis.context = new AudioContext();\n\t}\n\tthis.mainGai...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Language: Shell Session Requires: bash.js
function shell(hljs) { return { name: 'Shell Session', aliases: [ 'console' ], contains: [ { className: 'meta', // We cannot add \s (spaces) in the regular expression otherwise it will be too broad and produce unexpected result. // For instance, in the following example, it w...
[ "function start() {\n var engine = require('ringo/engine').getRhinoEngine();\n new org.ringojs.tools.RingoShell(engine).run();\n}", "function main() {\n try {\n const env = JSON.parse(fs.readFileSync(process.argv[2] || \"env.json\", 'utf8'))\n const sh = Object.entries(env).map(([a, b]) => ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
function to populate all sources for filter by source
function populateSources() { $('#search-filter').hide(); if (!_searchResults || !_searchResults.items || _searchResults.items.length == 0) return; var items = _searchResults.items; var sources = []; var sourceIds = []; for (var i = 0; i < items.length; i++) { var item = items[i]; if (isAtlasRes...
[ "function addSources() {\n screenshareSourceArray = sortSources();\n for (let i = 0; i < screenshareSourceArray.length; i++) {\n addSource(screenshareSourceArray[i], \"selects\");\n sourceMap[screenshareSourceArray[i].id] = screenshareSourceArray[i];\n }\n}", "createDataSources (config) {\n...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Isolated AST code to determine if a value is a wrapped DOM closure.
function isDOMWrapper(type, value) { return t.logicalExpression("&&", t.binaryExpression("===", type, t.stringLiteral("function")), t.memberExpression(value, t.identifier("__jsxDOMWrapper"))); }
[ "isBlock(editor, value) {\n return Element$1.isElement(value) && !editor.isInline(value);\n }", "function ISFUNCTION(value) {\n return value && Object.prototype.toString.call(value) == '[object Function]';\n}", "function isScopeOn(node) {\n if (node.type !== 'CallExpression') {\n retu...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
The below function pulls the data from the guesty
function guesty_reservation_data_pull() { key = '57b6349a1f211d3c4b2b4c886c5632c7' secret = '1b8e3bd1f42ce6b054868cd47dc0412f' reservations_url = 'https://superhostuser.herokuapp.com/api/v2/reservations' results = $.ajax({ type: "GET", url: reservations_url, dataType: 'json', ...
[ "function loadInfoLeagueEspagne(){\n\t\tLeagueEspagneServices.getInfo().then(function(response){\n\t\t\t$scope.infoLeagueEspagne = response.data.responseData.feed.entries;\n\t\t console.log($scope.infoLeagueEspagne);\n\t\t})\n\t}", "function getItems() {\n fetch('http://genshinnews.com/api')\n ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
index = which index should be animated of Big slide it is 3 or 4
function slide_animation(index){ _big.find('ul').css('opacity', 1); if(!_ul.is(':animated')){ _ul.stop(true, true).animate({top:_top}, 400, 'easeOutBounce'); _big.find('ul').css('opacity', 0).show().stop(true, true).animate({opacity:1, bottom:10}, 1000); clearTimeout(_info_timer); _info_timer = setTimeout('sl...
[ "slideNext() {\n super.slideNext();\n this.slides[this.lastSlide].style.opacity = 0;\n this.slides[this._index].style.opacity = 1;\n }", "function privateNext() {\n\t \timageCurrent++;\n\t \tif (imageCurrent > image.length - 1) {\n\t \t\timageCurrent = 0;\n\t \t\tcontainer.animate({left: \...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
extract the dataset from the nested data for a given gender and age group
function getDataset(groupedData, currentGender, currentGroup) { var genderData = groupedData.filter(function(d) { return d.key == currentGender; }) return genderData[0].values.filter(function(d) { return d.key == currentGroup; }) }
[ "function returnNestedData(filters){\n var _nested = summarizeChildren({\n key: 'total',\n values: filterSections(filters).map(d => {\n var nested = nestBy([undefined, 'property', d, 'year'], filterData(filters));\n nested.forEach(datum => { // mutates nested\n ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Is this the root path?
get isRoot() { return this.name === '/'; }
[ "function isSiteRootSane() {\n\tvar siteRoot = dw.getSiteRoot();\n\tvar folderSane = true;\n\n\t//Is site root defined?\n\tif (siteRoot != \"file:///\") {\n\t\t//Is defined site root writable/unlocked?\n\t\tfolderSane = dwscripts.isFileWritable(siteRoot);\n\t}\n\treturn folderSane;\n}", "isRoot() {\n\n ret...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Returns either the selected or alternate selected color for an item Parameters: pItemIndex: The index of the item Return value: Either colors.selectedItemColor or colors.altSelectedItemColor
function DDLightbarMenu_GetSelectedColorForItem(pItemIndex) { if ((pItemIndex < 0) || (pItemIndex >= this.NumItems())) return ""; return (this.GetItem(pItemIndex).useAltColors ? this.colors.altSelectedItemColor : this.colors.selectedItemColor); }
[ "function DDLightbarMenu_GetColorForItem(pItemIndex)\n{\n\tif ((pItemIndex < 0) || (pItemIndex >= this.NumItems()))\n\t\treturn \"\";\n\n\treturn (this.GetItem(pItemIndex).useAltColors ? this.colors.altItemColor : this.colors.itemColor);\n}", "function getCurrentColor() {\n\t\tlet expr = getStateExpr(ActiveItem.e...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
handles my Form Submission, rerenders updated product
handleFormSubmit(e) { e.preventDefault(); let id = parseInt(e.target.dataset.id); let product = Product.findById(id); const name = document.querySelector(`#name-${e.target.dataset.id}`).value const price = document.querySelector(`#price-${e.target.dataset.id}`).value const size = do...
[ "async handleProductUpdate(evt) {\n evt.preventDefault()\n try {\n await this.props.updateProduct(this.props.selectedProduct.id, {\n name: this.state.name,\n price: this.state.price,\n description: this.state.description,\n helpfulness: this.state.helpfulness,\n quantit...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Get previous key with given sid
function getPrevKeyWith( keys, fullSid, ndx ) { ndx = ndx >= 0 ? ndx : ndx + keys.length; for ( ; ndx >= 0; ndx -- ) { var key = keys[ ndx ]; if ( key.hasTarget( fullSid ) ) { return key; } } return null; }
[ "getLastTortoiseKey(req) {\n const turtleID = req._id;\n const turtleSyncToLatestHistory = req.history[0];\n\n return this.mongoShell.command(this.mongoShell._syncFromStore, \"READ\", { _id: turtleID })\n .then(tortoiseSyncFromDocs => {\n const tortoiseSyncFromDoc = tortoiseSyncFromDocs[0];\n\n...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
A factory for a log function predicated on the given debug parameter. The logging function created accepts a function that formats a message and parameters that the function utilises. Presuming the message function may be expensive we only call it if logging is enabled. The log messages are deduplicated based on the pa...
function createDebugLogger(/** A boolean or debug function */ debug) { const log = !!debug && (typeof debug === "function" ? debug : console.log); const cache = {}; return log ? actuallyLog : noop; function noop() {} function actuallyLog(msgFn, params) { const key = JSON.stringify(params); ...
[ "function createLogger(debug) {\n const { splat, timestamp, colorize, combine } = winston.format;\n const logFilePath = path.join(app.getPath(\"userData\"), \"exilibrium.log\");\n let level = \"info\";\n\n if (fs.pathExistsSync(logFilePath) && fs.statSync(logFilePath).size > 4e6) {\n console.log(`Removing ${...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Generate the Aphrodite API exports, with given `selectorHandlers` and `useImportant` state.
function makeExports(useImportant /* : boolean */ ) { var selectorHandlers /* : SelectorHandler[] */ = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : defaultSelectorHandlers; return { StyleSheet: _objectSpread({}, StyleSheet, { /** * Returns a version of the exports of Aphr...
[ "function main() {\n\tconsole.log('Abacus iPad App Generator.');\n console.log('Create flat basic styled app from converted spreadhseet.');\n\tDU.displayTag();\n\n\tif(ops.version){\n\t\tprocess.exit();\n\t}\n\n\tif(!ops.repoPath){\n\t\tconsole.error('Missing argument: --repoPath');\n\t\tops.printHelp();\n\t\tpr...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
implement middleware for redis
function cache(req, res, next) { const { username } = req.params; client.get(username, function(err, data) { if (err) res.send(err) else { if (!!data) { console.log("From redis cache") res.send(setResonse(username, data)) } else {...
[ "function _middleware(req, res, next) {\n if (req._redis_source) {\n if (chain) {\n next();\n } else {\n res.end(req.model);\n }\n return;\n }\n if (req.method.match(/create|update|delete/)) {\n publisher.publi...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
generic functions go to lastpage (used for cancel button)
function lastpage() { window.history.back(); }
[ "function goToPage(pageNr){\r\n\r\n}", "function goBack() {\n if (pageStack.slice(-1)[0] === 'persons-list') {\n clearPersonList();\n }\n\n window.location.hash = pageStack.slice(-2)[0];\n pageStack = pageStack.slice(0, pageStack.length - 2);\n checkPageNav();\n}", "backButtonClicked(){\n // ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
getInstance(self, constructor) Always returns an instance of constructor. Returns self if it is an instanceof constructor, otherwise constructs an object with the correct prototype.
function getInstance(self, constructor) { return self instanceof constructor ? self : Object.create(constructor.prototype); }
[ "getInstance() {\n if(this.instance.constructor === NoInstance)\n throw new Error(`Injectable ${this.name} is not initiated, but an instance is requested, please create it \\\n first via the container.`);\n\n return this.instance;\n }", "function Class(){\n var construct...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Process server response to the Trip Id save call.
function processTripIdSaveResponse(data){ // if validation errors exist, display them. if(data.validationErrors.errors != undefined){ processTripIdValidationErrors(data.validationErrors.errors); saveValidationErrors = true; return false; } // if multiple appointments found for the given date range, ...
[ "static handleSetSelectedAddressResponseSuccess(response, contextIdentifier){\n ContextualErrorActions.clearErrors(contextIdentifier);\n ApplicationDispatcher.dispatch({\n actionType: ServerStateActionTypes.RECEIVE_CHECKOUT_DELIVER_AND_COLLECT_SERVER_STATE,\n action: {\n serverState: response...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Evaluate cssvariable and csscalc expressions
function evaluateCssExpressions(view, property, value) { var newValue = Object(_core_properties__WEBPACK_IMPORTED_MODULE_0__["_evaluateCssVariableExpression"])(view, property, value); if (newValue === 'unset') { return _core_properties__WEBPACK_IMPORTED_MODULE_0__["unsetValue"]; } value = newValue; try...
[ "function useCssVars(getter) {\n if (!inBrowser && !false)\n return;\n var instance = currentInstance;\n if (!instance) {\n warn$2(\"useCssVars is called without current active component instance.\");\n return;\n }\n watchPostEffect(function () {\n var el...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
animate points into new positions / data is the global data object, newData is the new dataset to animate to
function animatePoints(data, newData) { /* varibale to hold new raphael path string */ var newPath = ''; /* upper and lower limits are the limits of the data set and are used to scale the data values into pixel positions */ var upperLimit = parseInt(newData.upper); if(isNaN(upperLimit)) { /* do...
[ "function updateDatapoints() {\n\t\t//remove all markers from the map in order to be able to do a refresh\n\t\tmarkers.clearLayers();\n\t\tmarkers_list = {};\n\t\t//for every datapoint\n\t\tbyId.top(Infinity).forEach(function(p, i) {\n\t\t\t//create a marker at that specific position\n\t\t\tvar marker = L.circleMar...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
On either pressing the key on the keyboard or clicking the city, sets the column id, fires the laser, and checks for any missiles in the path of the laser
function onUserInput() { columnID = this.getAttribute('data-city') if(deactivatedLasers[columnID - 1]) { return } $city = $('#city-' + columnID) shootLaser($city) isHit() }
[ "function handleKeyDownEvent(){\n if(d3.event.keyCode == 49){\n // Number 1: Set start point\n } else if(d3.event.keyCode == 50){\n // Number 2: Set end point\n } else if(d3.event.keyCode == 83){\n // Character S: Start search\n startSearch();\n } else if(d3.event.keyCode == ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
disable and enable div
function disable(div_name, title){ div_name.disabled = true; add_class(div_name,'disabled'); add_class(title,'disabled-light'); /*var nodes = div_name.getElementsByTagName('*'); for(var i = 0; i < nodes.length; i++){ nodes[i].disabled = true; }*/ ...
[ "function disableOtherElement() {\n //Back, home page, learn and speaker icons are disabled\n document.getElementsByClassName('backContainer')[0].setAttribute('disabled',\n 'true');\n document.getElementsByClassName('homePageContainer')[0].se...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
generates a random letter
function generateRandomLetter() { return String.fromCharCode(Math.floor(Math.random() * 26) + 97); }
[ "function randomWord() {\nvar word = \"\"\n for (var i = 0; i < Math.floor((Math.random() * 10) + 1); i++) {\n var word = word + randomLetter();\n }\nreturn word;\n}", "function generateRandomString() {\n const arrayOfAlphaNum = ['a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o', 'p'...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Conseguir Usuario por Id
function conseguirUsuario(req,res) { let id = req.params.id res.json({ id: id, nombre: "Prueba", message: "Usuario según Id" }) }
[ "function inserirUsuario() {\n if ($scope.novoUsuario.Id > 0) {\n atualizarModelUsuario();\n\n } else {\n inserirModelUsuario();\n }\n }", "function setAuthedUser (id) {\n return {\n type: SET_AUTHED_USER,\n id\n }\n}", "e...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Show pop button on block(welPopButtonOnBlock) which is for create new comment thread near to selected block
function _showPopButtonOnBlock(){ var htPosition = _getPopButtonPosition(); htElement.welPopButtonOnBlock.show(); htElement.welPopButtonOnBlock.css({ "top" : htPosition.top + "px", "left": htPosition.left + "px" }); }
[ "function showPopup(e) {\r\n\t$('#visPopup').html($(e).attr('blockname'));\r\n\t$('#visPopup').css('left', e.x + 4).css('top', e.y + 4);\r\n\t$('#visPopup').show();\r\n}", "async showComments() {\n const modal =\n create(\"qp-popup\", {\n heading: \"Comments\",\n headingElement: \"h3\",\n ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
creditSearch validates the search criteria if ok runs creditSearch at index.aspx.cs gets the file drop down displays the searching message, clears current expanded row, disables buttons, hides tab, and shows loading message
function creditSearch(){ //might need to make these dates to compare if (document.mForm.mCreditSentTo.value != "" && document.mForm.mCreditSentFrom.value > document.mForm.mCreditSentTo.value){ document.getElementById("mCreditErrorTD").innerHTML = "...
[ "function creditSearchCallback(res){\n document.getElementById('mCreditLoadingDiv').style.display = 'none';\n document.getElementById('creditTabSet').style.display = '';\n document.mForm.mCreditButton.disabled = false;\n \n if (!res.error &&...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Formats the given diagnostics, without pretty printing. Without colors, it's better for matching against programmatically.
function uglyFormat(target, diagnostics) { var diagnosticsHost = { getCurrentDirectory: function () { return ts.sys.getCurrentDirectory(); }, getNewLine: function () { return ts.sys.newLine; }, // Print filenames including their relativeRoot, so they can be located on ...
[ "function filterExpected(bazelOpts, diagnostics, formatFn) {\n if (formatFn === void 0) { formatFn = uglyFormat; }\n if (!bazelOpts.expectedDiagnostics.length)\n return diagnostics;\n // The regex contains two parts:\n // 1. Optional position: '\\(5,1\\)'\n // 2. Requir...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Function to display dbpedia data for a given city/county region is an internal object
function displayDBpediaData(region) { var img = region.img; $("#dbpedia-content-holder").html("<a href=\""+region.name+"\" target='_blank'>" + locationName + " in wikipedia </a><br>" + "<img id=\"myImage\"src=\"" + img + "\"><br><a href=\""+region.web+"\" target=\"_blank\">" + region.web +"<\/a>"); $("#my...
[ "function loadDBpediaData(uri,name) {\n\t\tvar rows;\n\t\tif (name.indexOf(\"County\")!=-1) {\n\t\t\t//special case for Laoghaire-Rathdown\n\t\t\tif (name.indexOf(\"Laoghaire-Rathdown\")!=-1)\n\t\t\t\tname = \"Dun Laoghaire-Rathdown\";\n\t\t\trows = queryDBpediaCountyResults.results.bindings;\n\t\t}\n\t\telse \n\t\...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Initializes the CasperJS Command Line Interface.
function initCasperCli(casperArgs) { /*eslint complexity:0*/ var baseTestsPath = fs.pathJoin(phantom.casperPath, 'tests'); function setScriptBaseDir(scriptName) { var dir = fs.dirname(scriptName); if (dir === scriptName) { dir = '.'; } ...
[ "_initCLI() {\n console.info(`${this._color(32)}Logged in. Fetching competitions...${this._color(0)}`);\n this._client.arena.competitions()\n .then(this._arenaCompetitions.bind(this));\n }", "async initialize() {\n this.loadEnv();\n this.loadConfiguration();\n }", "f...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
puts all the profits for different quality comparisons in the item.profit_array if ignore_maxAgeCity is false. if it is true instead puts them in the profits_array_ignored_maxAgeCity array. also logs the number of profitable and fresh trades item.profit_array format (assuming masterpiece item quality, cityQBMQ): [maste...
function compareQualities(cities, i, j, ignore_maxAgeCity) { var item = cities[i][j]; item.bmPrice = cities[0][j].buy_price_max; item.cityPrice = item.sell_price_min; ignore_maxAgeCity ? item.profits_array_ignored_maxAgeCity = [] : item.profits_array = []; for (var k = 0; k < item.quality; k++) { /* ...
[ "function filterDataByParameters(cities) {\n // cities[0] is the blackMarket first for loop then starts from 1\n for (var i = 1; i < cities.length; i++) { // Loop through every city\n for (var j = 0; j < cities[i].length; j++) { // Loop through every item\n var item = cities[i][j];\n\n // the reason ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Parse a pair adjustment positioning subtable, format 1 or format 2 The subtable is returned in the form of a lookup function.
function parsePairPosSubTable(data, start) { var p = new parse.Parser(data, start); // This part is common to format 1 and format 2 subtables var format = p.parseUShort(); var coverageOffset = p.parseUShort(); var coverage = parseCoverageTable(data, start + coverageOffset); // valueFormat 4: XAd...
[ "function parseLookupTable(data, start) {\n var p = new parse.Parser(data, start);\n var table, lookupType, lookupFlag, useMarkFilteringSet, subTableCount, subTableOffsets, subtables, i;\n lookupType = p.parseUShort();\n lookupFlag = p.parseUShort();\n useMarkFilteringSet = lookupFlag & 0x10;\n su...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
The application canvas controller
function CanvasController() { // Define the canvas reference and canvas context const canvas = document.querySelector('canvas'); // Get the window size dimensions this.width = window.width * window.scale; this.height = window.height * window.scale; // Set the canvas dimensions to the window size canvas....
[ "initCanvas() {\n // Create new canvas object.\n this._canvasContainer = document.getElementById(this._canvasId);\n if (!this._canvasContainer)\n throw new Error(`Canvas \"${this._canvasId}\" not found`);\n // Get rendering context.\n this._canvas = this._canvasContaine...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
create a new report by extracting title and outcome
function create_report() { let buffer = []; let title = extract_title(); let outcome = extract_outcome(); let titles = outcome[0].join(separator); let outcomes = outcome[1].join(separator); let ret = [ titles, outcomes ].join("\n"); ...
[ "function saveDataCreateReport() {\n console.log('Writing data to JSON...');\n const jsonFile = fileName(client,'results/','json');\n fs.writeFileSync(jsonFile, JSON.stringify(AllResults));\n console.log(`Created ${jsonFile}`);\n\n console.log('Creating A11y report...');\n var data = mapReportData...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
function to load in fake events database if no events are present.
function loadFakeEvents () { if(localStorage.getItem('event') == null) { //load in fake events array localStorage.setItem('event', JSON.stringify(fake_events)); } }
[ "function getAllEvents() {\n if (dbPromise) {\n dbPromise.then(function (db) {\n var transaction = db.transaction('EVENT_OS', \"readonly\");\n var store = transaction.objectStore('EVENT_OS');\n var request = store.getAll();\n return request;\n }).then(fun...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Updates the section size per second of a single bacteria
function updateSectionSize(sSize, j) { if(gameState == true){ var now = Date.now(); var time = now - last[j]; last[j] = now; return (sSize + (SECTIONSIZE_PER_SECOND * time) / 100.0); } }
[ "updateServings(type){\n\n const newServings = type ==='dec'?this.servings-1:this.servings+1;\n\n this.ingredients.forEach(element=>{\n element.count *= (newServings/this.servings);\n })\n\n\n this.servings=newServings;\n }", "_setCreatureSize(data, actor, sceneId) {\n ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Function for preloading assets
function Preload() { assets = new createjs.LoadQueue(); // asset container util.GameConfig.ASSETS = assets; // make a reference to the assets in the global config assets.installPlugin(createjs.Sound); // supports sound preloading assets.loadManifest(assetManifest); // load assetManifest ...
[ "function preload()\r\n{\r\n // Spiderman Mask Filter asset\r\n imgSpidermanMask = loadImage(\"https://i.ibb.co/9HB2sSv/spiderman-mask-1.png\");\r\n\r\n // Dog Face Filter assets\r\n imgDogEarRight = loadImage(\"https://i.ibb.co/bFJf33z/dog-ear-right.png\");\r\n imgDogEarLeft = loadImage(\"https://i.ibb.co/dgg...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
renders all comments for the certain post
async function renderComments(postId) { const comments = await get(`http://5c332abce0948000147a7749.mockapi.io/api/v1/posts/${postId}/comments`); if (comments.length) { sortByDate(comments); let n = comments.length - 1; // if more than 4 comments, adds expand button if (comments.length > 4) { ...
[ "function getComments(postId) {\n\t\t\t}", "static fetchPostComments(post_id) {\n return this._getObject(this._POST_COMMENTS_URL(post_id));\n }", "function Wo_loadAllComments(post_id) {\n main_wrapper = $('#post-' + post_id);\n view_more_wrapper = main_wrapper.find('.view-more-wrapper');\n Wo_progressIco...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
toggle low/full resolution indicator for a plot
function toggle_resolution (i, resolution) { if (resolution == -1) { // do not show resolution indicator $("#dac-low-resolution-plot-" + (i+1)).hide(); $("#dac-full-resolution-plot-" + (i+1)).hide(); } else if (resolution > 1) { // turn on low resolution warning/turn off full resolution $("#...
[ "function zoom_on_or_off() {\n if(zoom_should_be_on()) {\n setTimeout(zoom_on, 200)\n } else {\n zoom_off()\n }\n}", "set resolutionMode(value) {}", "function hideIndicator() {\n overlay_id = 'screen';\n show_id = 'indicator';\n if ($(show_id)) {\n $(show_id).hide();\n }\n if ($(overlay_id)) {\...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Function to remove items from a supplied set of rows based on the selections the user has made on the popup filter page. Returns an array containing the rows to keep.
function applyPopupFilterExclusionsToRows(rows, div) { var rowsToDisplay = []; var keepRow; // Keep a count of each row we have worked on starting from 1. var rowCount = 1; indiciaData.popupFilterRemovedRowsCount = 0; indiciaData.allReportGridRecords = []; $.each(rows, function...
[ "function clearSelectedRows() {\n var tblRows = contentTbl.fnGetNodes(),\n\t\ttblRow,\n\t\tnumRows = tblRows.length;\n for (var i = 0; i < numRows; i++) {\n\t\ttblRow = $(tblRows[i]);\n if ($(tblRow).hasClass('selected')) {\n $(tblRow).removeClass('selected');\n }\n }\n}", "funct...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Remove the payment instrument for the current basket
async removePaymentInstrument() { let paymentInstrumentId = basket.paymentInstruments && basket.paymentInstruments[0]?.paymentInstrumentId if (!paymentInstrumentId) { return } const response = await api.shopperBask...
[ "removeBike(bike) {\n //Removes bike from basket\n for (let i of basket) {\n if (bike == i) {\n this.totalPrice -= basket[basket.indexOf(i)].displayPrice;\n basket.splice(basket.indexOf(i), 1);\n shared.basketLength = basket.length;\n this.updateBasket();\n this.calcDis...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Updating Question Slide bar height img position score position
function updateChoicesSlideView_(slide) { slide.maxScore = getMaxScore(slide.wrapper.getElementsByClassName('slide-choices__option-wrapper')); for( var i = 0; i < slide.answers.length; i++ ) { var answer = slide.answers[i], answerHeight = slide.answers[0].wrapper.clientHei...
[ "_updateYPosition() {\n this._updateSize();\n }", "function updateChoicesSlideScore_() {\n\n updateChoicesSlideView_(this.closest('.slide-choices__option-wrapper'));\n\n }", "function mostrarPrimeiraImagem() {\n if (slidePosition !== 0) {\n slidePosition = 0; \n }\n\n updateD...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Redirect to wishlist page
function Getwish() { alert("inside wish " + loginidd); url = "wishlist.html"; document.location.href = url; }
[ "function redirectToProductList() {\n document.location = location.origin + '/Product';\n}", "function continueShopping() {\n\tsaveFormChanges();\n\twindow.location.href = thisSiteFullurl + backURL;\n}", "function goToSubscribe(_redirect) {\r\n\r\n\tvar redirect = (typeof _redirect == 'boolean' && _redirect ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Send discovery command to TTS
function discoverTTSDevices() { console.log('[TTS] Discovering resources on TTS...'); var json = JSON.stringify({ path: '/api/v1/device/list', requestID: '1', options: {depth: 'all'} }); manageWS.send(json); }
[ "function call_control_speak(f_call_control_id, f_tts_text) {\n\n var cc_action = 'speak'\n\n var options = {\n url: 'https://api.telnyx.com/calls/' +\n f_call_control_id +\n '/actions/' +\n cc_action,\n auth: {\n username: f_telnyx_api_key_v1,\n ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Walking iterates the statements and expressions and processes them
walkStatements(statements) { for (let index = 0, len = statements.length; index < len; index++) { const statement = statements[index]; this.walkStatement(statement); } }
[ "visitData_manipulation_language_statements(ctx) {\n\t return this.visitChildren(ctx);\n\t}", "function evaluate(stmt, env) {\n if (is_self_evaluating(stmt)) {\n return stmt;\n } else if (is_empty_list_expression(stmt)) {\n return evaluate_empty_list_expression(stmt);\n } else if (is_variable(stm...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
calculate total population cap
function totalPopCap(){ var total = 0; for (var d in depotList){ total += depotList[d].popCap; } for (var h in houseList){ total += houseList[h].popCap; } return total }
[ "function currentlyInfectedCalc(reportedCases, type, population) {\n // if (type === severeImpact) {\n // return Math.min(reportedCases * 50, population);\n // }\n // return Math.min(reportedCases * 10, population);\n console.log(population);\n if (type === severeImpact) {\n return reportedCases * 50;\n ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
changes JSON.stringify to array with its individual emotion
function getEmotion(strDisplay) { var emotion = [null, null, null, null, null, null, null]; var strSplit = strDisplay.split(' '); var i = 0; console.log('Person'); while (i != strSplit.length) { // console.log(strSplit[i]); switch (strSplit[i]) { case '"a...
[ "function experimentToJSON(exp){\n // Get the basic information\n let expJSON = {};\n expJSON[EXP_JSON_TITLE] = exp.title;\n expJSON[EXP_JSON_CREATOR] = exp.creator;\n\n // Get the Equipment\n let equips = [];\n let equipTypes = {};\n exp.equipment.forEach(function(eqCont){\n let eq =...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Detects changes to how a given font renders in a Canvas context, using the assumption that the first such change indicates that the font has loaded and should no longer be checked. If you provide multiple fonts (e.g. Lato, 'Open Sans', Arial), onchange handler can be called multiple times. options: font: a font family ...
function detectFontChange(_options) { var options = {}; // option processing Object.keys(_options).concat(Object.keys(DEFAULTS)).forEach(function (key) { options[key] = _options[key] != null ? _options[key] : DEFAULTS[key]; }); var multipleFonts = options.font.split(','); if (multipleFonts.length > 1) {...
[ "_listenFontSelectionChange() {\n var self = this;\n BB.comBroker.listenWithNamespace(BB.EVENTS.FONT_SELECTION_CHANGED, self, function (e) {\n if (!self.m_selected || e.caller !== self.m_labelFontSelector) {\n return;\n }\n var config = e.edata;\n ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Resets all vertical slides so that only the first is visible.
function resetVerticalSlides() { var horizontalSlides = toArray( dom.wrapper.querySelectorAll( HORIZONTAL_SLIDES_SELECTOR ) ); horizontalSlides.forEach( function( horizontalSlide ) { var verticalSlides = toArray( horizontalSlide.querySelectorAll( 'section' ) ); verticalSlides.forEach( function( verticalSlid...
[ "function reset() {\n for(let i = 0; i < sliderImages.length; i++) {\n sliderImages[i].style.display = 'none';\n }\n}", "function resetSlider() {\n currentSlideIndex = 0\n }", "function resetPagesIfOffScreen() {\n if (!pages)\n return;\n\n for (var p in pages) {\n if (!$('#p...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
prepare Prepare tasks Parse the following to produce an array of tasks Examples: release:app1:env => release app1 with env settings release:env => release all with env settings release:app1 => release app1 app with dev env test:app1 => test app1 app
function prepare() { var releases = []; // release:env envs.forEach(function (env) { var _tasks = []; // all apps with `env` settings apps.forEach(function (app) { _tasks.push('release:' + app + ':' + env); }); releases.push({ task: 'release:' + env, arr : _tasks }); }...
[ "function loadTasks(env, args, shouldDeploy, cb){\n var didLoad = config.load(args.file);\n var tasks = config.getTasks();\n if(!tasks) mess.warning(\"No tasks were found/specified\");\n if(!didLoad || !tasks){\n mess.yesOrNo('Would you like to deploy anyways?', rl, (yes) => {\n if(yes...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }