query
stringlengths
9
34k
document
stringlengths
8
5.39M
negatives
listlengths
19
20
metadata
dict
Finds the nearest vertex that is in the bounds of the circle. This will change the shape. i.e. this doesn't care about the line segment, only about the point.
nearestVertex(vertex) { const size = this.settings.maxRadius if ( vertex.length() < size) { const scale = size / vertex.length() return vertex.multiply(new Victor(scale, scale)) } else { return vertex } }
[ "function nearestVertexCircle(vertex, size) {\n const point = Victor.fromObject(vertex);\n if ( point.length() > size) {\n let scale = size / point.length();\n return point.multiply(Victor(scale, scale));\n } else {\n return point;\n }\n}", "ClosestPointOnBounds() {}", "nearestVertex(vertex) {\n ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[getUrl(color)] gets the url that corresponds with the color choice
function getUrl(color) { switch(color) { case "black": return "https://duckduckgo.com/?q=black+car&t=brave&iax=images&ia=images"; case "red": return "https://duckduckgo.com/?q=Red+car&t=brave&iar=images&iax=images&ia=images"; case "blue": return "https://duckduckgo.com/?q=Blue+Car&t=brav...
[ "function findColor() {\n let colorAndUrl = URL + \"?mode=\" + $(\"colorDropdown\").value;\n\n fetch (colorAndUrl)\n .then(checkStatus)\n .then(changeColors)\n .then(console.log);\n\n $(\"roygbiv\").classList.add(\"hidden\");\n $(\"generate\").classList.a...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Move a storypoint and rehighlight edges
function handleStorypointRearrange(storyline, oldIndex, newIndex) { moveInArray(storyline.path, oldIndex, newIndex); highlightEdges(); }
[ "move(){\n\n this.segments[this.select].x += this.segments[this.select].deltaX;\n this.segments[this.select].y += this.segments[this.select].deltaY;\n\n }", "function moveHighlight(e){\n sethighlightStyle({\n left:e.nativeEvent.layerX-150,\n })\n }", "moveBack() {\n if (this.se...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
send real category data to the firebase for saving / params basicData: basic data which sensor get through device categoryID: 0: status, 1: vocAnalytics, 2: vocRaw, 3: processedData, 4: debug
function sendCategory(basicData, categoryID) { var categoryName = categories[categoryID]; var sendValue; if(sensorTypes.hasOwnProperty(categoryName)) { var categoryTemplate = sensorTypes[categoryName]; sendValue = getSendValue(basicData, categoryTemplate); } else { writeLog(`${categoryName} property is not e...
[ "function postToFireBase(temp, humid) {\n var req = https.request({\n port: 443,\n method: 'POST',\n hostname: 'FIREBASEACCOUNT.firebaseio.com',\n path: '/climate.json',\n headers: {\n \"Host\": \"FIREBASEACCOUNT.firebaseio.com\",\n \"Accept\": \"*/*\",\n ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
HELPER FUNCTIONS / Sets an authorization token for the transaction
function setToken(transaction, done, type) { var tokenKey = type + 'UserToken' if (type === 'admin' || type === 'creator') { if (responseStash.hasOwnProperty(tokenKey)) { transaction.request.headers.Authorization = 'Bearer ' + responseStash[tokenKey] done() } else { ...
[ "authToken (state, token) {\n state.authToken = token\n }", "function setToken(token) {\n access_token = token;\n }", "setToken(token = null) {\n this.token = token;\n\n\n //this.instance.defaults.headers.common['Authorization'] = _.get(token, '_id');\n }", "function...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
call when a client disconnects and tell the clients except sender to remove the disconnected player
function onClientdisconnect() { console.log('disconnect'); var removePlayer = find_playerid(this.id); if (removePlayer) { player_lst.splice(player_lst.indexOf(removePlayer), 1); } console.log("removing player " + this.id); //send message to every connected client except the sender this.br...
[ "function onClientdisconnect() {\n\tconsole.log('disconnect');\n\n\tvar removePlayer = find_playerid(this.id); \n\t\t\n\tif (removePlayer) {\n\t\tplayer_lst.splice(player_lst.indexOf(removePlayer), 1);\n\t}\n\t\n\tconsole.log(\"removing player \" + this.id);\n\t\n\t//send message to every connected client except th...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Add event listeners on component load Notably, getSSID and window focus change
componentDidMount(){ console.log("Mounted.") this.getSSID(); AppState.addEventListener("change", this.getSSID); NetInfo.addEventListener(this.getSSID); }
[ "initEvents() {\n let myEvent = this.$window.attachEvent || this.$window.addEventListener;\n var chkevent = this.$window.attachEvent ? 'onbeforeunload' : 'beforeunload';\n\n myEvent(chkevent, () => {\n // always log session when closing tab\n this.codenvyAnalytics.logSession(this.uuid);\n r...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Replace .katex elements with their TeX source ( element). Modifies fragment inplace. Useful for writing your own 'copy' handler, as in copytex.js.
function katexReplaceWithTex(fragment, copyDelimiters) { if (copyDelimiters === void 0) { copyDelimiters = defaultCopyDelimiters; } // Remove .katex-html blocks that are preceded by .katex-mathml blocks // (which will get replaced below). var katexHtml = fragment.querySelectorAll('.katex-mathml + .katex-...
[ "function do_replace( name ) {\n\n\tvar rects = document.getElementsByTagName(\"g\");\n\n\t// retrieve the correct \"constructor\"\n\tvar makewidget = window[name];\n\tif (makewidget == undefined)\n\t\tmakewidget = function(obj) { Widget(obj,0xFF); }\n\n\t// get the template object\n\tvar templ = templates[name];\n...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Creates a `TypedEmitter` instance and returns helper functions for easily mixing `TypedEmitter` methods into other objects.
function createTypedEmitter() { var emitter = new TypedEmitter(); var createChainingEmitterMethod = function (method, source) { return function () { var args = []; for (var _i = 0; _i < arguments.length; _i++) { args[_i] = arguments[_i]; } ...
[ "function Emitter() {}", "function Emitter() {\n\n const eventTracker = {\n // key = eventName: value = array of functions\n }\n\n const subscribe = (name, cb) => {\n if(eventTracker[name]){\n eventTracker[name].push(cb)\n } else {\n eventTracker[name] = [cb]\n ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Creates a FieldPath from the provided field names. If more than one field name is provided, the path will point to a nested field in a document.
function FieldPath$1() { var fieldNames = []; for (var _i = 0; _i < arguments.length; _i++) { fieldNames[_i] = arguments[_i]; } validateNamedArrayAtLeastNumberOfElements('FieldPath', fieldNames, 'fieldNames', 1); for (var i = 0; i < fieldNames.length; ++i) { validateArgType('FieldPath...
[ "function FieldPath() {\n var fieldNames = [];\n for (var _i = 0; _i < arguments.length; _i++) {\n fieldNames[_i] = arguments[_i];\n }\n (0, _input_validation.validateNamedArrayAtLeastNumberOfElements)('FieldPath', fieldNames, 'fieldNames', 1);\n for (var i = 0; i < fie...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
view table extensible dispersion
function view_table_extensible_dispersion(tabla, fila, va, inicio){ var id_tabla = "#tabla_ext"; var str = "<div id = 'tabla_ext'>"; str = str + "<table style='float: left;'><tr><td id = 'filaFlecha'>v.a.:</td><td id = 'valor_asociado'>"+va+"</td></tr>"; for(i=0; i<fila; i++){ str = str + "<tr id = 'fila_ta...
[ "static tableView(value, options) {}", "function showTable(t) {\n\n tableContainer.innerHTML = \"\"\n \n var ht = new ui.Table()\n ht.addHeaders(t.headers)\n ht.addData(t.data)\n tableContainer.appendChild(ht.table)\n\n }", "function render_table_view(){\n\tif(current_tab == \"donate\"...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Method that pulls operation function arguments from the stack. Simple method that pulls operation function arguments from the stack.
function popOpArgs() { return opFuncArgsStack.pop(); }
[ "function pushOpArgs(args)\n {\n opFuncArgsStack.push(args);\n }", "function getArguments() { return args; }", "function PopArg() {\r\n}", "static args(ins_array){\n return ins_array.slice(Instruction.INSTRUCTION_ARG0)\n }", "function stack_fun(fun){\n return function(arg_stack...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
This function adds the selected package to the list display.
function add_to_install(val) { $('#package-name').val(""); $('#package-name').blur(); var a = val.split(' - '); var pkg = { 'name': a[0], 'version': a[1], 'staus': '' }; var data = []; data.push(pkg); var output = views....
[ "function onPackageAdd() {\n\n\t// Add the value if it exists\n\tvar value = packageInput.value;\n\tif (value) {\n\t\taddSelect(packageSelect, value, value);\n\t\tpackageInput.value = '';\n\t\tchanged = true;\n\t\tpackageDelButton.disabled = false;\n\t\tsetModuleButtons();\n\t}\n\tpackageAddButton.disabled = true;\...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Adds an offset clause to the query. Examples Select rows from index 10 to index 19 of the result: ```ts return await db .selectFrom('person') .select('first_name') .offset(10) .limit(10) ```
offset(offset) { return new SelectQueryBuilder({ ...this.#props, queryNode: SelectQueryNode.cloneWithOffset(this.#props.queryNode, OffsetNode.create(offset)), }); }
[ "_specifyOffset() {\n if (this.limit) {\n this.set('offset', this.limit);\n }\n }", "function nextOffset() {\n\tvar offset = getOffset() + getLimit();\n\taddPagingParam('offset', offset);\n}", "offset(offset) {\n this.offsetNumber = offset;\n return this;\n }", "get _offsetIndex()...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Catch any thrown value and return false instead The first parameter is a function that will be called with the await keyword. The supplied function must be async.
async function throwToBool(fn, ...args) { let thrown = false; try { await fn(...args); } catch (err) { thrown = true; } finally { return !thrown; } }
[ "async function doesThrow (asyncFn, ...args) {\n let threwError = false\n try {\n await asyncFn(...args)\n } catch (e) {\n threwError = true\n }\n return threwError === true\n}", "function verifyAsyncSupport() {\n try {\n new Function('async () => {}')();\n } catch (error) {\n return false;\n ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
World y coord to screen Status: done
WorldToScreenY(y) { return Math.round((this.center.y - this.scale.py*y)); }
[ "ScreenToWorldY(y) {\n return -( y - this.center.y + 0.5) / this.scale.py;\n }", "function render() {\n game.debug.text(`Y position is: ${logo.y}` , 10, 10);\n }", "function worldToScreen(x, y) {\n return {x: x - (-globals.background.x), y: y - (-globals.background.y)};\n\n}", "function GetY(...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Adds an IPFS object to the pinset and also stores it to the IPFS repo.
async function pinAdd (ipfsNode, hash) { ipfsNode.pin.add(hash, function (err) { if (err) return err }) // List all the objects pinned to local storage or under a specific hash. /* ipfsNode.pin.ls(hash,function (err, pinset) { if (err) { throw err } console.log(pinset) ...
[ "function addToIpfsS (ipfs, path) {\n return kefir.fromNodeCallback(cb => {\n ipfs.util.addFromFs(path, cb)\n }).map(r => r[0])\n}", "saveToIpfs (file) {\n let ipfsId\n const fileStream = fileReaderPullStream(file)\n this.ipfsApi.add(fileStream, { progress: (prog) => console.log(`received: ${prog}`)...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
when you click "OK" on the Edit Engagement Track dialog, send results to main script
function saveTrack(){ if (document.getElementById("edit-track-action").selectedItem.value == "c") { window.arguments[1].action="c"; } else if (document.getElementById("edit-track-action").selectedItem.value == "e") { window.arguments[1].action="e"; } else if (document.getElementById("edit-track-action")...
[ "function clickedOK()\n{\n updateSBRecordsetObject();\n recordsetDialog.onClickOK(window, RECORDSET_SBOBJ);\n}", "function SubmitAndScoreDialog() {\r\n}", "function openDialog(event)\n{\n $(\"#input-title\").text(event.data.title); \n $(\"#input-submit\").click({action: event.data.action, id: event.d...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Function to replace instantiatians of buildListOfGames
function buildInitialListOfGames() { for (var i = 0; i < dataForPreSelectedGames.length; i++) { new BuildGameItem(dataForPreSelectedGames[i][0], dataForPreSelectedGames[i] [1], dataForPreSelectedGames[i][2], dataForPreSelectedGames[i][3], dataForPreSelectedGames[i][4], dataForPreSelectedGames[i][5], ...
[ "createGameListing() {\n\n\t\tif (this.state.games.length == 0) {\n\t\t\treturn (\n\t\t\t\t<div class=\"text-center\">No games found.</div>\n\t\t\t)\n\t\t}\n\n\t\telse {\n\n\t\t\t// Render out each game if any exist.\n\t\t\treturn this.state.games.map(game => \n\t\t\t\t<Game\n\t\t\t\t\taddMinutesValue={this.state.a...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
renders div containing the Registration ReactComponent, defined in client/app/Registration.jsx
renderRegistration() { return ( <div id="registration"> <Registration callback={this.registerCallback} /> </div> ); }
[ "async showRegistrationForm() {\n const ctx = this.ctx;\n await ctx.render('auth/register');\n }", "renderAccCreation() {\n ReactDOM.render(<CreateAccount />, document.getElementById('root'));\n }", "render() {\n return (\n <div className='user-info-block'>\n <label c...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Have the function CountingMinutesI(str) take the str parameter being passed which will be two times (each properly formatted with a colon and am or pm) separated by a hyphen and return the total number of minutes between the two times. The time will be in a 12 hour clock format. For example: if str is 9:00am10:00am the...
function CountingMinutesI(str) { var twoTimes = str.split(/\-/); var secondTime = timeToMinute(twoTimes[1]); var firstTime = timeToMinute(twoTimes[0]); result = secondTime - firstTime; if(result < 0) { result += 1440; } return result; }
[ "function CountingMinutesI(str) {\n\n var timeArray = str.split(\"-\"); // split into two times\n // split into hours and minutes\n var h1 = timeArray[0].split(\":\")[0];\n var m1 = timeArray[0].split(\":\")[1];\n var h2 = timeArray[1].split(\":\")[0];\n var m2 = timeArray[1].split(\":\")[1];\n // convert mi...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Returns the CONNECT_DATA part of DESCRIPTION node of the TNS URL.
buildConnectData(serviceName, serverMode, instanceName, connectionIdPrefix) { const poolConnectionClass = this.urlProps.get("POOL_CONNECTION_CLASS"); const poolPurity = this.urlProps.get("POOL_PURITY"); const serviceTag = this.urlProps.get("SERVICE_TAG"); const parts = []; if (serviceName) pa...
[ "description() {\n return this.protocol[Object.keys(this.protocol)[0]].desc\n }", "function YDevice_describe()\n {\n var res = this._rootUrl;\n if(this._serialNumber != \"\") {\n res = this._serialNumber;\n if(this._logicalName != \"\") {\n res = res...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Helper function to start a playback in the browser. If the user passes in true for playbackIsForAComment then the playback starts at the end and a user can add a comment to the latest code. Otherwise it starts at the beginning.
function startPlayback(playbackIsForAComment) { //if we are tracking changes if(isStorytellerCurrentlyActive) { //save the state of the storyteller data for this project handleFileSave(); //Display a message box to the user fo 5000 ms (5 s) vscode.window.setStatusBarMessage('Sto...
[ "function startPlaybackToMakeAComment() {\n //if storyteller is active\n if(isStorytellerCurrentlyActive) {\n //start a playback at the end so the user can add a comment to the latest code\n startPlayback(true);\n } else { //storyteller not active\n //tell the user how they can use sto...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Check for matching feature types of multiple layers
function MatchingFeatureTypes() { for (var i=0; i < checkedLayers.length-1; i++) { for (var j=i+1; j < checkedLayers.length; j++) { if (checkedLayers[i].protocol.featureType != checkedLayers[j].protocol.featureType) return false; } } return true; }
[ "function MatchingFeatureTypes(exportLayers) {\n\tfor (var i=0; i < exportLayers.length - 1; i++) {\n\t\tfor (var j=i+1; j < exportLayers.length; j++) {\n\t\t\tif (exportLayers[i].protocol.featureType != exportLayers[j].protocol.featureType)\n\t\t\t\treturn false;\n\t\t}\n\t}\n\treturn true;\t\t\n}", "static isSa...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
This function will take the temporary array and randomly pick out image urls from the tempArr, then remove that url from tempArr, to then choose another image url until there are no more image url's in tempArr.
function randomImgGen(array, tempArray) { var tempArr = []; for (var i = 0; i <= array.length - 1; i++) { let j = Math.floor((Math.random() * tempArray.length)); var x = tempArray.splice(j, 1) tempArr.push(x[0]) }; return (tempArr); }
[ "function createImageArray() {\n var imgPick = imageChoice.fileSrc\n randomArray.push(imageChoice);\n availablePhotos.splice(randomImage, 1);\n }", "function suffelArray(imgArray){\n for(var j =0; j<imgArray.length; j++){\n var temp;\n var randmIndex = Math...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Checks if the element is the svg that opens the "row actions menu"
checkIfElementIsActionMenuIcon(element) { if (element.tagName && element.parentElement) { return (element.tagName === 'svg' && element.parentElement.classList.contains('row-actions-toggler')); } return false; }
[ "function _isClickable ( row ) {\n var output = false;\n var clickIndex = $scope.clickActionIndex;\n if ( clickIndex != null && $scope.actions && $scope.actions.length > 0 ) {\n var group = $scope.actions[0];\n if ( group.length > 0 ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
This function parses the incoming resource properties and change the solar panel position.
function updateProperties(properties) { var tilt = properties.tiltPercentage; simulationMode = properties.simulationMode; // Cancel simulation mode before we parse the incoming request. if (simulationTimerId) { clearTimeout(simulationTimerId); simulationTimerId = null; } if (si...
[ "function setConfigProperties(){\r\n \r\n var server = checkVal(\"http://sampleserver1.arcgisonline.com/ArcGIS/rest/services/\"); // url for server rest services directory, ends with \"/\"\r\n var folder = checkVal(\"TaxParcel/\"); // url for server subFolder, norma...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Signs the given transaction data and sends it. Abstracts some of the details of buffering and serializing the transaction for web3.
function sendSigned (txData, cb) { web3.eth.sendSignedTransaction('0x' + signTx(txData).toString('hex'), cb) }
[ "function sendSigned(txData, cb) {\n\t const privateKey = new Buffer(privKey, 'hex')\n\t const transaction = new Tx(txData)\n\t transaction.sign(privateKey)\n\t const serializedTx = transaction.serialize().toString('hex');\n\t web3.eth.sendSignedTransaction('0x' + serializedTx, cb)\n\t}", "function sendSigne...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Extracts the W0 or W1 state sequence for inList
function extractWX(valW, inList) { let extract = []; let useW = []; if (valW === 0) useW = [...w0]; else useW = [...w1]; for (let i = 0; i < inList.length; i++) { extract.push(useW[states.findIndex(function (value) { if (value === inList[i]) retu...
[ "function elements() {\n var ret = this.seq(alternation, this.manyf(c_wsp));\n return ret[1];\n}", "currentList (state) { return state.lists[state.currentList] }", "function joinStates(lst) {\n var joined = lst[0].concat([]);\n for(k = 1; k < lst.length; k++) {\n joined = joinTwoStates(joined, lst[k]...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Represent the database configuration
static getDatabaseConfig() { return { LOCAL: 'local', DEVELOPMENT: 'development', STAGING: 'staging', PRODUCTION: 'production', environment: { 'local': {config: 'mongodb://localhost:27017/tutorial-local'}, 'development': {config: 'mongodb://localhost:27017/tutorial-deve...
[ "getConfigFromDb() {}", "configureDatabase() {\n database.connect();\n }", "function Database(confdb, schemaPath){\n this.schemaPath = schemaPath;\n //create constructor\n if (confdb) {\n this.config = confdb;\n } else {\n this.config = {};\n }\n}", "constructor(config) {\n var default...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Creates a set of OSspecific buildspec installation commands for setting up the given registries and associated credentials.
function dockerCredentialsInstallCommands(usage, registries, osType) { const relevantRegistries = (registries ?? []).filter(reg => reg._applicableForUsage(usage)); if (!relevantRegistries || relevantRegistries.length === 0) { return []; } const domainCredentials = relevantRegistries.reduce(funct...
[ "function GenerateX11InstallerMakefiles()\n{\n writeSeparator();\n console.writeln( \"Generating makefiles for PixInsight X11 UNIX/Linux installer program\" );\n console.flush();\n\n var files = new FileLists( PCLSRCDIR + \"/installer/x11\" );\n\n var parameters = new GeneratorParameters();\n parameters...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
grabs the ISO 639 language code based on either the browser or a supplied cookie return of "mul" will display all available strings
function ls_getLanguage() { var language = ''; // Priority: // 1. Cookie // 2. Browser autodetection // grab according to cookie language = ls_getCookieLanguage(); // grab according to browser if none defined if (!language) { language = ls_getBrowserLanguage(); } // inflexible: c...
[ "function ls_getCookieLanguage() {\n var allcookies = document.cookie;\n var marker = ls_cookie + '=';\n var pos = allcookies.indexOf(marker);\n \n // cookie isn't set, so no behavior defined\n if (pos === -1) return null;\n \n // cookie is set\n var start = pos + marker.length;\n var end = allcookies.i...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
get array of user emails
@computed get userEmails() { return this.users.map((user) => user.email); }
[ "getAllEmails() {\n return this.users.map(user => user.email);\n }", "function getEmails() {\n var emailsFound = knwlInstance.get('emails');\n\n emailsFound.forEach(function (email) {\n if (emails.includes(email['address']) == false)\n emails.push(email['address']);\n })\n}", ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Function to show students by page number
function showPage(pageNumber, listName) { // Takes arguments for page number and source list $(eachStudent).hide(); // Hides initial list of all students let currentLength = listName.length; for (let i = 0; i < currentLength; i++) { // Loops to check for right range if (i < pageNumber * studentsperPage && i +...
[ "function showPage(pageNumber, students) {\r\n // Calculate beginning and ending number for displaying students\r\n let studentListBegin = ((pageNumber - 1) * studentToDisplay);\r\n let studentListEnd = (pageNumber * studentToDisplay);\r\n // If student list ending is more than students array length, change its...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Map emote IDs to URLs.
function mapIdsToPaths(json, url, prefix, size="28x28") { emotes = json; Object.keys(emotes).forEach((id) => { // emote_url = url + prefix + emotes[id] + "-" + size + ".png"; emote_url = url + prefix + emotes[id] + ".png"; emotes[id] = chrome.extension.getURL(emote_url); }) conso...
[ "function TwitchEmoteUrl(id) {\r\n return \"//static-cdn.jtvnw.net/emoticons/v1/\" + id + \"/3.0\";\r\n}", "function createArticleIds (articles) {\n return articles.map(article => {\n article._id = removeSpecialCharsFromString(article.url)\n return article\n })\n}", "transformEmotes(emotes) {\n\t\tle...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Call the module's construct function.
function doConstruct(moduleName) { var module = modules.modules[moduleName]; module.isEnabled = true; module.construct(); }
[ "function _ctor() {\n\t}", "function constructAMD() {\n\n\t\t//create a library instance\n\t\treturn init(context);\n\n\t\t//spawns a library instance\n\t\tfunction init(context) {\n\t\t\tvar library;\n\t\t\tlibrary = factory(context, 'amd');\n\t\t\tlibrary.fork = init;\n\t\t\treturn library;\n\t\t}\n\t}", "fun...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
find an array of all protests and its movement(s) within a distance range of a particular location data
getNearbyProtests(location, distance) { let protests = this.getNearBy(this.toGeo(location), db.protests, distance * 1609.34); if (protests) { return protests.map((protest) => { let protestName = protest.name; return protestName + `(movements: ${this.findMoveme...
[ "function findEvents(grid, minx, maxx, miny, maxy, locationx, locationy){\n events = [];\n for (x=minx; x<=maxx; x++){\n for (y=miny; y<=maxy; y++){\n if(math.subset(grid, math.index(x,y)) != 0){\n var currentEvent = math.subset(grid, math.index(x,y));\n distance = calculateDista...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Group fields inside field groups of field collection into FieldVariant (wrapper on Field) based on record id (record id must be unique for all fields inside concrete field group)
function groupFields(fieldCollection) { fieldCollection.fieldGroups.forEach(function (fieldGroup) { var fields = fieldGroup.fields.reduce(function (acc, field) { if (!acc[field.record.id]) { acc[field.record.id] = new FieldVariant([field]); } else ...
[ "toGroups(fields) {\n // bail on empty schemas\n if (fields.length === 0) {\n return [];\n }\n\n // bail if we're already in groups\n if (fields[0].type === 'group') {\n return fields;\n }\n\n const groups = [];\n let currentGroup = -1;\n ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
compute when 2 cars 2 diff speeds when they are at the same point get the time
function carsSpeeds( speed1, speed2, start1, start2 ) { var d1, d2, t, s; // if start1 > start2 d2 = start1 + d1 s = Math.abs( start1 - start2 ); if ( speed2 > speed1 && start1 > start2 ) { d1 = ( speed1 * s) / Math.abs(speed2 - speed1); t = d1 / speed1; return {time : t,...
[ "static compareSpeed(carA, carB) {\n return carA.speed - carB.speed;\n }", "function race(v1, v2, g) {\n // if the first tortoise is faster than the second, it will always be ahead so return null\n if (v1 >= v2) { return null; }\n // find time it will take for tortoise 2 to catch-up with tortoise one...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
PRIVATE FUNCTIONS // Define a private method for setting the battle field
function setBattleField(fieldToken){ //console.log('canvasBattleField.setBattleField(fieldToken)', fieldToken); // Collect battle field data based on token var battleField = battleFieldIndex.getField(fieldToken); //console.log('canvasBattleField.setField // battleField = ', battleField)...
[ "function changeBattleField(battleField){\n //console.log('canvasBattleField.changeBattleField()', battleField);\n\n // Copy over the field name manually intro current\n thisGame.battleField.fieldName = battleField.fieldName;\n\n // Defer the background and foreground updates to dedicate...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
When in Mobile, maximize sidebar
function maximizeMobile() { $(window).on("breakpoint-updated", function () { if ($('.ls-window-xs').length) { maximizeSidebar(); } }); }
[ "function hideSidebar() {\n if (window.innerWidth <= smValue) {\n sidebar.classList.add(hideClass);\n } else {\n sidebar.classList.remove(hideClass);\n }\n}", "function hideMenuOnBigScreen() {\n if (window.innerWidth > 555) {\n closeSideNav();\n }\n}", "function maximize() {\n$('ul#responsive_mast...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Create a marker for the given place, fit map to bound depending on bFitBounds
function createMarker(place, bFitBounds) { if(!Boolean(place) || !Boolean(map)) return; var marker = new google.maps.Marker({ map: map, position: place.geometry.location }); google.maps.event.addListener(marker, 'click', function() { ...
[ "function plotPlace(place)\n {\n // 1. get and check\n if ((place.replace !== undefined) && (place.replace(/\\s/g, '') === ''))\n {\n return false;\n }\n\n // 2. get some information!\n var oPlace = place;\n if (typeof oPlace === \"string\")\n {\...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Updates the rotation matrix with 3x3 matrix.
setRotationMatrix3(rotationMatrix3) { this.rotator.setRotationMatrix3(rotationMatrix3); }
[ "setRotationMatrix3(rotationMatrix3) {\n this.rotator.setRotationMatrix3(rotationMatrix3);\n }", "updateMatrix(){\n this.matrix = Matrix3x3.FromProperties({\n position: this.getPosition(),\n rotation: this.getRotation(),\n scale: this.getScale(),\n ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
TODO: Define a function named `canPurchase` that takes in two `number` parameters, `billAmount` & `availableCash`. Return `true` if `availableCash` is greater than `billAmount`, `false` otherwise. For example, `canPurchase(10, 20)` would return `true`.
function canPurchase(billAmount, availableCash){ if(parseFloat(availableCash) > parseFloat(billAmount)){ return true; } else return false; }
[ "function canPurchase(billAmount, availableCash) {\n if (availableCash > billAmount){\n return true;\n } else {\n return false;\n }\n}", "function canAfford(item) {\n if (item.cost <= Cash.quantity) {\n return true;\n }\n\n return false;\n}", "function haveEnoughCash(to_wi...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Checks if this table is a junction table of the closure table. This type is for tables that contain junction metadata of the closure tables.
get isClosureJunction() { return this.tableType === TableTypes.CLOSURE_JUNCTION; }
[ "get isJunction() {\n return this.tableType === TableTypes.JUNCTION;\n }", "getJunction() {\n\t\tif (this.relationType == 'hasAndBelongsToMany') {\n\t\t\tlet tables = this.tables\n\t\t\t//tables.sort((a,b) => {return a - b})\n\t\t\treturn tables.join('_')\n\t\t}\n\t\treturn false\n\t}", "function _isR...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Get a list of families
function getFamilies() { var xmlHttp = new XMLHttpRequest(); xmlHttp.onreadystatechange = function() { if (xmlHttp.readyState == 4 && xmlHttp.status == 200) { response = JSON.parse(xmlHttp.response); if (response.result == 'success') { family_info = response.families; } e...
[ "function getFamilyList() {\n\t\tvar familyListQT = new esri.tasks.QueryTask(\"http://54.247.127.44/ArcGIS/rest/services/MarineIBAs/Species/MapServer/3\");\n\t\t// get the family list table\n\t\tvar familyListQ = new esri.tasks.Query();\n\t\tfamilyListQ.outFields = [\"SpcRecID\", \"FamEng\"];\n\t\tfamilyListQ.where...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
comes back as undefined A product offer can be applied only if a person buys more than 2 items, and the offer has not expired. Premium members do not need to buy a specific amount of products.
function getsDiscount() { if ((productsBought > 2) || (membership = premium)); }
[ "stockUpProducts(product, amount) {\n let stockAvailable = this.products[product].stock;\n if (stockAvailable < 5) {\n return (this.products[product].stock += amount);\n } else {\n return `There is ${stockAvailable} left and it does not need to be restocked.`;\n }\n }", "function freeMaxPur...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Creates a specification for a set of files that will be downloaded
function getDownloadSpecification(artifactName, artifactEntries, downloadPath, includeRootDirectory) { // use a set for the directory paths so that there are no duplicates const directories = new Set(); const specifications = { rootDownloadLocation: includeRootDirectory ? path.join(downl...
[ "async function downloadFiles(assignDir, meta){\n for(var [key, value] of Object.entries(meta)){\n var semester = meta.semester;\n if (typeof semester == \"undefined\"){\n await downloadFile(value.url, assignDir+key+\"_\"+value.name, cs225_token);\n }else{\n await downl...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
A strobogrammatic number is a positive number that appears the same after being rotated 180 degrees. For example, 16891 is strobogrammatic. Create a program that finds all strobogrammatic numbers with N digits.
function strobogrammaticNumber(N) { if (N <= 0) return []; if (N === 1) return [0, 1, 8]; if (N === 2) return [11, 88, 69, 96] const stroDigs = {1: 1, 8: 8, 0: 0, 6: 9, 9: 6}; const stro = []; const min = Math.pow(10, N); const max = Math.pow(10, N+1) - 1; for (let i = min; i <= max; i++) { const n...
[ "function sc(n){\n let str = n.toString(2), arr = [];\n for(let i = 1; i <= n; i++)\n if(str.includes(i.toString(2)) && (n % i === 0))\n arr.push(i);\n return arr;\n}", "function generateNormalPhoneNumber() {\n\n //first 3 numbers\n let result = '081-';\n\n // contain numbers\n let countOfNumber = ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Calls `close` of both start and end drawers
close() { this._drawers.forEach((drawer) => drawer.close()); }
[ "close() {\n this._drawers.forEach(drawer => drawer.close());\n }", "close() {\n this._drawers.forEach(drawer => drawer.close());\n }", "closeAllOpenDrawers() {\n let closetDrawers=this.closet.getProducts(ProductTypeEnum.DRAWER);\n for(let closetDrawer of closetDrawers)\n ThreeDrawerA...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
insertAt(idx, val): add node w/val before idx.
insertAt(idx, val) { // check if index is valid. if (idx < 0 || idx > this.length) { throw new Error("Invalid Index."); } if (idx === 0) return this.unshift(val); if (idx === this.length) return this.push(val); // create new node. let newNode = new Node(val); let pre...
[ "insertAt(idx, val) {\n if (idx < 0 || idx > this.length) {\n throw new Error(\"Invalid index\");\n }\n if (idx === 0) {\n this.unshift(val);\n }\n if (idx === this.length) {\n this.push(val);\n }\n\n let newNode = new Node(val);\n // TODO\n }", "insertAt(idx, val) {\n i...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Ensures the value of the 'control' matches the 'expression' if 'requiresMatch' is true. Ensures the value of the 'control' does not match the 'expression' if 'requiresMatch' is false.
function validateRegex(control, expression, requiresMatch, matchMessage, noMatchMessage, showMessage) { var result = true; if (control != null) { var pattern = new RegExp(decode(expression)); var matches = pattern.test(control.value); if (matches != requiresMatch) { ...
[ "function ValidateToControlOnExpression() {\n\n var validateControl;\n if (typeof (event) != \"undefined\") {\n validateControl = event.srcElement;\n }\n else {\n validateControl = this;\n }\n\n if (!isNull(validateControl) && !isNullOrEmpty(validateControl.className)) {\n if ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
id; name; address; phone;
constructor(id /* Number */, name /* String */, address /* Address object */, phone /* String */) { if (id === null) { this.id = Math.random().toString() } else { this.id = id }; this.name = name; this.address = address; this.phone = phone; ...
[ "function genRow(id){\n\n var fnames = ['joe','fred','frank','jim','mike','gary','aziz'];\n var lnames = ['sterling','smith','erickson','burke','ansari'];\n var seed = Math.random();\n var seed2 = Math.random();\n var first_name = fnames[ Math.round( seed * (fn...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
validate the returned permalink URL is correct
validatePermalink (permalink) { const type = 'e'; const origin = this.test.apiConfig.apiServer.publicApiUrl.replace(/\//g, '\\/'); const regex = `^${origin}\\/${type}\\/([A-Za-z0-9_-]+)\\/([A-Za-z0-9_-]+)$`; const match = permalink.match(new RegExp(regex)); Assert(match, `returned permalink "${permalink}" doe...
[ "validatePermalink (permalink) {\n\t\tconst type = 'r';\n\t\tconst origin = this.test.apiConfig.apiServer.publicApiUrl.replace(/\\//g, '\\\\/');\n\t\tconst regex = `^${origin}\\\\/${type}\\\\/([A-Za-z0-9_-]+)\\\\/([A-Za-z0-9_-]+)$`;\n\t\tconst match = permalink.match(new RegExp(regex));\n\t\tAssert(match, `returned...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Pairfantasyland/compose :: Pair a b ~> Pair b c > Pair a c . . `compose (Pair (x) (y)) (Pair (v) (w))` is equivalent to `Pair (v) (y)`. . . ```javascript . > S.compose (Pair ('a') (0)) (Pair ([1, 2, 3]) ('b')) . Pair ([1, 2, 3]) (0) . ```
function Pair$prototype$compose(other) { return Pair (this.fst) (other.snd); }
[ "function compose(a, b) {\n return function (...args) {\n return a(b(...args));\n };\n}", "function compose(x, y) {\n return Semigroupoid.methods.compose (y) (x);\n }", "function compose(x, y) {\n return Semigroupoid.methods.compose(y)(x);\n }", "function compose() {\n var funcs = Array.apply(nu...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
========================================================================== Display keg level chart ==========================================================================
function displayKegLevelChart() { kegLevelChart = new Chart(kegLevelChartDOM, { type: "bar", height: 400, // The data for our dataset data: { labels: [ "ELH", "FTA", "HBL", "GTH", "HEA", "MIT", "R26", "RCH", "SLR", "...
[ "function displayLevel(){\n textSize(50);\n fill(0,0,255);\n level = getLevel();\n text(\"Level \" + str(level), windowWidth - 400, 70);\n}", "function updateKegLevelChart() {\n kegLevelChart.data.labels = [];\n kegLevelChart.data.datasets[0].data = [];\n kegLevelChart.data.datasets[0].backgroundColor = []...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
endregion OneTimeItemBoost endregion OTIB classes region JAFTING classes region JAFTING_Component A single instance of a particular crafting component, such as an ingredient/tool/output, for use in JAFTING.
function JAFTING_Component() { this.initialize(...arguments); }
[ "function Component() {\n\n /**\n * The associated game object. A component only be part of one game object at the same time.\n * @property object\n * @type gs.Object_Base\n * @default null\n */\n this.object = null;\n\n /**\n * Indicates if the component is disposed. A disposed componen...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Gets validators from either an options object or given validators.
function pickValidators(validatorOrOpts) { return (isOptionsObj(validatorOrOpts) ? validatorOrOpts.validators : validatorOrOpts) || null; }
[ "function pickValidators(validatorOrOpts) {\n return (isOptionsObj(validatorOrOpts) ? validatorOrOpts.validators : validatorOrOpts) || null;\n }", "function pickValidators(validatorOrOpts) {\n return (isOptionsObj(validatorOrOpts) ? validatorOrOpts.validators : validatorOrOpts) || null;\n}", "function ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Gets the contents of the file at the given Handshake domain.
async function getFileContentHns(domain, customOptions) { const opts = { ...defaultDownloadHnsOptions, ...this.customOptions, ...customOptions }; const url = this.getHnsUrl(domain, opts); return this.getFileContentRequest(url, opts); }
[ "function getFileContentHns(domain, customOptions) {\n return __awaiter(this, void 0, void 0, function () {\n var opts, url;\n return __generator(this, function (_a) {\n opts = __assign(__assign(__assign({}, defaultDownloadHnsOptions), this.customOptions), customOptions);\n ur...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Returns true if this folder has sub folders. readonly attribute boolean hasSubFolders;
get hasSubFolders() { return true; }
[ "function hasSubfolders(folder) {\n if (isFolder(folder)) {\n for (var i = 0; i < folder.children.length; i++) {\n if (isFolder(folder.children[i])) {\n return true;\n }\n }\n }\n return false;\n }", "get canCreateSubfo...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
=========================================================================== Read a new buffer from the current input stream, update the adler32 and total number of bytes read. All deflate() input goes through this function so some applications may wish to modify it to avoid allocating a large strm>input buffer and copy...
function read_buf(strm, buf, start, size) { var len = strm.avail_in; if (len > size) { len = size; } if (len === 0) { return 0; } strm.avail_in -= len; // zmemcpy(buf, strm->next_in, len); arraySet(buf, strm.input, strm.next_in, len, start); if (strm.state.wrap === 1) { s...
[ "function read_buf(strm,buf,start,size){var len=strm.avail_in;if(len>size){len=size}if(len===0){return 0}strm.avail_in-=len;// zmemcpy(buf, strm->next_in, len);\nutils.arraySet(buf,strm.input,strm.next_in,len,start);if(strm.state.wrap===1){strm.adler=adler32(strm.adler,buf,len,start)}else if(strm.state.wrap===2){st...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Define the function that obtains the max and min of India's population data from the TSV file
function indiaPopData() { d3.tsv("indiaPopulation.tsv", function(error,data) { // Iterating through the data data.forEach(function(d) { // Parsing the Year format present in the original data d.Year = parseDate(d.Yea...
[ "function findMinAndMax(dataColumn) {\n rMin = d3.min(dataset, function (d) { return (d[dataColumn]) });\n rMax = d3.max(dataset, function (d) { return (d[dataColumn]) });\n}", "function findMinAndMax(dataColumnY) {\n yMin = d3.min(REdata, function(data) {\n return +data[dataCo...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Cancel add category handler. Restores previously selected category and returns the user "save as" dialog.
function CancelAddCategory() { reportViewerContext.categoryControl.select(reportViewerContext.previousCategory); ReportingServices.showModal(document.getElementById("saveAsBlock"), { buttons: [ { value: jsResources.OK, classes: "izenda-dialog-btn-primary", style: "margin-right: 10px;", onclick: SaveReportAs ...
[ "function actionCancelEditCategory()\n{\n\t// Revert field input data be null\n\t$('#txt_category_id').val(0);\n\t$('#cbo_parent').val(0);\n\t$('#txt_name').val('');\n\t$('#txt_description').val('');\n\t\n\t// Change button update become save\n\t$('.category.btn-update').fadeOut(500);\n\t$('.category.btn-cancel-edi...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
UTILITY FUNCTIONS BELOW // / reports the current state information to the console
function state(){ // logs current state to console console.log("vertices length is " + vertices.length); console.log("index is " + index); console.log("vCount is set to " + vCount); }
[ "function printCurrentStateinConsole() {\n\t\tconsole.log('numbers: ', numbers);\n\t\tconsole.log('actions: ', actions);\n\t\tconsole.log('------------------')\n\n\t\tconsole.log(\"isNewNumber = \"+isNewNumber);\n\t}", "function state(){\n console.log(\"\\nCache: \" + util.inspect(cache));\n console.log(\"State...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Shared function to create lists of input values from list items
function inputValuesList(list) { let ret = []; for (let i=0; i<list.length; i++) { let v = list[i].firstChild.value.trim(); if (v != '') { ret.push(v); } } return ret; }
[ "function prepareList ( newList ) {\n const list = newList.map( function ( value, index ) {\n return {\n originalValue: value, // text\n originalIndex: index\n }\n } )\n return list\n }", "function createlstWant() {\n var lst = $(\"#iWant\").val().toLowerCase().s...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Helpers if link doesn't have a protocol, prefixes it via http:
function url(href) { return /^([a-z]{2,}):/.test(href) ? href : ('http://' + href) }
[ "function formatLink (link) {\n\n\tif (link.substr(0, 4) !== 'http') {\n\t\tlink = 'https://' + link;\n\t}\n\n\treturn link;\n\n}", "function url(href) {\n return /^([a-z]{2,}):/.test(href) ? href : ('http://' + href);\n }", "function prefixURLwithProtocol( url ) {\n if ( !url ) return false\n\n url = url...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Callback function for the uptime twitter command
function twitter_uptime_callback (error, stdout, stderr) { twit.verifyCredentials(function (err, data) { if (err) { console.log("Error verifying credentials: " + err); process.exit(1); } }).updateStatus(settings.server_name+' uptime+load: /' + stdout + settings.additional_status_conten...
[ "function uptimeProcess() {\n var s = process.uptime()\n var date = new Date(null);\n date.setSeconds(s);\n var uptime_bot = date.toISOString().substr(11, 8);\n return uptime_bot\n}", "async function uptime(ctx, next) {\n ctx.state.uptime = status.getUptimeMessage();\n return next(); // call next...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Check if any window is maximized
checkMaximized () { if (this.shadowRoot.getElementById('canvas').hasChildNodes()) { for (let i = 0; i < this.shadowRoot.getElementById('canvas').children.length; i++) { if (this.shadowRoot.getElementById('canvas').children[i].isMaximized) { return true } } return false ...
[ "function isMaximized() {\n\treturn $(\"window\").hasClass(\"maximized\");\n}", "function IsMaximized(Window)\n{\n var WS_MAXIMIZED = 0x01000000;\n // Declaring the WinAPI hexadecimal value for the maximized window\n return (Window.WndStyles & WS_MAXIMIZED) == WS_MAXIMIZED;\n}", "maximizedWindows() {\n...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Add one room for all.
addOneRoomAll ({socket, room}) { socket.server.sockets.emit('roomAdded', room); }
[ "addRoom(){\n\t\tvar newRoom = new Room(this);\n\t\tthis.rooms.push(newRoom);\n\t}", "function addRoom() {\n /*\n TO-DO: make sure each question is answered so that there are no nulls\n */\n const url = getRoute(\"/rooms\");\n\n var data = {\n roomNumber: parseInt(document.getElementById(\"roo...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Renders the AWS CloudFormation properties of an `AWS::CodeDeploy::DeploymentGroup.RevisionLocation` resource
function cfnDeploymentGroupRevisionLocationPropertyToCloudFormation(properties) { if (!cdk.canInspect(properties)) { return properties; } CfnDeploymentGroup_RevisionLocationPropertyValidator(properties).assertSuccess(); return { GitHubLocation: cfnDeploymentGroupGitHubLocationPropertyToC...
[ "function cfnDeploymentGroupGitHubLocationPropertyToCloudFormation(properties) {\n if (!cdk.canInspect(properties)) {\n return properties;\n }\n CfnDeploymentGroup_GitHubLocationPropertyValidator(properties).assertSuccess();\n return {\n CommitId: cdk.stringToCloudFormation(properties.comm...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
7. find longest word in arr and return length of that word
function findLongestWord(arr){ let result=0; for(i=0; i<arr.length; i++){ if(arr[i].length>result) result = arr[i].length; } return result; }
[ "function findLongestWord(array) {\n var wordLength = 0;\n array.forEach(function(word){\n if (word.length > wordLength) {\n wordLength = word.length;}});\n return wordLength;}", "function find_longest_phrase(arr) {\n var longestword = arr[0]\n for (var i = 0; i < arr.length; i++) {\n if (longestwor...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
isVerbose Show SPARQLS without answers for debugging.
get isVerbose() { return this._isVerbose }
[ "notVerbose() {\n this.isVerbose = false;\n for (const child of this.children) {\n child.notVerbose();\n }\n }", "function verbose () {\n if (true != program.verbose) return;\n return fmtprefix('verbose').apply(null, arguments);\n}", "verbose() {\n this.isVerbose = tr...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Checks if an article is selected from the list
function checkSelected(){ var noSelection = $('#ce-list').find('.ce-selected').length == 0 || $('.ce-selected').css('display') == 'none'; $('#ce-edit, #ce-delete').prop('disabled', noSelection); noSelection ? clearSide() : setPreview($('.ce-selected')); }
[ "function checkArticleSelection() {\n article = articleSelect.value;\n ratingSelect.disabled = false;\n ratingSelect.value = ratings[article];\n}", "function checkSelected(){\n\tvar noSelection = $('#ne-list').find('.ne-selected').length == 0 || $('.ne-selected').css('display') == 'none';\n\t$('#ne-edit, #ne-d...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Get the available jobs (from Perforce workspace)
function getAvailableJobs(filter) { if (getAvailableJobsCache === null) { var gonogo = []; var others = []; var checkDependencies = false; if (typeof config.blacklist !== 'undefined' && typeof config.blacklist.dependencies !== 'undefined' && config.blacklist.dependencies.length > 0) ...
[ "function getJobList() {\n return jobs;\n }", "function findAll() {\n return new Promise(function (resolve, reject) {\n let jobs = queueService.getJobList();\n resolve(jobs);\n });\n }", "function getPrinterJobs(printer) {\n return printer.queue.map((jId) => Pmg...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
funcion que recibe el pais de la persona y devuelve una lista de las vacunas que se usan en ese pais
function asociarVacunas (pais) { let paisResidencia = pais; const listaDeVacunasPosibles = []; const contenedor = document.getElementById("inputVacuna"); switch (paisResidencia) { case "URUGUAY": listaDeVacunasPosibles.push('SINOVAC'); ...
[ "function vaciarComprasPersona(pos){\n //Resto en 1 la cantidad de compras de cada compra de la persona, para resetear las compras \n for (var i = compras.length - 1; i >= 0; i--) {\n for (var o = personas[pos].comprasPorPersona.length - 1; o >= 0; o--) {\n if(personas[pos].comprasPorPersona...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
PrivateFunction: createRelationships Creates the relationship information for this model. Parameters: (Express) app An Express.js application instance
function createRelationships(app, db) { db = app ? app.get('db') : db; var residentDao = db.daoFactoryManager.getDAO('Resident') , taskDao = db.daoFactoryManager.getDAO('Task') , communityDao = db.daoFactoryManager.getDAO('Community'); taskDao.belongsTo(residentDao, { as: 'Creator' , foreignKey: 'creatorId...
[ "function addRelationship(){\n\n if(vm.relationshipFrom ==undefined || vm.relationshipTo == undefined || vm.relation == undefined){\n logError('All fields should be selected to create a relationship'); \n return; \n }\n datacontext.createRelationshi...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Draws a heart at the mouse position
function drawHeart(evt) { var position = getMouseXY(evt); var img = new Image(); img.onload = function() { context.drawImage(img,position.x,position.y); } img.src = "heart_picture.png"; }
[ "function heartPen() {\n if (mouseIsPressed) {\n image(img4, mouseX, mouseY, 40, 40);\n }\n}", "function createHeart(e) {\n const heart = document.createElement('i')\n heart.classList.add('fas')\n heart.classList.add('fa-heart')\n\n // position of mouse on the page\n const x = e.clientX;\n const y = e....
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Display operation success modal window modal : The id of the modal window title : The title of the modal window messageArray : The message to be displayed, can be HTML code buttonText : The text of the button(default: OK) buttonHandler : The event handler of the button(default: closeModal)
function displayOperationSuccess(modal, title, message, buttonText, buttonHandler) { buttonText = buttonText || "OK"; buttonHandler = buttonHandler || closeModal; $(modal + " .modalHeader .modalHeaderCenter h2").text(title); $(modal + " .modalBody").addClass("operationSuccess"); $(modal + " .modalBody .modalC...
[ "function openSuccessModal () {\n return fsModals.openTimedPopup({\n title: 'Success',\n text: 'User is now ' + status + '.',\n topColor: 'green'\n });\n }", "function displayComingSoonMessage(modal, title, message, ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Algoritma highestScore mencari nilai tertinggi yang spesifik dari parameter array of object 1. deklarasikan variabel hasil sebagai objek yang belum memiliki property, karena propertynya dinamis 2. lakukan looping dari indeks i sama dengan 0 sampai limit loopingnya adalah panjang array student 2a. deklarasikan variabel ...
function highestScore(students) { var hasil = {} for (var i = 0; i < students.length; i++) { var kelas = students[i].class if (hasil[kelas] === undefined ) { //hasil[kelas] undefined karena kelas itu sendiri masih kosong hasil[kelas] = { name: students[i].name, ...
[ "function highestScore2 (students) {\n // Code disini\n var result = {};\n //get top scorer\n for(var i = 0; i < students.length; i++){\n var thescore = students[i].score\n var thename = students[i].name\n var theclass = students[i].class\n var studentData = {\n name : thename,\n score : t...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Unregister, and removes the glass pane if nothing else is currently dependent on it.
unregisterAndDestroyGlassPane() { // caller is done with the glass pane; unregister this._glassPaneUsageStack.pop(); // If stack is empty, then nothing is currently dependent on the glass pane, so it's safe to remove if (this._glassPaneDrawn && this._glassPaneUsageStack.length === 0) { this.remov...
[ "unRegisterWithDocking() {\n routerClientInstance_1.default.transmit(\"DockingService.deregisterWindow\", { name: this.windowName });\n }", "dispose() {\n this.workspace_.getComponentManager().removeComponent('zoomControls');\n if (this.svgGroup_) {\n dom.removeNode(this.svgGroup_);\n }\n ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
5. Collect actual casefolders from activities and audit redaing action
async function auditCaseOpen( itcb ) { if( args.user.su ){ //do not audit system user return itcb( null ); } const caseFolderIds = [...new Set( [ ...(activities || []).map( activity => activity.caseFolderId ), ...
[ "async function getCaseFolders( itcb ) {\n let\n err,\n result,\n caseFolders;\n\n if( !activities.length ) {\n return itcb( null );\n }\n\n let caseFolderIds = activities.map( act...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Call the ASYNC get request for an image's metadata
function load_metadata(){ var url_string = window.location.href var url = new URL(url_string); var nasa_id = url.searchParams.get("nasa_id"); var query = "https://images-assets.nasa.gov/image/" + nasa_id + "/metadata.json"; var result = httpGetAsync(query, load_text); }
[ "static getMetadata(date) {\n return fetch(`https://epic.gsfc.nasa.gov/api/natural/date/${date}`)\n .then(response => {\n console.log(`Successfully fetched metadata for natural color images on ${date}`);\n return response.json();\n })\n .then(jsonResponse => {\n ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
This function at then end of the game build result file Function buildResultFile(map, player, sendingPath)
buildResultFile(map, player, sendingPath){ var fs = require('fs'); var path = require('path'); let msg = `C - ${map[0].length} - ${map.length}\r\n`; map.forEach((e, i) => { e.forEach((ee, ind) => { if(ee == 'M'){ msg += `M - ${i} - ${ind}\r\n`; } else if(ee > 0){ msg += `#{T comme Tréso...
[ "function buildTeam(){\n fs.writeFileSync(outputPath,render(teamArray), 'utf8')\n}", "completeTeam() {\n const data = template(this.manager, this.engineers, this.interns);\n this.writeToFile(data)\n this.copyFile()\n }", "function completeData() {\n console.log(\"Got the third ro...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Checks if two primitives can be combined based on their attributes, materials, and modes.
function readyToCombine(a, b) { if (a.material !== b.material || a.mode !== b.mode || defined(a.indices) !== defined(b.indices)) { return false; } var aKeys = Object.keys(a.attributes); var bKeys = Object.keys(b.attributes); if (aKeys.length !== bKeys.length) { return false;...
[ "canCombine(){\n let numOfVertex = this.vertexBufferArray[0].numOfVertex();\n let dataType = this.vertexBufferArray[0].getTypeOfValue();\n for(let vertexBuffer of this.vertexBufferArray){\n if(numOfVertex != vertexBuffer.numOfVertex() || dataType != vertexBuffer.getTypeOfValue()) return false;\n }\...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Maps an API record into our app domain.
function mapObsFromApiIntoOurDomain(obsFromApi) { // BEWARE: these records will be serialised into localStorage so things like // Dates will be flattened into something more primitive. For this reason, // it's best to keep everything simple. Alternatively, you can fix it by // hooking vuex-persistedstate to des...
[ "function transformAndEnrichRecordAPI(record) {\n\tfixFieldDataTypes(record);\n\taddInMissingFields(record);\n}", "function strapi2mergeRecord(strapiRecord) {\n\n\n let tmpResult;\n\n strapiRecord.domain = strapiRecord.idName;\n strapiRecord.web = strapiRecord.url;\n delete strapiRecord.url; // after ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
This function append the flakes passed as parameter to the canvas, moreover it makes them move marking them as new flakes, as soon the transition ends, the new flakes are marked as "moving" flakes so they can be controlled from the main "transition" function
function appendToCanvas(flakes) { var g = svg.selectAll() .data(flakes) .enter() .append('g') .classed('new snowflake', true) .style('fill-opacity', function(d) { return (d.radius - minRadius) / (maxRadius - minRadius) }) .attr('T', 0) .at...
[ "function drawFlakes() {\n console.log('fired');\n ctx.clearRect(0, 0, W, H);\n ctx.fillStyle = 'white';\n ctx.beginPath();\n for (let i = 0; i < mf; i++) {\n let f = flakes[i];\n ctx.moveTo(f.x, f.y);\n ctx.arc(f.x, f.y, f.r, 0, Math.PI * 2, true);\n }\n ctx.fill();\n moveFla...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Updates the checkin habits HTML table.
function update_checkin_habits_html_table(data_table) { var i = 0; var j = 0; var $table = $("#analytics-checkin-habits"); // Build header row. var header_row = "<tr>"; for (i = 0; i < data_table.getNumberOfColumns(); i++) { header_row += "<th>" + data_table.getColumnLabel(i) + "</th>"; } header_row += "</t...
[ "function updateBuddyList() {\r\n\tif (!buddyListTable) return;\r\n\tvar tbody = buddyListTable.tBodies[0];\r\n\tvar thead = document.createElement('thead');\r\n\tthead.appendChild(tbody.rows[0]);\r\n\tbuddyListTable.insertBefore(thead,tbody);\r\n\tvar ths = thead.getElementsByTagName('th');\r\n\tths[0].className =...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
scrNav function Change active dot according to the active section in the window
function scrNav() { var sTop = $(window).scrollTop(); $('section').each(function () { var id = $(this).attr('id'), offset = $(this).offset().top - 1, height = $(this).height(); if (sTop >= offset && s...
[ "function scrNav() {\n var sTop = $(window).scrollTop();\n $('section').each(function() {\n var id = $(this).attr('id'),\n offset = $(this).offset().top-1,\n height = $(this).height();\n if(sTop >= offset && sTop < offset + height) {\n link.removeClass('active');\n $(...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
specularLighting function: calulates the colors for specular lighting//
function specularLighting(normArray){ var specColors = []; for (var i=0; i<normArray.length; i++){ var norm = new Vector3([normArray[i].x, normArray[i].y, normArray[i].z]); var lightDir = new Vector3([1, 1, 1]); lightDir.normalize(); //halfway vector var ...
[ "function specularLighting(normArray){\r\n var specColors = [];\r\n for (var i=0; i<normArray.length; i++){\r\n var norm = new Vector3([normArray[i].x, normArray[i].y, normArray[i].z]);\r\n var lightDir = new Vector3([1, 1, 1]);\r\n lightDir.normalize();\r\n\r\n //cos(theta) = dot ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
return a < 13 ? `You're a(n) kid` : a < 18 ? `You're a(n) teenager` : a < 65 ? `You're a(n) adult` : `You're a(n) elderly` }
function describeAge(age) { return "You're a(n) " + (age < 13 ? "kid" : age < 18 ? "teenager" : age < 65 ? "adult" : "elderly") }
[ "function describeAge(a){\n return `You're a(n) ${a<13?'kid':a<18?'teenager':a<65?'adult':'elderly'}`\n}", "function describeAge(age) {\n return \"You're a(n) \" + (age < 13 ? \"kid\" : age < 18 ? \"teenager\" : age < 65 ? \"adult\" : \"elderly\")\n}", "function basicTeenager(age) {\n if (13 <= age && age ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
NB: Slides are always done by the visible upper page.
function slideIn(callback) { setX(upperPage(), 0, slideOpts(), callback); }
[ "function viewPageSlider() {\n _setPage(_getSliderPage());\n}", "function keepSlidesPosition() {\n $(SLIDE_ACTIVE_SEL).each(function() {\n silentLandscapeScroll($(this), \"internal\");\n });\n }", "function keepSlidesPosition() {\n $(SLIDE_ACTIVE_SEL).each...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Correct floating point error
function _correctFloatingPointError(number, precision) { precision = precision || 10; var correction = Math.pow(10, precision); var result = correction * number; result = result > 0 ? Math.floor(result) : Math.ceil(result); return result / correction; ...
[ "function enforceFloat() {\r\n var valid = /^\\-?\\d+\\.\\d*$|^\\-?[\\d]*$/;\r\n var number = /\\-\\d+\\.\\d*|\\-[\\d]*|[\\d]+\\.[\\d]*|[\\d]+/;\r\n if (!valid.test(this.value)) {\r\n var n = this.value.match(number);\r\n this.value = n ? n[0] : '';\r\n }\r\n}", "function enforceFloat() {\n var valid =...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
forces a number to an integer between 0 and 127 inclusive, in line with MIDI standard.
function clipInt0to127(x) { return Math.min(Math.max(Math.round(x), 0), 127); }
[ "function NumbersOnly(Sender, key) {\r\n\tif (key != RegexMatch(key, \"[\\\\x00\\\\x08\\\\x09\\\\x0D\\\\x1B\\\\d]\", true)) key = chr(0);\r\n}", "function limit (v) {\n return Math.min(0xff, Math.max(0, Math.round(v)))\n }", "function en2mm(num) {\r\n var nums = { '0': '၀', 1: '၁', 2: '၂', 3:...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Handler get sections from api
getSections() { return fetch(this.url)// eslint-disable-line .then(res => res.json()) .then(result => result.sections) .catch(err => console.error(err)) // eslint-disable-line }
[ "function getSections() {\n return $http({\n method: 'GET',\n url: Routing.generate(\n 'api_sections_get'\n )\n }).then(function (result) {\n return result.data;\n });\n }", "static getSections (year, term) {\n let url = URL...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
When the value of layers drop down is changed
function onChangeLayer(dropdown,checkbox) { var selectedIndex = dropdown.selectedIndex; layerIndex = selectedIndex+1; //+1 is because of google layer layerId = layersList[selectedIndex][0]; layerName = layersList[selectedIndex][1]; document.getElementById('info').innerHTML = ""; currentPolygonI...
[ "function changeLayer() {\r\n\r\n\tvar dropdownLayer = document.getElementById(\"dropDownLayer\");\r\n\r\n\tvar dropdownFields = document.getElementById(\"dropDownFields\");\r\n\tvar dropdownValue = document.getElementById(\"dropDownValue\");\r\n\r\n\t// Clear old field options\r\n\tfor (var i = dropdownFields.opti...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Manager inquirer code, uses inquirer to ask questions then use the Manager class to create a new Manager and push manager into the employeeArray
function promptManager() { return inquirer.prompt([ { type: "input", name: "ManagerName", message: "What is the Manager's name?" }, { type: "input", name: "ManagerID", message: "What is the Manager's employee ID?" }, { type: "input", ...
[ "function createManager() {\n inquirer.prompt([\n {\n type: \"input\",\n message: \"Enter Manager's name: \",\n name: \"name\"\n }, {\n type: \"input\",\n message: \"Enter Manager's email: \",\n na...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
creating resize button dynamically with an dynamic button id
function createButton(bot) { var butu='<div class="leaflet-control-container" >'+ '<div class="leaflet-top leaflet-right">'+ '<div class="leaflet-control-zoom leaflet-bar leaflet-control">'+ '<button type="button" id='+bot+'>Resizer</button>'+ ...
[ "function sizeToggleBtn() {\r\n var container = $(\"<div></div>\"),\r\n userInterface = $(\"<div title=\\\"Maximize\\\"></div>\"),\r\n content = $(\"<span class=\\\"typcn typcn-arrow-maximise\\\"></span>\");\r\n\r\n container.css({ \"padding\": \"5px\" });\r\n ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Activating the website main menu elements according to the given slide name.
function activateMenuElement(name) { $(options.menu).forEach(function (menu) { if (options.menu && menu != null) { removeClass($(ACTIVE_SEL, menu), ACTIVE); addClass($('[data-menuanchor="' + name + '"]', menu), ACTIVE); } }); }
[ "function activateMenuElement(name){\n $(options.menu).forEach(function(menu) {\n if(options.menu && menu != null){\n removeClass($(ACTIVE_SEL, menu), ACTIVE);\n addClass($('[data-menuanchor=\"'+name+'\"]', menu), ACTIVE);\n }\n ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Get MIDI data from a set of Timeline instrument channels. Outputs multitrack MIDI for Timelines with multiple channels.
function toMIDI(channels) { var channelsToAdd = channels.filter(function (c) { return !!c.events.length; }), numCh = channelsToAdd.length, multiCh = numCh > 1; return new Uint8Array(getHeader(multiCh ? numCh + 1 : numCh).concat(multiCh ? getTrackChunk([], true) : ...
[ "function toMIDI(channels) {\n const channelsToAdd = channels.filter((c) => !!c.events.length), numCh = channelsToAdd.length, multiCh = numCh > 1;\n return new Uint8Array(getHeader(multiCh ? numCh + 1 : numCh).concat(multiCh ? getTrackChunk([], true) : [], // Time info only\n channelsToAdd.reduce((chunks, ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Adds a new type.
addType(id, data) { this.types[id] = new TypeData(data); }
[ "function addType(type) {\n helper.addTypeToStore(store, type);\n }", "function addType(type) {\n helper.addTypeToStore(store, type);\n }", "addType(type, config) {\r\n\t\tthis._types.set(type, new EntityType(config));\r\n\t}", "function addType(typeDef) {\n myTypeTable[ty...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }