query
stringlengths
9
34k
document
stringlengths
8
5.39M
negatives
listlengths
19
20
metadata
dict
Sends to the appropriate platforms all the information stored at yellPageEvents. The page view call for all the platforms will be used.
function sendPageEvents() { var plattforms = getAvailablePlattforms(); // Loop over all events and check which need to be sent var events = yellPageEvents.getEvents(); for (var i = 0; i < events.length; i++) { var currentEvent = events[i]; if (!currentEvent.hasBeenSent()) { currentEvent.markAsSent(); pl...
[ "function sendAnnotatedPageViewEvent() {\r\n\t\t\tcX.initializePage();\r\n\t\t\tcmsCustom();\r\n\t\t\tcX.setSiteId(TAMSiteId);\r\n\t\t\tcX.sendPageViewEvent();\r\n\t\t\tcX.stopAllSessionAnnotations();\r\n}", "function _triggerPageEventsBasedOnDOM() {\n var bodyAttr = document.querySelector('body').getAttri...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Retorna um Array com os valores dos inputs de coluna
function getInputColumsValuesArray(){ let inputsArray = Array.prototype.slice.call(document.getElementsByClassName('colum')) return inputsArray.map(x=>x.value.trim().toUpperCase()).filter(x=>x != '') }
[ "function getColumnAsArray(col){\n var array = [];//empty array to push it in\n for (var i = 0; i < data.length; i++) {\n array.push(data[i][col]);\n }\n return array; \n}", "function col2Array(dat){\nreturn values(dat).map((v) => {return v['$0']['$1'];});\n}", "_rowToArray(colNames, row) {\n const...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Gets the collection of RoleDefinition resources
get roleDefinitions() { return new RoleDefinitions(this); }
[ "async function getAllResourceRoles () {\n return helper.queryDataFromDB(QUERY_GET_ALL_RESOURCE_ROLES, [])\n}", "function RoleDefinitions(baseUrl, path) {\n if (path === void 0) { path = \"roledefinitions\"; }\n return _super.call(this, baseUrl, path) || this;\n }", "function RoleDefinitions(b...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
/ Writes the given data to the socket as an end command, suppressing all errors / Returns true if successful; otherwise, returns false
function endSafe(socket, data) { try { socket.end(data); return true; } catch(err) { log("Error ending socket:" + err.message); return false; } }
[ "end(data) {\n\t\tif (this.open){\n\t\t\tthis.sock.write(data);\n\t\t\tthis.open = false;\n\t\t\tthis.sock.end();\n\t\t} else {\n\t\t\tconsole.warn('Connection Closed!');\n\t\t}\n\t}", "write(data){\n\t\tif (this.open){\n\t\t\tthis.sock.write(data);\n\t\t} else {\n\t\t\tconsole.warn('Connection Closed!');\n\t\t}\...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
HELPER FUNCTIONS BELOW Name: jobInfoPrepper Input: JSON object of jobs fields Output: JSON object of formatted jobs fields
function jobInfoPrepper(body){ let job = (body.job_id) ? body.job_id : null; let user = (body.user_id) ? body.user_id : null; let title = (body.title) ? body.title : null; let wage = (body.wage) ? body.wage : null; let frequency = (body.frequency) ? body.frequency : null; let filing = (body.fili...
[ "function getJobDetails(data,cookies){\n\n // var currentdate = new Date();\n // jobCreatedDate = currentdate.toISOString(); \n // // var datetime = currentdate.getDate() + \"/\"\n // + (currentdate.getMonth()+1) + \"/\" \n // + currentdate.getFullYear() + \" @ \" \n // ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Operation: getQueryParam summary: Test query parameters req.query: type: object properties: int1: type: integer int2: type: integer valid responses: '200': description: ok
async getQueryParam(req) { if ( typeof req.query.int1 !== "number" || typeof req.query.int2 !== "number" ) { throw new Error("req.params.int1 or req.params.int2 is not a number"); } return ""; }
[ "async getQueryParamObject(req) {\n\t\tif (\n\t\t\ttypeof req.query.int1 !== \"number\" ||\n\t\t\ttypeof req.query.int2 !== \"number\"\n\t\t) {\n\t\t\tthrow new Error(\"req.params.int1 or req.params.int2 is not a number\");\n\t\t}\n\t\treturn \"\";\n\t}", "function QueryParameters() {}", "exQueryParams(request,...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Finalize the zip archive
_finalize() { this.sheetStream.end(templates.SheetFooter); return this.zip.finalize(); }
[ "function finalize() {\n debug('finalizing zip');\n archive.finalize(function(err, written) {\n if (err) return callback(err);\n debug('wrote bytes to zip', written);\n callback();\n });\n }", "function zipperComplete(){\n\t//Increase the counter of file compressed\n\tzippedFiles++;\n\tif...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Save the simulation grid This allows users to reset their grid to the inital state
SaveSimulation() { this.savedSimulationGrid = this.simulationGrid; }
[ "function saveGrids() {\n\t\t\t\tconsole.log(gridArray);\n\t\t\t\twriteGridToFile(gridArray);\n\t\t}", "function save() {\n let gridArray = [];\n let getGrid = document.querySelectorAll('.pixel-canvas tr td');\n document.querySelector('.save').addEventListener('click', function () {\n for (let i = 0; i < ge...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
end T get uncertainty
function uncertainty(average, num, string, min) { var ua = 0; var ub = min / Math.pow(3, 0.5); for (i = 0; i < num; i++) { var n = parseFloat(string); string = string.replace(n, ''); ua += Math.pow(n - average, 2); } ...
[ "get normTemperautreDifference() {\r\n return this._getTemperatureDifference(data.NORM_VALUES);\r\n }", "standardDeviation () {\n return Math.sqrt(this.variance())\n }", "standardDeviation() {\n return Math.sqrt(this.variance());\n }", "get variance(): number {\n return this.mean / this...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
dummy disposable to satisfy interfaces
dummyDisposable() { return { dispose: () => 0 } }
[ "temp_disposer(disposer_key, fn, ...args) {\n if(this[disposer_key]) {\n this.disposables.remove(this[disposer_key])\n this[disposer_key].dispose()\n }\n\n const on_dispose = fn.call(this, ...args)\n\n this[disposer_key] = new Disposable(on_dispose)\n this.disposables.add(this[disposer_key]...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Highlights rows selected in a table using a checkbox element
function highlightCheckedSelections() { $( "tr[input]" ).removeClass( "highLightAdded" ); $( "tr[input[@checked]]" ).addClass( "highLightAdded" ); }
[ "function tableHighlight () {\n\t var table = $('.table');\n\t var chboxes = table.find('input.check');\n\n\t chboxes.on('change', function () {\n\t if(this.checked) {\n\t $(this).closest('tr').addClass('highlight');\n\t } else {\n\t \t$(this).closest('tr').removeClass('highl...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Join a sequence of url components with `'/'`.
function urlPathJoin() { var paths = []; for (var _i = 0; _i < arguments.length; _i++) { paths[_i - 0] = arguments[_i]; } var url = ''; for (var i = 0; i < paths.length; i++) { var path = paths[i]; if (path === '') { continue; } if (i > 0) { ...
[ "function join_url_parts(url_parts) {\n return url_parts.reduce(function(l, r) {\n return l.toString().replace(/\\/$/, '') \n + '/' + r.toString().replace(/^\\//, ''); \n });\n}", "function urlPathJoin() {\n var paths = [];\n for (var _i = 0; _i < arguments.length; _i++) {\n p...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
function to create an order with order items. specify the customer id and the number of items that should be in the order
function createOrderWithItems(customer,noItems){ //created this to be async to run multiple orders let prom = new Promise(function(resolve,reject){ var today = new Date(); //ORDER //Generate Order with UUID let orderId = `order-${uuidv4()}`; console.log("Order UUID: " + o...
[ "function createOrder() {\n\tvar data = JSON.stringify({customer_ident: currentCustomer.customer_ident, paid: false});\n\tmakeCall(\"POST\", \"OneCustomer.Orders\", data, null, true, function(response) {\n\t\trefreshAfterUpdate(response);\n\t});\n}", "function createNewOrders(noOfOrders) {\n var creati...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
EngineWrapper can help generating a http engine quickly through a adapter
function EngineWrapper(adapter) { var AjaxEngine = function () { function AjaxEngine() { _classCallCheck(this, AjaxEngine); this.requestHeaders = {}; this.readyState = 0; this.timeout = 0; // 0 stands for no timeout this.responseURL = ""; ...
[ "function EngineWrapper(adapter) {\n var AjaxEngine = function () {\n function AjaxEngine() {\n _classCallCheck(this, AjaxEngine);\n\n this.requestHeaders = {};\n this.readyState = 0;\n this.timeout = 0; // 0 stands for no timeout\n this.responseURL =...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Narudzbu cemo rijesiti preko local storagea uz pomoc life cycle metoda componentWillUpdate Ona okidana se komponenti prosljede novi parametri ili novo stanje Prima 2 parametra novi atributi(params, parametri, nextProps) i novo stanje(nextState)
componentWillUpdate(nextProps, nextState){ /* console.log("state of props changed"); console.log({nextProps, nextState});*/ const keyVal = "order-" + this.props.match.params.storeId; //Ovo ovako ne radi jer localStorage ne prima objekat, ali moze string tako da cemo objekat pret...
[ "componentDidUpdate (P_prev_props, P_prev_state)\n {\n //[ all_options reset-local-storage-01;^B]\n\n //console.log (\"componentDidUpdate\");\n if (P_prev_state.all_options.length !== this.state.all_options.length)\n {\n const L_json = JSON.stringify (this.state.all_options);\n localStorage.s...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
cloud function to retrieve replies by docid, data ==>document(reply)id
async function getReplyById(data, context){ // user is not logged in, throw error if(!context.auth){ if (Constant.DEV) console.log('not logged in', context.auth.token.email) throw new functions.https.HttpsError('unauthenticated', 'only users can invoke update request'); } try{...
[ "getReplies (id) {\n return Api().get(`post/${id}/replies`, id)\n }", "async getAutoReply(ctx, next) {\n const firebase = ctx.service.firebase.init();\n const data = firebase.getOnce('list', 'autoReply');\n }", "function getReplies(threadId) {\n return 'SELECT * FROM reply WHERE thread_id_num = '+th...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Gets or sets the type of spline to be rendered. ```html ``` ```ts this.series.splineType = SplineType.Clamped; ```
get splineType() { return this.i.qn; }
[ "function ShowSplineChart(splineDataset) {\n $(\"#container\").highcharts(SetUpHighCharts(splineDataset));\n}", "function toggleLineType(){\n if (TagTracker.theCurveType == \"function\"){\n TagTracker.theCurveType = \"none\";\n }else{\n TagTracker.theCurveType = \"function\";\n }\n }", "f...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Resolve clientside monitoring configuration from either environmental variables or shared config file. Configurations from environmental variables have higher priority than those from shared config file. The resolver will try to read the shared config file no matter whether the AWS_SDK_LOAD_CONFIG variable is set.
function resolveMonitoringConfig() { var config = { port: undefined, clientId: undefined, enabled: undefined, host: undefined }; if (fromEnvironment(config) || fromConfigFile(config)) return toJSType(config); return toJSType(config); }
[ "function resolveEndpointDiscoveryConfig(request) {\n var service = request.service || {};\n if (service.config.endpointDiscoveryEnabled !== undefined) {\n return service.config.endpointDiscoveryEnabled;\n }\n\n //shared ini file is only available in Node\n //not to check env in browser\n if (util.isBrowse...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
navigates the user to a view element with given name if the element not found in the compiled markup, the same is searched in the available dialogs in the page
function goToView(viewElement, viewName, pageName) { var $is, parentDialog; if (viewElement.length) { if (pageName === $rs.activePageName) { viewElement = getViewElementInActivePage(viewElement); } $is = viewElement.isolateSc...
[ "goToElementView(viewElement, viewName, pageName, variable) {\n let $el, parentDialog;\n const activePage = this.app.activePage;\n if (viewElement.length) {\n if (!this.app.isPrefabType && pageName === activePage.activePageName) {\n viewElement = this.getViewElementInA...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Calculates the fitness of entire population using a fitness function This function also updates the fitness of every member.
calculate_fitness() { this.fitness = new Array(this.population_size); for (let i = 0; i < this.fitness.length; i++) { this.fitness[i] = this.members[i].fitness; } this.total_fitness = this.fitness.reduce((total, fitness) => total += fitness); }
[ "calcPopulationFitness() {\n this.population.forEach(member => {\n member.calcFitness(this.target);\n });\n }", "calcFitness () {\n const len = this.population.length;\n let sum = 0;\n for (let i=0;i<len; i++) {\n this.population[i].calcFitness(this.target);\n sum+=t...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
method to add contact and check duplicate entries
function addContact() { let newContact = createContatct() let alreadyExists = addressBook.filter(contact => contact.firstName == newContact.firstName).length if (alreadyExists) { console.log("Conatct already exists"); } else { addressBook.push(newContact) console.log("Added suces...
[ "function addContact() {\r\n let getName = getNameInput();\r\n let getNumber = getNumberInput();\r\n let getEmailAddress = getEmailInput();\r\n let getNote = getNoteInput();\r\n let catcher;\r\n let tmp;\r\n let i, j;\r\n\r\n let contactsObject = {\r\n name: getName,\r\n number: getNumber,\r\n emai...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Go through all meal nodes and find what is on the menu
getMenu() {alert("entering grocery.js getMenu()") // Assemble the menu list (meal nodes) this.menuCloset.destructBoxes() let mealNodes = graph.getNodesByID_partial("meal", "") for (let meal of mealNodes) { if (meal.inMenu) { // i don't think we need to keep track of what's on the menu by using inMenu anymore...
[ "findMenuItems(topping) {\n for(let menuItem of this.menu) {\n for (let ingredients of menuItem.ingredients) {\n if (topping === ingredients) {\n console.log(menuItem.name);\n }\n }\n }\n }", "function parseMenus() {\n cons...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
get all movies in 2018 > 4 Sort their rating in descending order only pick their title property & display on console. result should be 'b' and 'a'
function getMovies(movies) { return movies .filter((m) => m.year >= 2018 && m.rating > 4) .sort((a, b) => a.rating - b.rating) .reverse() .map((m) => m.title); }
[ "function test1(array) {\n return array\n .filter(movie => movie.year == 2018 && movie.rating >= 4)\n .sort((a, b) => b.rating - a.rating)\n .map(movie => movie.title);\n}", "function pickFlicks(array, year, rating){\n let list = movies\n .filter(movie => movie.year === year && m...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Return value for nth slot.
value(n) { return this.slots[n * 2 + 1]; }
[ "set_value(n, value) {\n this.slots[n * 2 + 1] = value;\n }", "get_slot(slotNumber) {\n return parseInt(this.memory[slotNumber - 1]);\n }", "function slot_x(slot) { return slot[0] }", "function getSlot(i, a)\r\n{\r\n\tvar slot = i >> (5 * a.height);\r\n\twhile (a.lengths[slot] <= i)\r\n\t{\r\n\t\tslot...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Used as a Redirect marker when writing to a Stream's incoming buffer
function StreamRedirect(to) { this.__HighlandStreamRedirect__ = true; this.to = to; }
[ "function writeToStream(e,t){const r=t.body;null===r?e.end():\"string\"==typeof r?(e.write(r),e.end()):isURLSearchParams(r)?(e.write(Buffer.from(String(r))),e.end()):r instanceof Blob?(e.write(r[BUFFER]),e.end()):Buffer.isBuffer(r)?(e.write(r),e.end()):\"[object ArrayBuffer]\"===Object.prototype.toString.call(r)?(e...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Takes in a module code and passes into a callback a dictionary of all lessons being conducted for the module
function api_getModuleLessonTimetable(moduleCode, cb) { request({ method: 'GET', url: `https://nusmods.com/api/2016-2017/2/modules/${moduleCode}/timetable.json`, headers: { 'Content-Type': 'application/json' }, }, (err, res, body) => { if (err) { return cb(err); } return cb(e...
[ "function LeathermanModule() {\n }", "function initModuleFn () { }", "function initializeLesson() {\n module.init();\n animate();\n}", "runModules (event) {\n if (event === 'init') {\n // Initializing a module should only be done if it has an init\n // function, which means it's not rendered...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Loads an .xlsx file and adds it rows into the file object
function loadBook() { return new Promise(resolve => { new Excel.Workbook().xlsx.readFile(path) .then(workbook => { addRows(workbook); resolve(); }) .catch(err => { if (err.message.includes("File not found:")) { console.log(`[${dateNow()}] No ${SUBREDDIT}.xlsx file found. A new one will be c...
[ "parseExcel()\n { \n console.log(\"parseEXCEL\");\n that = this;\n \n this.fileName = this.template.querySelector(\"input[type=file]\").files[0].name;\n var f = this.template.querySelector(\"input[type=file]\").files[0]\n var reader = new FileReader();\n reader...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Retusn original representation of the lexical grammar.
getOriginalLex() { return this._orignalLex; }
[ "function Grammar() {}", "function Grammar(lhs, rhs, dprec){\n\treturn {\"lhs\": lhs, \"rhs\": {\"rhs\": rhs, \"dprec\": dprec}};\n}", "function saveLex() {\n return {nextChar:nextChar,nextToken:nextToken,prevChar:prevChar,lastBraces:lastBraces,inPtr:inPtr,inValue:inValue,templates:templates};\n}", "functio...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
This method creates and returns the text editor control to be used. Subclasses can override to provide their own editor control that should be used (e.g. a DiffEditor). The passed in configuration object should be passed to the editor control when creating it.
createEditorControl(parent, configuration) { // Use a getter for the instantiation service since some subclasses might use scoped instantiation services return this.instantiationService.createInstance(codeEditorWidget_1.CodeEditorWidget, parent, configuration, {}); }
[ "function createEditor(config)\n\t{\n\t\tvar editor = null;\n\t\t\n\t\tvar hideSplash = function()\n\t\t{\n\t\t\t// Fades-out the splash screen\n\t\t\tvar splash = document.getElementById('splash');\n\t\t\t\n\t\t\tif (splash != null)\n\t\t\t{\n\t\t\t\ttry\n\t\t\t\t{\n\t\t\t\t\tmxEvent.release(splash);\n\t\t\t\t\tmx...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
takes in an aggr switch num and port number and returns corresponding sw
function linkToSwitch(swNum, port) { let level = port < 3 ? 1 : 3; // console.log(swNum, port); if (swNum % 2 === 1) { if (level === 3) { return { level: level, swNum: port - 2 }; } else { return { level: level, swNum: swNum + port - 1 }; } } else { if (level === 3) { return { ...
[ "function make_switchport_link(switch_name, port_name) { \n\n var fake_switch = new dmws.Switch({name: switch_name});\n fake_switch.setValue(\"name\", switch_name); \n var fake_loc = new dmws.SwitchPort({ name: port_name, \n switchObj: fake_switch\n ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Remove the given widgetId from the list of widget ids for the page with the given pageId
function pullWidget(pageId, widgetId) { return Page.update( { _id: pageId }, { $pullAll: { widgets: [widgetId] } } ); }
[ "function deleteWidget(widgetId) {\n return widgetModel\n .remove({\n _id: widgetId\n })\n .then(function(status) {\n return pageModel\n .deleteWidget(pageId, widgetId);\n });\n}", "removeWidgetFromArea(aWidgetId) {\n CustomizableUIInternal.removeWidgetFromArea(aWidgetId);\n }", ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Observable of metadata for the document with the given id If we can't read a document it is either because it's not readable or because it doesn't exist
function observeDocumentAvailability(id) { // check for existence return (0, _.observePaths)(id, [['_rev']]).pipe((0, _operators.map)(res => Boolean(res === null || res === void 0 ? void 0 : res._rev)), (0, _operators.distinctUntilChanged)(), (0, _operators.switchMap)(hasRev => { return hasRev ? // short circui...
[ "async getMetadata(id) {\n let filename = this._formatMetadataFilename(id);\n\n let contents = await fs.readFile(filename);\n\n return imagery.Image.fromObject(JSON.parse(contents));\n }", "function getSeqMetadata(id) {\n return fetch(CRAM_REF_URL + \"/\" + id + \"/metadata\", {\n meth...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Simply utility function to download a JavaScript object as JSON
function downloadJSON(obj) { const str = JSON.stringify(obj); /* Print to console in case dev wants to copy from there instead */ console.log(str); const data = "text/json;charset=utf-8," + encodeURIComponent(str); const element = document.createElement('a'); element.setAttribute('href', data)...
[ "function downloadObjectAsJson() {\n var dataStr = \"data:text/json;charset=utf-8,\" + encodeURIComponent(JSON.stringify(JSON_DATA.filter((item) => visible[item.bn])));\n var downloadAnchorNode = document.createElement('a');\n downloadAnchorNode.setAttribute(\"href\", dataStr);\n downloadAnchorNode.setA...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Google chart jazz... just shows the current set of reactions
function drawChart(reactionData) { var reactionDataTable = new google.visualization.DataTable(); reactionDataTable.addColumn('number', 'Time'); reactionDataTable.addColumn('number', 'Reaction'); reactionDataTable.addRows(reactionData); var options = { title: 'Reactions over Time', curve...
[ "updateRewardChart_() {\n // Thee are two series, i.e. reward and the cumulative reward. We maximize\n // the chart area and hide the legend. Crosshair provides the visual clue\n // for the current step of the replay.\n this.replayRewardChart_.draw(\n /** @type{!Object} */ (this.replayRewardData_...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Fetch the list of restaurants from RestaurantService and updates the component state. Sets the state to display loading indicator during data fetch from service.
async fetchRestaurantList() { this.setState({ isLoading: true }); let restaurantsList = await RestaurantService.getRestaurantsList(); if (restaurantsList.length > 0) { this.setState({ isLoading: false, data: restaurantsList, error: null }); console.log(this.state); ...
[ "function loadRestaurants() {\n API.getRestaurants()\n .then(res => \n setRestaurants(res.data)\n )\n .catch(err => console.log(err));\n }", "getRestaurants(){\n kzGet(\"getrestaurants\").then(restaurantListResponse=>{\n if(restaurantListResponse && restaurantListResponse.success...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Make an instance of Effect called "Pair Programming"
PairProgramming(){ this.power += 2; console.log(this.name + "'s" + " power is now " + this.power); }
[ "function pair(kind, x, y)\n{\n this.tag\t\t\t= \"pair\";\n\n this.kind\t\t\t= kind;\n this.x\t\t\t= x;\n this.y\t\t\t= y;\n}", "function Pair(x, y) {\n if (!(this instanceof Pair)) {\n return new Pair(x, y);\n }\n\n this.fst = function() {\n return x;\n };\n\n this.snd = function() {\n ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Function related to the YouTube API that makes an ajax call to the previous video result
function showPrevPage() { var token = $("#prev-button").data('token'); var q = $('#prev-button').data('query'); $("#videos-view").empty(); $("#buttons").empty(); var params = $.param({ part: 'snippet, id', maxResults: '1', q: keyword, pageToken: token, t...
[ "function prevVideo() {\n $('.js-btn-prev-YT').on('click', function() {\n query_string.pageToken = prevPage;\n $.getJSON(youTubeUrl, query_string, displayYouTubeData);\n });\n}", "function nextVideo() {\n $('.js-btn-next-YT').on('click', function() {\n query_string.pageToken = nextPage;\n $.getJSON...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
ecs_cluster_arn computed: true, optional: false, required: false
get ecsClusterArn() { return this.getStringAttribute('ecs_cluster_arn'); }
[ "get clusterArn() {\n return core_1.Stack.of(this).formatArn({\n service: 'rds',\n resource: 'cluster',\n arnFormat: core_1.ArnFormat.COLON_RESOURCE_NAME,\n resourceName: this.clusterIdentifier,\n });\n }", "get clusterId() {\n return this.getStr...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Evaluates, or attempts to evaluate, a NewExpression
function evaluateNewExpression({ node, environment, evaluate, statementTraversalStack }) { const evaluatedArgs = []; if (node.arguments != null) { for (let i = 0; i < node.arguments.length; i++) { evaluatedArgs[i] = evaluate.expression(node.arguments[i], environment, statementTraversalStack)...
[ "Evaluate() {}", "function evaluateExpression() {\r\n if (calculator.operator != null) {\r\n operation = getOperation(calculator.operator);\r\n result = operation(calculator.firstOperand, calculator.displayValue);\r\n addHistoryElement(\r\n calculator.firstOperand,\r\n calculator.displayValue,...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Set the output state error flag to true if there is a current error, false if not.
function setOutputErrorFlag(vni, errorFlag) { var error = _.isUndefined(errorFlag) ? ! _.isUndefined(vni.errorState().data) : errorFlag; vni.outputState({error: error}); }
[ "get errorState() {\n if (this._startInput && this._endInput) {\n return this._startInput.errorState || this._endInput.errorState;\n }\n return false;\n }", "set logError(bool) {\n this._logError = bool;\n }", "set isError(value) {\n this._isError = value;\n }", ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Copyright 20052013 The Kuali Foundation Licensed under the Educational Community License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at Unless required by applicable law or agreed to in writing, software distributed under the Licens...
function showGrowl(message, title, theme) { var context = getContext(); if (theme) { context.jGrowl(message, { header: title, theme: theme}); } else { context.jGrowl(message, { header: title}); } }
[ "themePopup_html(themeObj) {\n let text = \"<div class='theme-popup'>\"\n text += \"<h1>\" + themeObj.Theme + \"</h1>\"; \n text += \"</div>\"\n return text;\n }", "function handleGrowlMessage(growl)\n{\n //make sure that the growl data is not null. Sometimes multiple requests \n //o...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Hides type's prototype properties (makes them nonenumerable).
function hidePrototypeProperties(ctor, propsToHide) { var proto = ctor.prototype; for (var prop in proto) { if (!propsToHide || propsToHide.length === 0 || propsToHide.indexOf(prop) >= 0) { var desc = Object.getOwnPropertyDescriptor(proto, prop); if (desc && d...
[ "function hidden(proto, name, desc) {\n desc.enumerable = false;\n }", "function obscure(source, prototype = getPrototypeOf(source)) {\n let descriptors = {};\n for (let name of getNames(source)) {\n let property = getOwnPropertyDescriptor(source, name);\n property.enumerable = f...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Starts the preprogrammed blinking sequence. The sequence is run in a loop until it is stopped by stopBlinkSeq or an explicit change.
startBlinkSeq() { this.liveFunc.startBlinkSeq(); return _yocto_api.YAPI_SUCCESS; }
[ "function startBlink() {\n blinker = setInterval(() => {\n flash(flashTime);\n }, blinkInterval);\n}", "blinky(step, sequence) {\n for (let i = 0; i < step; i++) {\n this.nextBlink(sequence[i], i);\n };\n this.setState({ player: true });\n }", "function blink() { blink_rate = 1.5; }", "fun...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
This SelectionBox class exists within Angel. It is in charge of swapping the orbs within it's boundaries. function SelectionBox (colRow, side) : This is the constructor for SelectionBox function rotate (side) : This function is supposed to rotate the selection box around the pivot orb. function getRotation() : This fun...
function SelectionBox(colRow, side) { var rotation = 0; var nonPivotOrbY = colRow.getSecond(); if (side == "right") { rotation = 180; } // This function is supposed to rotate the selection box around the pivot orb. this.rotate = function(side) { var angle = 90; var leftBorder = VariableCont...
[ "function SelectionBox(colRow, side) {\r\n\t/*Private Variables*/\r\n\tvar selectionSprite = spriteManager[\"selectionBox\"][0];\r\n\tvar rotation = 0;\r\n\tvar nonPivotOrbY = colRow.getSecond();\r\n\t\r\n\tif (side == \"right\") {\r\n\t\trotation = 180;\r\n\t}\r\n\t\r\n\t // This function is supposed to rotate the...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
A type guard that checks whether an input is an "object" but also _not_ `null`. This is useful test in its own right but can also be an important building block for other type guards.
function isNonNullObject(input) { return typeof input === "object" && input !== null ? true : false; }
[ "function isNonNullObject(value) {\n return !!value && typeof value === 'object'\n }", "function isNonNullObject(value) {\n return isObject(value) && value !== null;\n}", "function object (thing) {\n\t return typeof thing === 'object' && !nulled(thing) && !array(thing) && !date(thing);\n\t }", ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Validates an incoming transfer prepare request and makes a callback to the originator with the result
async prepareTransfer(prepareRequest, sourceFspId) { try { // retrieve our quote data const quote = await this._cache.get(`quote_${prepareRequest.transferId}`); if(!quote) { // Check whether to allow transfers without a previous quote. if(!th...
[ "async prepareTransfer(prepareRequest, sourceFspId) {\n try {\n\n // retrieve our quote data\n const quote = await this._cache.get(`quote_${prepareRequest.transferId}`);\n\n if(!quote) {\n // Check whether to allow transfers without a previous quote.\n ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Renders the AWS CloudFormation properties of an `AWS::WAFv2::RuleGroup.CookieMatchPattern` resource
function cfnRuleGroupCookieMatchPatternPropertyToCloudFormation(properties) { if (!cdk.canInspect(properties)) { return properties; } CfnRuleGroup_CookieMatchPatternPropertyValidator(properties).assertSuccess(); return { All: cdk.objectToCloudFormation(properties.all), ExcludedCo...
[ "function cfnWebACLCookieMatchPatternPropertyToCloudFormation(properties) {\n if (!cdk.canInspect(properties)) {\n return properties;\n }\n CfnWebACL_CookieMatchPatternPropertyValidator(properties).assertSuccess();\n return {\n All: cdk.objectToCloudFormation(properties.all),\n Excl...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Retorna una instancia de UNQfy. Si existe filename, recupera la instancia desde el archivo.
function getUNQfy(filename) { let unqfy = new unqmod.UNQfy(); if (fs.existsSync(filename)) { console.log(); unqfy = unqmod.UNQfy.load(filename); } return unqfy; }
[ "function getUNQfy(filename) {\r\n let unqfy = new unqmod.UNQfy();\r\n if (fs.existsSync(filename)) {\r\n console.log();\r\n unqfy = unqmod.UNQfy.load(filename);\r\n }\r\n return unqfy;\r\n}", "function getUNQfy(filename) {\n let unqfy = new unqmod.UNQfy();\n if (fs.existsSync(filename)) {\n consol...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Returns link search results and/or quick answer, if available.
async function getResults(url) { // query webpage and load html and jquery let options = { uri: url, headers: { 'User-Agent': 'Mozilla/5.0' } }; let html = await rp(options); const $ = cheerio.load(html); let links = []; // get the knowledge result vide...
[ "function searchWithResults( searchURL ) {\n\n\t// get the type of query: letter, chapter, search\n\tvar searchParams = getSearchParamsFromURL( searchURL );\n\n\tvar rx = new RegExp(kLetterSearchFlag);\n\tif ( rx.test( searchParams[0] ) ) {\n\t\tvar html = runLetterSearch( searchParams[1] );\n\t\treturn html;\n\t}\...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
returns u plus v
function add2d(u, v) { return [u[0]+v[0], u[1]+v[1]]; }
[ "function vec_plus(u, v) {\n return point(u.x + v.x, u.y + v.y)\n}", "function vAdd(a, b) {\n return vec(a.x + b.x, a.y + b.y);\n}", "function AddVector(u,v){\r\n\t\t\tvar r = new Vector3D(u.ux+v.ux, u.uy+v.uy, u.uz+v.uz);\r\n\t\t\treturn r;\r\n\t\t}", "function add(u, v)\n{\n if (u.format == \"vector\")...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
function for rotating the maxMarker and maxStraighten based on the time it occurs
function rotateMaxTemp(x) { maxMarker.css({'transform':'rotate(' + x + 'deg)'}); maxStraighten.css({'transform':'rotate(' + (360-x) + 'deg)'}); }
[ "function rotateMinTemp(y) {\n minMarker.css({'transform':'rotate(' + y + 'deg)'});\n minStraighten.css({'transform':'rotate(' + (360-y) + 'deg)'});\n }", "function rotateTime(t) {\n timeMarker.css({'transform':'rotate(' + t + 'deg)'});\n }", "f...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Diese Klasse registriert wieder Klick Handler auf allen Elementen mit der Klasse "divs" und ruft die Funktion proceedCard auf ... ein neuer Zug/Durchgang beginnt
function enableCards() { window.setTimeout(function () { $(document).on("click", ".divs", function (e) { proceedCard(e); }); }, 800); }
[ "function impostaModalePerClasseConti(){\n \t$(\"#selezioneContoGuidata\").slideUp();\n \t$(\"#selezioneContoTestuale\").slideDown();\n \t$(\"#pulsanteSelezionaConto\").substituteHandler('click', aggiornamentoContoDaClasseConciliazioneConti);\n }", "function presentialDivs() {\n $(\"#btnPresident\"...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
The Patient Information as known when the document was published. May be a reference to a version specific, or contained.
get sourcePatientInfo () { return this._sourcePatientInfo; }
[ "get sourcePatientInfo() {\n\t\treturn this.__sourcePatientInfo;\n\t}", "function patientIdentity(doc) {\r\n let p = doc[\"Patient\"], res={};\r\n if (p === undefined) {\r\n res.mrn=\"?\";\r\n res.fullName=\"?\";\r\n res.gender=\"?\";\r\n return res\r\n }\r\n try {\r\n res.mrn = p.identifier[0]...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Successfully saved the updated entity to the server. If saved pessimistically, update the entity in the collection with data from the server. If saved optimistically, the entity was already updated in the collection. However, the server might have set or modified other fields (e.g, concurrency field) Therefore, update ...
saveUpdateOneSuccess(collection, action) { const update = this.guard.mustBeUpdateResponse(action); const isOptimistic = this.isOptimistic(action); const mergeStrategy = this.extractMergeStrategy(action); collection = this.entityChangeTracker.mergeSaveUpdates([update], collection, mergeSt...
[ "saveAddOneSuccess(collection, action) {\n // For pessimistic save, ensure the server generated the primary key if the client didn't send one.\n const entity = this.guard.mustBeEntity(action);\n const mergeStrategy = this.extractMergeStrategy(action);\n if (this.isOptimistic(action)) {\n...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Add a previous year to the history
function addPreviousYearToHistory() { var j; var found = false; var years = {}; for (var i = 0; i < bubbles.length; ++i) { if (bubbles[i].isClicked && bubbles[i].yearClick <= year.current) { if (dataEntries[guiAxes.X][bubbles[i].name] != null || dataEntries[guiAxes.X][bubbles[i].n...
[ "function previousYear() {\n currentYearIndex -= 1;\n if (currentYearIndex < 0) {\n currentYearIndex = 0;\n }\n updateYear();\n }", "function previousYear(){\n if(DateObj.year > 0){\n DateObj.year = DateObj.year - 1;\n refresh();\n }\n}", "previousYear(){\n ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
handle when the add page version button is clicked
function onAddPageVersionBtnClicked(event) { var pageName = prompt('What would you like to name this new page version?'); if (pageName) this.addPageVersion(pageName); }
[ "function onChangePageVersion(event)\n\t{\n\t\tvar pageVersionId = $(event.currentTarget).val();\n\n\t\tthis.changePageVersion(pageVersionId);\n\t}", "function addVersion() {\r\n\r\n\t\t// Version\r\n\t\tvar vers = $( \"<li class='version'><a href='\"+ URLSCRIPT +\"' target='_blank'> \" + VERSION + \"</a></li>\" ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Build php error toggles
function phpErrorToggles ($node) { var $togglesUl = $node.find('.debug-sidebar .php-errors ul') var categories = ['fatal', 'error', 'warning', 'deprecated', 'notice', 'strict'] $.each(categories, function (i, category) { var count = category === 'fatal' ? $node.find('.m_alert.error-summary.have-fatal')....
[ "function toggleError(show = false,msg = ''){\n setError({show,msg})\n }", "function toggleGeneralError(show, module) {\r\n if (show) {\r\n $(\"#egBuildOrderMsgPanel #msgWarning\").addClass(\"hidden\");\r\n $(\"#egBuildOrderMsgPanel #msgError\").removeClass(\"hidden\");\r\n } else if...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
/ DESIGNS / Displays designs returned by Constellation
function displayDesigns(editors, designs) { editors.designsEditor.setValue(designs); }
[ "function designSelection(design) {\n\n if (design == 'heart js' || design == 'js puns') {\n for (i = 0; i < colorS.length; i++) {\n colorS.children[i].style.display = 'none';\n if (colorS[i].getAttribute('name') === design) {\n colorS[i].style.display = '';\n ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Actual email extraction procedure / Crawler looks for search input box, writes connection name, clicks on first result, copies connection's email
async function fetchEmail(scrapper, {company, delayBetweenFetchesMs, maxRetries, name}) { try { await scrapper .wait('.nav-item--mynetwork') .click('.nav-item--mynetwork a') .wait('.mn-community-summary__link') .click('.mn-community-summary__link') ...
[ "async function getEmail(index, count) {\n count = count || 0;\n\n // Condition is here to make sure no more than the limit of emails is extracted on each interval\n if (count < connections.length) {\n try {\n await nightmare\n .wait('.nav-item--mynetwork')\n .click('.nav-item--mynetwork a')\n ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Play random sound from sound objects.
function playSound() { var soundIndex = Math.floor(Math.random() * shovelSounds.sounds.length); shovelSounds.sounds[soundIndex].play(); }
[ "function playRandomSound() {\n var index = Math.round(Math.random() * (sounds.length - 1));\n sounds[index].play();\n}", "function playRandomSound() {\n // 5 because that's the number of sounds in the array\n let randomIndex = getRandomInt(4);\n let randomSound = sounds[randomIndex];\n randomSound.play...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
builds the archive table this is hidden by default
function buildArchive() { const body = $("body"); const spoonTypes = body.data("spoonTypes"); const spoonEmoji = body.data("spoonEmoji"); const spoonDifficulties = body.data("spoonDifficulties"); // create the archive const archive = makeTable(); archive.attr("id", "archivelist"); body.append(archive); ...
[ "function setupArchiveList() {\n $(\"#archived-plan-list-header\").show();\n $(\"#archived-plan-list-titles\").show();\n $(\"#archived-plan-list-wrapper\").slideDown();\n}", "function archiveView()\n{\n const tasklist = $(\"#tasklist\");\n const archivelist = $(\"#archivelist\");\n // first, update the arch...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
If "Location" is selected, enable the text field and make it required
function toggleRequired() { if (textInput.hasAttribute('required') !== true) { textInput.removeAttribute('disabled'); textInput.setAttribute('required','required'); locationIsValid = false; activateSearchButton(); } else { textInput.removeAttribute('required'); ...
[ "function validateLocation(){\n var locationValue = $('#location-select')[0].value;\n if(locationValue != \"\"){\n $('#place-button').attr('disabled', false);\n }\n}", "function vehiclereg(x) {\n if (x == 1) {\n document.getElementById('vehiclereg').style.display = 'block';\n document.getEl...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Remaps one icon name to another.
function registerIconAlias(iconName, mappedToName) { _iconSettings.__remapped[normalizeIconName(iconName)] = normalizeIconName(mappedToName); }
[ "function registerIconAlias(iconName, mappedToName) {\r\n _iconSettings.__remapped[iconName.toLowerCase()] = mappedToName.toLowerCase();\r\n}", "function registerIconAlias(iconName, mappedToName) {\n\t _iconSettings.__remapped[iconName.toLowerCase()] = mappedToName.toLowerCase();\n\t}", "function register...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
function will stop the blockchain network.
function stop() { return new Promise((resolve, reject) => { var response; multichain.stop({ }, (err, res) => { console.log(res) if (err == null) { return resolve({ response: res, message: "your Blockchain node has been stopped....!" }); ...
[ "async stop () {\n if (this.peer && this.peer.connected) await this.peer.destroy();\n if (this.fullnode) await this.fullnode.close();\n await this.wallet.stop();\n // await this.chain.stop();\n }", "async stop() {\n\n // We can only stop when we are fully started\n if(this.state === Wallet.STAT...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
loads the login view
function loadLoginView() { let xhr = new XMLHttpRequest(); xhr.onreadystatechange = function(){ if((xhr.readyState == 4) && (xhr.status == 200)) { $('#view').html(xhr.responseText); $('#logo').hide(); } } xhr.open("GET", 'login.view', true); xhr.send(); }
[ "function loadLogin() {\n\t\tvar login = $(\"#login\");\n\n\t\tlogin.load(\"view/login.html\", function () {\n\t\t\tuserSetup.setupLogin();\n\t\t});\n\t}", "function loginView() {\n setFormView(\"login\")\n }", "function loadLoginView(){\n\tresetNavBarStyle();\n\tloadViewTitle();\n\tlet div_box = $(\"...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
_shouldFollowLink, provide a hook to check followLink. It check if component implement its own shouldFollowLink() method, otherwise return props.follow
_shouldFollowLink() { if (!isUndefined(this.shouldFollowLink)) { return this.shouldFollowLink(this.props); } return this.props.follow; }
[ "function isFollowedSymlink(stat, options) {\n return stat.isSymbolicLink() && options.followSymlinks;\n}", "function isFollowedSymlink(stat, options) {\n return stat.isSymbolicLink() && options.followSymlinks;\n}", "async is_follow() {\n const {id} = this.state;\n const followings = await get_object(...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
When updating the component load versions from the sources passed as properties.
async componentDidUpdate(prevProps, prevState) { for (const source of this.props.sources) { if (!this.state.computed.sources[source.name]) { if (source.options.versions) { if (Object.keys(source.options.versions).length > 0) { await this.loadVersionsFromSource(source); ...
[ "async loadVersionsFromSource(source) {\n let versionList = [];\n Object.keys(source.options.versions).forEach((version) => {\n versionList.push({\n label: version,\n value: {\n sources: [source.name],\n },\n });\n });\n\n let allVersions = this.state.options.vers...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
nickname: the name to request id: the game id to join. 1 to join a random game, 2 to create a game.
function joinGame(nickname, id){ g_socket.emit("usernameUpdate", {username: nickname, gameToJoinId: id}); }
[ "function joinGame(input){\n\n\tvar game_id = input.gameId ;\n\n\tio.socket.post('/game/'+game_id + '/users',{ id: input.userId});\n\n\tcreateGameDiv({id: game_id});\n}", "function attemptJoinGame(input){\n\tio.socket.get('/joinrequest',{userId: input.data.userId,gameId: input.data.gameId})\n}", "joinGame(id = ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Returns our plane WebGL bounding rect relative to document returns :
getWebGLBoundingRect() { if(!this._matrices.modelViewProjection) { return this._boundingRect.document; } else if(!this._boundingRect.worldToDocument || this.alwaysDraw) { this._computeWebGLBoundingRect(); } return this._boundingRect.worldToDocument; }
[ "_getWebGLDrawRect() {\n this._computeWebGLBoundingRect();\n\n return {\n top: this._boundingRect.worldToDocument.top - this.drawCheckMargins.top,\n right: this._boundingRect.worldToDocument.right + this.drawCheckMargins.right,\n bottom: this._boundingRect.worldToDocum...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Write a method that will return the second to last value in the linked list
secondToLast(){ if(this.isEmpty() || this.head.next == null){ // If the list is empty or only 1 element in length, we'll return null return null; } let runner = this.head;// start at the first node while(runner.next.next != null){ //until runner's .next has a .next of null, w...
[ "secondToLast(){\n var runner = this.head;\n if (runner == null || runner.next == null){\n return null\n }\n while (runner.next.next != null){\n runner = runner.next\n }\n return runner.value;\n }", "secondToLastValue() {\n\t\tvar runner = this.he...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
create detail chart for layer one (bullet chart for flood risk percentage)
function Detaillinegauge(){ // set the linegauge type linegauge = anychart.bullet([{value: floodriskvalue}]); // Set chart ranges linegauge.range().from(0).to(100); linegauge.range(1).from(0).to(25); linegauge.range(2).from(25).to(50); linegauge.range(3).from(50).to(75); linegauge.range(4...
[ "function Detailline(){\r\n\tvar data = anychart.data.set(floodincmonth);\r\n\tvar seriesData_1 = data.mapAs({x: 0, value: 1});\r\n\t// create a chart\r\n\tchartone = anychart.line();\r\n\t// create the first series, set the data and name\r\n\tseriesmonth = chartone.line(seriesData_1);\r\n\tseriesmonth.name(\"Flood...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Document ready handler and DOM mutation observers. Initializes Tabs components as necessary.
function onDocumentReady() { var elements = document.querySelectorAll(selectors.self); for (var i = 0; i < elements.length; i++) { new Tabs({ element: elements[i], options: readData(elements[i]) }); } var MutationObserver = window.MutationObserver || window.WebKitMutationObs...
[ "_ready() {\n this.tabs = new Tabs(this.app)\n }", "initializeTabs() {\n this.tabs.forEach((tab, index) => {\n tab.setAttribute('role', 'tab');\n tab.setAttribute('id', `tab-${this.componentId}-${index}`);\n tab.setAttribute('tabindex', '-1');\n\n tab.addEventListener('click', thi...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
States All all states, today's date
_getAllStatesCurrent() { return this._request(this.STATE + this.CURRENT_JSON) }
[ "function initialState() {\n return {\n get selectedDate() {\n return selectedDate;\n },\n set selectedDate(dt) {\n if (dt && !opts.inRange(dt)) {\n return;\n }\n\n if (dt) {\n selectedDate = new Date(dt);\n dp.state.hili...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
utility function envoked by almost all V3Dspecific puzzles filter off some nonmesh types
function notIgnoredObj(obj) { return ( obj.type !== "AmbientLight" && obj.name !== "" && !(obj.isMesh && obj.isMaterialGeneratedMesh) && !obj.isAuxClippingMesh ); }
[ "function notIgnoredObj(obj) {\n return obj.type !== 'AmbientLight' &&\n obj.name !== '' &&\n !(obj.isMesh && obj.isMaterialGeneratedMesh) &&\n !obj.isAuxClippingMesh;\n}", "filterByType (pokemon, type) {\n const filterType = [];\n for(let i= 0; i < pokemon.length; i++){\n fo...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
write a function that print all the fibonacci number from index 0 to n
function allFib(n) { for (let i = 0; i < n; i++) { console.log(`fib at index ${i} is ${fib(i)}`); } }
[ "function fibonacci(n) {\n\t// set a default limit\n\tif(!n) var n = 0;\n\t//start with 0 and 1\n\tvar a = 0,\n\t\tb = 1,\n\t\tx = a + b;\n\t// console.log(a + ' + ' + b + ' =', x);\n\t// start the sequence with a loop\n\tfor(a;x<n;) {\n\t\ta = b;\n\t\tb = x;\n\t\tx = a + b;\n\t\t// console.log(a + ' + ' + b + ' =...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Computes the points of a needle (needlePosition: 'center').
_computeNeedlePointsCenter(pointerWidth, angle) { const that = this, measurements = that._measurements, innerRadius = measurements.innerRadius, radius = measurements.radius, sin = Math.sin(angle), cos = Math.cos(angle); let pointerLength; ...
[ "get needleInnerPointExtent() {\n return this.i.cc;\n }", "get needleOuterPointExtent() {\n return this.i.cg;\n }", "get needleStartExtent() {\n return this.i.cv;\n }", "get needleInnerPointWidth() {\n return this.i.cd;\n }", "get needlePointFeatureExtent() {\n ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Attempts to get the retryafter value from a set of http headers. The retry time is originally denoted in seconds, so if present, it is converted to milliseconds
function tryGetRetryAfterValueTimeInMilliseconds(headers) { if (headers['retry-after']) { const retryTime = Number(headers['retry-after']); if (!isNaN(retryTime)) { core_1.info(`Retry-After header is present with a value of ${retryTime}`); return retryTime * 1000; } ...
[ "function parseRetryAfterHeader(now,header){if(!header){return defaultRetryAfter;}var headerDelay=parseInt(\"\"+header,10);if(!isNaN(headerDelay)){return headerDelay*1000;}var headerDate=Date.parse(\"\"+header);if(!isNaN(headerDate)){return headerDate-now;}return defaultRetryAfter;}", "function parseRetryAfterHea...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
xxxxxxxxxxxxxxxxxxxxxxxxxxx This is just Tom's scratch work for testing... It worked dude! Added songs to my playlist! xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx userSpotifyId = "12122110676"; //when done, uncommment the intiailization below spotifyAccessToken = "BQCoF_LZHz4xdGZx4BXj8FqQFa4L1c4QogNUM4Tocy4NqEfi1eqsLU3...
function makeSignInLink(){ var msrtSpotifyClientId = "f0bec57f45dd42bead54f9a76d931a9c"; // Log In and Link to MSRT App var queryURLforSpotifyToken = "https://accounts.spotify.com/authorize/?client_id=" + msrtSpotifyClientId + "&response_type=token&redirect_uri=http%3A%2F%2Fmsrt-spotify.herokuapp.com%2F&sc...
[ "function generateEndpointAddSongToPlaylist(play_list_id) {\r\n let ItemAddEndpoint = \"https://api.spotify.com/v1/playlists/\";\r\n\r\n chrome.storage.local.set({ \"RECENT_PLAYLIST_ID\": play_list_id }, function () { });\r\n chrome.storage.local.set({ \"RECENT_SONG_ID\": SONG_URI }, function () { });\r\n\...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
end chkCamposACA INICIALIZACION ESQUEMA
function chkCamposInicializa(){ //Validando los campos del formulario /***FECHA DE PUBLICACION DEL APOYO***/ var fecha = $('#fechaPeticion').val(); if(fecha=="" || fecha==null){ $('#dialogo_1').html('Seleccione la fecha de publicación de lineamientos'); abrirDialogo(); return false; } /***TIT...
[ "function verificarCampos() {\n\n\t\t\tvar ret = true;\n\n\t\t\tif (ctrl.liberacao.COR == undefined || ctrl.liberacao.COR.length == 0) {\n\t\t\t\tshowAlert('Escolha uma cor.');\n\t\t\t\tret = false;\n\t\t\t}\n\n\t\t\tif (ret == false)\n\t\t\t\tthrow 'Existem campos inválidos.';\n\t\t}", "function verificaCampiVuo...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Sets status badge to a certain state.
function set_progress_badge(badge, state) { // Reset badge. badge.removeClass('badge-secondary badge-info badge-success badge-danger'); badge.removeClass('flash animated infinite') switch (state) { case 'queued': badge.addClass('badge-secondary'); badge.text('Queued'); break; case 'st...
[ "function setSocialStatusState(state) {\n\n state = state || false;\n\n if(state) {\n \n chrome.browserAction.setBadgeText ( { text: \"yes\" } );\n chrome.browserAction.setBadgeBackgroundColor({color: [255, 128, 0, 255]});\n chrome.browserAction.setIcon({ path: \"circle_green.png\" });\n }\n else {\...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
VALIDAR CAMPOS PROCESO 2
function validarcampos_p2 () { if (nom_div("nombre_p2").value!=""&&nom_div("opcion_2").value!=0) { return true; } else{ if (nom_div("nombre_p2").value=="") { alert('Asigne un nombre al proceso 2'); nom_div("nombre_p2").focus(); } if(nom_div("opcion_2").value==0){ alert('¿Cuantas Lineas de ...
[ "function validazioneFormAggiuntaProdotti() {\n var prodotto = document.getElementById(\"prodotto\");\n var porzione = document.getElementById(\"porzione\");\n\tvar prezzo = document.getElementById(\"prezzo\");\n\t\n\tvar risProdotto = checkSoloLettereEDim(prodotto);\n\tvar risPorzione = checkNumeroIntero(por...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
numberSuffixSeparators() Get the separators found between a number and its suffix. For example: "" as in "5th", or "'" as in "6'thly", etc..
function numberSuffixSeparators() { return [ '', '\'', '-', ]; }
[ "function getNumberSeparators() {\n // default\n var result = {\n decimal: ',',\n thousand: '.'\n };\n\n // convert a number formatted according to locale\n var str = parseFloat(1234.56).toLocaleString();\n\n // if the resulting number does not contain...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Create this document only if it's empty. If it's not empty, do nothing.
createIfEmpty(data, type, options) { return __awaiter(this, void 0, void 0, function* () { const doc = yield this.fetch(); if (doc.type === null) { return this.create(data, type, options); } else { return this; } ...
[ "createIfNotExists(doc) {\n const op = \"createIfNotExists\";\n validateObject(op, doc);\n requireDocumentId(op, doc);\n return this._add({\n [op]: doc\n });\n }", "_createDocIfMissing(docId, actorId) {\n if (this.docs[docId]) {\n return\n }\n\n if (this._isWritable(actorId)) {\...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Function for all overlay table functions ACCEPTS no values RETURNS no values
function overlayFunctions(){ // Detect mouseDown on table $('.sparkle').on('mousedown', function(event){ event.stopPropagation(); // Add class to hex to change to active color $(this).addClass('sparkle_down'); $(this).on('mouseup', function(event){ // Only pull down...
[ "function hide_default_table() {\r\n}", "visitFuncColumnNameOptional(ctx) {\n\t return this.visitChildren(ctx);\n\t}", "function nullFunc(){}", "function TableTop() {\n}", "function userTable() { }", "ignoreHyperRelation(func) {\n return d => {\n // do nothing for hyperrelations...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Lists available translation language with their names in English (the default).
function listLanguages() { return new Promise((resolve, reject) => { translate .getLanguages() .then((results) => { [languages] = results; const randomNumber = getRandomInt(languages.length); target = languages[randomNumber].code; detectAndTranslateLanguages().then((res...
[ "function listLanguages() {\n return languageNames.concat()\n}", "function listLanguages() {\n return high.listLanguages()\n}", "function i18nLanguagesList(part, hl) {\n var response = YouTube.I18nLanguages.list(part,\n {'hl': hl});\n printResults(response);\n}", "async function listLanguagesWithTarg...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Fetch all the documents from the src as described in the "diffs", which is a mapping of docs IDs to revisions. If the state ever changes to "cancelled", then the returned promise will be rejected. Else it will be resolved with a list of fetched documents.
function getDocs(src, diffs, state) { diffs = clone(diffs); // we do not need to modify this var resultDocs = []; function fetchMissingRevs(id, missingRevs) { var opts = { revs: true, open_revs: missingRevs, attachments: true, binary: true }; return src.get(id, opts).then(fun...
[ "function getDocs(src, diffs, state) {\n diffs = clone(diffs); // we do not need to modify this\n\n var resultDocs = [];\n\n function fetchMissingRevs(id, missingRevs) {\n var opts = {\n revs: true,\n open_revs: missingRevs,\n attachments: true\n };\n return src.get(id, opts).then(functio...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
this method is fired based on row selection of List of fields datatable
handleRowAction(event){ const selectedRows = event.detail.selectedRows; this.selectedFieldsValue = ''; //newly efficient script // Display that fieldName of the selected rows in a comma delimited way selectedRows.map(element=>{ if(this.selectedFieldsValue !=='' ){ ...
[ "function selectRowHandler(data) {\n if (data) {\n $scope.fields = Object.assign({}, data);\n $scope.selectedFieldType.key = String($scope.fields.fieldIOType);\n $scope.selectedDataType.item = objectUtils.getPropertyByValue($scope.dataTypes, $scope.fields.fieldType, 'value');...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Backup runtime data, cleanup and reload the extension when an update is available.
function reloadForUpdate() { var backup = {}; backup.miniplayerOpen = miniplayer !== null; backup.nowPlayingSent = song.nowPlayingSent; backup.scrobbled = song.scrobbled; backup.songFf = song.ff; backup.songPosition = song.position; backup.songInfo = song.info; backup.songTimestamp = son...
[ "function reloadExtensions() {\n\t\trun('reload_extensions').then(e => {\n\t\t\tsetExtensions(e);\n\t\t});\n\t}", "async reload(scopePath: string, { throws }: Object): Promise<void> {\n Analytics.addBreadCrumb('base-extension', 'reload extension');\n if (!this.filePath && !this.options.core) {\n const ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Etherio constructor for accessing the Etherio IO24R 24 port digital IO device Returns a new etherio object for the Elexol Etherio24R
function Etherio(ip, port) { var dgram = require('dgram'); this.ip = ip; // Can be name or ipv4 address this.port = typeof b !== 'undefined' ? port : 2424; // port number // this turns this into a public properties this.zone = []; // new Array(); this.zone.A = 0; // this...
[ "static esp() {\n return new Port({\n protocol: Protocol.ESP,\n fromPort: 50,\n toPort: 50,\n stringRepresentation: 'ESP 50',\n });\n }", "constructor(){\n this.ifaceAddress = 'org.bluez.Adapter1'\n }", "function e368i(optionalIP)\n{\n //...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Update row of Property
function update_property_row(row_id){ create_property_list(row_id, from='update'); }
[ "function update_property(row_id){\n create_property_list(row_id, from='update');\n}", "setCell(rowId, property, value) {\n const index = findIndex(this.props.rows, { id: rowId });\n const rows = cloneDeep(this.props.rows);\n\n rows[index][property] = value;\n\n this.props.setRows(rows);\n ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Define function invert() and set the value of "val" variable to "INVERT" and call draw()
function invert() { val = "INVERT"; draw(); }
[ "invert() {\n this.addEffect(new Effects.Invert());\n }", "function invert() {\n var canvas = this.parms[1].getCanvas();\n var ctx = canvas.getContext('2d');\n var imgData = ctx.getImageData(0, 0, canvas.width, canvas.height);\n var pixels = imgData.data;\n\n for...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Append the answer from the last calculation into the current one, with the exception that the last answer was 'ERROR' or is undefined.
function handleLastAnswerClick() { if (previousAnswer && previousAnswer !== 'ERROR') { calculationArr.push(previousAnswer); } }
[ "function addResultToCalcStack() {\n\t\t\t\tif (!_self._model.isResultEmpty()) {\n\t\t\t\t\t_self._model.clearCalculate();\n\t\t\t\t\t_self._model.pushCalculate(_self._model.popResult(true));\n\t\t\t\t}\n\t\t\t}", "compute() {\n let work\n const prevanswer = parseFloat(this.theprevop)\n ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Returns an array of [wrongNode, weightTheNodeShouldBe]
function getWrongChild(node, targetWeight) { // If the node has no children, then this must be the wrong node! if (!node.children) return [node, targetWeight] // Create a map let map = {} // Loop thru each child node.children.forEach(child => { // Get the sum of the child node let sum = child.sum() ...
[ "function getWeightBen (intermediate){\n if (intermediate == [1]){ //pick the latent agent weights - for benev agent it is [1,0]\n final_left = weights_agent_r; // L side\n final_right = weights_agent_r; // R side\n } else { //pick the mine probabilit...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
handleDeliveryStatusCallback Handles the Delivery Status Callback. The delivery status callback is returned when the notification deliveries are processed.
function handleDeliveryStatusCallback(msg) { IALOG.debug("Enter - handleDeliveryStatusCallback"); var incidentId = msg.additionalTokens.incident_id; var responder = msg.recipient; var xmDeliveryStatus = msg.deliverystatus; var xmDevice = msg.device; // Create an annotation for the successful or failed del...
[ "function handleDeliveryStatus(msg)\n{\n if ( ANNOTATE_DELIVERY && msg.deliverystatus ) {\n switch (String(msg.deliverystatus).toLowerCase()) {\n \n case \"delivered\":\n addAnnotationToIncidentWorkInfo( getIncidentID(msg), notePrefix + \"Notification delivered successfully to \" + msg.recipient ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Create auto play with time 5s
function createAutoPlay(){ interval = setInterval(function(){ changeIndexNext() }, timeauto); }
[ "function AutoPlay() {}", "function play5sec() {\n audio5sec.play();\n}", "function beatPlay(steps){\n\t\n}", "play() {\n // imposto un ritardo di .8 secondi per far partire lo slide\n this.timer = setTimeout(this.goNext, 800);\n // scorro le immagini ogni 3 secondi\n this.timer = setIn...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Description: This function opens a text file with the name that was passed as a command line argument and counts the number of times each word appears in the file. It also keeps track of the starting indices of each occurrence of each word. After processing the file, it prints each word found in the file, the number of...
function wordCount(testChar){ // Read in the user specified file. fs.readFile(process.argv[2], 'utf8', function (err, data){ // If an error occurs, display its message. if(err){ console.log(err.message); } // If the file read was successful, process the text and displ...
[ "function getWordStats(fileContent) {\n \n let wordCount = document.getElementById(\"word-count\");\n let charCount = document.getElementById(\"char-count\");\n\n let text = fileContent.toLowerCase();\n let wordArray = text.match(/\\b\\S+\\b/g);\n wordArray = filterOutStopWords(\"Eng\", wordArray)...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Sort the backend decklist
function sortDeckList() { // body... deck_list.list = deck_list.list.sort( function(a, b) { return parseFloat(a.mana) - parseFloat(b.mana); } ); }
[ "function _sortDeck () {\n deck.sort ( (a, b) => {\n let cardA = getCardById(a);\n let cardB = getCardById(b);\n if (cardA[\"cost\"] > cardB[\"cost\"]) {\n return 1;\n }\n else if (cardA[\"cost\"] < cardB[\"cost\"]) {\n return -1;\n }\n else ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Updates the battery level
function checkAndUpdateBatteryLevel() { _batteryLevel.text = battery.chargeLevel; }
[ "function onBatteryLevelChange() {\n if (!enabled || !battery) {\n return;\n }\n\n t.set(\"bat\", battery.level);\n }", "function onBatteryLevelChange() {\n\t\t\tif (!enabled || !battery) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tt.set(\"bat\", battery.level);\n\t\t}", "async refreshBatteryL...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Checks if the substring incStr is included in the string str
function hasSubString(str, incStr) { return str.toLowerCase().includes(incStr); }
[ "function isSubString_Include(str1,str2){\nreturn str1.includes(str2);\n}", "function contains(str, subStr) {\n return str.indexOf(subStr) >= 0;\n }", "function includesSubstr(str1, str2) {\n return str1.includes(str2)\n}", "function IsSubstring(str, subStr, pos, inc){ \n var j = 0;\n for(var i =...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
A WixPagingData object is used to navigate cursored data sets returned by Wix APIs
function WixPagingData(initialResult, wixApiCallback, dataHandler) { this.currentData = initialResult; if(dataHandler !== undefined && dataHandler !== null) { this.resultData = _.map(initialResult.results, function(elem) { return dataHandler(elem); }); } else { this.resul...
[ "_pageData(data) {\n if (!this.paginator) {\n return data;\n }\n const startIndex = this.paginator.pageIndex * this.paginator.pageSize;\n return data.slice(startIndex, startIndex + this.paginator.pageSize);\n }", "function getPagedData( data, url, callback )\n{\n\trequest...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }