query
stringlengths
9
34k
document
stringlengths
8
5.39M
negatives
listlengths
19
20
metadata
dict
Ungroups an options array
function flattenOptions(options) { let flatOptions = []; options.forEach(optionOrGroup => { if (isGroup(optionOrGroup)) { flatOptions = flatOptions.concat(optionOrGroup.options); } else { flatOptions.push(optionOrGroup); } }); return flatOptions; }
[ "function flattenOptions(options){var flatOptions=[];options.forEach(function(optionOrGroup){if(isGroup(optionOrGroup)){flatOptions=flatOptions.concat(optionOrGroup.options);}else{flatOptions.push(optionOrGroup);}});return flatOptions;}", "function flattenOptions(options) {\n var flatOptions = [];\n options...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Return true iff the given StackFrame ( is a Node frame.
function isStackFrameNode(stackframe) { if (stackframe.isNative) { return true; } else { const fileName = stackframe.getFileName(); if (!fileName) { return true; } else { return !path.isAbsolute(fileName) && fileName[0] !== '.'; } } }
[ "function _isNode(x){\n\treturn !!(x.tree && x.statusNodeType !== undefined);\n}", "function _isNode(x) {\n\t\treturn !!(x.tree && x.statusNodeType !== undefined);\n\t}", "static isStack( el ) {\n return el instanceof Stack\n }", "isNode (obj) {\n return obj instanceof Node && (obj.constructor ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
draws a room with 4 wall, floor, and window
function drawRoom(){ //floor pushMatrix(); mat4.translate(modelview,modelview,[0,-100,0]); mat4.scale(modelview,modelview,[5,5,5]); currentColor = [.3333,.2352,.1647,1]; gl.uniform3f( u_material.specularColor, 0, 0, 0 ); plane.render(); popMatrix(); //ceiling pushMatrix(); ...
[ "function drawRoom() {\n // Draw floor\n\n ctx.fillStyle = \"Wheat\";\n ctx.strokeStyle = \"Tan\";\n ctx.lineWidth = 3;\n ctx.fillRect(0, 0, 1000, 600);\n ctx.strokeRect(0, 0, 200, 100);\n ctx.strokeRect(200, 0, 200, 100);\n ctx.strokeRect(400, 0, 200, 100);\n ctx.strokeRect(600, 0, 200, 100);\n ctx.strok...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Search for elements by given automationText. Searches only for exact string. Returns promise with array of elements.
findElementsByAutomationText(automationText, waitForElement = this.defaultWaitTime) { return __awaiter(this, void 0, void 0, function* () { if (this.isIOS) { return yield this.findElementsByAccessibilityId(`${automationText}`); } return yield this.findElements...
[ "findElementByAutomationText(automationText, waitForElement = this.defaultWaitTime) {\n return __awaiter(this, void 0, void 0, function* () {\n if (this.isIOS) {\n return yield this.findElementByAccessibilityId(`${automationText}`, waitForElement);\n }\n return...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
update peer box + create chat
function createPeerChatBox() { dom.style.backgroundColor = peerColor; if (chatBox) return; var container = createDiv('container', dom); chatBox = createDom('input', 'input', container); sendBtn = createDiv('button', container); chatBox.style.textAlign = 'right'; sendBtn.textContent = 'send'; sendBtn.add...
[ "function updatechatbox() {\n socket.on('updatechatbox', data => {\n $('#messageWindow').append(\"player \", data.name, \":\", data.description, \"<br/>\")\n });\n}", "function createChatBox() {\n var chatBox = ui.chatBox = {\n incoming: gebi(\"ecchat-incoming\"),\n outgoing: gebi(\"ecchat-o...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
We need to create a new definition for cpp so we can remove invalid keywords
function definition() { var cppp = $.extend(true, {}, cpp.language); // deep copy function removeKeyword(keyword) { var index = cppp.keywords.indexOf(keyword); if (index > -1) { cppp.keywords.splice(index, 1); } } function removeKeywords(keywords) { for (var...
[ "function definition() {\n var cppp = $.extend(true, {}, cpp.language); // deep copy\n\n function removeKeyword(keyword) {\n var index = cppp.keywords.indexOf(keyword);\n if (index > -1) {\n cppp.keywords.splice(index, 1);\n }\n }\n\n function removeKeywords(keywords) {\n...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
This slider lets the user select a range of values where one end is either the min or max (the other end is the handle). In other words, from the handle the range is "open ended" to the min or max. Other than a sligthly different visual treatment, this slider works the same as the ContinuousSliderWidget.
function OpenEndedRangeSliderWidget(props) { var value = props.value, max = props.max, min = props.min, testId = props.testId, onChange = props.onChange, disabled = props.disabled, style = props.style; return React.createElement(SliderWidget_1.SliderWidget, { value: value, max: max, min: min, testId: testId, on...
[ "onSliderWindowRange()\n {\n const arrVals = this.refs.sliderRange.slider.get();\n const vMin = parseInt(arrVals[0]);\n const vMax = parseInt(arrVals[1]);\n this.setState({ windowMin: vMin });\n this.setState({ windowMax: vMax });\n // console.log(`slider min/max = ${vMin} / ${vMax}`);\n }", "...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Elimina todos los objetos presentes en el archivo.
async deleteAll(){ await fs.promises.writeFile(this.nombreArchivo, JSON.stringify([])); }
[ "function removePythonObjectsFileList(fileName) {\n\n // remove all classes of fileName from classesList\n var pythonObjectClassesFile = document.getElementById(\"classes-\" + fileName);\n classesList.removeChild(pythonObjectClassesFile);\n\n // remove all functions of fileName from functionsList\n v...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
In the Unity editor on Linux.
get LinuxEditor() {}
[ "set LinuxEditor(value) {}", "function linuxAvail(){\n alert(\"This game is supported on Linux!\")\n}", "function testChromeCompositionEventsLinux() {\n runChromeCompositionEvents('LINUX');\n}", "get OSXEditor() {}", "function run() {\r\n fetch(`./run?code=${btoa(editor.getValue())}`).then(result => ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Returns the rectangle representing the visual viewport in the layout viewport's coordinate system. For browsers that do not support the visual viewport API, the rectangle will include the space taken by scroll bars if present.
function getVisualViewportRectRelativeToLayoutViewport() { var visualViewport = getVisualViewport(); var pos = { left: visualViewport.offsetLeft, top: visualViewport.offsetTop }; var size = { width: visualViewport.width, height: visualViewport.height }; return Geo...
[ "function clientViewportRect() {\n var elem = document.documentElement;\n var x = window.pageXOffset;\n var y = window.pageYOffset;\n var w = x + elem.clientWidth;\n var h = y + elem.clientHeight;\n return new utility.Rect(x, y, w, h);\n }", ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
This function checks a month and returns the number for that month
function checkMonth (month) { if(month.toLowerCase() === "january"){ return 1; }else if (month.toLowerCase() == "febuary") { return 2; }else if (month.toLowerCase() == "march") { return 3; }else if (month.toLowerCase() == "april") { return 4; }else if (month.toLowerCa...
[ "function g_getmnthnum(monthname)\r\n{\r\n\tvar sm=monthname.substring(0,3).toLowerCase()\r\n\tfor (x=1;x<=12;x++)\t{\r\n\t\t\tif (sm==g_getshtmnth(x).toLowerCase())\r\n\t\t\treturn x;\r\n\t\t}\r\n\treturn false;\r\n}", "function monthToNumber(month) {\n return \"JanFebMarAprMayJunJulAugSepOctNovDec\".indexOf(...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
handle switching page index base on direction of wheel moving
function handleWheelMove(event) { if (event.deltaY > 50) { scrollDown = true; checkDirection(); } else if (event.deltaY < -50) { scrollDown = false; checkDirection(); } // increase/decrease page index base on direction function checkDirection() { switch (scrollDown...
[ "function handleWheel(e){\n if (Math.abs(e.deltaY) <= WHEEL_SENSITIVITY) return;\n\n if (e.deltaY > 0 && !isLastPage()) {\n navigate(state.activePage + 1);\n } else if (e.deltaY < 0 && !isFirstPage()){\n navigate(state.activePage - 1);\n }\n }", "handleOnWheel(...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Create dialog to edit a user
function createEditUserDialog(data) { let modal_id = 'edit-user-modal'; let template = $(document.querySelector('#edit-user-modal_template').content.cloneNode(true)); let content = $('#content'); template.find('#edit-user-form').attr('action', '/edit/user/' + data['id']); template.find('#input-fir...
[ "showEditUser({ commit }, userId) {\n commit(consts.SH_USER_EDIT_DIALOG, userId);\n }", "function editUserClickHandler() {\n //fireEvent to open users dialog with selected user\n //console.log('editUserClickHandler');\n }", "edit() {\n console.log('[User Controller] Edit: ' + app.u...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
CustomerEditCtrl.$inject = ['$scope', '$location', '$routeParams', 'CustomerService', 'ngDialog']; [CustomerEditCtrl description]
function CustomerEditCtrl($scope, $location, $routeParams, CustomerService, ngDialog) { /*jshint validthis: true */ var vm = this; vm.back = back; vm.updateCustomer = updateCustomer; vm.deleteRecord = deleteRecord; vm.deleteCustomer = deleteCustomer; init(); ...
[ "function CustomerCtrl($scope, $location, CustomerService) {\n $scope.editRecord = editRecord;\n\n init();\n\n\n /**\n * Initilize customer view\n */\n function init() {\n getCustomers();\n $scope.columns = [{\n field: 'id',\n ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
checking a character or string. ///////////////////////////////////////////////////////////////////////////// Check a character is whether a digit or a alphabet.
function isDigitOrAlphabetChar(c) { return ((c>='0' && c<='9') || (c>='a' && c<='z') || (c>='A' && c<='Z')); }
[ "function is_num_or_letter(char) {\n if (char.length != 1) {\n return `Must be only one character`;\n }\n char = char.toLowerCase().charCodeAt(0);\n return (char >= 97 && char <= 122) || (char >= 48 && char <= 57);\n}", "function isLetterOrDigit (c)\r\n{ return (isLetter(c) || isDigit(c))\r\n}", "funct...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
The reason this complicated function is in the store is because it wiil update the UI by saving out an obervable as it trains. Since it's in the store I could just reference all of the store values like BATCH_SIZE intead of passing them in. I prefer to explicitly pass them in though since it makes a clearer and more te...
async run({ model, tensors, modelName, weightsIllustration, LEARNING_RATE, BATCH_SIZE, NUM_EPOCHS }) { model.compile({ optimizer: tf.train.sgd(LEARNING_RATE), loss: 'meanSquaredError' }) this.trainingState[modelName] = 'Training' await model.fit(tensors.trainFea...
[ "train() {\n\t\tif (!this.model) {\n\t\t\tthis.model = this.buildModel();\n\t\t\tthis.targetModel = this.buildModel();\n\t\t\tthis.targetModel.trainable = false;\n\t\t\tthis.copyWeights(this.model, this.targetModel);\n\t\t}\n\t\tlet [states, actions, rewards, dones] = this.rollout(this.replayBuffer.maxSize);\n\t\tt...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
=================================================================== from functions/fs/MvFile.java =================================================================== Needed early: Builtin Instruction Needed late: System_fs ArcObject ASYNC PORT NOTE: This had to be converted to an asynchronous design.
function MvFile() { }
[ "async getFileInfo(filename) { throw new NotImplementedError('getFileInfo'); }", "function FileSystemSuccessCallback(){\r\n}", "function updateFileFromFolderSync() {}", "openFile() {\n this.statFile(this.path);\n this.checkStartOffset();\n this.getMaxOffset();\n this.fd = fs.openSy...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
////////////////////// function to create FB button (post to wall)
function getFacebookButtonTour(){ var buttonHTML = "<a data-role=button data-theme='a' href='https://www.facebook.com/dialog/feed?app_id=367025673393589&"; buttonHTML += "link=https://developers.facebook.com/docs/reference/dialogs/&picture=http://trophyhunterfb.s3-website-eu-west-1.amazonaws.com/TrophyHunter/"; ...
[ "function createButton() {\n request({\n url: 'https://graph.facebook.com/v2.6/me/thread_settings',\n qs: { access_token: configManager.config.facebook.pageAccessToken },\n method: 'POST',\n json: {\n setting_type: 'call_to_actions',\n thread_state: 'new_thread',\n call_to_actions: [\n ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Helper for checking which card is selected based on the index of the card and the value of the cardSelected state Helps with the styling of the selected card
function checkCardSelected(card) { if (card === cardSelected) { return true; } else { return false; } }
[ "selectCard(event, index) {\n // don't select if disabled\n if (this.state.disabled[index]) return\n\n // toggle card selected\n const selected = this.state.selected.slice()\n selected[index] = ! selected[index]\n\n this.updateTotals(this.state.cards, selected)\n this.updateDisabled(this.state....
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Destroys the instance of the player and it's plugins.
destroy() { // Remove the player from the page. this.wrapper.innerHTML = ''; this.trigger('requestDestroy'); // HACK: fix this hack! Because requestDestroy refers to this.playerPlugin (via get playing) it throws an error when playerPlugin is nulled.. By using setTimeout 0 we effectively...
[ "dispose() {\n const {\n name,\n player\n } = this;\n\n /**\n * Signals that a advanced plugin is about to be disposed.\n *\n * @event Plugin#dispose\n * @type {EventTarget~Event}\n */\n this.trigger('dispose');\n this.off();\n player.off('dispose', this.dispose);\n\...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Process the escape sequence that starts at the current position in the text. This method is called to ensure that `peek` has the unescaped value of escape sequences.
processEscapeSequence() { const peek = () => this.internalState.peek; if (peek() === $BACKSLASH) { // We have hit an escape sequence so we need the internal state to become independent // of the external state. this.internalState = Object.assign({}, this.state); ...
[ "processEscapeSequence() {\n const peek = () => this.internalState.peek;\n if (peek() === chars.$BACKSLASH) {\n // We have hit an escape sequence so we need the internal state to become independent\n // of the external state.\n this.internalState = Object.assign({}, th...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
END closeSearchStreamField START checkStreamTypeAndLoadIt [checkStreamTypeAndLoadIt Check whether to load the normal activitystream or community specific stream.]
function checkStreamTypeAndLoadIt(savedSettings) { var targetStream, communityModeSaved = (savedSettings.useCommunity && savedSettings.hasCommunity); currentAccess.widgetCommunityUuid = communityModeSaved ? savedSettings.communityUuid : undefined; checkIfUserisCommunityMember(currentAccess.widgetCommunityU...
[ "function initiateLoadStream(query, socket){\n //Initiate the stream\n twitterClient.stream('statuses/filter', {track: query}, function(stream) {\n var count = 0;\n //When a tweet is received from the stream\n stream.on('data', function(tweet) {\n count++;\n checkLoadTweets(tweet.text, socket,...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Recursive dir walker input:path = base directory output:promise = array of files directories
async _dirWalker(path) { const currentElement = await this._reading(path); const list = []; if (currentElement.isDirectory()) { let pathList = await this._listing(path); pathList = this._validate(pathList, this._dirExclude, this._ignorePattern); await this._forEachAsync(pathList, async current => { ...
[ "async getAllFilesOfLocalDirectoryRecursively(path){\n try{\n const items = await fs.promises.readdir(path).then(async data => {\n let files = [];\n for(let item of data){\n const isItemDir = await fs.promises.stat(`${path}/${item}`).then(stats => {...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Gets the byte stream of a given media
function downloadMedia(URL){ return new Promise( function(resolve, reject){ var Http = new XMLHttpRequest(); /* This request doesn't require credentials. The info and endpoint is public*/ Http.open( "GET", URL); Http.send(); Http.responseType = 'blob'; Http.onreadystatechange = function() { ...
[ "function getImageStreamFromMessage(message) {\n var headers = {};\n var attachment = message.attachments[0];\n if (checkRequiresToken(message)) {\n \n connector.getAccessToken(function (error, token) {\n var tok = token;\n headers['Authorization'] = 'Bearer ' + token;\n ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
This function should determine which conversion should happen based on which radio button is selected.
function determineConverter (clickEvent) { userTemp = document.getElementById("userTemp").value; if(fRadio.checked){ toFahrenheit(userTemp); console.log("FAHRENHEIT"); return; }else if(cRadio.checked){ toCelsius(userTemp); console.log("CELSIUS"); return; }else{ return; } console.log("Input: ", user...
[ "function determineConverter() {\n if (fRadio.checked) {\n toFahrenheit();\n } else {\n toCelsius();\n }\n}", "function determineConverter() { \r\n\tif (conversionToCelsius.checked === true) {\r\n\t\tconversionToFahrenheit.checked = false;\r\n\t\ttoCelsius();\r\n\t\tconversionFrom = \"Farenheit\";\r\...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Options of the breadcrumbs integration. This field is public, because we use it in the browser client to check if the `sentry` option is enabled.
constructor(options) {;Breadcrumbs.prototype.__init.call(this); this.options = { console: true, dom: true, fetch: true, history: true, sentry: true, xhr: true, ...options, }; }
[ "constructor(options) {Breadcrumbs.prototype.__init.call(this);\n this.options = {\n console: true,\n dom: true,\n fetch: true,\n history: true,\n sentry: true,\n xhr: true,\n ...options,\n };\n }", "constructor(options) {Breadcrumbs.prototype.__init.call(this);\n th...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Function: turnOffNow() Check to see if its time to turn the lights off.
function turnOffNow() { if (isPastTime(config.turnOffTime)) { if (DEBUG) { console.log("Turning OFF lights now..." + moment().local().format('LLL')); } client.publish(config.turnOffTopic, "{}"); turnedOn = false; setTimeout(turnOnNow, 43200000); // start to check 12 hrs from now. } else { se...
[ "function turnOnNow() {\n if (isNight && ! turnedOn) {\n if (DEBUG) { console.log(\"Turning on lights now...\" + new Date()); }\n client.publish(config.turnOnTopic, \"{}\");\n turnedOn = true;\n setTimeout(turnOffNow, 600000); // start check for when to turn off an hour from now.\n } else {\n se...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Extend object `a` with properties of object `b`, ignoring properties which are explicitly specified to be excluded.
function selectiveNotDeepExtend(propsToExclude, a, b) { var allowDeletion = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : false; // TODO: add support for Arrays to deepExtend // NOTE: array properties have an else-below; apparently, there is a problem here. if (isArray$3(b)) { throw n...
[ "function selectiveNotDeepExtend(propsToExclude, a, b) {\n var allowDeletion = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : false;\n\n // TODO: add support for Arrays to deepExtend\n // NOTE: array properties have an else-below; apparently, there is a problem here.\n if (isArray$5(b)) {\n...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
sqlPromiseWrapper wraps a sql query call into a Promise and handles the callbacks with resolve and reject
function sqlPromiseWrapper(sql) { return new Promise((resolve, reject) => { database.query(sql, function (err, result) { if (err) { reject(err); } else { resolve(result); } }); }); }
[ "async function executeQuery(sql) {\n //Wrap query around promise\n let queryPromise = new Promise((resolve, reject) => {\n //Execute the query\n connectionPool.query(sql, function (err, result) {\n //Check for errors\n if (err) {\n //Reject promise if there ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
append Multiple Choice (radio buttons) field for development optionText = array for options/list value texts type = radioButton, checkBox, list addRow = "true" or "false" (2nd to last row) rowNro = used for selectList's label's creation otherRow = "true" or "false" (last row)
function create_multi_choice_table_row(optionText, type, addRow, rowNro, otherRow) { var row = document.createElement("TR"); var columnCount = 5; //array for TD var tds = []; for (columnNro = 1; columnNro <= columnCount; columnNro++) { var td = documen...
[ "function setOptions()\n{\n\tvar numOptions = getMaxNumberOfRows();\n\t\n\tfor(var i = 0; i < numOptions; i++)\n\t{\t\t\n\t\tvar htmlOption = '<input type=\"radio\" class=\"row-option\" value=\"'+(i+1)+'\">'+(i+1);\n\t\t\t\t\t\n\t\t$(optionsSelector).append(htmlOption);\n\t}\n}", "function createRow(Rownum) {\n ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Impresion de vehiculos verificando si es moto o auto
imprimirVehiculos() { this.vehiculos.forEach(vehiculo => { if (vehiculo.puertas) { console.log(`Marca: ${vehiculo.marca} // Modelo: ${vehiculo.modelo} // Puertas: ${vehiculo.puertas} // Precio: $${this.formatearPrecio(vehiculo.precio)}`) } if (vehiculo.cilindrada) { console.log(`Marca: ${vehiculo.mar...
[ "function vehiculoMasCaro(vehiculos){\n let masCaro = vehiculos[0] , i = 0;\n let num = vehiculos.length;\n while(vehiculos.length-1>i){\n if(masCaro.precio <= vehiculos[i].precio){\n masCaro = vehiculos[i];\n }\n i++;\n }\n return masCaro;\n}", "function necesitaCon...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
After knows that file expired.
makeFileExpire(uri, item) { if (this.updating) { this.updateFile(uri, item); } else { let beFreshBefore = item.fresh; item.fresh = false; item.version = 0; this.allFresh = false; if (beFreshBefore) { console....
[ "function checkFileExpirations(fileID) {\n var query = fileID ? { id: fileID } : {};\n\n db.readData('file', query, function (error, result) {\n result.forEach(file => {\n var fileExpiration = Date.parse(file.expires);\n\n // expired\n if (Date.now() >= fileExpiration) ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Is an instance variable final?
function isNotFinal(instance_var) { return !instance_var.type.includes("final "); }
[ "get alive() {\n return this.__Internal__Dont__Modify__.alive;\n }", "static isInstance(obj) {\n if (obj === undefined || obj === null) {\n return false;\n }\n return obj['__pulumiType'] === BlobContainerImmutabilityPolicy.__pulumiType;\n }", "_isAnnotationFinal(type...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
makes the cell in this location solid
setSolid(x,y){ this.getCell(x,y)._solid = true;}
[ "isSolid(x,y){ return this.getCell(x,y)._solid}", "function paint_cell(cell) {\n ctx.fillStyle = 'black';\n ctx.fillRect(cell.x * unit, cell.y * unit, unit, unit);\n }", "setOpen(x,y){ this.getCell(x,y)._solid = false;}", "function celling(){\r\n \"use strict\";\r\n ctx.beginPath();\r\n...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Fallback implementation of 'create' service It is advised but not mandatory to return an object which implements 'IProduct'
createProduct(...args) { MxI.$raiseNotImplementedError(IAbstractFactory, this); }
[ "function createProduct(options) {\n switch (options.id) {\n case 'ID1':\n return new Product1(options);\n break;\n case 'ID2':\n return new Product2(options);\n break;\n }\n\n return new DefaultProduct(options);\n}", "createProductA() {}", "function createProduct(product) {\n ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Search for personals... use $timeout to simulate remote dataservice call.
function queryPrsnlSearchBy (query) { var results = query ? prsnl.personalsAll.filter( createFilterByTreatment(query) ) : prsnl.personalsAll; var deferred = $q.defer(); $timeout(function () { deferred.resolve( results ); }, Math.random() * 1000, false); return deferred.promise; }
[ "function queryPrsnlSearch (query) {\n var results = query ? prsnl.personals.filter( createFilterFor(query) ) : prsnl.personals;\n var deferred = $q.defer();\n $timeout(function () { deferred.resolve( results ); }, Math.random() * 1000, false);\n return deferred.promise;\n }", "function run...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
FUNCTIONS TO EXTRACT AND MANAGE LABEL STATES These functions extract the list of labels given the inner and outer label names. The next step initializes these labels to false. FOllowed by functions to update the state of these labels in the event of clicks. The setting and updation is only necessary for the outer label...
function initializeMainLabelState(labels) { var mainLabels = unique(labels.map(function (d) { return d.mainLabel })); var data = []; mainLabels.forEach(function (d) { data.push({ mainLabel: d, expand: false //initialize to false on expand }) }) return data; }
[ "function setMainRowLabePosition(mainLabelState, gridHeight, innerRowWidth, outerRowWidth, rowLabelTable, colLabelHeight) {\n //the first task is to find the number of expanded labels\n var expandedRows = mainLabelState.filter(function (d) { return d.expand }).map(function (e) { return e.mainLabel }),\n nExpan...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
del_question(qid) Delete a question with given ID
function del_question(qid) { var q = document.getElementById("q" + qid); q.parentNode.removeChild(q); }
[ "function delete_question(){\n let question = this.id.split('_')[0];\n console.log(\"one deleted: \" + question);\n remove_question(question);\n show_num_of_quiz();\n}", "function jsGUIDeleteQuestion(question) {\n\ttempID = $('#' + question + '_name').html();\n\tdeleteQuestion(tempID);\n\t$('#' + ques...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Remove a language to the selection and calculate the new price
handleRemoveLanguage(languageLabel) { let tmp = this.state.selectedLanguages; if (!tmp.find((x) => x.label === languageLabel)) return; const langObj = tmp.find((x) => x.label === languageLabel); tmp = tmp.filter((x) => x.label !== languageLabel); this.setState({ selec...
[ "function removeLanguage(value){\n //Find the container with the language in\n var p = document.getElementById(\"p\"+value);\n //Removing the parent element also removes children (select etc.)\n p.parentElement.removeChild(p);\n //Re-add the language to the select, now at the end\n var select = do...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
If Rhino hasn't started chasing the skier, start chasing
startChasing(skier) { this.x = skier.x; this.y = skier.y - (Constants.GAME_HEIGHT / 2); this.setDirection(skier.direction); this.chasing = true; }
[ "function startChase() {\n startMode(\"chase\");\n pacman.timers.modeTimeout = setTimeout(startScatter, 15000);\n }", "function knock(){\n\tif(dbg){\n\t\tdebug(\"Knocking\");\n\t}\n\tknocked = true;\n\tsend_event(EVENT_KNOCK,\"\")\n\tend_turn();\n}", "turnSnakeLeft() {\r\n this.s...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Function to change state to open modal and set current code to the code that was clicked on
openModal (code) { this.setState({ showModal: true, currentCode: code }) }
[ "openModal() {\n // to open modal set isModalOpen tarck value as true\n this.isModalOpen = true;\n }", "toggleModal(code) {\n this.currentTypologyCode = code;\n\n $('#radarDiagramModalVM').modal('toggle');\n $('#radarDiagramModalVM').modal('handleUpdate');\n\n if (RadarDiagram...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
constructs MongoDB connection string assumes that host, port, database are always defined in default config, but that username and password may not be
function getMongoConnectionString () { const appEnv = process.env.NODE_ENV let dbUser, dbPassword if (process.env.MONGO_USER && process.env.MONGO_PASSWORD) { dbUser = process.env.MONGO_USER dbPassword = process.env.MONGO_PASSWORD } else { dbUser = config.has(`${appEnv}.username`) ? config.get(`${ap...
[ "function buildMongoURL() { \n\tif(c.dbs.auth.dbUsername && c.dbs.auth.dbPassword) {\n\t\treturn 'mongodb://' + c.dbs.auth.dbUsername + ':' + c.dbs.auth.dbPassword + '@' + c.dbs.auth.dbHost + ':' + c.dbs.auth.dbPort + '/' + c.dbs.auth.dbName + '?auto_reconnect=true&safe=true';\n\t} else { \n\t\treturn 'mongodb://' ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Fetch the lookup tables and display them on the page
function getLookupTables() { var time = new Date().getTime(); lookupTablesConfig.element.innerHTML = '<img src="/core/images/loading.gif"> &nbsp; Searching ... please wait.'; ajaxGet(lookupTablesConfig.fetchURL + time, 'processLookupTables', 'lookupTablesAjaxError'); }
[ "fetchLookupData() {\n const backendRequest = this.lookupService.getLookupTable(this.luxTableNo, this.luxParameters, this.apiPath);\n backendRequest.subscribe((entries) => {\n this.setLookupData(entries);\n this.luxDataLoaded.emit(true);\n }, () => {\n this.luxD...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Here, componentDidMount() is called each time an image is rendered. So with the help of ref=this.imageRef assigment, we can now extract each image info, tweak dimensions, and rerender it
componentDidMount(){ // we add EventListener to know when ALL imageRef info is ready // before we try to extract it. We also add a callback 'setSpans' // to notify us, and then define 'setSpans' in our class this.imageRef.current.addEventListener('load', this.setSpans); console...
[ "componentDidMount() {\n console.log(this.imageRef);\n\n //But if you directly try to access the image height here..like so, you won't get anything\n //because by the time you access it, the image hasn't even been downloaded and rendered on the \n //DOM.\n //console.log(this.image...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
function to grab league id and drop it in the req object for the other middleware to save.
function leagueIDgrab(req, res, next){ let ign = req.body.ign || req.query.ign ign = ign.split(' ').join('%20') request({ url: 'https://na.api.pvp.net/api/lol/na/v1.4/summoner/by-name/'+ign, qs: { api_key: process.env.RIOT_DEV_KEY }, method: 'GET' }, (error, response, body) => { if (er...
[ "function getTeamId() {\n if (!teamId) {\n teamId = getTeamIdFromReq(req);\n }\n\n return teamId;\n }", "genReqId(req) {\n return req.id;\n }", "requestId(req, res, next) {\n req.id = cuid();\n next();\n }", "function assignId(req, res, next) {\n\treq.id = uuidv4();\n\tne...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
transfer to front page
toFrontPage() { this.navigation.navigate('FrontPage'); }
[ "async bringToFront() {\n await this._client.send('Page.bringToFront');\n }", "function toClientHome(){\n\t document.location.href = parentUrl(parentUrl(document.location.href));\n }", "static pageForward() {\n history.forward();\n }", "function returnHome() {\n\twindow.location.replace(\"...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
ASSERT_Failure class extends ASSERT_Abstract_Failure Role: setting the assertion failure data Instantiator: ASSERT_Tester /c)class
function ASSERT_Failure( /*a)string*/id, //)function name and test comment /*a)any*/found, //)found value (arg0) /*a)string*/expected //)expected value (arg1) ){ /*m)protected string*/this.getFound=function(){ return this.found.getArgumentAsText(); } //---getFound /*m)private string*/this.caller = this.setCaller(i...
[ "function\nASSERT_Abstract_Failure(){\n/*m)private string*/this.setCaller=function(\n/*a)string*/id\t\t\t//)function name and test comment\n){\nreturn Argument.isUndefined(id) ? '(not specified)' : id.substr(0, id.indexOf(':'));\n}\t//---setCaller\n\n/*m)private string*/this.setComment=function(\n/*a)string*/id\t\t...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
ClientEnterServer Called after a client has been accepted and its gamelevel connect request has been processed.
function ClientEnterServer(socket, data) { if (!Running()) { return; } // Find a slot for the client. var clientNum; for (var i = 0; i < sv_maxClients.get(); i++) { if (svs.clients[i].state === CS.FREE) { clientNum = i; break; } } if (clientNum === undefined) { COM.NetOutOfBandPrint(socket, 'print...
[ "enterPlayer(client){\n // send to new client information regarding current groups parameters\n Object.keys(this.params).forEach( (key) => {\n this.e.send(client, this.moduleName, [key, this.params[key]] );\n });\n }", "function onPlayerStart(){\n if(globals.currentPlayers.length > 1 && globals.ga...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
This function gets called when layer selection is made in the TreeSelect.
treeSelectLayer (val, label, extra) { console.log('treeSelect', val); console.log('treeSelect', label); console.log('treeSelect', extra); let that = this; let value_layer = that.state.value_layer; if (extra.triggerValue && extra.triggerValue.split('-').length == 2 && extra.triggerValue.split('-')[1] == 21) ...
[ "updateTreeSelection_() {\n if (angular.isUndefined(this.tree_)) {\n return;\n }\n\n this.tree_['deselect_all']();\n this.tree_['select_node'](this.selectionName_);\n }", "function on_selection_changed() { }", "handleTreeNodeSelect(event) {\n this.selectedTreeNodes = event.detail.select...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
This is a Resource resource
static get __resourceType() { return 'Resource'; }
[ "constructor(type, name, args) {\r\n super('resource', [type, name], args);\r\n this.type = type;\r\n this.name = name;\r\n }", "CreateFromResource() {\n\n }", "get resource () {\n\t\treturn this._resource;\n\t}", "buildResource() {\n }", "function Resource()\r\n{\r\n\tthis.fil...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
funcion que recibe una lista de archivos, los filtra y genera los elementos visuales con su informacion
function mostrarInfoDeArchivos(archivos) { var archivosPermitidos = formatosAceptados(); var listaInfoDeArchivos = document.getElementById('listaArchivos'); for (var i = 0; i < archivos.length; i++) { var archivo = archivos[i]; var extension = getExt(archivo.name); if(archivosPermiti...
[ "function fnMuestraArchivosFiscales() {\n\tvar $el = $(this), $tbl = $('#tbl-filesToUp'), len = 0, files = [], $tbody;\n\t\tfiles = $el.prop('files');\n\t\tlen = files.length;\n\t\t$tbody = $tbl.find('tbody');\n\t$('#showFiles').removeClass('hidden');\n\tif(len){\n\t\t// agregado a variable global\n\t\tvar flag = 0...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
This function will update the details of bought item with new info from arguments
updateBoughtItem(transactionID, beerID, adminID, amount, price) { for (let i = 0; i < window.Database.DB.bought.length; i++) { if (window.Database.DB.bought[i].transaction_id == transactionID) { window.Database.DB.bought[i].admin_id = adminID; window.Database.DB.bough...
[ "function updateBoughtItems(item) {\n\t\tif (boughtItems[item.name] != 'undefined') {\n\t\t\tboughtItems[item.name] += 1;\n\t\t}\n\t\t$(\"#owned\"+item.name).text(\"\"+item.name+\": \"+boughtItems[item.name]+\"\");\n\t\t// if the item was bought for the first time, add the description text to the top of the descrip...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
populates the project description
function popDesc(){ var x = "Project Description: " + currentProject.description; document.getElementById("projDesc").innerHTML = x; }
[ "function renderProjectDesc(description) {\n if (description) {\n console.log(description)\n readMeProjectDesc = `## __Description__ \\n ${description}`\n }\n else {\n readMeProjectDesc = ''\n }\n}", "function createMarkupForProjectDescription() {\n if (project.projectDescription) {\n ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Update the queue config
updateConfig() { this.maxBatchSizeBytes = config_1.getConfig().maxBatchSizeBytes; this.batchSize = config_1.getConfig().batchSize; this.maxQueueSizeBytes = config_1.getConfig().maxQueueSizeBytes; }
[ "async configureQueue() {\n await queue.connect();\n }", "updateQueueEvents() {\n const container = this.getEventsContainerByType('queue');\n const event = container[0];\n\n this.updateEvent(event);\n }", "function setMQconfig(newconfig) {\n MQconfig = newconfig;\n }", "f...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Check if the user has selected filter options or searched; cannot search for group name or email AND memberKey simultaneously
function checkGroupsSidebar(memberKey) { if (searchName && !memberKey) { document.getElementById("search").value = searchName; document.getElementById("user-sel").value = null; searchMemberKey = null; } if (searchMemberKey) { document.getElementById("user-sel").value = search...
[ "function filterGroup() {\n var sel = document.getElementById(\"filterOptions\");\n filterIndex = sel.selectedIndex;\n filterValue = sel.options[sel.selectedIndex].value;\n\n if (filterValue != \"all\" && filterIndex != 0) {\n // data request to get friends who are part of this group.\n var req ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
CLASS LOGIC / returns the measure the timestamp (in MIDI pulses) occurs in based on the current time signature
midiTicksToMeasure(timestamp) { return Math.floor(timestamp/this.measure); }
[ "function getTrackTime()\n {\n return Date.now() - recordingStartTime;\n }", "getMusicTimes( globalMsec ){\n //Event time in msec rel to sequencer start\n var perfMsec = globalMsec - this.startMsec;\n\n //Absolute fractional beat from start of sequencer\n //UN-quantized\n ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Extend the primary selection range, discard the rest.
function extendSelection(doc, head, other, options) { setSelection(doc, new Selection([extendRange(doc, doc.sel.primary(), head, other)], 0), options); }
[ "function extendRange(doc,range,head,other){if(doc.cm&&doc.cm.display.shift||doc.extend){var anchor=range.anchor;if(other){var posBefore=cmp(head,anchor)<0;if(posBefore!=cmp(other,anchor)<0){anchor=head;head=other;}else if(posBefore!=cmp(head,other)<0){head=other;}}return new Range(anchor,head);}else {return new Ra...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
function for sending product data and uploading image
async function sendProductData() { let inputName = document.getElementById("nameInput").value let inputPrice = document.getElementById("priceInput").value let inputDesc = document.getElementById("descInput").value let inputCategory = document.getElementById("categoryInput").value let image =...
[ "function addProductWithImage(req,res,name,data){\n\t\tvar path = '';\n\t\tupload(req, res, function (err) {\n\t\t\tif (err) {\n\t\t\t\tconsole.log(err);\n\t\t\t\treturn res.status(422).send(\"an Error occured\")\n\t\t\t}\t \n\t\t\tif(req.file){\n\t\t\t\tpath = req.file.filename;\t\n\t\t\t}else{\n\t\t\t\tpath = \"...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
end ready / start sortCurrentDice
function sortCurrentDice() { if (currentDice.length===0) { alert("You haven't rolled yet!"); } else { currentDice.sort(function(a,b){return a-b}); var x=document.getElementById("sortDice"); for(var i=0; i<=4; i++) $('button.sortedDie' + i).html(cur...
[ "function sortDice (dice) { \r\n dice = dice.sort()\r\n return dice \r\n}", "sortDices(dices, ones, twos, threes, fours, fives, sixes) {\n for (let i = 0; i < dices.length; i++) {\n switch (dices[i]) {\n case 1:\n ones.push(dices[i].value);\n ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
When a user selects highlighted text, IE and FF returns a mess: this function displays a minimal dialog with the selected text, cleaned up
function fixTextSelection( dom_element ) { //chrome, opera, and safari select PRE text correctly if ($.chili.selection.active && ($.browser.msie || $.browser.mozilla)) { var element = null; $(dom_element) .parents() .filter("pre") ...
[ "function displaySelectedTextDialog( event ) \n {\n if (! (element && element == this)) \n {\n return;\n }\n element = null;\n \n var selectedText = getSelectedText();\n if ( '' == selectedText ) \n { \n return;\n }\n sel...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Draw Quadratic StartFinish Points
static draw(){ switch (drawType){ case 'Quadratic': if (startX === undefined && startY === undefined){ //If Start Point missing, then create startX = mouseX; startY = mouseY; } else {//If Start Point already created, then create Finish Point ctxShadow.beginPath();...
[ "function draw_adjusted_quadratic_fn(){\n\n\tvar x_increments = parseFloat(document.getElementById('x_inc').value)\n\tvar y_increments = parseFloat(document.getElementById('y_inc').value)\n\tvar min = parseFloat(-1)*25*x_increments; // Minimum x\n\tvar max = 25*x_increments; // Maximum x\n\tvar xstep = 0.1; // How ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
set hand position Everytime a card moves out of a players hand, the positions are readjusted to fill up the space
__setHandPos(){ this.players.forEach((player, i) => { for(var i = 0; i < player.hand.length; i++){ var tile = player.hand[i]; //if the player is currently moving a tile, do not reset that tile's position if(player.selectedTile == tile){ continue; } //top ro...
[ "setHandLocation (player) {\n // use regular location\n let playerX = player.location.x;\n let playerY = player.location.y;\n\n // if player has a render location, use that one\n if (player.renderLocation) {\n playerX = player.renderLocation.x;\n playerY = pl...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Computes the bin count of an FFT with given size.
function fft_bin_count(fft_size) { return fft_size / 2; }
[ "get frequencyBinCount() {\r\n return this.fftSize / 2;\r\n }", "function bitsOn(buf, size) {\n var nElements = nElementsNeeded(size);\n var numOverhang = size % PER_ELEM_BITS;\n var sum = 0;\n for (var i = 0; i < nElements; i++) {\n if (i === nElements - 1 && numOverhang > 0) {\n ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
make big turn since robot has already checked the angles using small turn this will avoid duplicate checks
function big_turn(dir) { const motor_dur_big_turn = 900; const motor_spd_forward = 500; const motor_spd_reverse = -500; //value of motor duration and speed corresponds to the angles that robot //should turn. In this case, we want the robot to make big turns. //speed of motor have th...
[ "function rotate() {\n undraw();\n currentRotation++;\n if (currentRotation === current.length) {\n currentRotation = 0;\n }\n current = theTetrominoes[random][currentRotation];\n if (\n current.some((index) =>\n squares[currentPosition + index].classList.contains(\"taken\")\n ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
check styling depending on page editing mode
function changeStyleOnMode(isEdit) { if (isEdit) { $('#editable-mode').addClass('selected'); $("#sortable-mode").removeClass('selected'); $('#page-preview').css('cursor', 'text'); } else { $('#editable-mode').removeClass('selected'); $("#sortable-mode").addClass('selected...
[ "function isEditing() {\r\n return buttons.$addMedia.is('.edit') && EM_Document.selected.$element.length > 0;\r\n }", "function listingEditorAllowedForCurrentPage() {\n var namespace = mw.config.get( 'wgNamespaceNumber' );\n if (namespace !== 0 && namespace !== 2 && namespace !== 4...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Function to create in the layer a centered message box that the user can close Take as an argument the message for the warning
function addMessageBox(text) { let messageBox = document.createElement("div"); messageBox.classList.add("messageBox"); let warning = makeWarning(text); let closeButton = makeCloseButton(); messageBox.append(warning, closeButton); document.body.appendChild(messageBox); // Calculate to always center the box...
[ "function showWarningBox (sText, sTitle, aCallBack)\n// ---------------------------------------------------------------------\n{\n var aConf =\n {\n msg: sText.replace(/\\[ait-[0-9]*\\]\\n/, \"\").replace(/\\[ado-[0-9]*\\]\\n/g, \"\"),\n icon: Ext.MessageBox.WARNING,\n title: sTitle,\n fn: aCallBack\n...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
return info about the instantaneous skiertomouse angle and velocity vectors
getMouseAndVelocityInfo(gamepadInfo) { if (gamepadInfo) { this.mousePos.x = (this.gameWidth / 2) + 7 + (10 * gamepadInfo.gamepadAnalogVectors[0]); this.mousePos.y = (this.gameHeight / 3) + 32 + (10 * gamepadInfo.gamepadAnalogVectors[1]); } let mouseDiffX = -(this.mousePos.x - ((this.gameWidth / 2) + 7)); ...
[ "function calculateVelocity() {\n velocity_of_x = bullet_moving_velocity * Math.cos(bullet_moving_theta * Math.PI / 200);\n velocity_of_y = bullet_moving_velocity * Math.sin(bullet_moving_theta * Math.PI / 200);\n}", "vel() {\n return [this._velocity.x, this._velocity.y, this._velocity.z];\n }", "func...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Function to clear buildings
function clearBuildings() { document.getElementById('building1').innerHTML = ""; document.getElementById('building2').innerHTML = ""; document.getElementById('building3').innerHTML = ""; document.getElementById('building4').innerHTML = ""; document.getElementById('building5').innerHTML = ""; doc...
[ "function clearAll () {\n ninja_config.variables = {};\n ninja_config.rules = {};\n ninja_config.build_statements = [];\n ninja_config.default_build_statements = [];\n ninja_config.phony_rules = {};\n}", "function clear() {\n if (generate) return\n const freshGrid = buildGrid()\n ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Retrieves the current status of whether there is someone at the door. The status is sent back to the watch after it is retrieved.
function getStatus() { var xhr = new XMLHttpRequest(); var url = SERVER_URL + '/doorbells/' + DOORBELL_ID + '/visitors?authtoken=' + AUTH_TOKEN; xhr.open('GET', url, true); xhr.onload = function(e) { var data = JSON.parse(this.response); if (data.length > 0) { var mostRecentVisitor = data[0]; ...
[ "async function checkStatus () {\n const curStatus = await readDoor()\n if (curStatus !== prevStatus) {\n logger.info('Door changed to ' + curStatus)\n const msg = {\n status: curStatus,\n timestamp: new Date().getTime()\n }\n notifyBot(msg)\n }\n prevStatus = curStatus\n}", "async funct...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Admin can add Shopkeeper
async function addShopkeeper(req, res) { if (req.user.user == 'admin') { const shopkeeper = new ShopkeeperModel(req.body); shopkeeper.representative_id = req.params.representative_id; const doc = await shopkeeper.save(); const rep_assign = await RepresentativeModel.findById(req.para...
[ "async function addShopkeeper(req, res) {\n if (req.user.user == 'representative') {\n const shopkeeper = new ShopkeeperModel(req.body);\n shopkeeper.representative_id = req.user._id;\n const doc = await shopkeeper.save();\n return res.status(200).json({ doc, message: \"Shopkeeper Suc...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Return env var VCAP_SERVICES, parsed.
function getVcapServices () { return JSON.parse(JSON.stringify(VcapServices)) }
[ "function getVcapService() {\n var env = getEnvironmentVariable('VCAP_SERVICES');\n var vcapServices;\n if (!env) {\n logger.warn(\"Environment variable 'VCAP_SERVICES' is not defined.\");\n return null;\n }\n try {\n vcapServices = JSON.parse(env);\n }\n catch (error) {\n ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
= Description When the +_flag+ is true, the view will be aligned to the left (default). The +_px+ offset defines how many pixels from the parent's left edge the left edge of this view will be. If both setFlexLeft and setFlexRight are set, the width is flexible. Use the constructor or setRect instead of calling this met...
setFlexLeft(_flag, _px) { if (this.isNullOrUndefined(_flag)) { _flag = true; } this.flexLeft = _flag; if ((_px || _px === 0) && this.rect) { this.rect.setLeft(_px); } return this; }
[ "alignLeft(view, offset = 0) {\n this.left = Math.round(view.left + offset);\n return this;\n }", "moveLeftOf(view, offset = 0) {\n this.right = Math.round(view.left + offset);\n return this;\n }", "growLeft(){\n let amount = 1;\n let diff = [-1 * amount, 0];\n ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Gets the component configuration for showing the feedback of an service validation error response.
function getValidationErrorFeedbackConfig(json, showCloseIcon) { var message = !Ext.isEmpty(json.validationMessage) ? json.validationMessage : json.detailedMessage; message = !Ext.isEmpty(message) ? message : json.message; message = !Ext.isEmpty(message) ? message.concat("<br>") : ""; if(showCloseIc...
[ "function getServiceErrorFeedbackConfig(json) {\r\n var topElCls = \"xcp-notify-server-errors\";\r\n var toggleCls = \"xcp-notify-toggle\";\r\n var expandCls = \"xcp-notify-expand-icon\";\r\n var collapseCls = \"xcp-notify-collapse-icon\";\r\n var detailsCls = \"xcp-notify-server-errors-details\";\r\...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
function used to cancel the link request from the user listing pages Author: Sunny patial version: 1.0
function cancelRequestFromListing(event){ var profileID=event.id; $(".message_box").remove(); jQuery.ajax({ async: false, url: "/" + PROJECT_NAME + "profile/cancel-request", type: "POST", dataType: "json", data: "cancel_request="+event.rel+"&profileID="+profileID+"&type=request", ...
[ "function cancelRequest() {\n //TODO need to enable method to be able to cancel a request\n}", "cancelLink() {\n this.closeLinkPanel();\n }", "function cancelLink(){\r\n\t\tdocument.getElementById('downloadArea').innerHTML = \"\";\r\n }", "function cancel(){\n setNewProfilePage(false)\n ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Extract translatable messages from an html AST
function extractMessages(nodes, interpolationConfig, implicitTags, implicitAttrs) { var visitor = new _Visitor$2(implicitTags, implicitAttrs); return visitor.extract(nodes, interpolationConfig); }
[ "function extractMessage(ast) {\n return printMessage(sanitize(validateMessage(ast)));\n}", "function extractMessages(nodes,interpolationConfig,implicitTags,implicitAttrs){var visitor=new _Visitor(implicitTags,implicitAttrs);return visitor.extract(nodes,interpolationConfig);}", "function extractMessages(node...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
End checkHitOrMiss / Remove and check if that ship has been sank ([Array], String, [Array], [Array]) => [Boolean, Number, [Array]] The first returned value true/false if an entire ship has been sunk The second returned value is the index of the length of the sunk ship The third returned value is the updated array of sh...
function checkShipStatus(indShips, idAtPos, copyShips, ships) { for (var x = 0; x < indShips.length; x++) { //Looks for the ship position and removes it from indShips array if (indShips[x].includes(idAtPos)) { indShips[x].splice(indShips[x].indexOf(idAtPos), 1); //If after removing the ship ret...
[ "checkShipSunk(c) {\n for (let i = 0; i < this.ships.length; i++) {\n if (this.ships[i].isHit(c)) {\n return this.ships[i].isSunk();\n }\n }\n return false;\n }", "allSunk()\n\t{\n\t\tlet count = 0;\n\t\tfor(let i = 0; i < this.shipArray.length; i++){\n...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
transforms link rules data to the format required by d3network
function transformLinkRules(linkRules) { const list = []; for (let rule of linkRules) { list.push({ "sid": rule.startItemTypeKey, "tid": rule.endItemTypeKey }); } return list; }
[ "function transform_routes(){\n // The d3 force edge bundling algorithm transforms and groups paths on a node-link graph so that readability is improved and overlap\n // reduced. It requires an input \"node_data\" dictionary defining the location of every node on the graph. Every field is an index \n // ma...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Init update entity endpoint PUT '/:id'
initUpdateEndpoint() { this.router.put('/:id', (req, res) => { if (!req.body.id) { try { req.body.id = parseInt(req.params.id); } catch (error) { return this.sendErr(res, 400, error.message); } } ...
[ "PUT() {\n this.execute('PUT');\n }", "function updateEntity(entityId, body, headers = {}) {\n /* return request({\n url: BASE_PATH + '/entities/' + entityId + '/attrs',\n method: 'PATCH',\n body,\n headers,\n json: true,\n });*/\n}", "function createPutMethod() {\n this.put(\n '/...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Skip just one generation
function skipSingleGeneration() { nextGenerationCalculated(); }
[ "function skip() {\n\t this.shouldSkip = true;\n\t}", "function skip(){\n\t\n}", "function skip() {\n this.shouldSkip = true;\n}", "function hideGen(idx) {\n allGenerators[idx].isHidden = true;\n }", "function customGenerator() {\n //Change the flag and ReWrite here\n}", "function ski...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
code for creating an SVG donut chart from feature properties
function createDonutChart(feature) { let props = feature.properties; let offsets = []; let counts = [ props.mag1, props.mag2, props.mag3, props.mag4, props.mag5 ]; let total = 0; ...
[ "function createDonutChart(props) {\n var offsets = [];\n // console.log(props)\n // props: {cluster: true, cluster_id: 34, mag1: 2136, mag2: 514, mag3: 130, mag4: 12, mag5: 3, point_count: 2795, point_count_abbreviated: \"2.8k\"},\n var counts = [props.mag1, props.mag2, props.mag3, props.mag4, props.ma...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Function to handle the whole process of converting text to image input: type (cedit, snap)
function handleConvertToImg(type) { console.log("handleConvertToImg this", this); console.log("handleConvertToImg type", type); // var $btn = $(this); var $btn = $('.emailplus-toolbar'); var textbox = $($btn.parents("tbody")[1]).find("[role=textbox]")[0]; console.log("handleConvertToImg textbox", textbox); // Ma...
[ "function convertToImg(text, font_family, font_size, refid, $imgContainer, uuid, type) {\n\tif (text == \"\") {\n\t\treturn;\n\t}\n\tconsole.log(\"convert to img\");\n\tvar api = 'https://boosend.com/getImg';\n\t$.ajax({\n\t type: 'POST',\n\t url: api,\n\t\t\tcrossDomain: true,\n\t\t\twithCredentials: true,\n...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Show information of superhero
function SuperheroInformation(details){ Common.hideLoader(); const superHeroInfo= document.querySelector('.Info-details'); const indexOfSuperHeroInFav= Common.getFavouriteSuperheroes().findIndex( (hero) => hero.id === details.id ); if(!details){ ...
[ "static displaySuperHeroes() {\n const superheros = StoreSuperHero.GetSuperHeroFromLS();\n \n superheros.forEach((superhero) => {\n const list = new SuperheroList;\n list.addSuperhero(superhero);\n })\n }", "function renderSuperhero(data){\n let nameTag ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
creates new plant form for new plant button
function createNewPlantForm(e){ clearDivPlantField() clearDivNewPlantForm() let targetGardenId = parseInt(e.target.parentNode.id) let newPlantField = document.querySelector(`#new-plant-form-${targetGardenId}`) newPlantField.innerHTML = ` <input hidden id="plant" value...
[ "function createPlantField(e){\n clearDivNewPlantForm()\n clearDivPlantField()\n let targetGardenId = parseInt(e.target.parentNode.id)\n let plantField = document.querySelector(`#plant-field-${targetGardenId}`)\n let gardenPlantsArr = Plant.all.filter(plant => plant.garden_id === ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Create cards for individual art
function createArtCard(holder, art) { var card = new Card(holder, art, { title: art.toString(), classes: "card-art card-art" + art.id, hideDetails: true, }); // Create the holder for the svg card.art = $("<div/>", { class: "art-thumbnail", html: art.svg }).appendTo(card.contents); card.title.click(fun...
[ "function createCard(article) {\n \n }", "function createCards() {\n cardsData.forEach((data, index) => createCard(data, index));\n }", "function createCards() {\n for (let i = 0; i < imgList.length; i += 1) {\n const cards = document.createElement('div');\n cards.classList.add('card'...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Function to update the name of an artifact
function change_artifact_name(portal_dir, artifact_id, new_name, on_success_func) { $.ajax({ url: portal_dir + '/artifact/' + artifact_id + '/', type: 'PATCH', data: {'op': 'replace', 'path': '/name/', 'value': new_name}, success: on_success_func, error: function(object, status, error_msg) { ...
[ "function updateReleaseName(name) {\n assertAgent(\"2.132\");\n exports.command(\"release.updatereleasename\", null, name);\n}", "function sanitizeArtifactName(x) {\n let sani = x.replace(/[^A-Za-z0-9_]/g, '_'); // Charset requirement is imposed by CodeBuild\n const maxLength = 100; // Max length of 1...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
for a review, collect the review, and all its markers for deletion
async collectObjectsToDeleteFromReview (reviewId) { const review = await this.data.reviews.getById(reviewId); this.toDelete.reviews.push(reviewId); await this.collectMarkersToDelete([review]); }
[ "function deleteReview() {\n\t\tvar review = $(this).parent();\n\t\tvar id = review.attr('id');\n\t\tvar query = new Parse.Query(Review);\n\t\tquery.get(id, {\n\t\t\tsuccess:function(result) {\n\t\t\t\tresult.destroy({\n\t\t\t\t\tsuccess: function() {\n\t\t\t\t\t\tgetReviews();\n\t\t\t\t\t}\n\t\t\t\t});\n\t\t\t}\n\...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
updateAllBlockStatus update all Block's status to app.
function updateAllBlockStatus() { 'use strict'; var name; var idx; var values; for (var no = 0; no < _activeBlocksCache.length; no++){ if (_activeBlocksCache[no] && (_activeBlocksCache[no].online)){ name = _activeBlocksCache[no].name; idx = getBlockIdx(name,no); values = _activeBlocksCa...
[ "function updateAllBlockStatus() {\n 'use strict';\n\n var name;\n var idx;\n var values;\n for (var no = 1; no < _activeBlocksCache.length; no++){\n if (_activeBlocksCache[no].online){\n name = _activeBlocksCache[no].name;\n idx = getBlockIdx(name,no);\n values = _activeBlocksCache[no].value...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Create a method that renders the Gin's HTML structure with dynamic data
renderHTML() { }
[ "html() {\n console.log(\"Rendering\");\n const html = ` <h2>${this.name}</h2>\n <div class=\"image\"><img src=\"${this.imgSrc}\" alt=\"${this.imgAlt}\"></div>\n <div>\n <div>\n <h3>Distance</h3>\n <p>${this.distanc...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Turn Off the Race runner toggle button
clickRaceRunnerToggleOFF(){ this.raceRunnerToggleOFF.waitForExist(); this.raceRunnerToggleOFF.click(); }
[ "clickRaceRunnerToggleOFF(){\n this.raceRunnerToggleOFF.waitForExist();\n this.raceRunnerToggleOFF.click();\n }", "switchOff() {\n this.setIllumination(false);\n }", "turnOff() {\n return __awaiter(this, void 0, void 0, function* () {\n debug('turn off');\n ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Supplement a fieldOption (from options.fields[]) with a fieldDef, config (which provides timeFormat, numberFormat, countTitle) Either fieldOption or fieldDef can be undefined, but they cannot both be undefined. config (and its members timeFormat, numberFormat and countTitle) can be undefined.
function supplementFieldOption(fieldOption, fieldDef, vlSpec) { // many specs don't have config var config = vl.util.extend({}, vlSpec.config); // at least one of fieldOption and fieldDef should exist if (!fieldOption && !fieldDef) { console.error('[Tooltip] Cannot supplement a field when field ...
[ "function supplementFieldOption(fieldOption, fieldDef, config, vlSpec) {\n if (config === void 0) { config = {}; }\n // at least one of fieldOption and fieldDef should exist\n if (!fieldOption && !fieldDef) {\n console.error('[Tooltip] Cannot supplement a field when field and fieldDef are both empty...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
============================ end findBibRefs =========================================== journalNames %%%%%%%%%%%%%%%%%%%%%%%% passed 4/22/2019 big help: The format for the journal name is to spell out the full name, and to capitalize the parts of the name that are "required" to be present for a match and/or that compo...
function journalNames() { // read in the external file and split out the individual rows of data: // See https://mirror.hmc.edu/ctan/macros/latex/contrib/mnras/mnras_guide.pdf regarding journal letters // that have a designation of "L" in front of the page numbers. var lines = (GM_getResourceText(astroJournals).t...
[ "function findBibRefs() {\n// Searches text for citations/bibliographic entries by looking for text that has the format of a list of\n// authors followed by publication year, journal name, volume number and page number. \n// If such are identified, a short citation is constructed from the author list, pub year, etc...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
This function takes a message and loops through it. At every step the loop checks the current character's position in the character index, it then replaces that character with the character at the same position in the factored/ rotated/ split index.
function encrypt(msg, encryp, rotate){ split(encryp,rotate); var codedMsg = []; for(var i=0;i<msg.length;i++){ if(Charindex.join('').indexOf(msg[i])>=0){ var pos = Charindex.join('').indexOf(msg[i]); codedMsg.push(factoredRotatedSlicedIndex[pos]) } else { codedMsg.push(msg[i]) } } console.log(...
[ "function Encrypt() {\n\n let normaltext = prompt (\"Please enter your message into the box:\");\n let cipheredtext = \"\";\n let firstletter = \"\";\n let lastletter = \"\";\n \n normaltext = normaltext.replace (\" \");\n for ( let a = 0; a < normaltext.replace; a = a + 1) {\n if (norma...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Function that calls the flood simulation URL, displays the flood alert and warning for the flood and also drops a marker on the graph that can be clicked on to display the current and hsitorical water levels
function callDemoSimulatedFlood() { // Make call to the Flood Demo URL and return data var requestFour = new XMLHttpRequest(); requestFour.open('GET', demoTestURL); requestFour.responseType = 'json'; requestFour.send(); requestFour.onload = function () { var myresults = requestFour.response; var r...
[ "function showTransportFlooding(mapLayer, data) {\n console.info('showing RMS reported flooding');\n\n let count = 0;\n if (data && data.features) {\n for (let i = 0; i < data.features.length; i++) {\n let feature = data.features[i];\n\n if (feature.geometry.type.toLowerCase() === 'point') {\n ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Creates an instance of ScholarParser
constructor(querier) { super(); this.articleParser = new ScholarArticleParser(); this.querier = querier; }
[ "static create() {\n\n\t\treturn new QSParser();\n\t}", "function parser(p) {\n return new Parser(p);\n }", "function Parser() {}", "instantiateParser() {\n return new this.ParserClass(this.config);\n }", "function Parser() {\n}", "function Parser() {\n var nodeFactory = arguments...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
`onIgnoreTag` function for removing all the tags that are not in whitelist
function onIgnoreTagStripAll() { return ""; }
[ "function filterTagList(tags) {\n const ignoredTags = ['all', 'nav', 'post', 'posts', 'page', 'xtweet'];\n const result = (tags || [])\n .filter((tag) => ignoredTags.indexOf(tag) === -1);\n return result;\n }", "wipeTurnTags( ignorePlayers ){\n\t\tfor( let p of this.players ){\n\t\t\tif( ignorePl...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Select row by offset
function selectOffset (offset) { select(Math.max(0, Math.min(List.selected + offset, list.length))) }
[ "function getRow(idx) {\n return data[idx];\n }", "tmpSelectRow(x, y, append = false) {\n this.setActive(x, y)\n this.tmpSelectRowRange(y, y, append)\n }", "offset(offset) {\n return new SelectQueryBuilder({\n ...this.#props,\n queryNode: SelectQueryNode.cloneW...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Get options for vis.js 3d plotting from user input or defaults
function getVisOptions() { if ($('#showAxes').is(':checked')) { // show axes? var showAxis = true; // do show axes } else { var showAxis = false; // don't show axes } console.log("plot style = "+$('#plotStyle').val()); var options = { width: '100%', //TODO: Fix (need to set up CSS so this does...
[ "function getOptions()\n{\n\n var mode = getVal(\"mode\")\n var normalizeX1 = getVal(\"normalizeX1\")\n var normalizeX2 = getVal(\"normalizeX2\")\n var normalizeX3 = getVal(\"normalizeX3\")\n var xRes = getVal(\"xRes\")\n var zRes = getVal(\"zRes\")\n var barchartPadding = getVal(\"barchartPadd...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Test Members Make sure the data is read and send a test slack message
function testMembers(){ var members = new Members(); members.find("---Name of test member (guinne pig)--").sendSlack("howdy, in case you wanted to know this function is working"); }
[ "function onTest(data) {\n console.log('Received: \"' + data + '\" from client: ' + client.id);\n client.emit('test', \"Cheers, \" + client.id);\n }", "function onTest(data) {\r\n console.log('Received: \"' + data + '\" from client: ' + client.id);\r\n client.emit('test', \"Cheers, ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
! parseBase64SchemeForEncoding.js Version 0.1.7
function parseBase64SchemeForEncoding(scheme) { // scheme = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/" + // "=" // padding (optional) // returns [65,66,...,43,47,61] var i = 0, l = scheme.length, a = new Array(l); for (; i < l; i += 1) a[i] = scheme.charCodeAt(i); ...
[ "function initBase64Codec() {\n\t\tconst rxBase64 = /^(?:[A-Za-z0-9+\\/]{4})*(?:|[A-Za-z0-9+\\/][AQgw]==|[A-Za-z0-9+\\/]{2}[AEIMQUYcgkosw048]=)$/;\n\t\tconst rxBase64Url = /^(?:[A-Za-z0-9\\-_]{4})*(?:|[A-Za-z0-9\\-_][AQgw]|[A-Za-z0-9+\\/]{2}[AEIMQUYcgkosw048])$/;\n\n\t\t/**\n\t\t *\n\t\t * @param {string} string\n\...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Scales in or out to achieve a target CPU utilization.
scaleOnCpuUtilization(id, props) { return super.doScaleToTrackMetric(id, { predefinedMetric: appscaling.PredefinedMetric.ECS_SERVICE_AVERAGE_CPU_UTILIZATION, policyName: props.policyName, disableScaleIn: props.disableScaleIn, targetValue: props.targetUtilizationPe...
[ "function updateCpu() {\n let maxCpu = 0;\n let minTime = Number.MAX_SAFE_INTEGER;\n let maxTime = 0;\n cpu.forEach((value, key) => {\n // Get bounds for memory; minimum is always 0\n if (value > maxCpu) {\n maxCpu = value;\n }\n // Get bounds for time\n if (key > maxTime) {\n maxTime =...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }