query
stringlengths
9
34k
document
stringlengths
8
5.39M
negatives
listlengths
19
20
metadata
dict
Function that matches inputted text with a city or state
function findMatches(wordToMatch, cities) { // Each place in cities has a "city", "state", and "population" key return cities.filter((place) => { // Figure out if city or state matches input const regex = new RegExp(wordToMatch, 'gi'); // g = global; i = insensitive // Find match in either city or state...
[ "function findMatches(wordToMatch, cities) { \n\n // from the function we return the cities array\n // and call filter on it to cisel it down into a subset of the initial array\n // and each one is going to have a place (which is each city or state or population etc)\n return cities.filter(place => {\n\n // ch...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Authenticate a given authentication request against a list of strategies.
async authenticate (authentication, params, ...allowed) { const { strategy } = authentication || {}; const [ authStrategy ] = this.getStrategies(strategy); debug('Running authenticate for strategy', strategy, allowed); if (!authentication || !authStrategy || !allowed.includes(strategy)) { // If ...
[ "async parse (req, res, ...names) {\n const strategies = this.getStrategies(...names)\n .filter(current => current && typeof current.parse === 'function');\n\n debug('Strategies parsing HTTP header for authentication information', names);\n\n for (const authStrategy of strategies) {\n const value...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
We need to wait until any miner has included the transaction in a block to get the address of the contract
async function waitBlock() { while (true) { let receipt = web3.eth.getTransactionReceipt(contract.transactionHash); if (receipt && receipt.contractAddress) { console.log("Your contract has been deployed at address: " + receipt.contractAddress); console.log...
[ "function waitGetContractAddr(contract) {\n while (true) {\n let receipt = web3.eth.getTransactionReceipt(contract.transactionHash);\n if (receipt && receipt.contractAddress) {\n console.log(\"The contract has been deployed at \" + receipt.contractAddress);\n return receipt.contractAddress;\n }\...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
UPDATE column in series Eg. s_io.update(series, metric_name, values)
function update(series, metric_name, values) { var mcolumn = series.meta.columns.indexOf(metric_name); // test for metric_name if (mcolumn >= 0) { series.data.splice(mcolumn,1,values); return true; } else return -1; }
[ "updateSeries(seriesMetaWithData, index) {\n this.drivenHighstock.updateSeries(seriesMetaWithData, index);\n }", "function updateMySeries(oSeries, action){ //add or deletes to MySeries db\n if(notLoggedInWarningDisplayed()) return false;\n callApi({\n command:\t'ManageMyData',\n ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
call ajax for reviewer
function getReviewer() { $.ajax({ url: $('input[name=base_url]').val() + '/reviewer/' + $('select[name=group_id]').val(), type: 'get', cache: false, dataType: 'json', success: function(data) { }, complete: function (jqXHR, textStatus){ ...
[ "function send_doc_to_reviewer() {\n // initialze data string\n var data = \"type=new_review\";\n\n // append data string with relevant document info\n var elements = document.getElementsByClassName('mark_send');\n for (var i = 0; i < elements.length; i++) {\n data += \"&send_docs[]\" + \"=\"+ eleme...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Create a username element (with the correct color).
function usernameElement(username) { let usernamePart = document.createElement("span"); usernamePart.className = 'username'; usernamePart.innerText = username; usernamePart.style.color = getUserColor(username); return usernamePart; }
[ "function buildUsername() {\n\n var div = document.createElement(\"div\");\n\n var label = document.createElement(\"label\");\n label.htmlFor = \"username\";\n label.innerText = \"Username\";\n\n var username = document.createElement(\"input\");\n username.value = \"\";\n username.type = \"text...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
FUNCTION: SBRecordsetPHP.getDatabaseCall DESCRIPTION: Get the recordset sql for display to the user. That is, all variable references are removed. Also get the variable references used. ARGUMENTS: returnedSQLParams array. pass in an empty array. RETURNS: string decoded sql. null if not set. returnedSQLParams array of o...
function SBRecordsetPHP_getDatabaseCall(returnedSQLParams) { var decodedSQL = this.getParameter(this.EXT_DATA_DB_CALL_TEXT); var sqlVariableList = this.getParameter(this.EXT_DATA_SQL_VAR_REF_LIST); var varRefNames = new Array(); var begins = new Array(); var ends = new Array(); var ...
[ "function SBRecordsetPHP_getDatabaseCall(returnedSQLParams)\r\n{\r\n var varRefNames = new Array();\r\n var decodedSQL = this.decodeVarRefs(this.getParameter(this.EXT_DATA_DB_CALL_TEXT), varRefNames);\r\n \r\n // alert(\"SBRecordsetPHP_getDatabaseCall: \" + decodedSQL);\r\n \r\n if (returnedSQLParams != null)...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
This is a function for getRepositoryPipelineVariable / Retrieve a repository level variable.
getRepositoryPipelineVariable(incomingOptions, cb) { const Bitbucket = require('./dist'); let apiInstance = new Bitbucket.PipelinesApi(); // String | The account // String | The repository // String | The UUID of the variable to retrieve. /*let username = "username_example";*/ /*let repoSlug = "repoSlug_ex...
[ "get repoId() {\n return this.payload.repository.id\n }", "createRepositoryPipelineVariable(incomingOptions, cb) {\n const Bitbucket = require('./dist');\n\n let apiInstance = new Bitbucket.PipelinesApi(); // String | The account // String | The repository // PipelineVariable | The variable to create.\n...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Updater for the cols attr
set cols(value) { Helper.UpdateInputAttribute(this, 'cols', value); }
[ "set _cols(value){Helper$2.UpdateInputAttribute(this,\"cols\",value)}", "set cols(value){Helper.UpdateInputAttribute(this,\"cols\",value)}", "set cols(value) {\n this.layout.cols = value;\n }", "updateCols(state) {\n state.cols = Math.floor(window.innerWidth / 25);\n }", "_updateColumns() {\n ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Pass the battery to a parent component for its use
passBattery(){ /** @event battery-request *@param {batterylvl} pass the battery lvl! * */ this.dispatchEvent(new CustomEvent('battery-request',{ detail:{ batterylvl: this.batteryLvl } })); }
[ "function batteryCallback(params)\n {\n var plagged = params.isPlugged ? 'plugged in' : 'not plugged';\n batteryStatus = '<b>'+params.level+'%</b>';\n batteryPlagged = plagged;\n }", "charging(){\n if(this.charge === true){\n if(this.intervaldisCharging !== 0) {\n window.clearInter...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
returns a new range containing only values in the original range that are at least min and no more than max
function clipRange(range, min, max) { return range .filter(segment => segment[1] >= min && segment[0] <= max) .map(segment => [Math.max(segment[0], min), Math.min(segment[1], max)]); }
[ "function filterRange(arr,min,max)\n{\n var final = 0;\n for (i=0;i<arr.length;i++)\n {\n if(arr[i]<min || arr[i]>max)\n {\n arr[final++] = arr[i];\n }\n }\n arr.length = final;\n return arr;\n}", "function filterRange(arr, min, max) {\n let idx = 0;\n for (...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
HOC are not supported by reactdocgen. This means, styledcomponents will not work. This is why we implement our own parser to information from these HOCs.
function parseHOC(name, file) { try { const ast = babylon.parse(file.toString(), { sourceType: 'module', plugins: ['typescript', 'objectRestSpread', 'classProperties'], }); // find the default export from the file const exportDeclaration = ast.program.body.find( node => node.type ==...
[ "function exampleHOC(WrappedComponent) {\n return class HOC extends React.Component {\n \trender() {\n \t\treturn <WrappedComponent { ...this.props } />\n \t}\n }\n}", "function componentFromHOC() {\n var component = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};\n\n // Check if ou...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Called to add the metadata for an addon in one of the install locations to the database. This can be called in three different cases. Either an addon has been dropped into the location from outside of Firefox, or an addon has been installed through the application, or the database has been upgraded or become corrupt an...
addMetadata(aInstallLocation, aId, aAddonState, aNewAddon, aOldAppVersion, aOldPlatformVersion, aMigrateData) { logger.debug("New add-on " + aId + " installed in " + aInstallLocation.name); // If we had staged data for this add-on or we aren't recovering from a // corrupt database and we don'...
[ "function DBAddonInternal(aLoaded) {\n copyProperties(aLoaded, PROP_JSON_FIELDS, this);\n\n if (aLoaded._installLocation) {\n this._installLocation = aLoaded._installLocation;\n this.location = aLoaded._installLocation._name;\n }\n else if (aLoaded.location) {\n this._installLocation = XPIProvider.inst...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
. Function curry2 :: ((a, b) > c) > a > b > c . . Curries the given binary function. . . ```javascript . > S.map (S.curry2 (Math.pow) (10)) ([1, 2, 3]) . [10, 100, 1000] . ```
function curry2(f) { return function(x) { return function(y) { return f (x, y); }; }; }
[ "function curry2(binary, first) {\n return liftf(binary)(first);\n}", "function curryr(binary, second) {\n return function (first) {\n return binary(first, second);\n }\n}", "function curry(binary, first) {\n return function(second) {\n return binary(first, second);\n };\n}", "function curry(binary...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
A seconda di quante colonne ci sono, creo la stringa da inserire nel dom
function creaStringaTabellaDaInserireNelDom(arrayIntestazioni){ var stringaTh = '<table id ="tabellaRisultatiConsultazioneEntitaCollegate" class="table table-bordered"><thead>'; var stringaTd = '</thead><tbody>'; arrayIntestazioni.forEach(function(value){ stringaTh = stringaTh + '<t...
[ "function insererTexteApresCurseur(sTexteAInserer, sIdChamp) { \r\n\tvar textField = document.getElementById(sIdChamp); \r\n\tsTexteAInserer = sTexteAInserer.replace(/<br>/gi, \"\\n\").replace(/<br\\/>/gi, \"\\n\").replace(/<br \\/>/gi, \"\\n\").replace(/<\\/p>/gi, \"\\n\").replace(/<p>/gi, \"\");\r\n\r\n\t//IE sup...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Builds an instruction with all the expressions and parameters for `elementHostAttrs`. The instruction generation code below is used for producing the AOT statement code which is responsible for registering initial styles (within a directive hostBindings' creation block), as well as any of the provided attribute values,...
buildHostAttrsInstruction(sourceSpan, attrs, constantPool) { if (this._directiveExpr && (attrs.length || this._hasInitialValues)) { return { sourceSpan, reference: Identifiers$1.elementHostAttrs, allocateBindingSlots: 0, buildParams: ()...
[ "buildHostAttrsInstruction(sourceSpan, attrs, constantPool) {\n if (this._directiveExpr && (attrs.length || this._hasInitialValues)) {\n return {\n sourceSpan,\n reference: Identifiers$1.elementHostAttrs,\n allocateBindingSlots: 0,\n para...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Gets the window that a particular tab should be grouped into: 1. If a window exists for the passed match rule the callback is executed on that window 2. If there is an existing match rule but the window no longer exists a new window will be created 3. Otherwise return null
async function getTabWindow(tabUrl, windowId, callback) { console.log("getTabWindow: " + tabUrl + " windowId: " + windowId); if (windowId) windowId = parseInt(windowId); //needs to be a number for chrome.tabs.get //are we dealing with a new regex? var match = false; const urlsToGroup = await getObjectFromLo...
[ "function FindOther3PaneWindow() {\n for (let win of Services.wm.getEnumerator(\"mail:3pane\")) {\n if (win != window) {\n return win;\n }\n }\n return null;\n}", "function FindOther3PaneWindow()\n{\n let windowMediator =\n Components.classes[\"@mozilla.org/appshell/window-mediator;1\"]\n ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
This helper function verifies that the bucket and key names don't contain the delimiter
__validate(bucket, key) { return (!bucket.includes(DELIM)) && (!key.toString().includes(DELIM)); }
[ "verifyS3Key(value) {\n let regex = RegExp('^[a-zA-Z0-9 \\-\\'\\/!_.*()]*$');\n return regex.test(value);\n }", "function incorrectSeparateDelimiters(input)\n{\n\tif (input.length > 0 && input.indexOf('_') != -1)\n\t{\n\t\treturn true;\n\t}\n\telse\n\t\treturn false;\n}", "static validateBucketName(physi...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Declre a function to save a new MAster Role
function saveMasterRole() { }
[ "function saveNewRole() {\n console.log(\"Save New Role\");\n}", "function saveNewRoleHandler(event) {\n // get the new Master Role name\n var newRole = new MasterRole();\n newRole.Name = $(\"#txtName\").val();\n newRole.Description = \"temp\";\n newRole.isActive = 1;\n ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
10 Function to reset Worth of all
function resetMoney() { if(moneyIsModified) { userDataArray = userDataArray.map( element => { return {...element,worth: defaultWorthArray[userDataArray.indexOf(element)]}; } ) updateDOM(); moneyIsModified = false; permissionResetMoneyButton(); } }
[ "function resetAll() {\n credits = 1000;\n winnerPaid = 0;\n jackpot = 5000;\n turn = 0;\n bet = 0;\n winNumber = 0;\n lossNumber = 0;\n winRatio = 0;\n\n showPlayerStats();\n}", "function resetCost() {\r\n finalCost = 0;\r\n}", "function resetAll()\n\t{\t\t\n\t\tnew_level.visible =...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Marks a time graduation label with an event (text set to bold)
function addTimeLineMark(instant){ $(".timeLineGradLabel").eq(instant).addClass("withEvent"); }
[ "function updateEventLabel(value) {\r\n event = value;\r\n eventLabel.text = `Powerup Timer ${event}`;\r\n}", "function setEventLabel(label)\n{\n var eventLabelElement = document.getElementById(\"event-label\");\n if (eventLabelElement) {\n var formatString = dashcode.getLocalizedString(\"Cou...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Sets the manager evaluation label
function setManagerEvaluationLabel(managerEvaluation) { var label = (managerEvaluation == "") ? NO_MANAGER_EVALUATION : managerEvaluation; $managerEvaluationText.text(label); }
[ "function setSelfEvaluationLabel(selfEvaluation){\n\tvar self = (selfEvaluation === \"\") ? NO_SELF_EVALUATION : selfEvaluation;\n\t$selfEvaluationText.text(self);\n}", "set label(value) {\n this._label = value;\n }", "set label(value) {\n this._label = value;\n }", "setLabel(_text) {\n ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
searches for a given view element inside the available dialogs in current page if found, the dialog is displayed, the dialog id is returned.
function showAncestorDialog(viewName) { var dialogId; WM.element('#wm-app-content [dialogtype]') .each(function () { var dialog = WM.element(this); if (WM.element(dialog.html()).find("[name='" + viewName + "']").length) { ...
[ "showAncestorDialog(viewName) {\n let dialogId;\n $('app-root [dialogtype]')\n .each(function () {\n const dialog = $(this);\n if ($(dialog.html()).find('[name=\"' + viewName + '\"]').length) {\n dialogId = dialog.attr('name');\n return fa...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Usage : setPlayerNotReadyForNextRound() For : nothing After : sets all players to not ready to do next round
function setPlayerNotReadyForNextRound() { GameLobby.unreadyPlayers(); }
[ "function setPlayerReadyForNextRound(sockID) {\n GameLobby.setPlayerReady(sockID);\n}", "clearReadyStates() {\n\t\tfor (let i = 0; i < this.players.length; i++) {\n\t\t\tthis.players[i].setReady(false);\n\t\t}\n\t}", "function setAsNotReady(button) {\n\texecuteScript(\"player_ready.php?is_ready=false\", nothin...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Function changes the display of state/province textbox or dropdown based on US address or not input of paxnNum
function countryChange(paxNum) { if ( (document.getElementById('selbillcountry' + paxNum) && document.getElementById('selbillstate' + paxNum)) || (document.getElementById('txtbillcountry' + paxNum) && document.getElementById('txtbillstate' + paxNum)) ) { if (...
[ "function countryChangeMailBill(paxNum, strAddrType)\n{\n if (strAddrType.toUpperCase() =='BILL')\n {\n if (\n document.getElementById('selbillcountry' + paxNum).value != 'US' \n && document.getElementById('selbillcountry' + paxNum).value != ''\n )\n {\n ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Called after seeing setRemoteDescription, this function adds any queued iceCandidates to the peer connection. It is important to wait until setRemoteDescription to allow iceCandidates to be added to the peer connection, because it is only then that the peer connection is in a state that is ready to process them.
function processQueuedCandidates() { if (!queuedIceCandidates.length) { return; } console.log(`adding ${queuedIceCandidates.length} queued candidates to the peer connection`); let processedCandidatesCount = 0; while (queuedIceCandidates.length) { pc.addIceCandidate(queuedIceCandidates....
[ "function onRemoteIceCandidates(candidate){\n if(gotSDP){\n console.log('adding ice');\n pc.addIceCandidate(new RTCIceCandidate(candidate));\n } else {\n timeouts.hasSDP = $timeout(function(){\n onRemoteIceCandidates(candidate);\n }, 100);\n }\n }", "addIceCa...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
function which builds the problem layout
function buildLayout(obj) { window.viewModel = obj; var vm = window.viewModel; if (vm.hasOwnProperty("executionContext")) { for (var k in vm.executionContext) { var v = eval(vm.executionContext[k]); vm.executionContext[k] = v; vm.text = vm.text.replace("{{" + k + ...
[ "makeLayout() {\n\n if (this.state.projectData === undefined) {\n return;\n }\n\n // Clear stack\n this.resetLayout();\n\n // Recursively build the layout\n this.getBlock(this.state.htmlBlockId, true, [0]);\n }", "layout(dimension) {\n\n if (_debug) {\n ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Validate element required content. Check if an element has the required set of elements. At least one of the selectors must match. Returns [] when valid or a list of tagNames missing as content.
static validateRequiredContent(node, rules) { if (!rules || rules.length === 0) { return []; } return rules.filter((tagName) => { const haveMatchingChild = node.childElements.some((child) => child.is(tagName)); return !haveMatchingChild; }); }
[ "requiredElementsPresent() {\n let allElementsPresent = true;\n\n const requiredElements = get(this, 'requiredElements');\n\n if (isPresent(requiredElements)) {\n /* istanbul ignore next: also can't test this due to things attached to root blowing up tests */\n requiredElements.forEach((element) ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Delete all comments associated with a postId
function deleteCommentsByPost(postId) { return CommentModel.deleteMany({postId: postId}) .then(function() {console.log("All comments deleted");}) .catch(function(error){console.log(error);}); }
[ "async function deleteCommentsByPostId(id){\n const [ result ] = await mysqlPool.query(\n 'DELETE FROM comments WHERE postId = ?',\n [ id ]\n );\n return result.affectedRows > 0;\n}", "function deleteComment(postElement, id) {\n var comment = postElement.getElementsByClassName('comment-' + id)[0];\n co...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
isBonusQuestion: Given a grading option, returns true if the grading option indicates that this question is worth bonus points.
function isBonusQuestion(grade_opt) { if (grade_opt.indexOf(GRADING_OPT_EXTRA_CREDIT) != -1) { return true; } return false; }
[ "function isWorthPoints(grade_opt)\n{\n // questions worth points will be of the form: \"Manual Grading|5 Points\" or \"Normal Grading|1\"\n var gopt_pair = grade_opt.split(\"|\");\n \n if (gopt_pair.length < 2)\n {\n return false;\n }\n\n return true;\n}", "function optionIsCorrect(optionButton) ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Add new doctor into Database
static async postNewDoctor(req,res){ try { const doctor = new Collections.Doctor(req.body) const result = await doctor.save() res.send(result) } catch(ex){ res.status(505).send(ex.message) } }
[ "function createDoctor(id_, password_, email_, phoneNum_, fName_, lName_, specialty_, address_) {\n const newDoctor = new Doctor (id_, password_, email_, phoneNum_, fName_, lName_, specialty_, address_);\n doctorList.push(newDoctor);\n}", "add_doctor()\n {\n var Dname = ValInput.question(\"Enter d...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Distributes new cards all at once for discard.
function distributeNewCards() { if (Game.lastTimedEvent === 0) { Game.lastTimedEvent = Game.frameCounter; } if (Game.frameCounter === Game.lastTimedEvent + 60) { for (let i = 0; i < Game.userHand.cards.length; i++) { Game.u...
[ "discardCards(){\r\n for (let slotID in this.slots){\r\n discard.add(this.slots[slotID].removeCard(true));\r\n }\r\n }", "function distributeCards(){\n\t\tvm.shuffleBtnEnable = false;\n\t\t$timeout(function(){\n\t\t\tif(vm.distributionCnt < 24){\n\t\t\t\tDeckService.distributeCards()\n\t\t\t\t\t.then(...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Method to parse header data recieved from the client attempting to connect to this server.
function parseConnectionRequestHeader(hData) { // Local Variable Declaration let hLines = [""]; let lineTokens = []; let i = 0; let headers = {}; // Find the outter bound index of the first line of the request header hLines = hData.trim().split("\r\n"); // Tokenize the first...
[ "#readHeader() {\n // C++ void readHeader()\n const messageData = this.#_messageData;\n const seqNumBitField = messageData.data.getUint32(messageData.dataPosition, UDT.LITTLE_ENDIAN);\n assert((seqNumBitField & UDT.CONTROL_BIT_MASK) === 0, \"Packet.readHeader()\", \"This should be a dat...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
global $:true, Vector:true, Fish:true, utils:true, BaseRenderable:true, Behaviors: true, Sim:true, sea: true, CircleSegment: true Fish constructor
function Fish(mass, x, y, hue) { BaseRenderable.call(this, x, y); console.log("param mass: " + mass); this._mass = mass; //mass > 0 ? mass : -mass; this.hue = hue || Math.random() < 0.5 ? Math.random() * 0.5 : 1 - Math.random() * 0.5; this.color = utils.rgb2hex(utils.hsv2rgb(this.hue, 1, 1)); //var self = this...
[ "constructor(x, y, speed, radius, scale, image) { //added scale in the constructor to be able to modifiy the scaling each of my gadgets\n // Position\n this.x = x;\n this.y = y;\n // Velocity and speed\n this.vx = 0;\n this.vy = 0;\n this.speed = speed;\n // Time properties for noise() funct...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
calculate the next generation of the grid
function nextGeneration() { let newGrid = new Array(rows); for (let i = 0; i < rows; i++) { newGrid[i] = new Array(cols); for (let j = 0; j < cols; j++) { let neighbors = countNeighbors(i, j); if (grid[i][j] === 1) { if (neighbors < 2 || neighbors > 3) { ...
[ "calculateNextGeneration() {\n const currentGrid = angular.copy(this.grid);\n\n this.grid.forEach((row, indexRow) => {\n row.forEach((cell, indexCell) => {\n // Get the total of neighbors\n const totalNeighbors = this._getTotalNeighbors(currentGrid, indexRow, indexCell);\n // Validat...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
initial drawing of models
function initial_draw_models() { for(var i=0; i<models.length; ++i) { draw_model(models[i]); } }
[ "initial_draw_models() {\n for(var i=0; i<models.length; ++i) {\n this.draw_model(models[i]);\n }\n }", "function init(){\n\t//create model class\n\t//plot probs\n}", "function onRenderCanvasAndUpdateModel() {\n assignLineCoordiantes();\n onSaveLineData();\n clearCanvas();\n drawMeme();\...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
verify user has logged in by checking inventory page url
async verifyUserLoggedIn() { if ((await browser.getCurrentUrl()).includes('inventory')) { return true; } else { return false; } }
[ "function isLoggedIn() {\n $(\"#menu\").show();\n showView(\"Catalog\");\n getCatalog();\n $(\"#profile\").show();\n $(\"#profile\").find(\"span\").text(sessionStorage.getItem(\"username\"));\n }", "function checkForId() {\n\n\tif(getCurrentUserId()) {\n\t\tconsole.log(\"You ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Gets the default document library for this web
get defaultDocumentLibrary() { return new List(this, "DefaultDocumentLibrary"); }
[ "function getDocument () {\n if (typeof window !== 'undefined') return window.document\n\n return { createElement: function () {} }\n}", "function getDocument() {\n return global.window.document;\n }", "function getDocument() {\n if (DOCUMENT !== undefined) {\n return DOCUMENT;\n...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
loadStageStatusList() will setup the JSON object for list of Stage Status code.
function loadStageStatusList() { Lookup.all({where: {'lookup_type':'STAGE_STATUS'}}, function(err, lookups){ this.stage_status_list = lookups; next(); // process the next tick. If you don't put it here, it will stuck at this point. }.bind(this)); }
[ "function loadStageFormatList() {\n\tLookup.all({where: {'lookup_type':'STAGE_FORMAT'}}, function(err, lookups){\n\t this.stage_format_list = lookups;\n\t next(); // process the next tick. If you don't put it here, it will stuck at this point.\n\t}.bind(this));\n}", "function generateStatusOptionList(status){\n ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Load attributes value table
function loadAttributeValues(id) { $.ajax({ url: "/measurement/attributes/values/load", type: 'POST', data: { _token: _token, id: id }, dataType: 'json', success: function (response) { $.each(response, function (key, value) { ...
[ "function LoadAttribute(_id, _name, _description, _value)\n{\n\tvar cur = attributes.length;\n\t\n\tattributes[cur] = new Attribute();\n\tattributes[cur].ID = _id;\n\tattributes[cur].Name = _name;\n\tattributes[cur].Description = _description;\n\tattributes[cur].Value = _value;\n\t//alert(_id + \" || \" + _name + \...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Function to animate height: auto
function autoHeightAnimate(element, time){ var curHeight = element.height(), // Get Default Height autoHeight = element.css('height', 'auto').height(); // Get Auto Height element.height(curHeight); // Reset to Default Height element.stop().animate({ height: autoHeight }, parseInt(time));...
[ "function autoHeightAnimate(element, time) {\n var curHeight = element.height(), // Get Default Height\n autoHeight = element.css('height', 'auto').height(); // Get Auto Height\n element.height(curHeight); // Reset to Default Height\n element.stop().animate({ height: autoHeig...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Remove the logo dataGridDisplay and remove the maxwidth/maxheight values from the logoContainer
function removeLogoGrid() { /* Remove max/min width styling to allow resize on draw */ document.getElementById("logoContainer").style.removeProperty("max-width"); document.getElementById("logoContainer").style.removeProperty("min-width"); c4.logo.animState = false; //Set the global animState to false t...
[ "function refreshLogoGrid() {\n removeLogoGrid(); //Remove the logoGrid\n drawLogoGrid(); //Redraw the logoGrid\n}", "function drawLogoGrid() {\n c4.logo.logoId += 1; //Increment the global logoId value\n let result = displayDataGrid(c4.logo.grid, \"logoGrid\", \"off\", false); //Create the dataGrid d...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Returns the maximum number of lines of text that should be rendered based on the current height of the element and the lineheight of the text.
function getMaxLines(height) { var availHeight = height || element.clientHeight, lineHeight = getLineHeight(element); return Math.max(Math.floor(availHeight / lineHeight), 0); }
[ "function getMaxLines(height) {\n var availHeight = height || (element.parentNode.clientHeight-element.offsetTop),\n lineHeight = getLineHeight(element);\n\n return Math.max(Math.floor(availHeight / lineHeight), 0);\n }", "getMaxRows() {\n return Math.floor(this.height/(this.textBlock.fontO...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Execute js code. This function should be call using .call() by passing proper context for 'this'. ex: apiService.evalResponse.call(this, code, jQuery) By passig the jQuery reference, $ var use by code that need to be eval will work just fine, even if $ is not assign globally.
evalResponse(code, $) { eval(code); }
[ "execute_js(code) {\n\t\tthis.win.webContents.executeJavaScript(code)\n\t}", "function evalJSReturnedByUploadJSP(js) {\n const data = eval(`\n (function () {\n var result = undefined;\n window = {\n parent: {\n ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Set font size for the page fs = Integer, size in px
function setPageFontSize (fs) { let fontSize = fs + "px"; Body.style.fontSize = fontSize; SearchTextInput.style.fontSize = fontSize; }
[ "set fontSize(value) {}", "setFontSize(px) {\n this.font.size = px;\n this.setFont();\n }", "set font_size( sizeval ) {\n this.window.style.fontSize = sizeval;\n }", "function setfont(size) {\n setHeaderContents(size);\n $(\"html\").css(\"font-size\", size + \"px\");\n $(...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Create a function called 'dprint' that takes one argument and prints it out to the console log _twice_.
function dprint(x1) {console.log(x1); console.log(x1); }
[ "function println_3(d) /* (d : double) -> console () */ {\n return printsln(show_2(d, undefined));\n}", "function printCaptainTest() {\n console.log(\n printFirstAndLastName(nameThatWillBePrinted) + \" is a fancy foe, but \" + captainName() + \" is far superior!\"\n )\n}", "function myDoubleCons...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
copySelectedOptions(select_object,select_object[,autosort(true/false)]) This function copies options between select boxes instead of moving items. Duplicates in the target list are not allowed.
function copySelectedOptions(from,to) { var options = new Object(); if (hasOptions(to)) { for (var i=0; i<to.options.length; i++) { options[to.options[i].value] = to.options[i].text; } } if (!hasOptions(from)) { return; } for (var i=0; i<from.options.length; i++) ...
[ "function copySelectedOptions(from,to) {\n\tvar options = new Object();\n\tfor (var i=0; i<to.options.length; i++) {\n\t\toptions[to.options[i].text] = true;\n\t\t}\n\tfor (var i=0; i<from.options.length; i++) {\n\t\tvar o = from.options[i];\n\t\tif (o.selected) {\n\t\t\tif (options[o.text] == null || options[o.tex...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Override `createAndCacheDataSource` to support local Node resolution service.
createAndCacheDataSource(serviceDef) { // Special case for the local Node resolution service if (serviceDef.schema) { const dataSource = new LocalGraphQLDataSource(serviceDef.schema); return dataSource; } return super.createAndCacheDataSource(serviceDef); }
[ "function AbstractDataSource() {}", "function mproxy_ds_initDataSource(){\r\n\ttry{\r\n\t\t\r\n\t\t// Datasource URI\r\n\t\tif(gSProxyRdfDataSouce == \"rdf:local-store\"){\r\n\t\t\tvar file = Components.classes[\"@mozilla.org/file/directory_service;1\"].getService(Components.interfaces.nsIProperties);\r\n\t\t\tva...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
;; camDist(x1, y1, x2, y2 | pos1, x2, y2 | x1, y1, pos2 | pos1, pos2) ;; ;; A wrapper for ```distBetweenTwoPoints()```. ;;
function camDist(x1, y1, x2, y2) { if (camDef(y2)) // standard { return distBetweenTwoPoints(x1, y1, x2, y2); } var pos2 = camMakePos(x2, y2); if (!camDef(pos2)) // pos1, pos2 { return distBetweenTwoPoints(x1.x, x1.y, y1.x, y1.y); } if (camDef(pos2.x)) // x2 is pos2 { return distBetweenTwoPoints(x1, y1, ...
[ "function cameraDistance(obj) {\n\tvar xDis,yDis;\n\tvar x = obj.centerX();\n\tvar y = obj.centerY();\n\tvar camX = gameLayer.cameraX + GameManager.screenWidth / 2;\n\tvar camY = gameLayer.cameraY + GameManager.screenHeight / 2;\n\txDis = Math.abs(camX - x);\n\tyDis = Math.abs(camY - y);\n\treturn Math.sqrt(xDis*xD...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Use callback either only on the initial render or on all renders. In concurrent mode the "initial" render might run multiple times
function useInitialOrEveryRender(callback, isInitialOnly) { if (isInitialOnly === void 0) { isInitialOnly = false; } var isInitialRender = Object(react__WEBPACK_IMPORTED_MODULE_1__["useRef"])(true); if (!isInitialOnly || (isInitialOnly && isInitialRender.current)) { callback(); } isIni...
[ "function useInitialOrEveryRender(callback, isInitialOnly) {\n if (isInitialOnly === void 0) { isInitialOnly = false; }\n var isInitialRender = React.useRef(true);\n if (!isInitialOnly || (isInitialOnly && isInitialRender.current)) {\n callback();\n }\n isInitialRender.current = false;\n}", ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
incidence 0: (2)[1, 2] 1: (3)[0, 4, 5] 2: (2)[0, 5] 3: (2)[4, 5] 4: (2)[1, 3] 5: (3)[1, 2, 3] stack["4", "3", "2", "0"]
function color3(incidence, stack){ colors = {}; if(stack.length == 0){ return colors; } if (stack.length == 1) { colors[stack[0]] = 0; return colors; } for (var i=0; i < incidence.length; i++){ var mates = incidence[stack[i]]; var col = {0:1, 1:1, 2:1}; ...
[ "function getStack(label) {\n switch (label.toLowerCase()) {\n case 'freecell':\n return freeCells\n case 'deposit':\n return deposits\n case 'stack':\n return stacks\n }\n }", "function biStack(d, listed) {\r\n\tvar max=0, min=0;\r\n\tfor (var i=0; i<d...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
An event handler for when a search item has been updated/changed We research the provider information
function updateFilteredSearch(){ if(typeof searchPnt != "undefined") findProviders(providerFS, searchPnt) }
[ "static set searchChanged(value) {}", "static get searchChanged() {}", "function onSearchLiveChange(oEvent){\n\t\t\t\tgetSearchFieldInfoObjectForEvent(oEvent);\n\t\t\t}", "function initializeSearcher() {\n onSearchParamsChanged();\n}", "function onSearchParamsChanged() {\n var text = _ui_search.value;...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Local Scope and Functions// / Variables which are declared within a function, as well as the function parameters have local scope. That means, they are only visible within that function.
function myLocalScope() { 'use strict'; // you shouldn't need to edit this line var myVar = 7; console.log(myVar); }
[ "function localScope() {\r\n var varr = 5;\r\n console.log(varr);\r\n}", "function myLocalScope() {\n var localScope = \"\";\n console.log('inside myLocalScope', localScope);\n}", "function myLocalScope() {\n 'use strict'; // you shouldn't need to edit this line\n var myVar = \"holly molly\";\n c...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
The current event subscriptions that are active on this collider.
get eventSubscriptions() { return this.internal.eventSubscriptions; }
[ "getEvents() {\n\n\t\treturn( this._events );\n\n\t}", "get eventListeners() {\n return this.eventListenersLocal;\n }", "get subscriptions() {\r\n return Object.values(this._subscriptions);\r\n }", "function getSubscriptions(){\n\t\t\treturn subscriptions;\n\t\t}", "_subscribeToChipEvent...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Set the XAxis Format for the current type
function getXAxisFormat() { /*Check if the timespan bigger then 1 day*/ //var d_start = new Date($scope.startTime.substring(6, 10),$scope.startTime.substring(3, 5),$scope.startTime.substring(0, 2)); //var d_end= new Date($scope.endTime.substring(6, 10),$scope.endTime.substring(3, 5),$scope.endTime.substring(0,...
[ "setXAxisFont(font)\n{\n this.xAxisFont = font;\n}", "function AxisFormat()\n{\n\t/**\n\t * The type of axis defines its scale.\n\t * <ul>\n\t * <li> \"linear\" - ...\n\t * <li> \"log\" - ...\n\t * <li> \"ordinal\" - The values along the axis are determined by a\n\t * discrete itemized list, ca...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
A predicate for a filter function used in the _alterModifications. Returns true if piece has a valid shape with nonzero area, and false otherwise.
function validShape(piece) { return (piece.shape !== undefined) && (turfArea(piece.shape) > 0.33); }
[ "hasNonzeroArea() {\n return this.getWidth() > 0 && this.getHeight() > 0;\n }", "isValidPiece(piece) {\n let valid = true;\n\n return piece.forActivePixels((pixelX, pixelY) => {\n const x = piece.x + pixelX;\n const y = piece.y + pixelY;\n\n if (x < 0 || x >= this.columns) {\n retu...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
if they did not gain 10 yards in 4 plays, this resets total yardage to 20, runs 1:30 off the clock and resets down and distance
function totalDowns(){ if (downs > 4 && currentYardage < 10 ) { console.log("turnover") totalYardage = 20 downs = 1 currentYardage = 0 totalTime -= turnoverTime; if (totalTime > 0) { audioBoo.play(); ...
[ "function ytg(yardsGained) {\n // global yards\n yardsToGo = yardsToGo - yardsGained;\n // check if entered end-zone\n // if (yardsToGo == 0) {\n // endZone();\n // scoring(7);\n // playMarquee(\"Touchdown\");\n // window.setTimeout(switchSides, 2200);\n // }\n // first...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Push a new node to this node's children.
addChild(node) { this.children.push(node); return this; }
[ "addChild(branch) {\n this.children.push(branch);\n }", "addChild(tree) {\n this.children.push(tree);\n return this;\n }", "addChild(child) {\n this.children.push(child);\n }", "addChild(child) {\n this.children.push(child);\n child.parent = this;\n }", "addCh...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Project 3 is hovered over
function projectHover3() { projectImage3_div.classList.add("project-img-active"); projectsThirdProject_div.addEventListener("mouseout", projectInactive); }
[ "function projectHover1() {\n projectImage1_div.classList.add(\"project-img-active\");\n projectsFirstProject_div.addEventListener(\"mouseout\", projectInactive);\n}", "function projectHover2() {\n projectImage2_div.classList.add(\"project-img-active\");\n projectsSecondProject_div.addEventListener(\"mouseout...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Starts an RPC server that receives requests for the Emailer service at the sample server port
function main() { console.log("connecting to emailer-svc"); client = new emailer.Emailer("emailer-svc:50051", grpc.credentials.createInsecure()); console.log("sending email"); client.email({recipient: "borg286@gmail.com", subject: "hi brian", body: "you are my bro"}, function(err, response) { console.lo...
[ "function main() {\n var server = new grpc.Server();\n server.addService(ep_proto.Teste.service, {Teste1: Teste1, Teste2: Teste2, Teste3: Teste3, Teste4: Teste4, Teste5: Teste5});\n server.bind('0.0.0.0:50051', grpc.ServerCredentials.createInsecure());\n server.start();\n console.log('\\033[96m'+'Servidor em e...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Bresenham's line algorithm set pixels, modified step
function lineBresenham(x1, y1, x2, y2){ let dx, dy; let stepX, stepY; dx = x2 - x1; dy = y2 - y1; if (dy < 0) { dy = -dy; stepY = -totPixel; } else { stepY = totPixel; } if (dx < 0) { dx = -dx; stepX = -totPixel; } else { stepX = ...
[ "function lineBresenham(x0, y0, x1, y1,color)\r\n{\r\nvar dy = y1 - y0;\r\nvar dx = x1 - x0;\r\nvar stepx, stepy;\r\nif (dy < 0)\r\n{\r\ndy = -dy;\r\nstepy = -1;\r\n}\r\nelse\r\n{\r\nstepy = 1;\r\n}\r\nif (dx < 0)\r\n{\r\ndx = -dx;\r\nstepx = -1;\r\n}\r\nelse\r\n{\r\nstepx = 1;\r\n}\r\ndy <<= 1;\r\ndx <<= 1;\r\ncre...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Responsible for chanign the base color of the ps1 and the lid (since it's a seperate object)
function ps1Color (){ counter += 1; document.getElementById('model__Base_ps1').getAttribute('diffuseColor'); document.getElementById('model__lidcolor').getAttribute('color'); switch (counter) { case 1: document.getElementById('model__Base_ps1').setAttribute('diffuseColor', ' 0.05882 0.1961 0.3804'); docu...
[ "changeToLightningColor() {\n this.stroke.r = this.stroke.lightning.r;\n this.stroke.g = this.stroke.lightning.g;\n this.stroke.b = this.stroke.lightning.b;\n }", "SetProceduralColor() {}", "constructor(x1, y1, penMode1, color1) {\n this.x = x1;\n this.y = y1;\n this.penMode = penMode1;...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Difficulty is like number of zeros in prefix of hash. Bitcoin uses zeros but it can be any constraint so that miners find exact hashes to make a new block and get reward
mineBlock(difficulty){ while(this.hash.substring(0, difficulty) !== Array(difficulty + 1).join("0")){ this.nonce++; this.hash = this.calculateHash(); } console.log("BLOCK MINED: " + this.hash); }
[ "mineBlock(difficulty) {\n // below loop will keep calculating hash until it contains a specified number of \n // zeroes acoording to difficulty value specified in properties of class Blockchain\n while(this.hash.substring(0, difficulty) !== Array(difficulty + 1).join(\"0\")) {\n // ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Bootstrap code to initialize all expected data structures for the room
function bootstrap(room) { room.memory.infrastructure = {}; // Designate mining posts // Stores in room.memory.shafts setupSources(room); // Order array by name in case there is more than one spawn. we want the // original var spwn = room.find(FIND_MY_SPAWNS).sort()[0]; if (!util.def...
[ "function initializeRoomData() {\n\tvar rooms = JSONData.rooms;\n\tfor (var i = 0; i < rooms.length; i++) {\n\t\tvar newRoom = {};\n\t\tnewRoom[\"_id\"] = generateUUID();\n\t\tnewRoom.title = rooms[i].prefix + \" \" + rooms[i].number;\n\t\tnewRoom.classes = [];\n\t\troomData.push(newRoom);\n\t}\n}", "async init (...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Function to populate the elections on the candidates board
function candidateElection(result){ candElec.innerHTML = ''; for(let i = 0; i < result.length; i++){ let opt = document.createElement('option'); candElec.options.add(opt); opt.text = result[i]['election_title']; opt.value = result[i]['election_id']; candElec.appendChild(o...
[ "function populateCandidates() {\n Voting.deployed().then(function (contractInstance) {\n contractInstance.allCandidates.call().then(function (candidateArray) {\n for (let i = 0; i < candidateArray.length; i++) {\n /* We store the candidate names as bytes32 on the blockchain. We use the\n * ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Gets the opened link details based on idValue
function getOpenedLinkDetails(grid, idValue) { var linkDetail; if (idValue && idValue.length > 0) { $.map(grid.openedLinkDetailsList, function (openedLinkDetails) { if (openedLinkDetails.doubleClickedItemId == idValue || getRowNumberFromCellId(grid, openedLinkDetails.doubleClickedItemId) == getRowNumberFromC...
[ "get openurl() {\n let self = this;\n let list = [];\n if (self.item && self.item.delivery) {\n let openUrlList = self.item.delivery.link.filter(f => /^openurl/.test(f.displayLabel)).map(m => m.linkURL);\n if (openUrlList.length > 0) {\n list = list.concat(openUrlList);\n }\n }\n\n...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
When an user changes its status (online > offline, offline > online or other combinations), we must also update it in the right side of the application (the friends list). This is done by the moveUser function that takes an user from an array and moves it completely to the second one, not before changing the user statu...
function updateFriendNewStatus(params) { /** * Moves an user from an array to another one, not before changing the * status of the user with the specific ID. * * @param userID: the user id of the user to be moved * @param firstArray: the first array to be used ...
[ "function changeStatusUser(status, user) {\n users.forEach(item => {\n if (item.nickname === user.nickname) {\n if (status == 'online' && item.status == 'just appeared') {\n item.status = status;\n item.color = '#00b75d';\n io.emit('user online', user);\n }\n ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
When open is true, the passed in wall will be open, otherwise the wall will be closed
function updateWall(rowOne, colOne, rowTwo, colTwo, open){ if(open){ if(rowOne < rowTwo){ mazeCells[rowOne][colOne].bottomWall = 'open'; mazeCells[rowTwo][colTwo].topWall = 'open'; } else if(rowOne > rowTwo){ mazeCells[rowOne][c...
[ "function playWallShouldOpen() {\n return true;\n}", "function openFan()\n {\n toggleHideElements([DOM.pause.deskContainer], animation.duration.hide, false);\n desk.toggleFan(4, 35, 10, true);\n for (var counter = 0; counter < desk.cards.length; counter++)\n {\n...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Read an integer from the string
readInt() { const helper = new misc_functions_1.ReturnHelper(); const start = this.cursor; const readToTest = this.readWhileRegexp(StringReader.charAllowedNumber); if (readToTest.length === 0) { return helper.fail(EXCEPTIONS.EXPECTED_INT.create(start, this.string.length)); } // The Java readI...
[ "function read(string, start, digits)\n{\n\tvar substring = string.substring(start, start + digits);\n\treturn parseInt(substring);\n}", "function stringInt(str){\n return(parseInt(str))\n}", "function toInteger (str) {\n if (typeof str == 'number') return str;\n var num;\n num = parseInt(str.ma...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Ouvre un mapfile isigeo
function openMFIsigeo(){ if(viewer!=null && !viewer.closed){ viewer.close(); } if(mapFile!=null){ if(mapFile.state=="MODIFY" || mapFile.serverState=="MODIFY"){ saveConfirm(openMFIsigeo); return; }else{ if(ongletActive!="parametres"){ flipOnglet('parametres'); } ...
[ "function uploadMap(map, e) {\n let reader = new window.FileReader();\n\n reader.readAsText(e.target.files[0]);\n\n reader.onload = function () {\n let data = JSON.parse(event.target.result);\n map.new(data);\n };\n}", "function importMap() {\r\n formIsEnabled = false;\r\n ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
END registerItemEvents START removeExistingAlerts
function removeExistingAlerts() { var existingAlerts = jContainer.find(".container-ASWidgetAlert"); if (existingAlerts) { existingAlerts.remove(); } }
[ "function removeAlerts (scr) {\r\n\r\n for (const alert of currentAlerts) {\r\n\r\n if (alert.script === scr) {\r\n\r\n removeAlert(alert);\r\n }\r\n }\r\n}", "function resetAlerts() {\n}", "function bindExistingAlerts() {\n\t\t\tvar allAlertsCloseBtns$ = jContainer.find(\".contai...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Bind AdaptiveCard with data
renderAdaptiveCard(rawCardTemplate, dataObj) { const cardTemplate = new ACData.Template(rawCardTemplate); const cardWithData = cardTemplate.expand({ $root: dataObj }); const card = CardFactory.adaptiveCard(cardWithData); return card; }
[ "static renderAdaptiveCard(rawCardTemplate, dataObj) {\n const cardTemplate = new ACData.Template(rawCardTemplate);\n const cardWithData = cardTemplate.expand({ $root: dataObj });\n const card = CardFactory.adaptiveCard(cardWithData);\n return card;\n }", "function BindedCard(element, card){\n thi...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Returns all the attribute identifiers that starts with 'dataattr'. These attributes are normally passed down to the final element.
getAllDataAttrKeys() { return Object.keys(this.attributesObject).filter(field => field.startsWith('data-attr')); }
[ "getDataAttributes() {\n const attributes = [].slice.call(this.element.attributes);\n const data = {};\n attributes.forEach(attribute => {\n if (attribute.name.indexOf('data-') === 0) {\n const propName = attribute.name.substr(5);\n data[propName] = attr...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Disable steps 2 and 3 in plus menu
function disableSteps() { $("#swish-button").removeAttr("href"); $("#step2").css("opacity",0.5); $("#step3").css("opacity",0.5); $("#plusButtons").css("opacity",0.5); $("#plusSwish").css("opacity",0.5); $("#plusButtons span.button").removeAttr("style"); }
[ "function enableSteps() {\n $(\"#plusButtons\").css(\"opacity\",1);\n $(\"#plusSwish\").css(\"opacity\",1);\n $(\"#step2\").css(\"opacity\",1);\n $(\"#step3\").css(\"opacity\",1);\n $(\"#plusButtons span.button\").css(\"cursor\",\"pointer\");\n $(\"swish-QR\").removeAttr(\"src\");\n}", "function...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
We check that all the patterns appeared on the output
areAllSuccessPatternsPresent(successPatterns) { return successPatterns.every(pattern => { let patternRe = new RegExp(pattern, "i"); return patternRe.test(this.output); }); }
[ "completed_patterns() {\n //console.log(\"\\n------ done ------\");\n var count = 0; for (var key in this.patterns) { count += 1; }\n //console.log(\"Looking for complete patterns in total: \" + count);\n var tmp = this.patterns;\n var rtn = [];\n this.patterns = {};\n for (var key in tmp) {\n ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Min/Max Chat Starts a new group with every user from the buddiesClickedOn array
function beginGroup() { var sessionName = document.getElementById('sessionName'); if(sessionName.value != "") { pfc.sendRequest("/join "+sessionName.value); addSelfToGroup(sessionName.value); for(var i=0;i<buddiesClickedOn.length;i++) { addToGroup(buddiesClickedOn[i], sessionName.value); pfc.s...
[ "function addGroupsListener(user,state) {\n _.forEach(user.groups,item => {\n socket.on(item,({from,data}) => {\n if(data.type) return\n if(item === state.currentRoom._id) {\n state.messages.push(data)\n } else {\n if(_.isString(state.count)) ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Resets domains related to CSS scales.
resetStyleDomains() { this.__notify(EV.BEFORE_STYLE_DOMAINS_RESET); this._resetStyleDomains(); this.__notify(EV.STYLE_DOMAINS_RESET); return this; }
[ "_resetStyleDomains() {}", "function updateDomains() {\n xScale.domain(cur_display.map(function(d) { return d.name; }));\n yScale.domain([0, d3.max(cur_display, function(d) { return d.percentage})]);\n }", "function setDomains() {\n x0.domain(currentData.map(getId));\n x1.domain(keys).rangeRound([0, x0...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
if reached end of sequence
function checkEnd() { if (activeIndex >= sequence.length) { lockBoard(); nextRound(); } }
[ "function reportEndOfSequence()\n {\n if (currentLivePerformersKeyPitch === -1) // key is up\n {\n if (currentIndex === endIndex)\n {\n stop();\n }\n else if (performedSequences[nextIndex].chordSequence !== u...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Checks whether the elment causes a visual line break ( or block elements)
function _isLineBreakOrBlockElement(element) { if (_isLineBreak(element)) { return true; } if (wysihtml5.dom.getStyle("display").from(element) === "block") { return true; } return false; }
[ "function _isLineBreakOrBlockElement(element){if(_isLineBreak(element)){return true;}if(wysihtml5.dom.getStyle(\"display\").from(element)===\"block\"){return true;}return false;}", "function _isLineBreakOrBlockElement(element) {\r\n if (_isLineBreak(element)) {\r\n return true;\r\n }\r\n\r\n if (dom...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
retrieve random user from DB
static async getRandomUser(){ let res = await this.request(`matches/random`); return res.user; }
[ "function randomUsers() {\n usersModule.getUsers(getRandomUsers);\n}", "function randomUser() {\n var userId = userArr[Math.floor(Math.random() * userArr.length)]._id;\n return userId;\n}", "randomizeRecipient(db) {\n return db\n .raw('SELECT id FROM briefpal_users OFFSET random() * (SELECT COUNT(*...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
pick up entries from vendor chunk file
function readEntries () { return new Promise (resolve => { const rs = fs.createReadStream(VENDOR_CHUNK_PATH) const rl = readLine.createInterface(rs) const entries = [] rl.on('line', (line) => { if (line.startsWith('/***/ "./node_modules')) { const path = line.slice(7, -2) if (pa...
[ "loadVendors(){\n\t\ttry{\n\t\t\treturn JSON.parse(this.fs.readFileSync(this.vendorfile));\n\t\t}catch(err){\n\t\t\tconsole.log(err);\n\t\t}\n\t}", "function addVendors() {\n let extractions = Config.extractions.map(entry.addExtraction.bind(entry));\n\n // If we are extracting vendor libraries, then we also...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Update the cities table with the latest search result, select the row and ensure it is visible
function updateCitiesTable(searchCity) { $("#citySearchDataTable").jqxDataTable('addRow', null, { city: searchCity }, 'last'); $("#citySearchDataTable").jqxDataTable('clearSelection'); var lastRow = $("#citySearchDataTable").jqxDataTable('getRows').length; //alert("lastRow: " + lastRow); $("#citySea...
[ "function updateCitySelection() {\n // Create a blank option\n var option = citySelection.append(\"option\");\n var cityList = [];\n option.text(\"\");\n tableData.forEach((sighting) => {\n Object.entries(sighting).forEach(([key, value]) => {\n // find the city key, and check if cit...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Definimos la clase telefono
function Telefono(num, marca, color) { this.marca = marca; this.color = color; this.num = num; this.numLlamadas = 0; this.marcar = function(){ console.log("llamada realizada"); this.numLlamadas++; return this.numLlamadas; }; }
[ "getTelefono () {\n return this.telefono;\n }", "constructor(tipo, numero) {\r\n this.Tipo = tipo;\r\n this.Numero = numero;\r\n }", "constructor(nombre, telefono, direccion){\n\n\n\n\tthis.nombre = nombre;\n\tthis.telefono = telefono;\n\tthis.direccion = direccion;\n\t}", "function Tel(n...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Write a function which takes as its parameter the above array. Then for each of the elements write a log to the console. Here are example logs: "I am reading 'The Road Ahead' by Bill Gates", "I will read 'Mockingjay: The Final Book of The Hunger Games' by Suzanne Collins" If the readingStatus is true, then it should sa...
function print(array) { var tense; for (var i = 0; i < array.length; i++) { if (array[i].readingStatus === true) { tense = "am reading '"; } else if (array[i].readingStatus === false) { tense = "will read '"; } console.log("I " + tense + array[i].title + "' by " + array[i].author); } }
[ "function readingStatus(books){\n for(let book in books){\n if(books[book].haveRead === true){\n console.log(`${books[book].author} has read ${books[book].title} book.`);\n }else{\n console.log(`${books[book].author} hasn't read ${books[book].title} book.`);\n }\n }\...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Function mainCanvasApp calls the gameBoard.place() method. This sets up the main Canvas. It then places all existing tiles on the game board using the BD18.boardTiles array.
function mainCanvasApp(){ BD18.hideMapItems = false; BD18.gameBoard.place(); if (BD18.boardTiles.length === 0) { return; } var tile; for(var i=0;i<BD18.boardTiles.length;i++) { if (!(i in BD18.boardTiles)) { continue; } tile = BD18.boardTiles[i]; tile.place(); } }
[ "function makeBoard(){\n\t\t// Draw images first to be under grid.\n\t\tcontext.drawImage(img, board.startX1, board.startY1, board.imgSize, board.imgSize);\n\t\tcontext.drawImage(img, board.startX2, board.startY2, board.imgSize, board.imgSize);\n\n\t\tmakeGrid(board.startX1, board.startY1, board.endX1, board.endY1)...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
"$" dollar signs must be doubled before being used in a regex replace This can occur in eyes or tongue. For example: cowsay g Moo! cowsay e "\$\$" Moo!
function escapeRe (s) { if (s && s.replace) { return s.replace(/\$/g, "$$$$"); } return s; }
[ "function escapeReplacementString(text) {\n return text.replace(/\\$/g, '$$$$'); // each dollar sign is replaced by *TWO* dollar signs\n}", "function escapeRe(s) {\r\n\tif (s && s.replace) {\r\n\t\treturn s.replace(/\\$/g, \"$$$$\");\r\n\t}\r\n\treturn s;\r\n}", "function escapeRe (s) {\n\t\tif (s && s.repla...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
You may need to create variables to store state. This function will be called when the camera video page is intialised and ready to be used.
function cameraVideoPageInitialised() { function handleOrientation(event) { var absolute = event.absolute; var alpha = event.alpha; var beta = event.beta; var gamma = event. gamma; }// Step 1: Check for and intialise deviceMotion cameraVideoPage.setHeadsUp...
[ "cameraSetUp() {\n //Checking the navigator such as depending on what naviagtor each browser is using that different methods are used to get WebRTC.\n navigator.getUserMedia = navigator.getUserMedia ||\n navigator.webkitGetUserMedia ||\n navigator.mozGetUserMedia ||\n ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
hasModSuffix returns true if the given tool has a different, modulespecific name to avoid conflicts.
function hasModSuffix(tool) { return tool.name.endsWith('-gomod'); }
[ "function isTslibHelperName(name) {\n const nameParts = name.split('$');\n const originalName = nameParts[0];\n if (nameParts.length > 2 || (nameParts.length === 2 && isNaN(+nameParts[1]))) {\n return false;\n }\n return tslibHelpers.has(originalName);\n}", "function isModuleName(name) {\n ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Put a large number in here. Function to get a tree of desired depth and leaves
function jsTree(depth, leaves) { var node = new Object(); node.value = 0; node.status = 0; node.terminal = function(){return false;}; node.children = new Array; if(depth > 0){ for(var i = leaves; i > 0; i--){ node.children.push(jsTree(depth-1, leaves)); } } if(depth==0) {node.value=Math.round(9 * Math.ra...
[ "function getTree(depth) {\n switch (depth) {\n case 1:\n return {\n value: 1,\n depth: 1,\n };\n case 2:\n return {\n value: 1,\n depth: 1,\n halfFrom: {\n value: 2,\n ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
create an activity context if none exists, allows more efficient creation of multiple copies
function setupContext( itcb ) { // if a context was passed we can skip this step if ( hasContext || isTest ) { return itcb( null ); } options.activityContext = { skipInvalidateParentActivities, 'cache': {}, ...
[ "static create(cntxt) {\n\t\treturn cntxt instanceof Contexts ? cntxt \n\t\t\t: (cntxt ? new Contexts(cntxt) : new Contexts());\n\t}", "createContext() {\n return new CbtContext();\n }", "function Activity() {\n Context.call(this);\n}", "function createContext() {\n return _.cloneDeep(defaultCon...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
WORKAROUND: cosi's text_to_array is too slow ...use nonutf8 shim until that gets fixed
function text_to_array(text) { var byte, bdx = 0, len = text.length, res = new Array(len), bytes = text_to_bytes(text) for(;;) { byte = get_byte(bytes, bdx) if(byte == 0) break res[bdx++] = byte } free(bytes) verify(bdx == text.length, "UTF-8 not yet supported") return res }
[ "function createUtf8CodeArrayFromString(text) {\n // XXX do documentation\n var i = 0, l = text.length, utf16Codes = new Array(l);\n for (; i < l; i += 1) utf16Codes[i] = text.charCodeAt(i);\n return createUtf8CodeArrayFromUtf16CodeArray(utf16Codes, 0, utf16Codes.length);\n }", "function textToArray(...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Callback for when the user clicks the "Send message" button in a private conversation
function onClickSendPrivateMessage(e) { // Get the button that was pressed var button = e.currentTarget; // Get the ID of the user we want to send to var recipientId = button.id.split('-')[2]; // Get the message to send var message = $('#private-message-'+recipientId).val(); $('#private-message-'+recip...
[ "function onClickSendPrivateMessage(e) {\n\n // Get the button that was pressed\n var button = e.currentTarget;\n\n // Get the ID of the user we want to send to\n var recipientId = button.id.split('-')[2];\n\n // Get the message to send\n var message = $('#private-message-'+recipientId).val();\n $('#private-...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Returns whether additional work was scheduled. Caller should keep flushing until there's no work left.
function flushActWork() { if (flushMockScheduler !== undefined) { try { return flushMockScheduler(); } finally { } } else { try { var didFlushWork = false; while (flushPassiveEffects()) { didFlushWork = true; } return didFlushWork; } finally { } } ...
[ "needsReschedule() {\n if (!this.currentTask || !this.currentTask.isRunnable) {\n return true;\n }\n let el = this.taskQueue.peek();\n if (el && el.absoluteDeadline < this.currentTask.absoluteDeadline) {\n return true;\n }\n return false;\n }", "g...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
removes layer with specified name returns name of next higher layer in render order or layer at index 0 if deleted first layer, or "" if deleted last layer
deleteLayer(layer_name) { var return_name = ""; if (this.layers.hasOwnProperty(layer_name)) { console.log(this.channelName, `layer ${layer_name} deleted`); delete this.layers[layer_name]; // take out of layers_order var removed = false; for (var delete_index = 0; delete_index < this.layers_order....
[ "static removeLayer(name)\n {\n \tlet find = false;\n \tlet i = 0;\n \twhile(!find && i < layers.length)\n \t{\n \t\tif(layers[i].name == name)\n \t\t{\n \t\t\tfind = true;\n \t\t}\n \t\telse\n \t\t{\n \t\t\ti++;\n \t\t}\n \t}\n \t\n \tif(i == layers.length)\n \t{\...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Show the number of sources
function sourcesText(sources) { if (sources == 1) { sources = "1 source"; } else if (sources < 20) { sources = sources + " sources"; } else { sources = "20+ sources"; } return sources; }
[ "function countSources(data) {\n\n const sources = data.projects.map(project => project.source);\n return new Set(sources).size;\n}", "function countLinks() {\n var x = document.links.length;\n document.getElementById('count').innerHTML = x;\n}", "showNbSongs (){\n\t\t\t\t\tres.write('le nombre de c...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Returns the largest whole number scale factor that won't result in the canvas being larger than the given dimensions. Will always return a number n >= 1 so the canvas doesn't scale itself into zero size.
function getBestFitScaleFor(canvas, width, height) { return Math.max(1, Math.min(Math.floor(width / canvas.width - 1), Math.floor(height / canvas.height - 1))); }
[ "_getMaxN() {\n const minDim = Math.min(this.width, this.height);\n if (minDim > 4.0 / 10.0) return 250;\n if (minDim > 4.0 / 100.0) return 1000;\n if (minDim > 4.0 / 1000.0) return 2500;\n if (minDim > 4.0 / 10000.0) return 5000;\n if (minDim > 4.0 / 100000.0) return 10000;\n if (minDim > 4.0 ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Changes the max team size
function changeMaxTeamSize() { if (maxTeamSize < 8) { maxTeamSize = maxTeamSize + 1; } else { maxTeamSize = 2; } document.getElementById("teamsizebutton").textContent = maxTeamSize + " Max Team Size"; initializeTeamArrays(); }
[ "function setGoalSize(n) {\n //set the new goalSize\n goalSize = n;\n //check that the goalSize < gameSize (by at least minimum border thickness)\n while((gameSize-goalSize) < (2*minBorderThickness)){\n //adjust gameSize to fit with newly assigned goalSize\n gameSize += 1;\n }\n}", "f...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
called when change occurs; record the last used adjacency list for undoing and update adjlist/properties frames only exception is createFromList, which does slightly different things
function updateAppStatus() { record(curAlist.toNumList()); curAlist = getAdjlist(); updateAdjlistFrame(); updatePropFrame(); }
[ "replaceLastVisitedObjects (state, list) {\n state.lastVisitedObjects = list\n }", "function createAdjacencyList() {\n for (i = 0; i < node.size(); i++) {\n node_name = node[0][i].__data__.name;\n adjacencyList[i] = {\n name: node_name,\n size: 0,\n connec...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Initializes a new instance of the `PdfTilingBrush` class.
function PdfTilingBrush(arg1,arg2){var _this=_super.call(this)||this;/** * Local variable to store Stroking. * @private */_this.mStroking=false;/** * Local variable to store the tile start location. * @private */_this.mLocation=new PointF(0,0);/** * Local v...
[ "function PdfTilingBrush(arg1, arg2) {\n var _this = _super.call(this) || this;\n /**\n * Local variable to store Stroking.\n * @private\n */\n _this.mStroking = false;\n /**\n * Local variable to store the tile start location.\n * @private\n ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
readNext (private use) read next emvItem, and return the remaining string
function readNext(inputText) { const id = inputText.substring(0, 2); const len = parseInt(inputText.substring(2, 4)); const data = inputText.substring(4, len + 4); const emvItem = { id, name: getDataObjectName(id), len, data }; const remainingText = inputText.subs...
[ "function getNextItem()\n\t{\n\t\treturn stream.shift();\n\t}", "function readNext() {\n\n if (charStream.endof()) return null;\n var char = charStream.peek();\n readWhile(isWhitespace);\n char = charStream.peek();\n if (char === '#') {\n ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }