query
stringlengths
9
34k
document
stringlengths
8
5.39M
negatives
listlengths
19
20
metadata
dict
Clean up the underlying MutationObserver for the specified element.
_cleanupObserver(element) { if (this._observedElements.has(element)) { const { observer, stream } = this._observedElements.get(element); if (observer) { observer.disconnect(); } stream.complete(); this._observedElements.delete(element);...
[ "function unsubscribe_observe(element) {\n let subs = new Subscription();\n for (let i = 0; i < observe_arr[element].length; i++) {\n subs.add(observe_arr[element][i]);\n }\n subs.unsubscribe();\n ob_attr_arr[element].disconnect();\n element.removeAttribute(\"TrueValue\");\n}", "function ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Description: Finds most frequent words in the text Parameter: txt Returns: array with the forst 10 most frequent words + number of times it appears
function mostFrequent(txt){ let dictionary = {}; let wordLengths = []; let uniqueWords = []; let strArray = []; let word = ""; let c; if(txt.length !== 0) { for (c of txt) { if (c.match(/^[0-9a-zA-Z]+$/)) { word += c; }else { ...
[ "function topWords(text) {\n let wordArray = text.split(' ');\n // ['hi', 'hello', 'hello']\n let wordCounter = {};\n \n for (let word of wordArray) {\n let lowerCaseWord = word.toLowerCase();\n\n if (!wordCounter[lowerCaseWord]) {\n wordCounter[lowerCaseWord] = 1;\n } else if (wordCounter[lowerC...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Handle response from saving user.
_handleSaveUserSuccess(response) { this._user = new User(response); Radio.channel('rodan').trigger(RODAN_EVENTS.EVENT__USER_SAVED, {user: this._user}); }
[ "function saveUser() {\n UserService.Update(vm.user)\n .then(function () {\n FlashService.Success('Usuario modificado correctamente');\n })\n .catch(function (error) {\n FlashService.Error(error);\n });\n }", "function saveAndPubl...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
BranchDisplay This function is responsible for creating the layout of the branch object
function BranchDisplay() { var branch = this; /* so get the level of nesting for this branch use this function 0 for root items, 1-N for the child items */ // var level = getBranchLevel(this.tree , this.parent.id); branch.actionFrameDiv = document.cr...
[ "function showBranch(branch_num, is_building, bracket, show_compare=false) {\n if (cur_view == \"actual\") {\n show_compare = false;\n }\n else {\n show_compare = true;\n }\n clearPage();\n\n // Hide 'continue' elements.\n hideContinue();\n\n //let cont = document.getElementByI...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Function:setSiteEditorCfgField (rowName, colName, newVal, baseVal) Purpose:sets the value of rowName X colName to newVal. If newVal is the same as the baseVal, newVal will only be written out if the page is the current working page or the base page
function setSiteEditorCfgField (rowName, colName, newVal, baseVal) { (baseVal == newVal ? bBase = true : bBase = false); if (rowName == gBASE_PAGE || rowName == gCURRENT_PAGE || !bBase) doAction ('DATA_SETCONFIGDATA', 'ObjectName', gSITE_ED_FILE, 'RowName', rowName, 'ColName', colName, 'NewValue', newVal); ...
[ "function addUpdateSiteEditorCfg (rowName, pageObj, baseObj, colNames)\n{\n\tdoAction ('DATA_DELETECONFIGROW', 'ObjectName', gSITE_ED_FILE, 'RowName', rowName);\n\tdoAction ('DATA_ADDCONFIGROW', 'ObjectName', gSITE_ED_FILE, 'RowName', rowName);\n\t\n\tfor (var n = 0; n < colNames.length; n++)\n\t\tsetSiteEditorCf...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Helper function to return all of a user's possible locations based on their availability map.
static getUserAvailableLocations(availability) { // NOTE: Availability is stored in the Firestore database as: // availability: { // Gunn Library: { // Friday: [ // { open: '10:00 AM', close: '3:00 PM' }, // { open: '10:00 AM', close: '3:00 PM' }, ...
[ "function locationFinder() {\n\t\t\tvar locations = [];\n\t\t\t// iterates through entries location and appends each location to\n\t\t\t// the locations array\n\t\t\tfunction appendLocations(entriesID) {\n\t\t\t\tmyData.forEach(function(tile) {\n\t\t\t\t\tif (tile.hasOwnProperty(entriesID)) {\n\t\t\t\t\t\ttile[entr...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
helper function, walks recursively inside nested folders and return absolute filenames
function walk(folder){ var filenames = []; // get relative filenames from folder var folderContent = fs.readdirSync(folder); // iterate over the folder content to handle nested folders _.each(folderContent, function(filename) { // build absolute filename var absoluteFilename = path.join(...
[ "function goThroughSubdirs(err, subdirs) {\n if (err) throw err;\n subdirs.forEach(populateSubrfid); \n}", "function traverse(basedir, ancestors, current, fn) {\n var abs, stat;\n\n abs = path.join(basedir, ancestors, current);\n stat = fs.statSync(abs);\n\n if (stat.isDirectory()) {\n an...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Set the value of the element at the given row and column, zero indexed
setat(row,column,value) { if (row >= 0 && row < 4 && column >= 0 && column < 4 ) this._data[row][column] = value; }
[ "set(r, c, val) {\n if (r < 0 || r >= this.numRows || c < 0 || c >= this.numCols)\n throw new RangeError(\"Index out of bounds\");\n this.cells[r][c] = val;\n }", "setRow(index, row) {\n return this.setRowFromFloats(index, row.x, row.y, row.z, row.w);\n }", "set(x, y, v...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
FORMAS DE SOLUCIONAR EL SCOPE DE THIS ====1 Forma====Dentro del forEach, this is undefindes, asi que tenemos que creal una nueva variable (Que va a ser global en la funcion) _this o sel y apuntarla a this, de esta forma podermos acceder a las propiedades del objeto,
listarAmigos(){ const _this = this this.amigos.forEach(function(amigo){ console.log(`Mi nombre es ${_this.nombre} y mi amigo es ${amigo}`) }) }
[ "prepare(){\n this.tasks.forEach(task => {\n console.log(this);\n })\n }", "show_cost() {\n let costs = this.cost_list\n var self = this\n costs.forEach(function (cost) {\n self.add_cost(cost)\n })\n // console.log(costs)\n }", "forEac...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
process indel vcf content for only 1 file
async function process_indel_vcf(f){//filename let filename = f.replace(".sam.vcf", ""); let vcf = await exactSNP.cat("/data/" + f); let lines = vcf.split(/\r?\n/); let summary = ""; for (let line of lines){ if (line && !line.includes("#")){ let ss = line.split(/\t/); ...
[ "async function process_indel_vcf(f){//filename\n let filename = f.replace(\".sam.vcf\", \"\");\n let vcf = await exactSNP.cat(\"/data/\" + f);\n let lines = vcf.split(/\\r?\\n/);\n let summary = \"\";\n // let depDict = await getDepthAll(\"/data/\" + filename + \".bam\");\n for (let line of lines...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Set Absorption Range returns String
SetAbsorption(num) { return ["10", "9 - 10", "8 - 10"][num-1]; }
[ "function createRangeDescription() {\n if((!dual || single) && incrementTop === 1) {\n return `(range: ${topStart} to ${topEnd})`;\n } else if((!dual || single) && incrementTop !== 1) {\n return `(range: ${topStart} to ${topEnd}(step ${incrementTop}))`;\n } else if((topStart === bottomS...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
This class represents an edge (llevel) for layout purposes.
function LEdge(source, target, vEdge) { LGraphObject.call(this, vEdge); // ----------------------------------------------------------------------------- // Section: Instance variables // ----------------------------------------------------------------------------- /* * Source and target nodes of this edge...
[ "function Edge(prev_node, character, next_node) {\n this.prev_node = prev_node;\n this.character = character; \n this.next_node = next_node; \n}", "addEdge(edge) {\n\t // is this edge connected to us at all?\n\t var nodes = edge.getNodes();\n\t if (nodes.a !== this && nodes.b !== thi...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
650vue pretends BRK triggers a nonmaskable interrupt, because the monitor lives in the terminal, outside of the virtual CPU.
BRK() { this.setFlag(constants.flags.SR_BREAK); this.nmi = true; }
[ "function ringBell() {\n process.stderr.write('\\x07');\n}", "function toggleBreak(){\n\tif (onBreak) {\n\t\tonBreak = false;\n\t} else {\n\t\tonBreak = true;\n\t}\n}", "async preventKeyEvent() {\n this.dummyTextArea.focus();\n await sleep(0);\n this.focus();\n }", "function blinkCame...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Called whenever the Calculate Probability button is pressed. Makes a bunch of requests, one for each road along the route.
function onCalcPressed() { console.log("Calculate button pressed"); var roadNames = Object.keys(roads); var roadArr = []; //map.clear(); for(var i = 0; i < previousPolylines.length; i++) { console.log("Calling setMap(null) on polyline"); console.log(previousPolylines[i]); previousPolylines[i].setMap(null)...
[ "function calcRoute() {\n\t// Prepare the API call\n\tvar start = start_location.geometry.location;\n\tvar end = end_location.geometry.location;\n\tvar request = {\n\t\torigin: start,\n\t\tdestination: end,\n\t\ttravelMode: 'DRIVING'\n\t};\n\n\t// Call Google Maps API\n\tdirectionsService.route(request, function (r...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
VERY LIMITED / BASIC GL STATE MANAGEMENT Executes a function with gl states temporarily set, exception safe Currently support scissor test and framebuffer binding
function glContextWithState(gl, _ref2, func) { var scissorTest = _ref2.scissorTest; var framebuffer = _ref2.framebuffer; // assertWebGLContext(gl); var scissorTestWasEnabled = void 0; if (scissorTest) { scissorTestWasEnabled = gl.isEnabled(gl.SCISSOR_TEST); var x = scissorTest.x; var y = scissor...
[ "bind(){ gl.ctx.useProgram( this.shader.program ); return this; }", "function initGL() {\n \"use strict\";\n ctx.shaderProgram = loadAndCompileShaders(gl, 'VertexShader.glsl', 'FragmentShader.glsl');\n setUpAttributesAndUniforms();\n prepareTerrain();\n gl.clearColor(0.4, 0.823, 1, 1);\n}", "func...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Return all elements associated with a link. PlantUML draw them after the path representing the link, and up to the next comment tag.
function findAssociatedLinkElements(link) { var elems = []; while (link && link.tagName) { elems.push(link); link = link.nextSibling; } return elems; }
[ "function renderAlmeLinks( linkCollection )\n {\n var formattedLinks = \"\";\n\n // if no sections exit\n if ( linkCollection.Sections.length == 0 )\n {\n return \"\";\n }\n\n for ( var obj in linkCollection.Sections )\n ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Retrieve folders and notes from api and populate the state
componentDidMount() { fetch(`${baseUrl}/folders`) .then(res => { if (!res.ok) { return res.json().then(e => Promise.reject(e)) } return res.json() }) .then(resJson => { // console.log(resJson) this.setState({ folders: resJson ...
[ "getFolders() {\n return fetch(this.BASE_API + \"/folders\", {\n method: 'GET',\n headers: {\n 'Accept': 'application/json'\n },\n });\n }", "setFolders(state, folders) {\n state.list = folders\n }", "onUpdateFolder() {\n this.s...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
display couples only works when even number of players START()
function displayCouplesOdd(){ for(i = 0; i < numberOfPlayers / 2 - 1; ++i) { // player 1 let p1 = document.createElement("p"); p1.setAttribute('id', `player${playerId}`); p1.innerHTML = `${couples[i].player1}`; p1.style.gridColumn = "1/2"; p1.style....
[ "function start(){\n\n // this is the real number of players updated\n updateNumberOfPlayers();\n\n plEvenOdd = numberOfPlayers;\n\n plEvenOdd % 2 !== 0 ? ++numberOfPlayers : numberOfPlayers;\n\n plEvenOdd % 2 == 0 ? updateTotalRounds() : updateTotalRoundsOdd();\n\n // update totalRounds\n // u...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Wrapper that gets the total values given gamma, mach, temp, dens and press
function calcTotalValues(gam,mach,temp,dens,press) { var temp0 = 0; var dens0 = 0; var press0 = 0; temp0 = calcTotalTemperature(gam,mach,temp); dens0 = calcTotalDensity(gam,mach,dens); press0 = calcTotalPressure(gam,mach,press); return [temp0,dens0,press0]; }
[ "function calcShockRatios(gam,mach) {\n\tvar stemp = 0;\n\tvar sdens = 0;\n\tvar spress = 0;\n\tstemp = calcShockTemperature(gam,mach,1.0);\n\tsdens = calcShockDensity(gam,mach,1.0);\n\tspress = calcShockPressure(gam,mach,1.0);\n\treturn [stemp,sdens,spress];\n}", "function calcTotal(){\n\n //Variable to hold to...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Return all packs that produce a given event, but which is not contained in the given "path" list.
getEventProducer (eventName, stageName, packs, path) { const producers = packs .filter(pack => { const stage = pack.config.lifecycle[stageName] return path.indexOf(pack) === -1 && stage.emit.indexOf(eventName) >= 0 }) if (producers.length > 1) { return new Error(`More than one...
[ "_filtersForPath (path) {\n const pathFilter = filters.HierarchyFilter(path);\n const filtersList = [];\n for (let i = 0; i < this.filters().length; i++) {\n const currentFilter = this.filters()[i];\n if (currentFilter.isFiltered(path) || pathFilter.isFiltered(currentFilte...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Mosaic Infinite Scrolling Initialization
function mosaicInfiniteScrollingInit($container) { if (globalDebug) {console.log("Mosaic Infinite Scroll Init");} max_mosaic_pages = $container.data('maxpages'); mosaic_page_counter = 1; $container.infinitescroll({ navSelector : '.mosaic__pagination', // selector for the paged navigation nextSelector : ...
[ "function initImageParallax() {\n const parallaxSections = gsap.utils.toArray(\".with-parallax\");\n parallaxSections.forEach((section) => {\n const img = section.querySelector(\"img\");\n\n gsap.to(img, {\n yPercent: 20,\n ease: \"none\",\n scrollTrigger: {\n trigger: section,\n ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Checks if mask still has any imaginary values
function stillImaginary(mask) { for (let i = 0; i < mask.length; i++) { if (gpuMult) { if (mask[i][1] != 0) return true } else { if (typeof(mask[i]) == "object") return true } } return false }
[ "isIdentity() {\n if (this._isIdentityDirty) {\n this._isIdentityDirty = false;\n const m = this._m;\n this._isIdentity =\n m[0] === 1.0 &&\n m[1] === 0.0 &&\n m[2] === 0.0 &&\n m[3] === 0...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Check whether device is considered live.
deviceStatusLive(device) { const difference = this.getTimeDifference(device.updated_at); return (difference <= 15); }
[ "function check() {\n clearTimeout(timer)\n\n if (device.present) {\n // We might get multiple status updates in rapid succession,\n // so let's wait for a while\n switch (device.type) {\n case 'device':\n case 'emulator':\n willStop = false\n t...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Constructs a new IntegrationApiKeyListResponse.
constructor() { IntegrationApiKeyListResponse.initialize(this); }
[ "async createApiKey (obj, args, context) {\n try {\n return {\n key: await WIKI.models.apiKeys.createNewKey(args),\n responseResult: graphHelper.generateSuccess('API Key created successfully')\n }\n } catch (err) {\n return graphHelper.generateError(err)\n }\n ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Calculate UTC time and inject to elements
function utcTime() { var today = new Date(); var hh = today.getHours(); var mm = today.getMinutes(); var ss = today.getSeconds(); hh = checkTime(hh); mm = checkTime(mm); ss = checkTime(ss); updateElement('span.utcdigit.hours',hh); updateElement('span.utcdigit.minutes',mm); updat...
[ "function renderLocalTimes() {\n $('.tiempo').each(function () {\n var timestamp = $(this).data('timestamp');\n if (timestamp) {\n renderLocalTime(this, timestamp);\n }\n });\n}", "function getOnsetAsUTC(obs, localdate) {\n //return new Date(localdate.getTime() - obs.offsetFrom);\n r...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
This method initializes the video player and updates the dimensions and positions for the first time.
function initVideoPlayer() { updateDimensions(); var playerOptions = { autoplay: 1, controls: 0, iv_load_policy: 3, cc_load_policy: 0, modestbranding: 1, playsinline: 1...
[ "setup() {\n this.player.setup();\n }", "function resizeAndPositionPlayer() {\n $player = element.children().eq(0);\n\n element.css({\n width: parentDimensions.width + 'px',\n height: parentDimensions.height + 'px'\n });\n\n ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Loop through and encode a 2D array using the encoder function
function encode_arr(arr) { var arr_out = [] for (let i of arr) { arr_out.push(encoder(i)) } return arr_out }
[ "tilesToTextures() {\n\n\t\t// Convert 1d array to 2d.\n\t\tfor (var i = 0; i < this.dimension; i++) {\n\t\t\t\n\t\t\tlet tempArr = [];\n\t\t\tfor (var j = 0; j < this.dimension; j++) {\n\t\t\t\t\n\t\t\t\ttempArr.push(this.tiles[i * this.dimension + j].texture);\n\t\t\t}\n\n\t\t\tthis.textureArray.push(tempArr);\n\...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Decodes an image from a URL.
decodeFromImageUrl(url){return __awaiter$1(this,void 0,void 0,function*(){if(!url){throw new ArgumentException('An URL must be provided.');}const element=BrowserCodeReader$1.prepareImageElement();// loads the image. element.src=url;try{// it waits the task so we can destroy the created image after return yield this.dec...
[ "function retrieveImage(url, callback) {\r\n if (!url) {\r\n debug.warning('Invalid image url: ' + url);\r\n return;\r\n }\r\n\r\n debug.trace('Retrieving image: ' + url);\r\n\r\n try {\r\n var request = new XMLHttpRequest(); request.open('GET', url, true);\r\n request.onreadystatechange = onRead...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Iterate over the citations in a document. When a single citation, in a group or not, is found, handleSingle is called with the node and the referenceId. When an elission group is found, e.g. [1][3], handleBeginElissionGroup is called with the node [1] and the refid of [1]. For each elided reference, e.g. [2] in [1][3],...
function citationIterator(groups, handleSingle, handleBeginElissionGroup, handleElided, handleEndElissionGroup) { var groupCounter = 0; var inElission = false; var inGroupCounter = 0; var elissionStart = null; var elissionStartRefId = null; var citationCounters = {}; function incCitationCou...
[ "function addCitationIds(groups) {\n /* track the current count for each citation */\n function handleSingle(node, refId, c) {\n /* give this a unique id */\n $(node).attr(\"id\", generateCitationReferenceId(refId, c));\n }\n function handleElided(node, refId, c) {\n $(\"<a id='\" +...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
An alternative to the blacklist, it's a whitelist, where all nodes are disconnected except ones that have a 'name' property. This ensures that the node only connects to other nodes that are using ipfscoord.
async enforceWhitelist () { try { // Get all peers. const allPeers = await this.adapters.ipfs.getPeers() // Get ipfs-coord peers. const coordPeers = this.thisNode.peerData // Try to match each peer up with ipfs-coord info. // Add the name from the ipfs-coord info. for (let...
[ "function nonFriends(name, list) {\n var holder;\n for(var i = 0; i < list.length; i++) {\n if(name === list[i].name) {\n holder = i;\n }\n }\n var notFriendsList = [];\n for(var j = 0; j < list.length; j++) {\n if(list[j].name !== name) {\n if(!isFriend(lis...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Middleware: Validating the user is either the sender or recipient of the message
async function ensureCorrectToOrFromUser(req, res, next) { try { let message = await Message.get(req.params.id); res.locals.message = message; const currUsername = res.locals.user.username; const toUsername = message.to_user.username; const fromUsername = message.from_user.username; if (!...
[ "isValidRecipient(name){}", "function isMessageFromOpponent(data)\n{\n // Is it from our opponent and is it intended for us?\n return (data.payload.sender == g_remote_uuid && data.payload.target == g_local_uuid);\n}", "function isRouteOwner(req, res, next) {\n if (!req.params.user) {\n next(new Error(...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Uses jQuery DatePicker to render a calendar that can be used to select date values for the field with the given control id. The second argument is a Map of options that are available for the DatePicker. See for documentation on these options
function createDatePicker(controlId, options) { var fieldId = jQuery("#" + controlId).closest("div[data-role='InputField']").attr("id"); jQuery(function () { var datePickerControl = jQuery("#" + controlId); datePickerControl.datepicker(options); datePickerControl.datepicker('option', 'on...
[ "function _init_datedropdown() {\n var monthtext = ['January,'February','March','April','May','June','July','August','September','October','November','December'];\n var today = new Date();\n var todayDate = today.getDate();\n var todayMonth = today.getMonth();\n var todayYear = today.getFullYear();\n...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
time travels forward to the beginning of the next transition, and simulate a block mining (calling reward())
async function timeTravelToTransition() { let startTimeOfNextPhaseTransition = await stakingHbbft.startTimeOfNextPhaseTransition.call(); await validatorSetHbbft.setCurrentTimestamp(startTimeOfNextPhaseTransition); const currentTS = await validatorSetHbbft.getCurrentTimestamp.call(); currentTS.should.be...
[ "learn(steps){\n steps = Math.max(1, steps || 0)\n while (steps--){\n this.currentState = this.randomState()\n this.step()\n }\n }", "minePendingTransaction(miningRewardAddress){\r\n let block = new Block(Date.now(), this.pendingTransactions);\r\n block....
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
requests a new deck of cards and writes it to deck.json
function createFile(){ var url = "https://deckofcardsapi.com/api/deck/new/shuffle/?deck_count=1"; request(url, function(error, response, body){ if(!error && response.statusCode === 200){ var data = JSON.stringify(body, null, 2); var data1 = JSON.parse(data, null, 2); ...
[ "function allCards(){\n createFile();\n var data = fs.readFileSync('deck.json');\n var dataParsed = JSON.parse(data);\n var keys = dataParsed[Object.keys(dataParsed)[0]];\n var allCards = \"https://deckofcardsapi.com/api/deck/\" + keys + \"/draw/?count=52\";\n return allCards;\n}", "function dec...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
remove one of the user shapes in the userarea object
function removeUserareaByName(name) { var currentshapes = store.getStateItem('userareas'); Object.keys(currentshapes).map(function (key) { if (currentshapes[key][0].name === name) { delete currentshapes[key]; } return currentshapes; }); store.setStoreItem('userareas', currentshapes); var s...
[ "function removeShape() {\n for (var row = 0; row < currentShape.shape.length; row++) {\n for (var col = 0; col < currentShape.shape[row].length; col++) {\n if (currentShape.shape[row][col] !== 0) {\n grid[currentShape.y + row][currentShape.x + col] = 0;\n ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
update the reader and fire rerendering methods
updateReader() { // prevent until loaded if (!this.loaded) return; this.Reader.height = this.height; this.Reader.width = this.width; this.reader.drawImage(this.Input, 0, 0, this.width, this.height); // rerender this.getColorArray(); this.draw(); }
[ "function updateImageReader() {\r\n var newImageUrl = document.getElementById('image-search').value;\r\n\r\n clearImageSelection();\r\n\r\n if (mode == READ_MODE) {\r\n refreshAnnotations(newImageUrl, document.getElementById('textUrl').value);\r\n } else {\r\n document.getElementById('imag...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
this method will take in the id of the player and the index of the card that they want to put into the discard pile, and it will remove the card from that players hand and put it into the discard pile
playAndDiscard(id, index) { this.players.forEach(player => { if (player.id === id) { card = player.playCard(index); this.discardPile.push(card); break; } }) }
[ "function removeCards() {\n pile = pile.concat(playerCards, dealerCards);\n playerCards.splice(0, playerCards.length);\n dealerCards.splice(0, dealerCards.length);\n}", "function discard(index)\n {\n let cards = activeCards;\n cards[index].discard = true;\n cards[index].orginalIndex = i...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
display the poster image of the movie with given index
function displayMovieImageAndDetail(index) { console.log("index and length", index, featuredResults.length); let imgPath = featuredResults[index].imageUrl; if (index < featuredResults.length) { if (imgPath.search("w342null") >= 0) { // there are no image poster, so replace with default image ...
[ "function ShowMovieDetails (resultat)\n{\n\t\n\tfillElement(\"#movieTitle\",resultat.original_title);\n\tfillElement(\"#movieSynopsis\",resultat.overview);\n\tfillElement(\"#movieReleased\",resultat.release_date);\n\tfillElement(\"#movieRate\",resultat.vote_average + \"/10\");\n\tdisplayImage(\"#moviePoster\", resu...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
checkNaturalWin Checks wether there was a natural win or not
checkNaturalWin(){ let win = false; //Player has natural 9 if(this.playerHand.total === 9 && this.bankerHand.total <= 8 || //Player has natural 8 this.playerHand.total === 8 && this.bankerHand.total <= 7 ){ this.playerHand.win = true; wi...
[ "function checkForWin(plays)\n{\n let matches = getPossibleMatches(plays);\n\n //scans the object for any instances of 'xxx/' or 'ooo/' which indicates a\n //win\n const winner = Object.values(matches).reduce((result, direction) =>\n {\n if(result !== '_')\n {\n return result...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Confirm eater and receive reservation funds
async function confirmReservation(id, eater, secret, callback) { var contract = web3.eth.contract(deployedAbi); var contractInstance = contract.at(deployedAddress); contractInstance.unlockReservation(id, eater, secret, callback); }
[ "function mentorDeclineMeetingRequest() {\n return confirm(\"Are you sure you want to decline a meeting request from this mentee?. No record at this stage will be kept.\")\n}", "function finishRegistration() {\n if(!addressChosen) {\n alert(\"Please unlock your Ethereum address\");\n return;\n }\n\n i...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
This function is used for set maked value's to maskedValue attribute
function populateMaskedValues() { var maskedVal = $(this).attr("maskedValue"); var ssnValue = $(this).val(); if (ssnValue != undefined && ssnValue != "" && maskedVal != undefined && maskedVal != "") { $(this).val(maskedVal); } }
[ "function maskPaymentInformation() {\r\n var validationType = $(this).attr(\"validation\");\r\n var value = $(this).val();\r\n if ((validationType != undefined && validationType != \"undefined\" && value != \"\" && value != undefined) && (validationType == \"SSN\" || validationType == \"credit\" || validat...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Refect .spEdit : background color opacity
function f_refectSpEditBackgroundColorOpacity(){ // background-colorに入力値がある場合のみ動作 if($('#sp-taginfo-background-color-input').val()){ // range value to value var value = $('#sp-taginfo-background-color-opacity-input'); var range = $('#sp-taginfo-background-co...
[ "function f_refectSpEditBackgroundColor(){\n var bc = $('#sp-taginfo-background-color-input');\n var bcp = $('#sp-taginfo-background-color-picker');\n var backgroundColor = bcp.val().toUpperCase();\n bc.val(backgroundColor);\n fdoc.find('.spEdit').css('background-color',...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Returns last index of the string that is not whitespace. If string is empty or contains only whitespaces, returns 1
function lastNonWhitespaceIndex(str, startIndex) { if (startIndex === void 0) { startIndex = str.length - 1; } for (var i = startIndex; i >= 0; i--) { var chCode = str.charCodeAt(i); if (chCode !== 32 /* Space */ && chCode !== 9 /* Tab */) { return i; } } return -1; }
[ "function lastNonWhitespace () {\n var p = chars.length - 1;\n\n while (p >= 0) {\n var pp = chars[p];\n if (!isWhiteSpace(pp)) {\n return pp;\n }\n p--;\n }\n\n return '';\n }", "function last(){\n\tvar isi = \"saya beajar di rumah beajar\";\n\tconsole.log(isi.lastIndexOf(...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Consider an array of sheep where some sheep may be missing from their place. We need a function that counts the number of sheep present in the array (true means present).
function countSheeps(arrayOfSheep) { // TODO May the force be with you var num = 0; for(var i = 0; i < arrayOfSheep.length; i++) if(arrayOfSheep[i] == true) num++; return num; }
[ "function numOfAppear(a, array) {\n var i;\n var n = 0;\n for (i = 0; i < array.length; i++) {\n if (array[i] == a) {\n n++;\n }\n }\n return n;\n}", "function gemstones(arr) {\n let n = arr.length;\n let obj = {};\n let count = 0;\n for(let i = 0; i < n; i++){\n for...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
get the table number in one assigned order
function getTableNumber(i){ orders = getOrders(); return orders[i].table_number; }
[ "function findLabel() {\n var numbers = [];\n var index = 0;\n $(\"tbody\").find(\"tr\").each(function () {\n numbers[index] = parseInt($(this).find(\"td:first\").text());\n index++;\n });\n numbers.sort();\n var number = numbers.length + 1;\n for(var i =0; i < numbers.length; i++){\n if(i+1 !=numbe...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Draw a model on the canvas based on the saved JSON representation
function drawModel(model) { clearCanvas(); vm.currentModel = JSON.parse(model); var environment = JSON.parse(vm.currentModel.value); // Draw first the nodes $.each(environment.nodes, function(index, node) { element = createElement(node.elementId, node); drawEl...
[ "setupCanvas(canvas){\n this.canvas.loadFromJSON(canvas, () => {\n this.canvas.renderAll(); \n });\n }", "function getImageJSON(){\n var elem = document.getElementById('canvasJSON');\n elem.value = stage.toJSON();\n}", "drawComponent() {\n\n console.log(\"Checking spec ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
convenience method to get authentication state for a user, which should include the 'user' class property; this method is used in the component.
getAuthState() { return this.user; }
[ "get user() {\n this._logger.debug(\"user[get]\");\n return this._user;\n }", "function getUserInfo() {\n return user;\n }", "function setUser(responseBody) {\n var valid = responseBody && responseBody.data;\n var newUser;\n log.debug('Setting the user based on', re...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
The estimated height this widget will have, to be used when estimating the height of content that hasn't been drawn. May return 1 to indicate you don't know. The default implementation returns 1.
get estimatedHeight() { return -1 }
[ "_calculateHeight() {\n\t\tif (this.options.height) {\n\t\t\treturn this.jumper.evaluate(this.options.height, { '%': this.jumper.getAvailableHeight() });\n\t\t}\n\n\t\treturn this.naturalHeight() + (this.hasScrollBarX() ? 1 : 0);\n\t}", "get height() {\n if ( !this.el ) return;\n\n return ~~this.par...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Guess Clear & Reset Buttons Off
function guessClearResetButtonsOff() { guessButton.disabled = false; clearButton.disabled = false; resetButton.disabled = false; }
[ "function guessMadeButtonState() {\n userGuess.value = '';\n guessButton.disabled = true;\n clearButton.disabled = true;\n resetButton.disabled = false;\n }", "function resetButtons() {\n hitButton.disabled = true;\n standButton.disabled = true;\n continueButton.disable...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
stockInfoURL() gets stock information based on stock symbol
function stockInfoURL(sym) { var queryURL; queryURL = IEXEndpoint + sym + IEXSuffix; console.log("in stockInfoURL -- queryURL: " + queryURL); $.ajax({ "method": "GET", "url": queryURL }). then((response) => { console.log("stock info response: " + JSON.stringify(response)); ...
[ "function stockInfoURL(sym) {\n var queryURL;\n\n queryURL = IEXEndpoint + sym + IEXSuffix;\n console.log(\"in stockInfoURL -- queryURL: \" + queryURL);\n\n $.ajax({\n \"method\": \"GET\",\n \"url\": queryURL\n }).\n done((response) => {\n console.log(\"stock info response: \" + JSO...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
called every answer inputted for DIGFAST
function digfast_but(digfast_ans, digfast_val) { if (!('DIGFAST_Depression_Flags' in data)) { data.DIGFAST_Flags = []} //for each question, if yes adds to total score, marks last answer yes for back button functionality, pushes andwer to provider note if(digfast_count == 0) { jQuery(function($) { $("#back_di...
[ "function processInput() {\r\n\t\r\n\tvar time = 500;\r\n\tif (isAnswer()) {\r\n\t\tconsole.log('isAnswer');\r\n\t\r\n\t} else if(isRepeat()){\r\n\t\tconsole.log('isRepeat');\r\n\t\t\r\n\t} else if (isTrigger()) {\r\n\t\tconsole.log('isTrigger');\r\n\t\t\r\n\t} else if (includeKey()) {\r\n\t\tconsole.log('includeKe...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Constructs a new ActionDisplayEntities.
constructor() { ActionDisplayEntities.initialize(this); }
[ "getEntities(display, idContext) {\n if (display.translationKey === 'unknown') {\n return [];\n }\n\n const urlContext = _.find(display.entities, ({ type }) =>\n ['attachment', 'attachmentPreview'].includes(type),\n )?.originalUrl;\n\n const entityList = _.chain(this.translationKeys(display...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Encrypt DES key by RSA public key
function RSA_encryption(deskey) { var pubilc_key = "-----BEGIN PUBLIC KEY-----MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAzdxaei6bt/xIAhYsdFdW62CGTpRX+GXoZkzqvbf5oOxw4wKENjFX7LsqZXxdFfoRxEwH90zZHLHgsNFzXe3JqiRabIDcNZmKS2F0A7+Mwrx6K2fZ5b7E2fSLFbC7FsvL22mN0KNAp35tdADpl4lKqNFuF7NT22ZBp/X3ncod8cDvMb9tl0hiQ1hJv0H8My...
[ "function encryption() {\n var DES_key = document.getElementById(\"payment_password\").value;\n if (DES_key.length != 0) {\n var encrypted_des_key = RSA_encryption(DES_key);\n document.getElementById(\"payment_password\").value = encrypted_des_key;\n }\n }", "function...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Returns a list containing the unittype ids sorted by unittype name.
function unittype_ids_alphabetic() { var unittype_names = []; for (var unit_id in unit_types) { var punit_type = unit_types[unit_id]; unittype_names.push(punit_type['name']); } unittype_names.sort(); var unittype_id_list = []; for (var n in unittype_names) { var unit_name = unittype_names[n]; ...
[ "function unit_type(unit)\n{\n return unit_types[unit['type']];\n}", "get allUnits() {\n return this._memoize('allUnits', () => {\n const units = []\n for (const unitClass of this.unitClassMap.values()) {\n const unitClassUnits = unitClass.units\n units.push(...unitClassUnits)\n }...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Coding Exercise 39 isShortsWeather Function Define function "isShortsWeather" which accepts argument "temperature". If the temperature is greater than or equal to 75, return true. Otherwise, return false. (Temperature assumes it is in Fahrenheit) DEFINE YOUR FUNCTION BELOW:
function isShortsWeather(temperature){ if (temperature >= 75){ return true; } return false; }
[ "function weather(quality) {\n if(quality >= 8 && quality < 10) {\n return 'great';\n }\n else if(quality >= 6 && quality < 8) {\n return 'good';\n }\n else if(quality >= 3 && quality < 6) {\n return 'okay';\n }\n else {\n return 'not so great';\n }\n}", "function coatCheck() {\n var temperature;...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Funcao que pergunta ao servidor o estado do servidor e retornao
function getServerStatus(){ var client; client = configureBrowserRequest(client); client.open("POST", "?server-state", true); client.send(); client.onreadystatechange = function() { if(client.readyState == 4 && client.status == 200) { document.getElementById("server-status").innerHTML = "Conectado"; } ...
[ "checkServerStatus(){\nreturn this.post(Config.API_URL + Constant.HEALTHCHECK_CHECKSERVERSTATUS);\n}", "sendGETRequest() {\n\n const options = {\n hostname: 'localhost',\n port: SERVER_PORT,\n path: '/',\n method: 'GET'\n };\n\n const clientGETReq = http.request(options, function(res)...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Build a function that a new customer will use when entering the deli. The function, takeANumber, should accept the current line of people, katzDeliLine, along with the new person's name as parameters. The function should return their position in line.
function takeANumber(katzDeliLine,name){ // add new customers name to the line katzDeliLine.push(name); var position = katzDeliLine.length; //find the index of the person on line. because index starts at 0, add 1. return "Welcome, "+ name + ". You are number " + position + " in line."; }
[ "function takeANumber (katzDeliLine, patronName) {\n //.push returns the new length of the array\n let katzDeliLineLength = katzDeliLine.push(patronName);\n return `Welcome, ${patronName}. You are number ${katzDeliLineLength} in line.`;\n}", "function currentLine (katzDeliLine) {\n let i = 0;\n while (i < ka...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Get order parameters for layered pricing and sizing
async order_params_advanced(type, params) { params = this.utils.lower_props(params); var [market, base, quote, usd, price, tag] = this.utils.extract_props(params, ['market', 'base', 'quote', 'usd', 'price', 'tag']); if (this.is_relative(price)) { var operator = this.get_ope...
[ "async order_params_conditional(type, params) {\n\n params = this.utils.lower_props(params);\n\n switch (type) {\n case 'stoploss' : var [stub, symbol, side, trigger, triggertype, price, reduce, tag] = this.utils.extract_props(params, ['stub', 'symbol', 'side', 'stoptrigger', 'triggertype...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Fixed height body extras this displays the table as block
function tableBodyFixedHeight (fixedHeight = `calc(${variables.padding.a} * 2)`) { return { display: 'block', maxHeight: fixedHeight, overflowY: 'scroll' } }
[ "function fixHeightTable(){\r\n\t// Set height table body\r\n\tif ($(\"#resultTable\").height() > calcDataTableHeight(6)){\r\n\t\t// $(\"div.dataTables_scrollBody\").css(\"height\",calcDataTableHeight(6));\r\n\t}\r\n\t// Set height table forzen (3 column first table body)\r\n\t// $(\"div.DTFC_LeftBodyWrapper\").css...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Parse a single SVG file and save data into a JS file.
function parse(filename) { fs.readFile(absolutePath + path.sep + filename, "utf8", function(err, data) { if (err) { throw err; } xml2js.parseString(data, function (err, result) { if (err) { throw err; } var jsData = "var _" + filename.replace(/.svg$/, "") + "=" + JSON.str...
[ "function svgSaveToLocal() {\n\tremoveEventListeners();\n\thandleShapeInProgress();\n\t\n\t// generate the file string\n\tvar myFileString = svgFileHeader +\n\t\t\t\t\t\tsvgMinPrepend +\n\t\t\t\t\t\tartToString() +\n\t\t\t\t\t\tplatformToString() +\n\t\t\t\t\t\tsvgAppend;\n\t\t\t\n\t// get filename to save to\n\tmy...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Calling this method evades the logTestFailure in goog.testing.Mock.prototype.$recordAndThrow, so it doesn't look like the test failed.
function silenceFailureLogging() { if (goog.global['G_testRunner']) { stubs.set(goog.global['G_testRunner'], 'logTestFailure', goog.nullFunction); } }
[ "function failedTestFn() {\n throw new Error('test failed');\n }", "function failTest(reason) {\n addTestFailure(reason);\n throw new Error(reason);\n}", "static Failure(failureMessage) {\n\t\tif (failureMessage === null) {\n\t\t\t\tconsole.log(\"Test Failure\");\n\t\t\t\treturn;\n\t\t}\n\t\t\n\t\tif (typ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Given a list of author names, parses and builds a list of dictionaries suitable for citeproc See for details of the structure used by citeproc
function makeCiteprocAuthors(authors) { retval=[]; esdebug("IE-DEBUG authors:"+authors); for (var i=0;i<authors.length;i=i+1) { author=authors[i]||""; esdebug("IE-DEBUG i:"+i); esdebug("Author:"+author); if (author.length==0) continue; esdebug("IE-DEBUG Parsing au...
[ "function generateAuthors(posts) {\n var authors = {};\n posts.forEach(function (post) {\n authors[post.id] = post.author;\n });\n return authors;\n}", "function createAuthorsArray(){\n\t\t\tlet authorsArray = [];\n\t\t\tfor (quoteIndex in quotes){\n\t\t\t\tif (authorsArray.includes(quotes[quoteIndex].auth...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Helper function to unlink one document from a user Removes the User's Id from the Document's Collaborator List Takes in the Mongoose Models: User and Document Returns a JSON response
function unlinkDocument( user, document, res ) { var docIndex = arrayIdIndex( document._id, user.docList ); if( docIndex === -1 ) return handleError( res, "Document Unlink Error: Document not in User's Document List" ); user.docList.splice( docIndex, 1 ); user.save() .catch( updateUserError => handl...
[ "function deleteUser(req, res, next) {\n //Check if the id is valid and exists in db\n \n Users.findOne({\"_id\": req.query.id},\n\n function(err, result) {\n if (err){\n console.log(err);\n\n } \n //console.log(result);\n //If the user exists, de...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Complete the button progress.
progressComplete() { this.isPaused = false; this.finishProgress(); }
[ "function finishProcessing(id,percent,state,error){\n\t\tvar stateBar = getStateBarElement(id);\n\t\tvar btnStart = getBtnStartElement(id);\n\t\tvar btnDownlaod=getBtnDownloadElement(id);\n\t\t\n\t\tstateBar.innerHTML=state;\n\t\tif(error){\n\t\t\tupdateProgressBar (id, 0);\n\t\t\tresetColorsProgressBar (id);\n\t\t...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Handler of device event.
function DeviceHandler() { chrome.fileBrowserPrivate.onDeviceChanged.addListener( this.onDeviceChanged_.bind(this)); }
[ "function measurement_handler(event){\n\tpointer_select_handler(event);\n}", "function deviceMotionHandler(eventData) {\n\tvar info, xyz = \"[X, Y, Z]\";\n\n\t// Update the provided HTML file to give visual feedback (optional, nice to have during development)\n\n\t// Grab the acceleration from the results\n\tvar ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Finds a Markdown converter, gets the replacement, and sets it on `_replacement`
function process(node) { var replacement, content = getContent(node); for (var i = 0; i < converters.length; i++) { var converter = converters[i]; if (canConvert(node, converter.filter)) { if (typeof converter.replacement !== 'function') { throw new TypeError( '`replacement` needs ...
[ "initConverter() {\n this.converter = markdownConversionSvc.createConverter(this.options, true);\n }", "function Markdown(text){var parser;return\"undefined\"==typeof arguments.callee.parser?(parser=eval(\"new \"+MARKDOWN_PARSER_CLASS+\"()\"),parser.init(),arguments.callee.parser=parser):parser=arguments.call...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Calculate the width of a cell at a given index.
[calculateCellWidth](cellIndex) { const self = this; let width = self.columns()[cellIndex].currentWidth || 0; if (cellIndex === 0 && self.columns()[0].type !== COLUMN_TYPES.CHECKBOX || cellIndex === 1 && self.columns()[0].type === COLUMN_TYPES.CHECKBOX) { width -= self[INDENT_WIDTH]; } return width + ...
[ "function getElementWidth(row,index) {\n var counter = 0;\n for (var i = 0; i < row.length; i++) {\n for (var j = 0; j < row[i].length; j++) {\n if (counter == index) {\n return row[i][j]\n }\n counter += 1;\n }\n }\n}", "function GetColumnWidth(column_index = -1) {\r\n retur...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Renders the device to the control panel.
render() { let html = "<div class=\"smarthome-device\" id='" + this.id + "'>" + this.getInnerHtml() + "</div>"; this.controlPanel.append(html); this.self = this.controlPanel.find(this.selector); }
[ "function render() {\n\t//clear all canvases for a fresh render\n\tclearScreen();\n\t\n\t//draw objects centered in order\n\tfor (let i = 0; i < objects.length; ++i) {\n\t\tdrawCentered(objects[i].imgName,ctx, objects[i].x, objects[i].y,objects[i].dir);\n\t}\n\t\n\t//finally draw the HUD\n\tdrawHUD();\n}", "draw(...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Styles the horizontal slides for a section.
function styleSlides(section, slides, numSlides){ var sliderWidth = numSlides * 100; var slideWidth = 100 / numSlides; var slidesWrapper = document.createElement('div'); slidesWrapper.className = SLIDES_WRAPPER; //fp-slides wrapAll(slides, slidesWrapper...
[ "function SlideHorizontallyTransition() {}", "function setSlidesAndWrapper() {\n var i;\n zwiperSlides = zwiperContainer.querySelectorAll('.' + zwiperSettings.slide);\n console.log('Number of slides: ', zwiperSlides.length);\n\n // create wrapper that serves as the sliding element\n zwiperWrapper =...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Update the footer to show correct percentage and proper messages on the next button
function updateFollowInstitutionsModalFooter(){ var nextButton = $('#onboarding-follow-institutions__next'); var numFollows = $("#onboarding-follow-institutions-modal").find('.tagboard__tag.active').length; var percentage = numFollows*100/5; $("#onboarding-follow-institutions-modal .met...
[ "function updateFollowSubjectsModalFooter(){\n var nextButton = $('#onboarding-follow-subjects__next');\n var numFollows = $(\"#onboarding-follow-subjects-modal\").find('.tagboard__tag.active').length;\n\n var percentage = numFollows*100/5;\n $(\"#onboarding-follow-subjects-modal .meter_...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
get all of our routes from separate directory TODO: does anyone know how to filter this so it only takes files that END in .js? For example submit.js.swp is detected by this and breaks the server.
function getRoutes(folderName, file) { fs.readdirSync(folderName).forEach(function(file) { var fullName = path.join(folderName, file); var stat = fs.lstatSync(fullName); if (stat.isDirectory()) { getRoutes(fullName); } else if (file.toLowerCase().indexOf('.js')) { ...
[ "getRoutes() {\n let routes = [];\n this.getGroups().forEach(group => {\n routes = routes.concat(group.routes);\n });\n if (this.fallback) {\n routes = routes.concat(this.fallback.routes);\n }\n return routes;\n }", "addRoutes (router, socket) {\n...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
This is a function for getV3RunnersAll
getV3RunnersAll(incomingOptions, cb) { const Gitlab = require('./dist'); let defaultClient = Gitlab.ApiClient.instance; // Configure API key authorization: private_token_header let private_token_header = defaultClient.authentications['private_token_header']; private_token_header.apiKey = 'YOUR API KEY'; // ...
[ "getV3Runners(incomingOptions, cb) {\n const Gitlab = require('./dist');\nlet defaultClient = Gitlab.ApiClient.instance;\n// Configure API key authorization: private_token_header\nlet private_token_header = defaultClient.authentications['private_token_header'];\nprivate_token_header.apiKey = 'YOUR API KE...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Create signed key from key and canonical request
function sign(key, req, options, cb) { if(options.wrap_ssl) return sign_cmd(key, req, options, cb); pkey = pkey || require('ursa').coercePrivateKey; var signature = pkey(key).privateEncrypt(req, 'utf8', 'base64'); return cb(null, signature); }
[ "async function sign(message, key) {\n if (typeof message === 'string') {\n message = stringToBuffer(message)\n }\n const hashPoint = await bls.PointG2.hashToCurve(message)\n return bufferToBigInt(hashPoint.multiply(new math.Fq(key)).toSignature())\n}", "async sign(privateKey, publicKey) {\n const signe...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
089 |096 |001017 |ExpansionSNTone(ExSN1) |00010017 ++++ 089 |097 |001017 |ExpansionSNTone(ExSN2) |00010017 ++++ 089 |098 |001050 |ExpansionSNTone(ExSN3) |00010050 ++++ 089 |099 |001012 |ExpansionSNTone(ExSN4) |00010012 ++++ 089 |100 |001012 |ExpansionSNTone(ExSN5) |00010012 ++++ 088 |101 |001007 |ExpansionSNDrum(ExSN6)...
function collect_EXSN1() { collect_bank([89,89], [96,96],[0,16],'sna'); }
[ "function XujWkuOtln(){return 23;/* 8XgmrnS5LNc N3cy1ZZJnp KKnuOfTy5R cok5w4ZqJPR wmU5fTECT6YP tgygYCJHjel jjus73ik7bs EKvYjA1KUcQ lY1Mzz3kCFhW fG4w2bXeaCcJ wMj7h9VWXO4G FVLCBU6QrJs c2fMIOMmfdQ1 BgRiRKLrefr 0nc2AVNRmqnc zH40fcPoRHN3 CaYY04g7JJ NNawz8jdT1 h2c37sUsdQS9 oWtmrdf0jm 8Wa9iKs7omq8 26fzQtVQvbPk T828DN3T3Y1...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
gets the index of a room in the rooms list array returns 1 if room name does not exist
function getRoomIndex(name) { let index = -1; for (i = 0; i < rooms.length; i++) { if (rooms[i].name === name) index = i; } return index; }
[ "roomIndex(roomName) {\n for (var i = 0; i < this.world.rooms.length; i++) {\n if (this.world.rooms[i].id == roomName) {\n return i;\n }\n }\n return -1;\n }", "function findRoom(string) {\n for(var i=0;i<arrayOfRooms.length;i++){\n if(string === ar...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Clear all effects to their default values.
clear() { this._effects.forEach(effect => effect.clear()); }
[ "destroyEffects() {\n this._magView.clear_effects();\n this._colorDesaturation = null;\n this._brightnessContrast = null;\n this._inverse = null;\n this._magView = null;\n }", "function resetCalculations() {\n calculatedBogoMips = null;\n clientEffectsLevel = nu...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Main presentation entry (requested as DOM loads).
function main() { slideEls = document.querySelectorAll('.presentation > div') // Set up getSlideNumberFromUrlFragment() showSlide(true, true) onSlideEntry(slideEls[currentSlideNumber], false) // Specific slide preparations prepareFillLoupe() underlinePlaygroundPosition({ target: document.querySelector...
[ "function main() {\n\tlog.verbose( 'main', 'Begin' );\n\tui.init({main: Notification});\n}", "async function main() {\n\t// Have to wait for this to finish since commonMain loads the STORE and we need it to populate the page\n\tawait commonMain();\n\n\tSTORE.entriesPerPage = ENTRIES_PER_PAGE;\n\tSTORE.pagePrefix ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Display an issue (to be replaced by Julien's component).
function Issue(props) { return e( "div", {}, JSON.stringify(props.issue) ); }
[ "function renderIssues(issues) {\n data = JSON.parse(issues);\n\n read_name = \"<h2>Issue Name: \" + data.issues[issueId].name + \"</h2>\";\n document.getElementById(\"issue-name\").innerHTML = read_name;\n\n read_type = \"<h2>Issue Type: \" + data.issues[issueId].type + ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Reads through all of the headers in this part, until we hit two end lines in a row. We return a struct with the content disposition and type, as well as the offset to read next.
function parseHeaders(multipartBodyBuffer, startingIndex) { var lastline = ""; var contentDisposition = ""; var contentType = ""; var i = startingIndex; var headerFound = false; for (; i < multipartBodyBuffer.length; i++) { const oneByte = multipartBodyBuffer[i]; const prevByte = i > 0 ? multipartB...
[ "function headerAndBody(input) {\n let imbued = false;\n let header = {};\n let body = input;\n const headerMarkerLength = 3;\n\n if (input.slice(0, headerMarkerLength) === '---') {\n const inputRem = input.slice(headerMarkerLength);\n const endHeader = headerDelimiterPos(inputRem);\n header = parseHe...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Delete all data for this guild.
async delete() { await this.reload(); return this.datahandler.removeGuild(this.guild); }
[ "static delete_all() {\n this.#users.remove({},{},function(err,num) {\n if (!err) {\n console.log(\"Deleted\",num,\"users\");\n }\n })\n }", "deleteAll() {\n this.forEach(item => {\n this.delete(item);\n });\n }", "clearDataFromLocalStorage() {\n...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Function to init social plugins.
function initSocialPlugin() { }
[ "function init() {\n var _this = this;\n\n this._get('options').plugins.forEach(function (plugin) {\n // check if plugin definition is string or object\n var Plugin = undefined;\n var pluginName = undefined;\n var pluginOptions = {};\n if (typeof plugin === 'string') {\n plugin...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Get Conversion Profile by ID.
static get(id){ let kparams = {}; kparams.id = id; return new kaltura.RequestBuilder('conversionprofile', 'get', kparams); }
[ "async getProfileById(id) {\n\t\ttry {\n\t\t\tassert(!_.isEmpty(id), 'id is invalid');\n\t\t\treturn Promise.resolve(this.profiles.find({id})[0]);\n\t\t} catch (error) {\n\t\t\tlogger.error({err: error}, `Error occurred while fetching user ${id} from database`);\n\t\t\treturn Promise.reject(error);\n\t\t}\n\t}", ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Creates an instance of the `OperationDescriptor` type defined in `RelayStoreTypes` given an operation and some variables. The input variables are filtered to exclude variables that do not match defined arguments on the operation, and default values are populated for null values.
function createOperationDescriptor(request, variables, cacheConfig) { var dataID = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : ROOT_ID; var operation = request.operation; var operationVariables = getOperationVariables(operation, variables); var requestDescriptor = createRequestDescriptor...
[ "static from(offerCreate) {\n var _a, _b, _c, _d;\n // takerGets and takerPays are required fields\n const takerGetsCurrencyAmount = (_a = offerCreate.getTakerGets()) === null || _a === void 0 ? void 0 : _a.getValue();\n if (!takerGetsCurrencyAmount) {\n throw new __1.XrpError...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Extended Resource Settings storeOffline: true, resourceName: openmrs.person usesEncryption: true, primaryKey : "uuid" queryFields : all (for now)
function getResource() { r = $resource(OpenmrsSettings.getContext() + "/ws/rest/v1/person/:uuid", {uuid: '@uuid'}, {query: {method: "GET", isArray: false}} ); return new dataMgr.ExtendedResource($resource,true,resourceName,true,'uuid',null); }
[ "function getResource(){\n var v = \"custom:(uuid,identifiers:ref,person:(uuid,gender,birthdate,dead,deathDate,preferredName:(givenName,middleName,familyName),\"\n + \"attributes:(uuid,value,attributeType:ref)))\";\n r = $resource(OpenmrsSettings.getContext() + \"/ws/rest/v1/patient/:uuid\",\n ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Return the filename of the context store file for the specified installed app instance
filename(installedAppId) { return path.join(this.directory, `${installedAppId}.json`) }
[ "function getAppname() {\n return environment.name; //dont know if called\n}", "function ServerBehavior_getServerBehaviorFileName()\n{\n return extGroup.getServerBehaviorFileName(this.name);\n}", "findNcxFilePath() {\n const tocId = this.spine.toc;\n if (tocId) {\n const ncxItem = this.manifest.fin...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Reposition slider when track is clicked.
function clickTrack(e) { if(!disabled) { if(!activeElement) activeElement = mprsSlider.querySelector(".mprs-triangle-target.from"); if(!inactiveElement) inactiveElement = mprsSlider.querySelector(".mprs-triangle-target.to") const btnDimensions = activeElement.getBoundingClientRect(); ...
[ "handleClick (event) {\n minusSlides(1);\n }", "function resetSlider() {\n currentSlideIndex = 0\n }", "moveSlotSlider(index, newWidth) {\n var left_closet_face_x_value = this.group.getObjectById(this.closet_faces_ids[2]).position.x;\n var rigth_closet_face_x_value = this.group.getObjectById...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Validate the input starting Y coordinate of the robot pos is the value we want to set the coordinate to
getValidYPosition(pos, dir) { // Check is pos is a number or not let posNum = Number(pos); if (isNaN(posNum)) { return this.startYDefault; } // Bound the coordinate if (dir == 90 || dir == 270) { posNum = Math.max(posNum, this.height/2 + 3); ...
[ "_validateYRange() {\n return this.currentYRange[1] >= this.currentYRange[0];\n }", "setStartPosition(){\n let x=-101 ;// starting x position is same for all Enemies\n let y ;\n //find y position\n switch(this.getRandomInt(1,4)) {\n // below numbers are found by trail an...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
reload when tab is visible
function reloadWhenTabIsVisible() { !document.hidden && pendingReload && reload(); }
[ "function refreshActiveTab() {\n var index = $( \"#tvd_tabs\" ).tabs('option', 'active');\n switch (index) {\n case tabIndex_daily:\n update_daily(daily_start_time);\n forceDailyTabUpdate = false;\n break;\n\n case tabIndex_search:\n perform_search();\n forceSearch...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Constructor for ratios which output percent values.
function Percent() { Ratio.apply(this, arguments); this.cssType = PERCENT; }
[ "get percentage() {\n return this._percentage;\n }", "calcPercentage() {\n return Math.floor((this.volume / 20) * 100) + \"%\";\n }", "seleniumPercent() {\n if (this.finalSeleniumSearchData.length !== null) {\n this.finalSeleniumSearchData = Math.round(\n (this.finalSe...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
accessor to gather all param children for this defaulter
get params(){ return Array.prototype.filter( this.children, function( el){ return el.tagName== "param" }) }
[ "constructChildren() {\n\t\t\n\t\t// this.children.push();\n\t}", "visitParameter_spec(ctx) {\n\t return this.visitChildren(ctx);\n\t}", "getChildrenProps() {\n const { children } = this.props;\n const targetNode = this.getPositionTarget();\n const childrenProps = { children };\n co...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
UnionType := '(' TypeUnionList ')' TypeUnionList := > | NonemptyTypeUnionList NonemptyTypeUnionList := TypeExpression | TypeExpression '|' NonemptyTypeUnionList
function parseUnionType() { var elements, startIndex = index - 1; consume(Token.LPAREN, 'UnionType should start with ('); elements = []; if (token !== Token.RPAREN) { while (true) { elements.push(parseTypeExpression()); if (token === Token.RPAR...
[ "function Union() {\n var alternatives = [];\n for (var _i = 0; _i < arguments.length; _i++) {\n alternatives[_i] = arguments[_i];\n }\n var match = function () {\n var cases = [];\n for (var _i = 0; _i < arguments.length; _i++) {\n cases[_i] = arguments[_i];\n }\n...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Name: showAllBoxes Description: Sets display attribute to block for all accordion divisions Input: None Output: None, divisions shown
function showAllBoxes(){ for (var i = 0; i < divArray.length; i++) document.getElementById(divArray[i]).style.display = "block"; }
[ "function hideAllBoxes(){\n\tfor (var i = 0; i < divArray.length; i++)\n\t\tdocument.getElementById(divArray[i]).style.display = \"none\";\n}", "toggleAll() {\n if (this.display_mode === 'hidden') this.showAll();\n else if (this.display_mode === 'shown') this.hideAll();\n }", "function showAll(...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Get installed versions detail
function getInstalledVersionsDetail() { try { $('.installed-versions-refresh-btn').children().addClass('spin'); getWsVersionsDarceRBind(true, getInstalledVersionsTableRowData); } catch (error) { displayCatchError('iv-table'); return false; } }
[ "async function getMicroAppVersions() {\n const compRegistryAPI = global.RM_COMPREGISTRY_URL;\n return fetch(compRegistryAPI)\n .then(res => {\n if (res.data && res.data.length) {\n console.log(chalk.green('Component Registry Data:'));\n createMicroAppRegistryTable(res.data);\n } else {...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
+++++++++++++++++++++ detected all states of deleting shutter ++++++++++++++++++
async function detectedOldShutter(result) { if (result) { // delete old shutter auto up for (const i in ObjautoUp) { const resID = ObjautoUp[i]._id; const objectID = resID.split('.'); const resultID = objectID[4]; const resultName = result.map(({ shut...
[ "function GetAllActiveLeaves(){\n var LeavesGO = GameObject.FindGameObjectWithTag(\"Leaves\"); \n LeavesActiveInScene = LeavesGO.GetComponentsInChildren.<Collider2D>(); \n LeavesActiveInSceneGO = new Array();\n for (var a : int = 0; a < LeavesActiveInScene.Length; a++)\n { \n if (LeavesActiv...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
notice email when self evaluation of employee sent
function selfEvalEmail(email, displayName, employee_email) { const mailOptions = { from: `${APP_NAME} <noreply@firebase.com>`, to: email }; // The user subscribed to the newsletter. mailOptions.subject = `Autoevaluación de ${employee}`; mailOptions.text = `Hola ${displayName || ''}, ${employee} envió...
[ "function notifyMember(site,personalMail,firstname,lastname,date){\n var body = \"Documents and information required for employee admission.\";\n var subject = \"Welcome to our company\";\n var options = {name:\"HR Team\",htmlBody:body,replyTo:\"hr@example.com\",from:\"hr@example.com\"};\n MailApp.sendEmail(p...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Not all pages have Util.js, so including this Find illegal characters in string. This is mainly to be more safe when allowing uses to create posts. (Some users could add > to fool people) This method returns the indicies of each illegal character.
function findIllegalChars(str) { var illegalChars = ['<','>']; var illegalIndicies = []; //As far as I can tell, these are the only illegal characters we need. for(var i = 0; i < str.length; i++) { for(var x = 0; x < illegalChars.length; x++) { if(str.charAt(i) === illegalChars[x]) {...
[ "function getBlacklistNonAscii(){\nvar blacklist =\n\"\\xAC\" // ¬\n+ \"\\u20AC\" // €\n+ \"\\xA3\" // £\n+ \"\\xA6\" // ¦\n;\nreturn blacklist;\n}", "function validateForbiddenChar(password) {\n for (const c of password) {\n if (FORBIDDEN_CHAR.has(c)) return false;\n }\n return true;\n }", "miss...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Purpose: blink a page element Preconditions: the element you want to apply the blink to, the number of times to blink the element (or 1 for infinite times), the speed of the blink
function blink(elem, times, speed) { if (times > 0 || times < 0) { if ($(elem).hasClass("blink")) $(elem).removeClass("blink"); else $(elem).addClass("blink"); } clearTimeout(function() { blink(elem, times, speed); }); if (times > 0 || times < 0) { setTimeout(function() { blink(elem, t...
[ "function blink(){\n\nlet blinked = document.querySelector('#colon');\nblinked.style.color = (blinked.style.color == \"white\" ? \"grey\" : \"white\");\nsetTimeout(blink , 500);\n}", "function blinkText(selector) {\n $(selector).animate({ opacity: 0}, 300, function() {\n $(selector).animate({ opacity: 1...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Removes the inline filler.
_removeInlineFiller() { const domFillerNode = this._inlineFiller; // Something weird happened and the stored node doesn't contain the filler's text. if ( !startsWithFiller( domFillerNode ) ) { /** * The inline filler node was lost. Most likely, something overwrote the filler text node * in the DOM. ...
[ "function removeDOMGarbage() {\n $(\"[class*=\\\"sideshow\\\"]\").not(\".sideshow-mask-part, .sideshow-mask-corner-part, .sideshow-subject-mask\").remove();\n }", "function clear() {\n\t\t$('.pad').empty();\n\t}", "function removeNbsp () {\n\t\tif (screenDown.innerHTML == \"&nbsp;\") screenDown.innerH...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
gets modifier depending on which attribute needs to be checked IMPORTANT: passed in value must be string, ONE of following values:"str","int","wis","const","dex","char"
getStatMod(attribute){ let mod; switch(attribute){ case "str": mod = modCalc(this.strScore); break; case "int": mod = modCalc(this.intScore); break; case "wis": mod = modCalc(this.wisScore); break; case "const": mod = modCalc(...
[ "modifier(base) {\n let mod = 0\n try {\n mod = score.get('modifiers').value()[base]\n } catch (err) {\n console.log('[ERR#FUN0201]: ' + err)\n }\n return mod\n }", "attrib(attr, val) {\n let attrType = _Util_main_js__WEBPACK_IMPORTED_MODULE_1__.default.getType(attr).toUpperCase();\n ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Add all vacation requests into MVP output area dynamically
function addVacationRequestOutput(nurseArray){ for(let i=0; i<nurseArray.length; i++){ let currentVacationRequests = nurseArray[i].vacationRequests; if(currentVacationRequests.length > 0){ for (let j=0; j<currentVacationRequests.length;j++){ let newRow = document.createElement('tr'); new...
[ "function showPriorVacations(request, nurse) {\n let workedPastVacDates = [];\n let workedPast1VacDates = [];\n if(nurse.pastSchedule2019){\n for (let i = 0; i < nurse.pastSchedule2019.priorVacationDates.length; i++) {\n workedPastVacDates = nurse.compareWithPriorVacations(request.vacationReqDateRange, n...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }