query
stringlengths
9
34k
document
stringlengths
8
5.39M
negatives
listlengths
19
20
metadata
dict
Using the CQ server search for traits. This will after asynchronously calling the server.
function searchForTraits(field, newV, oldV, listToUpdate) { if (newV !== oldV) { listToUpdate.hide(); CQ.Ext.Msg.wait(CQ.I18n.getMessage("Searching....")); $.getJSON(traitLookupUrl, { q : newV }, function(result) { CQ.Ext.Msg.wait(C...
[ "function selectAvailableTraits(callback) {\n if (mockup) {\n availableTraits = {\n 73801 : {\n title : \"Trait 73801\"\n },\n 73802 : {\n ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Applies reset styles to the textarea and clone Stores the original textarea styles in case of destroying
function _resetStyles() { scope._oldTextareaStyles = scope.$textarea.attr('style'); scope.$textarea.css({ margin: 0, webkitBoxSizing: "border-box", mozBoxSizing: "border-box", boxSizing: "border-box", width: "100%" }); }
[ "function _setCloneStyles() {\n\t\t\t\t\tvar css = {\n\t\t\t\t\t\tdisplay: 'block',\n\t\t\t\t\t\tborder: '0 solid',\n\t\t\t\t\t\tvisibility: 'hidden',\n\t\t\t\t\t\tminHeight: scope.$textarea.prop('offsetHeight')\n\t\t\t\t\t};\n\n\t\t\t\t\tif(scope.$textarea.attr(\"wrap\") === \"off\") css.overflowX = \"scro...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Add a single message file to the list of loading functions using the file name as the bundle name. The loader will only be added if the bundle name is not already taken.
static importMessageFile(packageName, filePath) { if (path.extname(filePath) !== '.json' && path.extname(filePath) !== '.js') { throw new Error(`Only json and js message files are allowed, not ${path.extname(filePath)}`); } const bundleName = path.basename(filePath, path.extname(file...
[ "function loadFile() {\n loadStrings('files/spam.txt', fileLoaded);\n}", "function AddPreloadedFile(file, element) {\n if (_preloadedFiles.hasOwnProperty(file))\n console.log(\"Warning (Preload): overriding duplicate file '\"+file+\"'\");\n _preloadedFiles[file] = element;\n // Go...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
end bornosoft_keyboard_map Maps an ASCII character to its equivalent unicode character according to selected layout. \param C The ASCII character to find its Map Coded by : S M Mahbub Murshed Date: August 30, 2006
function MapUnicodeCharacter(C) { if(KeyBoardLayout == BIJOY) return bijoy_keyboard_map[C]; else if(KeyBoardLayout == UNIJOY) return unijoy_keyboard_map[C]; else if(KeyBoardLayout == PROBHAT) return probhat_keyboard_map[C]; else if(KeyBoardLayout == SWIPHONETIC) return somewherein_phonetic_keyboard...
[ "function charMap(code) {\r\n if(code==32) { return [\" \",'0 0 0 0']; } // space\r\n\r\n if(code==65 || code=='A') { return [\"𝐴\",'0 0 0 0']; } // A\r\n if(code==66 || code=='B') { return [\"𝐵\",'0 .17em 0 0']; }\r\n if(code==67 || code=='C') { return [\"𝐶\",'0 .1em 0 0']; }// C\r...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
add Store to the global SuperStore, under the hood it override the state pointer of each store with the global one
addStore(store) { // keep a reference to the store to easy access this[store.constructor.name] = store // fetch all the store's state and put in the superStore for (let key in store.state) { Vue.set(this.state, key, store.state[key]) } //override state pointer...
[ "addStore(store) {\n if (this[store.constructor.name])\n throw new Error(SuperStoreError.STORE_ALREADY_ADDED(store.constructor.name))\n\n if (!store || store === undefined)\n throw new Error(SuperStoreError.STORE_NULL)\n\n if (store instanceof Store)\n this._registerStoreToDispatcher(store)\...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Classic append for onload event to avoid overriding
function AppendOnLoad(fx) { var old = window.onload; if (typeof old != 'function') { window.onload = fx; } else { window.onload = function() { old(); fx(); }; } }
[ "function appendOnLoad(fx) {\n\t\ttry { // For browsers that know DOMContentLoaded (FF, Safari, Opera)\n\t\t\tdocument.addEventListener('DOMContentLoaded', fx, false);\n\t\t}\n\t\tcatch(e) { // for IE and older browser\n\t\t\ttry {\n\t\t\t\tdocument.addEventListener('load', fx, false);\n\t\t\t}\n\t\t\tcatch(ee) {\n...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
var marks = 0; "s" is a parameter which is entered as an argument at "checkAnswers( questions[i] )" in the function "function checkAll()". and questions[i] is an array index will retrieve the content of the document, by using object "document.getElementsByName(s)"
function checkAnswers(s) { var answers = document.getElementsByName(s); //getting all the radio buttons named as a1 || a2 || a3 ..ect var noOfAnswers = answers.length; //check how many answers are there named as a1 //console.log( noOfAnswers ); var marks = 0; for(var i = 0; i < noOfAnswers; i++) // ...
[ "function evalMultiAnswer(qnId,answer,maxMarks){\n var userInput = false;\n var question = getElement(qnId); \n var multiAnsInputs = question.getElementsByTagName(\"input\");\n var score = 0;\n var ansCorArray = answer.split(\" \");\n var optScore = maxMarks/ansCorArray.length;\n for(var i=0; i...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
This function starts drawing the loading animation
startDrawing() { var canvas = this.context.getContext("2d"); canvas.save(); this.updateAnimation = true; var infographic = this; window.requestAnimationFrame(function () { infographic.drawLoading(); }); }
[ "drawLoading() {\n var canvas = this.context.getContext(\"2d\");\n var halfDim = { w: this.context.width / 2, h: this.context.height / 2 };\n\n canvas.globalCompositeOperation = 'destination-over';\n canvas.clearRect(0, 0, halfDim.w * 2, halfDim.h * 2);\n canvas.fillStyle = 'rgba(...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
apply a mapping of Arrays of mixin methods to a component prototype
function applyMixins(proto, mixins) { for (var key in mixins) { if (mixins.hasOwnProperty(key)) { proto[key] = multihook(mixins[key].concat(proto[key] || ARR), key === 'getDefaultProps' || key === 'getInitialState' || key === 'getChildContext'); } } }
[ "function applyMixins(proto, mixins) {\n \tfor (var key in mixins)\n \t\t{ if (mixins.hasOwnProperty(key)) {\n \t\t\tproto[key] = multihook(\n \t\t\t\tmixins[key].concat(proto[key] || ARR),\n \t\t\t\tkey === 'getDefaultProps' || key === 'getInitialState' || key === 'getChildContext'\n \t\t\t);\n ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
deletes a given ride
function deleteRide(ride_id) { var httpRequest = new XMLHttpRequest(); // var turl = "http://localhost/final/data.php"; httpRequest.open('POST', turl, true); var params = "action=deleteRide&ride_id="+ride_id; httpRequest.setRequestHeader("Content-type", "application/x-www-form-urlencoded"); httpRequest.send(param...
[ "function delete_ride(ride_id, callback) {\n $.ajax({\n url: \"api/rides\" + \"/\" + ride_id,\n type: \"DELETE\",\n success: callback,\n });\n}", "static deleteRide(req, res) {\n if (typeof req.params.id === 'string') {\n return ride.delete(req, res);\n }\n return res.stat...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Render a chunk of text, typically one line (but for justified text we render each word as a separate Text object, because spacing is variable). Returns true when it finished the current node. After each chunk it updates `start` to just after the last rendered character.
function doChunk() { var origStart = start; var box, pos = text.substr(start).search(/\S/); start += pos; if (pos < 0 || start >= end) { return true; } // Select a single character to determine the height of a line of text. The box.bottom //...
[ "function doChunk() {\n\t var origStart = start;\n\t var box, pos = text.substr(start).search(/\\S/);\n\t start += pos;\n\t if (pos < 0 || start >= end) {\n\t return true;\n\t }\n\n\t // Select a single character to determine the height of a line of text. The bo...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Create new document instance, called when you create new instance of your resource after all assignments are already done, but immediately before saving it to your database.
async createDocument(scope) { scope.model = await this.dataSource.create({}); }
[ "createDocument(documentId, initialChange, cb) {\n this.addChange(documentId, initialChange, cb)\n }", "function createDocument() {\n\t// var op = {\n\t// \"command\": \"document:create\",\n\t// \"data\": {\n\t// \t \"name\": \"project-1\",\n\t// \t \"user\": \"michael\",\n\t// \t \"rev\": 4,\n\t// \t ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Check if database is nearly full If so, delete data that can be deleted
function checkDataSize () { DataPoint.collection.stats() .then(result => { // calculate percentage of used disk space const storageSize = result.storageSize / (1024 * 1024); const maxGB = config.maxDatabaseSize; const usedStorage = storageSize / (maxGB * 1000); if (usedStorag...
[ "resetDataBaseIfReachedLimit() {\n FileSystem.readFile(this.database.path, (error, data) => {\n const allRecords = JSON.parse(data);\n if(allRecords.length > 900)\n this.initialDatabase();\n });\n }", "emptyIfFull() {\n let msg = \"Collection is full. Emptying now.\";\n...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Create a new activity record for this phone call using appropriate CIF APIs.
createCallActivity() { var phActivity = {}; //Setup basic details of the activity - subject, direction, duration phActivity["phonenumber"] = this._number; phActivity["subject"] = "Call with " + this.name; phActivity["directioncode"] = this.direction == CallDirection.Incoming ? fa...
[ "createCallActivity() {\n var phActivity = {};\n //Setup basic details of the activity - subject, direction, duration\n phActivity[\"phonenumber\"] = this._number;\n phActivity[\"subject\"] = \"Call with \" + this.name + \" at \" + this._timer.startTime.toLocaleTimeString();\n phA...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Option validator for a Buffer file system option.
function bufferValidator(v, cb) { if (Buffer.isBuffer(v)) { cb(); } else { cb(new ApiError(ErrorCode.EINVAL, "option must be a Buffer.")); } }
[ "function bufferValidator(v, cb) {\n\t if (Buffer.isBuffer(v)) {\n\t cb();\n\t }\n\t else {\n\t cb(new ApiError(ErrorCode.EINVAL, \"option must be a Buffer.\"));\n\t }\n\t}", "function bufferValidator(v, cb) {\n if (Buffer.isBuffer(v)) {\n cb();\n }\n else {\n cb(n...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Insert a user user is the object to insert into the collection callback has two arguments error and result
insertUser(user, callback = (error, result) => {}){ this.connect((error, database) => { if (error){ callback(error); } else { // LAB 1 // Implement the query to insert a user // user is the document that we want to insert // remeber once it's finish to comment cal...
[ "insertUser (user, callback = (error, result) => { if (error) callback(error) }) {\n this.connect((error, database) => {\n if (error) {\n callback(error)\n } else {\n // LAB 1\n // Implement the query to insert a user\n // user is the document that we want to insert\n ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Adds a bubble to the chat
function appendBubble(text) { var bubble = $("<div>") .text(text) .addClass("float-right") .addClass("chat_bubble"); $("#chat_text").append(bubble); }
[ "function addBubble(message, type) {\n let time = getTime();\n // create chatList item\n let listItem = document.createElement(\"li\");\n listItem.classList.add(\"listItem\");\n // create bubble element\n let bubbleDiv = document.createElement(\"div\");\n let textMessage = document.createElement(\"p\"); //...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Set global session vars
function setGlobalSessionInfo(res, jqXHR){ CSRF_ParamName = jqXHR.getResponseHeader('X-CSRF-PARAM'); CSRF_token = jqXHR.getResponseHeader('X-CSRF-TOKEN'); }
[ "function SetSessionVariables() {\n Session.set(\"page\", 'main'); //Default page\n Session.set(\"teams\", []); //Teams Object Array\n Session.set(\"players\", []); //Global Player Object Array\n \n Session.set(\"game_name\", null); //Name of the game the user set\n Session.set(\"team_size\", 2); ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Opens a request and sends messages.
open(messages = []) { if (this.disabled || this.loading) { // Never loose messages, even if right now this situation should // not possible, its better to handle them always. this.multiplexer.add(messages) return } this.loading = true this.request = request({ url: this.op...
[ "performRequest() {\n this._debug('performRequest');\n const channel = this._reserveChannel();\n if (!channel) {\n this._error('Could not acquire lookup channel');\n return;\n }\n this.initializeStatusDisplay();\n if (this.output) {\n this.c...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Heavily modified star object. Most of the actual physics is conducted using global arrays However Star objects are still used to draw the stars and their paths They also keep the colour and mass consistent, since these terms determine how the star is draw The position update function should be called to change the posi...
function Star(m_, colour_, planet_flag_) { this.pos = createVector(0, 0, 0); this.m = m_; this.r = scale_radius * sqrt(m_); this.path = []; this.colour = colour_; //draws an elipse representing the star this.draw = function () { //draw the star //220 for white if (pl...
[ "function StarField(context, numberStars, startX, startY, width, height, direction, velocity) { \n this.context = context; // Context of Canvas on which stars are drawn\n this.startX = startX;\n this.startY = startY;\n this.startZ = 0;\n this.widt...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Build a standalone Inferno entry module, component or VNode.
function serveInferno(args, cb) { if (args._.length === 1) { return cb(new _errors.UserError('An entry module must be specified.')); } (0, _runSeries2.default)([function (cb) { return (0, _utils.install)(['inferno', 'inferno-component', 'inferno-compat'], { args, check: true }, cb); }, function (cb) { ...
[ "function buildConfig(args) {\n let entry = path.resolve(args._[1])\n let mountId = args['mount-id'] || 'app'\n\n let config = {\n babel: {\n presets: ['inferno'],\n stage: 0,\n },\n output: {\n filename: 'app.js',\n path: process.cwd(),\n publicPath: '/',\n },\n plugins: ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
cartodb layer group view
function LayerGroupView(base) { var GMapsCartoDBLayerGroupView = function(layerModel, gmapsMap) { var self = this; var hovers = []; _.bindAll(this, 'featureOut', 'featureOver', 'featureClick'); var opts = _.clone(layerModel.attributes); opts.map = gmapsMap; var // preserve the user's call...
[ "showFeatureGroup (groupId, map) {\n this.currentLayer = this.indexedFeatures()[groupId]\n map.addLayer(this.currentLayer)\n }", "function showGroups(){\n $.getJSON(\"https://\"+cartoDBUserName+\".cartodb.com/api/v2/sql?format=GeoJSON&q=\"+sqlQuerygroup, function(buffer) {\n Buffer_locations = L.geoJson(...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Writes the table to the page.
function writeTableData() { // Creates a tbody element. var finalTbody = document.createElement("tbody"); // Loop through the table data for (var i = 0; i < tableData.length; i++) { // Get the current row. var current = tableData[i]; // Make a new row ...
[ "writeTable(streamWriter, table) {\n for (let i = 0; i < table.rows.length; i++) {\n let row = table.rows[i];\n for (let j = 0; j < row.cells.length; j++) {\n let cell = row.cells[j];\n this.writeBody(streamWriter, cell.blocks);\n }\n }\n ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Remove all files and directories in the working directory without removing the working directory itself.
async clearWorkingDir() { for (const file of await this.list()) { if (file.isDirectory) { await this.cd(file.name); await this.clearWorkingDir(); await this.cdup(); await this.removeEmptyDir(file.name); } else { ...
[ "async clearWorkingDir() {\n for (const file of await this.list()) {\n if (file.isDirectory) {\n await this.cd(file.name);\n await this.clearWorkingDir();\n await this.cdup();\n await this.removeEmptyDir(file.name);\n } else {\n await t...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Display a deathscreen for level 2 when called
function Deathscreen2(SmaeX,SmaeY){ background(0); image(DeathScreen,0,SmaeY); fill(255,0,0); textSize(72); text('Defeat',515,SmaeY+150) textSize(36); text('Press Number 2 to Retry',425,SmaeY+300); noLoop(); }
[ "death() {\n // update the HUD, so it doesn't vanish\n engine.gfxController.drawScore(scoreStr, engine.storage.getCachedScore());\n engine.gfxController.drawHealth(healthStr, engine.playerMngr.getHP());\n engine.gfxController.drawHighscore(\n highScoreStr,\n engine....
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
function to initiate transition and show a row
function showRow(row, type) { row.className = type + " toShow"; transitioning = false; }
[ "function rowToggle() {\n if (direction) {\n if (row >= 0) {\n $(trs[row]).hide();\n row--;\n timeout = setTimeout(rowToggle, 20);\n }\n }\n else {\n if (row < trs.length) {\n $(trs[row]).removeClass('js-...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Filters by version and component name
function filterByComponentAndVersion(compName, compPos, versionNumber, versionPos, cssTableName) { var oTable = jQuery(cssTableName).dataTable(); var oSettings = oTable.fnSettings(); var compFilter = oSettings.aoPreSearchCols[ compPos ].sSearch; var versionFilter = oSettings.aoPreSearchCols[ versionPos ].sSearch;...
[ "_filterComponentsWithLowerVersions(componentsWithDependencies) {\n return componentsWithDependencies.filter(comp => {\n const sameIdHigherVersion = componentsWithDependencies.find(c => !c.component.id.isEqual(comp.component.id) && c.component.id.isEqualWithoutVersion(comp.component.id) && (0, _componentVer...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Call all necessary method to pass a period and calculate all variable. set phase (if period egal max period) and set period. if enter in phase 2, change pageGantt and pageTask then call function setWeekliesVariables to calculate values like gauges and EV, AC, ... if period is passed in phase realisation, calculate task...
function nextPeriod() { CURRENT_PERIOD_NUMBER = PMGHelper.getCurrentPeriodNumber(); CURRENT_PHASE_NUMBER = PMGHelper.getCurrentPhaseNumber(); var currentPhase = PMGHelper.getCurrentPhase(), currentPeriod = PMGHelper.getCurrentPeriod(); assertAllPeriodQuestionAnswered(); ...
[ "function nextPeriod() {\n var currentPhase = PMGSimulation.getCurrentPhase(),\n currentPeriod = PMGSimulation.getCurrentPeriod();\n\n allPhaseQuestionAnswered(); // First Check if all questions are answered\n assertAdvancementLimit();\n\n Variable....
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
connects to a given peripheral and displays information about it
function connectToPeripheral(peripheral) { peripheral.connect(function(error) { try { let peripheralAddrName = peripheral.address + ' (' + JSON.stringify(peripheral.advertisement.localName) + ')'; peripheral.addrName = peripheralAddrName; if (targetDevices.indexOf(peripheral.address) < 0) { ...
[ "function connect(){\n $(\"#message\").append(\"<p>\\n\\nBluetooth is on</p>\");\n console.log(\"bluetooth is on at mac \"+mac_add);\n /* connect to the hard coded MAC address of the PI */\n bluetoothSerial.connect(mac_add, con_success, con_failure);\n}", "connect(id) {\n debug('[connect]\\n\\t' + id);\n ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
returns text with regard to SEO. Visible text and image alt text,
function seoText(node) { let tempNodes = []; [...node.querySelectorAll("img")].forEach((image) => { if (image.alt && image.alt.trim().length > 0) { var span = image.ownerDocument.createElement("SPAN"); span.innerText = " ["+image.alt.trim()+"] "; image.parentNode.insertBefore(...
[ "function hideDescrText(){\n\n\t\t// скрываем изображение и заголовки\n\t\t$(img).show();\n\t\t// $(title).show();\n\n\t\t// скрываем текст\n\t\t$(text).hide();\n\n\t}", "function display_seo_text() {\n if ($('#dbv_seo_text').length && $('#dbv_seo_block').length) {\n $('#dbv_seo_block').html($('#dbv_seo...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Add w to the sets at map indices [lo, hi]
static addToDivvy(w, lo, hi) { for (let i = lo; i <= hi; i++) { if (!this.divvy.has(i)) this.divvy.set(i, new Set()); if (DEBUG_MODE && this.divvy.get(i).has(w)) throw new Error("programmer error: addtodivvy adding a dup"); this.divvy.get(i).ad...
[ "addToSet(cell, set, sets, cellsToSets) {\n const cellIndex = cell.index;\n\n cellsToSets[cellIndex] = set;\n\n if (!sets.hasOwnProperty(set)) {\n // create a new array\n sets[set] = [];\n }\n\n sets[set].push(cellIndex);\n }", "function addWord(w, map) {\n if (!map.hasOwnProperty(w)) {...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
function to update the current entity's representation on the page preview
function updateEntityPreviewContent() { if (currentEntity) { // first get the contentContainer for the entity's preview var contentContainer = $("#" + currentEntity.id + " > div"); // create the contentContainer if it doesn't exist: if (!contentContainer[0]) content...
[ "function updatePagePreview() {\r\n // clear whatever was in the page preview\r\n pagePreviewDiv.empty();\r\n // for each entity in the entity list\r\n for (var i = 0; i < entityList.length; ++i) {\r\n // set this entity as current\r\n currentEntity = entityList[i];\r\n // update th...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
replicate packages, then when we don't see any updates for a full second, do the users.
function replicatePackages() { console.error('replicate packages (around 1/256th of the registry)') new Replicator({ from: 'http://couch.ctx.io/registry', to: 'http://admin:admin@localhost:15984/registry', filter: filterPackage }).push(function() { if (didMorePackages) return clearTimeout(more...
[ "function updatePackages() {\n\tvar dataDir = getDataDirectory();\n\n\tfs.readdir(dataDir, function(err, files) {\n\t\tfiles.forEach(function(file) {\n\t\t\tvar name = path.basename(file, '.json');\n\n\t\t\tvar infoFilePath = path.join(dataDir, file);\n\t\t\tfs.readFile(infoFilePath, 'utf8', function(err, data) {\n...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
This is a function to make a contour plot of a bivariate normal Note that the actual densities are calculated within the fxn
function makeBivarNormContourData (muX,muY,sigmaX,sigmaY,rho,resolution,nlev, thresh) { // calculate ranges var xRange = [muX-3*sigmaX, muX+3*sigmaX]; var yRange = [muY-3*sigmaY, muY+3*sigmaY]; // create xx and yy arrays (which give support of density) var xx = jStat.seq(xRange[0], xRang...
[ "function bivariateNormal(x,y,muX,muY,sigmaX,sigmaY,rho){\n \t\tvar det = Math.pow(sigmaX,2)*Math.pow(sigmaY,2)-Math.pow(rho,2)*Math.pow(sigmaX,2)*Math.pow(sigmaY,2);\n \t\tvar epower = -1/2*1/(1-Math.pow(rho,2))*(Math.pow((x-muX),2)/Math.pow(sigmaX,2) - 2*rho*(x-muX)*(y-muY)/(sigmaX*sigmaY)+Math.pow((y-muY),2)/Mat...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
This is a Catberry Catcomponent file. More details can be found here Creates new instance of the "masterblockabout" component.
function MasterBlockAbout() { this.tp = new Typograf({lang: 'ru'}); }
[ "function creatAboutPanel() {\n\t\treturn new Ext.Panel({\n\t\t\tborder : true,\n\t\t\tid : 'infoPanel',\n\t\t\tbaseCls : 'md-info',\n\t\t\tautoWidth : true,\n\t\t\t// contentEl: 'infoContent',\n\t\t\tautoLoad : {\n\t\t\t\turl : catalogue.services.rootUrl + '/about?modal=true',\n\t\t\t\tcallback : loadCallback,\n\t...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
doubleAndReturnArgs 4. Write a function called doubleAndReturnArgs which accepts an array and a variable number of arguments.The function should return a new array with the original array values and all of additional arguments doubled.
function doubleAndReturnArgs(arr, ...nums){ nums.map( val => { const double = val * 2; arr.push(double); }) return arr; }
[ "function doubleAndReturnArgs(array,...args) {\n function double(n) {return n * 2};\n return [...array, double(...args)];\n}", "function doubleAndReturnArgs(arr, ...args) {\n let doubled = args.map((n) => {\n return n * 2;\n });\n let newArr = [...arr, ...doubled];\n return newArr;\n}", "function d...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Loads lead data for the given timeframe and format.
async fetchLeads(timeframe, format) { const url = this.createUrlBuilder() .setSubPath("leads" /* LEADS */) .setFileType("txt" /* TEXT */) .setTimeframe(timeframe) .setFormat(format) .build(); return leads_1.leadsFromString(await this.request(ur...
[ "function loadHistoricalData(){\n\ttry{\n\t\tconsole.log(\"Loading Historical Data\");\n\n\t\tlet data = String(fs.readFileSync(historicalData));\n\t\tlet lines = data.split(\"\\n\"); //downloaded from yahoo finance\n\t\tlines.shift();\n\t\tlines.forEach((line) => {\n\t\t\tlet splitData = line.split(',');\n\t\t\tle...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
adds a welcome message for whoever is insession to the navigation bar
function addWelcome(){ var name = getCookie("name"); if (!name) { //in case this is called without the cookie being set throw new Error("User's name was not set"); } var nav = document.getElementById("navigation"); var navList = nav.lastElementChild; var welcome = document.createElement("li"); welcome.innerHT...
[ "function set_welcome_message(message) {\tdocument.getElementById(\"welcome_message\").innerHTML = message; }", "function showNavForLoggedInUser() {\n $navLogin.hide();\n $navLogOut.show();\n $navHeaders.show();\n $navName.text(currentUser.username);\n $(\"#nav-welcome\").show();\n }", "displayW...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
searchByAge : given a age attribute, this method tries to search it in the data store. param ageToSearch : the value to search return itemId : the id of the first item found or item_not_found in other case.
searchByAge( ageToSearch ) { let itemId = this.ItemNotFound; let list = this.state[this.townName]; for( let indx=0; indx<list.length; ++indx ) { if( list[indx].age.toString() === ageToSearch ) { itemId = list[indx].id; break; } } console.log('sear...
[ "searchByHeight( heightToSearch ) {\n let itemId = this.ItemNotFound;\n let list = this.state[this.townName];\n \n for( let indx=0; indx<list.length; ++indx ) {\n if( list[indx].height.toString() === heightToSearch ) {\n itemId = list[indx].id;\n break;\n }\n ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Edita a img selecionada no campo
editImg(img, id) { this.state.formFields.map( (fieldItem, index) => { if (id === index) { fieldItem.fieldName = img.fieldName; fieldItem.fieldContent = img.fieldContent; fieldItem.isText = false; fieldItem.fileLink = img.fileLink } //this.state.formFields[index] = fieldItem; }); this.s...
[ "function editImage(selImg) {\n initEditor(selImg);\n}", "function editImg(imag) {\r\n // copy image information to form\r\n formUrl.value = imag.img;\r\n\r\n // disable add button\r\n addButton.disabled = true;\r\n\r\n // clear all events update button events\r\n clearUpdateButtonEvents();\r...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Declares AutoBrowser's exported functions, their input and output types, as well as their names, and other metadata that helps automata run most efficiently to the Automata engine, the first time Automata encounters the AutoBrowser plugin.
function theInterface(automata){ automata.makeSet( { 'name': 'AutoBrowser' }, function(set){ set.block.begins('init', function(){ }) set.block('visit', function(block){ block.takes.url(); block.outputs(automata.boolean); }); ...
[ "function Automation() {\n}", "function Tools()\n{\n}", "function setup() {\n\t\n\t // Rect annotation button.\n\t $('.js-tool-btn-rect').off('click').on('click', function (e) {\n\t\n\t var $btn = $(e.currentTarget);\n\t\n\t // Make disable.\n\t if ($btn.hasClass('active')) {\n\t ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Gets a query string parameter by name, returns a list which may have multiple values for a querystring such as ?q=1&q=2
function getParameterByName(name, queryString) { name = name.replace(/[\[]/, "\\\[").replace(/[\]]/, "\\\]"); var regexS = '(?:\\?|&(?:amp;)?)(' + name + ')(?:=?([^&#]*))'; var regex = new RegExp(regexS, 'g'); var results; var resultsAsAList = []; queryString = queryString || window.location.sea...
[ "function getParameterByName(name, queryString) {\n name = name.replace(/[\\[]/, \"\\\\\\[\").replace(/[\\]]/, \"\\\\\\]\");\n var regexS = '(?:\\\\?|&(?:amp;)?)(' + name + ')(?:=?([^&#]*))';\n var regex = new RegExp(regexS, 'g');\n var results;\n var resultsAsAList = [];\n ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Registers a plugin with the loader.
addPlugin(pluginName, implementation) { this.loaderPlugins[pluginName] = implementation; }
[ "register(plugin) {\n if (!(plugin instanceof Plugin)) {\n plugin = new Plugin(plugin);\n }\n if (plugin.register) {\n plugin.register();\n }\n this.registry.add(plugin);\n }", "function registerPlugin(plugin) {\n data.plugins.push(plugin);\n}", "function registerPlu...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
All Meteor Canvas components that render to a canvas should use the CanvasComponent template.
static template() { return 'CanvasComponent'; }
[ "function Canvas() {\n return (\n <div id='canvas-container'>\n <canvas width='425px' height='300px' id='canvas' />\n </div>\n )\n}", "function renderTemplate() {\n\t\tif (canvas)\n\t\t\tcanvas.repaint();\n\t}", "canvasContext() {\n this._canvas = this.template.querySelecto...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Operations about the HOSTING_RESELLER service [PRODUCTION] [See on api.ovh.com](
ListAvailableServices() { let url = `/hosting/reseller`; return this.client.request('GET', url); }
[ "getHostings() {\n return this.OvhHttp.get('/hosting/web', {\n rootPath: 'apiv6',\n });\n }", "getAgentRefferal(data){\nreturn this.post(Config.API_URL + Constant.AGENT_GETAGENTREFFERAL, data);\n}", "function EfwServerRest() {\n\n}", "function getServiceCatalog () {\n return [\n ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Checks whether the runtime is a WebView.
function isWebView() { return IS_IOS_WEBVIEW || IS_ANDROID_WEBVIEW; }
[ "function isEmbedded() {\r\n return isWebView() || isIframe();\r\n }", "isWeb() {\n return (typeof window != 'undefined');\n }", "function isWebPage(what) {\n if (!what || !isType(what, \"object\")) {\n return false;\n }\n if (phantom.version.major <= 1 && phantom.v...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
override save() in order to automatically save projects along with the collective decision
save(){ return this._super() // firstly persist the collective decision .then( savedCD => savedCD._saveProjects() ); // then persist the child projects }
[ "function saveProject() {\n const project = getProjectInitialState();\n downloadCode(project);\n project.setCode(getXml());\n}", "function _saveProjectDetail() {\n if ($scope.projectForm.$valid) {\n $scope.project.startdate = $scope.project.startdateCn;\n $scope.project.enddate = $...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
starts the ringtone and shows the modal that alarm is ringing
function fireAlarm(x) { console.log("fire alarm getting called") jQuery.noConflict(); $('#alarmModal').modal('show'); //deleteAlarm(document.getElementById(x)); setInactiveOnRing(x); // start ringtone startRingtone(); }
[ "startRingtone() {\n console.log(\"startringtone\", this);\n if (this.ringtone != undefined)\n this.ringtone.play();\n Session.set(\"phoneIsRinging\", true);\n }", "function startAlarming()\n{\n\tif(is_alarm_rining == 1)\n\t\treturn;\n\telse\n\t\tis_alarm_rining = 1;\t\n\n\t//pl...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
access the value of the last element of the array and set it to a variable called school. print the school variable to the console.
function lastItem(){ let school = foodArray[foodArray.length - 1] return console.log(school) }
[ "function Work_2(foodArray, adjectiveArray){\n var school = foodArray[foodArray.length - 1];\n console.log(school);\n for(var i = 0; i < foodArray.length; i++){\n console.log(foodArray[i] + 'are/is' + adjectiveArray[i])\n }\n}", "function getSchool()\n{\n\treturn this.school;\n}", "get school...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
var myParser = Dataset.parser('groupedinterval', 'timeframe.end');
function parseGroupedInterval(){ var options = Array.prototype.slice.call(arguments); return function(res){ var dataset = new Dataset(); each(res.result, function(record, i){ var index = options[0] && options[0] === 'timeframe.end' ? record.timeframe.end : record.timeframe.start; if (record.valu...
[ "function parseGroupedInterval() {\n var options = Array.prototype.slice.call(arguments);\n return function (res) {\n var dataset = new Dataset().type('grouped-interval');\n Object(each[\"a\" /* each */])(res.result, function (record, i) {\n var index = options[0] && options[0] === 'timeframe.end' ? re...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
open a specific version of a requirement in a popup window
function openLinkedReqVersionWindow(req_id, req_version_id, anchor) { if (anchor == null) { anchor = ''; } else { anchor = '#' + anchor; } var windowCfg=''; var feature_url = "lib/requirements/reqView.php"; feature_url += "?showReqSpecTitle=1&requirement_id=" + req_id + "&req_version_id=" + req_v...
[ "function openSetupClickHandler() {\n openPopup();\n }", "function openLinkedReqSpecWindow(reqspec_id, anchor)\n{\n if (anchor == null) {\n anchor = '';\n } else {\n anchor = '#' + anchor;\n }\n \n var windowCfg='';\n var feature_url = \"lib/requirements/reqSpecView.php\";\n feature_url += \"?req...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Add a button to save.
addSaveButton(callback) { this.addButton(CHECK_ICON, callback); }
[ "get saveButton() {\n return {\n command: \"save\",\n icon: \"save\",\n label: \"Save\",\n type: \"rich-text-editor-button\",\n };\n }", "function createSaveBtn() {\r\n const btn = document.createElement(\"BUTTON\");\r\n btn.innerHTML = \"Save\";\r\n btn.className = `sa...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Whether we should be tracking dynamic child nodes inside a block. Create a block root vnode. Takes the same exact arguments as `createVNode`. A block root keeps track of dynamic nodes within the block in the `dynamicChildren` array.
function createBlock(type, props, children, patchFlag, dynamicProps) { const vnode = createVNode(type, props, children, patchFlag, dynamicProps, true /* isBlock: prevent a block from tracking itself */ ); // save current block children on the block vnode vnode.dynamicChildren = currentBlock || EMPTY_ARR; // cl...
[ "function createBlock(type,props,children,patchFlag,dynamicProps){var vnode=createVNode(type,props,children,patchFlag,dynamicProps,true/* isBlock: prevent a block from tracking itself */);// save current block children on the block vnode\nvnode.dynamicChildren=currentBlock||EMPTY_ARR;// close block\ncloseBlock();//...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
showColor changes the opacity of the color tiles. The timer delays the elements in the .forEach from looping through too quickly. Outside timer is 500 milliseconds behind to allow delay between elements displaying. Add one to index number and multiply by 1500 milliseconds, so specific element runs at correct timing. Ex...
function showColor(target,index,arr){ setTimeout(function(){ $('.' + target).css('opacity', '0.5'); // beep function beep.play(); setTimeout(function(){ $('.' + target).css('opacity','1'); if (index === arr.length){ colorTiles.forEach(function(tile,index){ //turn click function on add beep and displ...
[ "function show() {\n console.log(\"--------------\")\n var pause = 1000;\n console.log(\"function show:\")\n for (i = 0; i < count; i++) {\n var color = colorOrder[i];\n pause += 600;\n console.log(\"color: \" + color);\n if (color == \"blue\") {\n setTimeout(function() {\n ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
scrollToObjY Set the window scroll position to the top position of the specified object. Prototype: Pos scrollToObjY(Object o) Arguments: o ... An HTML Element object Results: A Pos object representing the current x, y scroll position. The scroll position will not necessarily equal the object's position.
function scrollToObjY(o) { self.scrollTo(self.viewLeft(), absPos(o).y); return new Pos(self.viewLeft(), self.viewTop()); }
[ "function _scrollToY() {\r\n return scrollToObjY(this);\r\n}", "function getPositionY(obj)\n{\n var curtop = 0;\n if (document.getElementById || document.all)\n {\n while (obj.offsetParent)\n {\n \t curtop += obj.offsetTop\n \t obj = obj.offsetParent;\n }\n }\n else if (document.lay...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
/ Creates a new instance of a ContactManifold and copies this instances data to it.
Copy() { let mani = new ContactManifold(this.ColA, this.ColB); mani.Normal = this.Normal; mani.Hit = this.Hit; mani.Penetration = this.Penetration; return mani; }
[ "function ContactManifold() {\n\n\t\t// The first rigid body.\n\t\tthis.body1 = null;\n\t\t// The second rigid body.\n\t\tthis.body2 = null;\n\t\t// The number of manifold points.\n\t\tthis.numPoints = 0;\n\t\t// The manifold points.\n\t\tthis.points = [new ManifoldPoint(), new ManifoldPoint(), new ManifoldPoint(),...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Populate state with book data, as well as the earliest publish date of all books in the DB
componentDidMount() { let datesArr = []; let sorted = []; // Update state with book data axios .get(process.env.REACT_APP_BASE_URL + "/home") .then(res => { // Map dates of all books to datesArr, then sort, to find the earliest date res.data.map(x => { datesArr.pus...
[ "function initializeBookState(book) {\n //console.log('initBook', book);\n $('input[name=title]').val(book.title);\n $('input[name=author]').val(book.author);\n $('select[name=language]').val(book.language || ' ');\n $('input[name=category]').prop('checked', fa...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Library / Library functions are those that are exported to Lisp, but usually not directly used in the implementation from JavaScript. However, there is no clear distinction between library and "nonlibrary" functions there are also functions exported to Lisp that are not marked as library. It's important that all export...
function lisp_truth(native_bool) { return native_bool ? lisp_t : lisp_f; }
[ "function lisp_native_truth(lisp_bool) {\n lisp_assert(lisp_is_instance(lisp_bool, Lisp_Boolean));\n return lisp_bool === lisp_t ? true : false;\n}", "function myFunc() {\n return true;\n}", "function True () {\n}", "isNativeFunction() {\n return !this.isUserFunction();\n }", "function isBu...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
if we created any streams onthefly for the markers, publish them as needed
async publishCreatedStreamsForMarkers () { // streams created on-the-fly for markers are necessarily going to be file streams, // these should automatically get published to the whole team await Promise.all((this.transforms.createdStreamsForMarkers || []).map(async stream => { await this.publishStream(stream);...
[ "function publishMarkers() {\n $rootScope.$broadcast('markers:update', _markers);\n }", "function listen_to_markers(){\n var listener = new ROSLIB.Topic({\n ros : ros,\n name : '/mkr_srv_talkback',\n messageType : 'marble_gui/ArtifactTransport'\n });\n \n listener.subscrib...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
! principal canvas \class Canvas \param canvas canvas element \param image image draw on the canvas \param baseline list of baselines \param boundingBox list of boundingBox
function Canvas(canvas, image, baseline, boundingBox) { var myCanvas = this; this.canvas = canvas; this.width = canvas.width; this.height = canvas.height; this.ctx = canvas.getContext('2d'); this.image = image; this.baseline = baseline; this.boundingBox = boundingBox; this.draggi...
[ "function init(src, boundingBox, baseline) {\n var image = new ProcessingImage(src);\n var imagePreview = new ProcessingImage(src);\n \n\n var listRect = new Array();\n for (var rect in boundingBox) {\n listRect.push(new Rectangle({x:boundingBox[rect].x, y:boundingBox[rect].y, w:boundingBox[re...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Queries an element's rootNode and any ancestor rootNodes. based on
function queryElementsRoots(element, selector) { // Gets the rootNode and any ancestor rootNodes (shadowRoot or document) of an element and queries them for a selector. function queryFromAll(el, allResults) { if (!el) { return allResults; } if (el.assignedSlot) { el = el.assignedSlot; } ...
[ "function queryElementRoots(element, selector) {\n // Gets the rootNode and any ancestor rootNodes (shadowRoot or document) of an element and queries them for a selector.\n function queryFrom(el) {\n if (!el) {\n return null;\n }\n if (el.assignedSlot) {\n el = el.assignedSlot;\n }\n cons...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
note: we're using uriMatch here to avoid case sensitivity, but still strongly match on the actual flow name itself TODO: make this a flat fn.doc call in the future and figure out how to normalize the uri so we don't need this loop at all
getFlow(name) { let uriMatches = cts.uriMatch('/flows/'+name+'.flow.json', ['case-insensitive'], cts.directoryQuery("/flows/")); // cache flow to prevent repeated calls. if (cachedFlows[name] === undefined) { if (fn.count(uriMatches) === 1) { cachedFlows[name] = cts.doc(fn.head(uriMatches)).to...
[ "function getLocalname(uri)\n{\n if (fn.contains(uri, \"#\")) \n return functx.substringAfterLast(uri, \"#\");\n else \n return functx.substringAfterLast(uri, \"/\");\n}", "function isDeepLikHref(uri) {\n var fileName = uri.filename();\n return fileName && Helpers.EndsWith(fileName, '.opf');\n ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
wrap the VirtualList to internally manage the selection, passing outside only the new selection
function SelectableList(props) { return ( <VirtualList // ... /> ); }
[ "select(index){if(this._insertedItems[index]){// deselect the last selected\nif(this.selectedIndex!==void 0){this.deselect(this.selectedIndex)}this._insertedItems[index].virtualElement._FBPTriggerWire(\"--itemSelected\");this.selectedIndex=index}}", "extendSelectionTo(index) {\n if('none' === this.selectionMod...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Resets the animation to first frame.
reset() { this.currentFrame = 0; }
[ "function resetAnimation() {\n\t\tanimateHome.reset();\n\t\tanimateHome.setFrameProgress(0);\n\t\tanimateHome.play();\n\t}", "function firstAnimationState() {\n resetAnimationState();\n render();\n }", "function resetAnimation() {\n m_animationState.currentTime = new ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Hand constructor; inherits Card object
function Hand() { Card.call(this, rank, suit, isFaceUp); this.cards = []; }
[ "function Hand() {\n this.cards = [];\n }", "function Hand() {\n this.cards = []\n}", "function Hand(){\n this.cards = [];\n}", "function OogaahHand() {\n\tthis.mCards = new Array(); // the cards that make up this hand\n}", "function Hand() \n{\n this.cards = [];\n this.strength = eHandStr...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Call the parent function to delete a version, then close the modal.
function deleteProductVersion() { ctrl.parent.deleteProductVersion(ctrl.version.id); ctrl.close(); }
[ "closeModalDialog() {\n set(this, 'approveDeleting', null);\n set(this, 'denyDeleting', null);\n\n this.send('removeModalDialog');\n }", "closeModalDialog() {\n this.set('approveDeleting', null);\n this.set('denyDeleting', null);\n\n this.send('removeModalDialog');\n }", "fun...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
ask player to participate in tournament
function getTournie() { document.getElementById("askTournament").style.display = "inline"; var serverMsg = document.getElementById('serverMsg'); serverMsg.value += "\n> please accept/decline quest by clicking below" if (isAI) { var data = JSON.stringify({ 'AICommand' : "AskTournament", 'name': PlayerName ...
[ "function acceptQuestParticipate() {\n\tdocument.getElementById(\"merlin\").style.display = \"none\";\n\tstageCounter = 0;\n\tdocument.getElementById('acceptQuest').style.display = \"none\";\n\tvar data = JSON.stringify({\n\t\t'name' : PlayerName,\n\t\t'participate_quest' : true\n\t});\n\tsocketConn.send(data);\n\t...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
This function determines whether or not the label for Senators should be displayed. It should be displayed only after the user has entered their state and the system has retrieved the correct senator names.
nameLabel() { if (this.state.senatorOneName !== '') { return <h3 className="senator-name">Your Senators: {this.state.senatorOneName} and {this.state.senatorTwoName} </h3>; } }
[ "get isLabelDisplayed() {\n return !!this.currentLabel;\n }", "function isAdviser() {\n if (document.getElementById('roleC').checked) {\n // switch accreditation and skills on\n document.getElementById('s-ins-lines').style.display = 'block';\n }\n else if (\n document.getElemen...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
This function simply returns some internal information on the xrender camera view, specifically the current max distance. This is needed to preserve the same viewpoint distance when switching between different planar views in the main display.
function camera_maxCurrent() { // var pos = xrender.camera.view.toArray(); // return(pos[2][3]); return(xrender.camera.view[14]); }
[ "get cameraHeight() {\n // ### Sync with the way geoviz is computing the zoom level.\n return this.mapView.camera.position.z;\n }", "calculateCameraPosition () {\n return this.boundingBox.zmax * 2 + 1000\n }", "function computeOverviewDistance() {\n var size = _maxViewRegion.si...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
_getKeyLength internal method the calculate the key length
_getKeyLength(key) { return key.length; }
[ "_getKeyLength(key) {\n return key.toString().length;\n }", "_getKeyLength( key ){\n\t\treturn key.length;\n\t}", "static get KEY_ID_LEN() {\n return 8;\n }", "keySize() {\n return this.size * 8;\n }", "static get keySignatureLength() {\n return {\n 'C': 0,\n ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Creates a cognito authenticationdetails object from user authentication data
initAuthDetails(pwd) { var authenticationData = { Username : this.username, Password : pwd, }; this.authenticationDetails = new AmazonCognitoIdentity.AuthenticationDetails(authenticationData); }
[ "static async signIn(authenticationData) {\n let authenticationDetails = new AmazonCognitoIdentity.AuthenticationDetails({\n Username: authenticationData.email,\n Password: authenticationData.password\n });\n let poolData = {\n UserPoolId: config.cognito.userPoolId,\n ClientId: config.c...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Returns the signed angle of a cartesian point relative to [cosRadius, 0, 0].
function circleRadius(cosRadius,point){point=cartesian(point),point[0]-=cosRadius;cartesianNormalizeInPlace(point);var radius=acos(-point[1]);return((-point[2]<0?-radius:radius)+tau-epsilon)%tau}
[ "function get_angle(point){\n\n // From origin center of circle\n var x = point.x - me.cx;\n var y = me.cy - point.y;\n var angle = Math.atan2( y , x ) / rad;\n if (angle < 0) {\n angle = 360 + angle;\n };\n return angle;\n }", "cos() {\n retur...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Check the spelling of a line, and return [start, end]pairs for misspelled words.
function misspelled(line) { // split lineby word boundaries var words = line.split(/[\s,(,),\[,\],<,>,:,",=,?,!,.,;,\,]/g); var i = 0; var bads = []; for (var wordIndex in words) { var word = words[wordIndex] + ""; // only use ...
[ "function misspelled(line) {\n var words = line.split(/[\\- ]/);\n var i = 0;\n var bads = [];\n for (var word in words) {\n var x = words[word] + \"\";\n var checkWord = x.replace(/[^a-zA-Z']/g, '');\n if (!dictionary.check(checkWord)) {\n bads[bads.length] = [i, i + words[word].length];\n }\n...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Apply a sound to a mesh
function applySound(mesh, filename, sound) { if (!mesh || !filename || !sound) return; // Load a sound and set it as the PositionalAudio object's buffer audioLoader.load(filename, function (buffer) { sound.setBuffer(buffer); sound.setLoop(true);...
[ "function wavify(e,t){void 0===t&&(t={});var n,o=Object.assign({},{container:t.container?t.container:\"body\",height:200,amplitude:100,speed:.15,bones:3,color:\"rgba(255,255,255, 0.20)\"},t),i=e,r=document.querySelector(o.container).getBoundingClientRect().width,a=document.querySelector(o.container).getBoundingClie...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Returns a function that extends the domain of an axis setup: this.xextend = domain_extender(this, 'x', true) // creates an ordinal extender for x usage: this.xextend() // extends .xscale().domain() using data
function domain_extender(self, axis, ordinal) { var scalename = axis + 'scale', zero = axis + '0', zero_val = axis + '0_value'; if (ordinal) return function () { var scale_prop = self[scalename], scale = scale_prop(), domain = self.data().map(self[axis]()); if (scale_prop._has_do...
[ "function axis$1 () {\n\n var decorate = noop,\n orient = 'bottom',\n tickFormat = null,\n outerTickSize = 6,\n innerTickSize = 6,\n tickPadding = 3,\n svgDomainLine = d3.svg.line(),\n ticks = _ticks();\n\n var dataJoin$$ = dataJoin().selector...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
render a single toy card
function renderToyCard(toy) { return ` <div class="card" data-id="${toy.id}"> <h2>${toy.name}</h2> <img src="${toy.image}" class="toy-avatar" /> <p>${toy.likes} Likes </p> <button class="like-btn">Like <3</button> <button class="delete-btn">Delete</button> </div> ...
[ "function displayCard(card, x, y, index) {\n var color\n if (card.type === VICTORY) {\n color = '#00FF00'\n } else if (card === COPPER) {\n color = '#DF7401'\n } else if (card === SILVER) {\n color = '#848484'\n } else if (card === GOLD) {\n color = '#D7DF01'\n } else i...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
MutateDeck ( ARRAY deck [INTEGER index] = OBJECT Card ): ARRAY deck [INTEGER index] = OBJECT Card
function MutateDeck(deck) { let newDeck = deck.slice(); for(let i = 0, n = newDeck.length; i < n; i++) { if(Random(1, 100) <= _config.features.genetic.mutationRatePercentage) { let swapCard = Random(0, n - 1); let tempCard = new Card(newDeck[i].suit, newDeck[i].type); newDeck[i] = new Card(newDeck...
[ "setCard(card, index) {\n this.cards[index] = card;\n }", "function updateCardbyIndex(index){\n if(index!=-1){\n cardsArray[index] = saveEditorContentToObjct();\n }else{\n cardsArray.push(saveEditorContentToObjct())\n }\n}", "function makeBlackjackDeck(cardDeck) {\n for (var i = 0;...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
validate address for iotex.
function validateAddress(address) { try { const payload = _bech.default.decode(address); return payload.prefix === "io"; } catch (e) { return false; } }
[ "function isValidAddress(address) {\n const api = new RippleAPI();\n return api.isValidAddress(address);\n}", "checkAddress(address) {\n return Web3.utils.isAddress(address)\n }", "function isValidAddress(address) {\n const api = new RippleAPI();\n if (address[0] === 'r') return api.isValidAddress(addre...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Same as handleRequestBody, but syntax shorter
async handleRequest(req, sendResponse) { return this.handleRequestBody(req, sendResponse) }
[ "function processJSONBody(req, res, controller, methodName) {\n let response = new Response(res);\n let body = [];\n req.on('data', chunk => {\n body.push(chunk);\n }).on('end', () => {\n try {\n // we assume that the data is in JSON format\n if (req.headers['content-...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Function that changes the example tags based on the selected dropdown option
function changeTags() { var modName = modSelect.options[modSelect.selectedIndex].value; switch (modName) { case "all": tagsField.innerHTML = allTags.join(', '); break; case "everred": tagsField.innerHTML = everredTags.join(', '); break; case "adelie": tagsField.in...
[ "function generate_tags(sentence, tag_list) {\n // This is the tag area.\n var e = document.getElementById(\"tags\");\n // We iterate over the elements of the tag list.\n for (var i = 0; i < tag_list.length; i++) {\n // We create an option element.\n var o = document.createElement(\"option...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
set alarmTime. The unit is millsenconds and it's seperated by ',' alarmDict is a dict whose key is on string, val is bool (true means the alarm is added).
static setAlarm(reminder,alarmDict) { /* We have to trigger the alarm further away from the starting time. so I sorted the keys in reverse order */ let keys = Object.keys(alarmDict).reverse(); let firstAlarm = true; let isScheduleDict = {}; let alarmTime = []; let isSchedule = []; for(var i = 0; ...
[ "function setAlarmTime(value) {\r\n alarmTime = value;\r\n}", "function setAlarm() {\r\n if(alarmTime) {\r\n const current = new Date();\r\n const timeToAlarm = new Date(alarmTime);\r\n\r\n if (timeToAlarm > current) {\r\n const timeout = timeToAlarm.getTime() - current....
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Stops and flushes the current batch.
stop() { this.flush(); }
[ "function _endBatch() {\n --_batch;\n if (_batch < 0) {\n throw \"Calls to startBatch() and endBatch() are not paired\";\n }\n\n if (_batch === 0 && !_isDisconnected() && !_internalBatch) {\n _flushBatch();\n }\n }", "function _endBatch()\n {\n --_batch;\n if (_batch < 0...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
display log in on openlogin button
function displayLogIn(){ //change button oplogin's appearance to Log In var openlogin = document.getElementById("openlogin"); openlogin.innerHTML = "Log In"; }
[ "function showLoginButton() {\n\t\tshow(btnOpenLogin);\n\t}", "function showLogin() {\n openLoginDialog();\n }", "function open__login() {\n\t$(\"#modal__login\").toggle();\n}", "function showLoginButton() {\n if (typeof showCustomLoginButton === \"function\") {\n showCustomLoginButton(t...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
if the loading process takes too long, it'll change the stat's text
function loadTimeoutFunction() { if (isLoading == 1) { stat.innerHTML = "Your internet seems to be be slow..."; // isLoading = 0; // runrun.src = "img/loading-static.png"; } }
[ "updateLoadingBar() {\n if (this.loadingRemains !== G.resource.remains) {\n this.loadingBar.text = `${G.resource.remains} resource(s) to load...\\nReceived file '${G.resource.currentLoad}'.`;\n }\n }", "function setProgressText(text) {\n if (showLoadingText) document.querySelector('...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Deal with the special case of routing / Note: to debug the homepage, use the /homepage prefix rule (e.g., /homepage?acre.console=1)
function CustomRouter(rules) { var app_labels = rules.labels; var rule, route_map; this.add = function(rules) { rule = rules; route_map = h.map_array(rule.tabs, "path"); }; this.route = function(req) { // redirect custom hosts for bases var site_host = h.parse_uri(acre.freebase.site_host).h...
[ "function normalRoute() {\n\n }", "function homeRoute(request, response){\n //if url == \"/\" && GET\n console.log(\"weee3eeeeeeeeeesdfgaaauifyueeeeeerrreeeeeeeeee still reading stuff\");\n //if url == \"/\" && POST\n //redirect to /:username\n}", "handleRouting() {\n let pageUrl = location.ha...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
declare the function to sign a transaction object and send it to the Ethereum network.
function sendSignedTx(transactionObject, cb) { let transaction = new EthTx(transactionObject); const privateKey = new Buffer.from(privKey, "hex"); transaction.sign(privateKey); const serializedEthTx = transaction.serialize().toString("hex"); web3.eth.sendSignedTransaction(`0x${serializedEthTx}`, cb); }
[ "async function sendSignedTx(transactionObject, cb) {\n let transaction;\n\n await web3.eth.signTransaction(\n transactionObject\n ).then(async (transaction) => {\n\n let result = await web3.eth.sendSignedTransaction(transaction.rawTransaction);\n console.log(result);\n\n\n\n });\n\...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Get JFire UserID as String by given attributes of an LDAP entry.
function getUserIDFromLDAPEntry(attributes){ var displayName = LDAPScriptUtil.getAttributeValue(attributes, 'displayName', null); if (displayName == null || displayName == ''){ // assume it's not a Person var uid = LDAPScriptUtil.getAttributeValue(attributes, 'uid', 'userid'); if (uid != null){ return uid...
[ "function getUserIDFromLDAPEntry(attributes){\r\n\tvar uid = LDAPScriptUtil.getAttributeValue(attributes, 'uid', 'userid');\r\n\tif (uid != null){\r\n\t\treturn uid;\r\n\t}\r\n\treturn null;\r\n}", "get uniqueDCIdentifier() {var _metadata$, _metadata$$metaKey;\n const metadataId = this._content.package.attr[\"...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
TreeMap Chart using GoogleCharts
function createTreeMapChart(total_debits) { var data = new google.visualization.DataTable(); data.addColumn("string", "Objecto de custo"); data.addColumn("string", "CNPJ"); data.addColumn("number", "Reembolso"); data.addRow([ 'Objecto de Custo', null, 0]); var exist= {}; $.each(total_debit...
[ "function showCharts(mapid, timeSeries) {\n for (var i = 0; i < timeSeries.length; i++) {\n var value = timeSeries[i];\n if (value != null) {\n if (i + 1 < timeSeries.length) {\n var nextValue = timeSeries[i + 1];\n if (nextValue != null && value[0] == nextV...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
add eventlistener to all numbers and display them on the screen
function displayNumbers(nr) { nr.addEventListener("click", function () { clicked.push(nr.value); screen.innerText += nr.value; }) }
[ "function digitListeners (num) {\n num = num.toString();\n let idName = \"digit-\" + num;\n document.getElementById(idName).addEventListener(\"click\", function() {\n numberOne = numberOne + num\n resultWindow.textContent = numberOne;\n }, false);\n}", "function numberShown(ev) {\n var $evTarget = $(...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
generate ChatId works cause when you are the user sending chat you take user.uid and your friend takes uid when your friend is using the app to send message s/he takes user.uid and you take the uid cause you are the friend
generateChatId() { if (this.user.uid > uid) return `${this.user.uid}-${uid}`; else return `${uid}-${this.user.uid}`; }
[ "get chatId() {\r\n const chatId = this.toId - CHAT_PEER;\r\n return chatId > 0\r\n ? chatId\r\n : undefined;\r\n }", "chatId() {\n let text = '';\n const possible = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789';\n for (let i = 0; i < ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
7. A list of 25 modified names
async modifiedNames (nNumberNames) { // wait for completelyUniqueNames function to generate first N // number of unique names listing before shuffle const uniqueList = await this.completelyUniqueNames(nNumberNames) const firstNames = [] const lastNames = [] const shuffledUniqueList = [] uni...
[ "function changeName(){\n var firstName = starWarsName.slice(0,5);\n var lastName = starWarsName.slice(5)\n $('.star-wars-name').text(firstName.join(\"\") + \" \" + lastName.join(\"\"));\n}", "extractItemNames() {\n\t\tlet data = this.getRawItem(556);\n\t\tthis.itemNames = [];\n\t\tlet newName = [];\n\t\twhile...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Returns the avaliable browsers on the current machine.
function getAvailableBrowsers(cb){ var browsers = browsersForPlatform() browsers.forEach(function(b){ b.protocol = 'browser' }) async.filter(browsers, function(browser, cb){ browser.supported(cb) }, function(available){ cb(available) }) }
[ "get browsers() {\n return generateLocalBrowserLaunchers();\n }", "get browsers() {\n return generateSauceBrowserLaunchers();\n }", "function getBrowsersList() {\n\tconst projectBrowsersList = browserslist();\n\tif ( browserslist( browserslist.defaults ) === projectBrowsersList ) {\n\t\t...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
parse out an array of (modifier+key) presses from a single string e.g. "12ctrl+3" becomes [ "1", "2", "ctrl+3" ]
function keyComboArrayFromString(keyString) { var keysArr = []; var currModifiers = ''; while (keyString.length) { var modifierMatch = keyString.match(/^(ctrl|meta|shift|alt)\+/i); var multiCharMatch = keyString.match(multiCharRegex); if (modifierMatch) { ...
[ "function keyComboArrayFromString(keyString) {\n var keysArr = [];\n var currModifiers = '';\n \n while (keyString.length) {\n var modifierMatch = keyString.match(/^(ctrl|meta|shift|alt)\\+/i);\n var multiCharMatch = keyString.match(multiCharRegex);\n \n ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Emits a mousemove event with the current coordinate of the mouse Emits a mousedrag if the mouse was previously down Listens to the entire document, but normalizes mouse events to within the canvas
onMouseMove (e) { let event = 'mouse-move'; if (this.isMouseDown) { event = 'mouse-drag'; } this.emit(event, normaliseMouseEventToElement(this.canvas, e)); }
[ "function bindMouseMove() {\r\n canvas.addEventListener('mousemove', function(e) {\r\n mousePos = getMousePos(e);\r\n });\r\n }", "function canvasMouseMoveEv(event) {}", "onCanvasMouseMove(event) {\n const { viewer } = this.state;\n\n viewer.raiseEvent('mouse-move', event);\n ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Adds the route children to the given folder for each step in the route
function addRouteChildren(folder, route) { folder.children = []; folder["routeXmlNode"] = route; route.setAttribute("_cid", folder.key); $(route).children("*").each(function (idx, n) { addRouteChild(folder, n); }); }
[ "_setChildrenRoutes () {\n this.collection.forEach((childRouteConfig) => {\n this.routeManager.registerRoute(childRouteConfig)\n })\n }", "function addRouteDirs(directories) {\n\n}", "function addRouteChild(folder, n) {\n var nodeName = n.localName;\n if (nodeName) {\n var n...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
When this function is called. It will trigger socket to turn on 'GET_PLAYERS_DATA' task. So that when the server side emit this task, client side can update accordingly. When receiving playerList from server. We do the following things. 1. Use playerList to update the sprite in this container. 2. Align camera by calcul...
onGetPlayersData() { this.socket.on('GET_PLAYERS_DATA', (playerList) => { playerList.forEach((player) => { player.cellList.forEach((cell) => { let sprite = this.children.find(child => child.id === cell.id); if (sprite === undefined) { console.log(cell); spri...
[ "onDataReceived(dataArray) {\n let newAdded = false;\n dataArray.forEach(data => {\n if (data.hashedVisitID !== this.playerId) {\n if (!this.foundNodes[data.hashedVisitID]) {\n // If this id is not on the list we create a new node and added to the found nod...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
mnemonic.js : Converts between 4byte aligned strings and a humanreadable sequence of words. Uses 1626 common words taken from wikipedia article: Originally written in python special for Electrum (lightweight Bitcoin client). This version has been reimplemented in javascript and placed in public domain.
function mn_encode(a){for(var b=[],c=mn_words.length,d=0;d<a.length;d+=8){var e=parseInt(a.substr(d,8),16),f=e%c,g=(Math.floor(e/c)+f)%c,h=(Math.floor(Math.floor(e/c)/c)+g)%c;b=b.concat([mn_words[f],mn_words[g],mn_words[h]])}return b.splice(8,4),b.join(" ")}
[ "newMnemonic(entropy) {\n let entropyBitLength = entropy.length * 8;\n let checksumBitLength = entropyBitLength / 32\n let sentenceLength = (entropyBitLength + checksumBitLength) / 11\n\n let err = validateEntropyBitSize(entropyBitLength)\n if (err != null) {\n throw err;\n }\n\n // Add ch...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Callback for our scroll event just keeps a track on the last scroll value
function onScroll() { _lastScrollY = window.scrollY; requestTick(); }
[ "function updateLastScroll() {\n lastScrollTop = st;\n } // Make sure they scroll more than delta", "function onScroll() {\n lastScrollY = window.scrollY;\n requestTick();\n }", "function onScroll() {\n latest_known_scrollY = window.scrollY;\n requestTick();\n }", "fu...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
GEOLOCATION adds a marker for the geolocation result at the given position
function addGeolocationResultMarker(position) { var layer = this.theMap.getLayersByName(this.GEOLOCATION)[0]; layer.removeAllFeatures(); //convert corrdinates of marker var feature = null; if (position) { position = util.convertPointForMap(position); var point = new OpenLayers.Geometry.Point(pos...
[ "function addGeolocationResultMarker(position) {\n var layer = this.layerGeolocation;\n layer.clearLayers();\n //convert corrdinates of marker\n var feature = null;\n if (position) {\n feature = new L.marker(position, {\n icon: Ui.markerIcons.unset,\n ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Calculates the change in x position for a movement of d units and angle tx to the X axis.
function dx(tx, d) { return d * Math.cos(rad(tx)); }
[ "function x_motion(d, v, a, p){\n this.d = d;\n this.v = v;\n this.a = a;\n this.p = p;//x final position;\n}", "updateDxDy() {\n let moveData = calculateDxDy(this.direction, this.speed);\n this.dx = moveData.dx;\n this.dy = moveData.dy;\n }", "deltaX() { return Math.cos(this.angle) ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }