query
stringlengths
9
34k
document
stringlengths
8
5.39M
negatives
listlengths
19
20
metadata
dict
Processes everything required to complete the reveal phase of a round. Shows everyone's hand and determines who lost the hand.
function completeRevealPhase () { /* reveal everyone's hand */ for (var i = 0; i < players.length; i++) { if (players[i] && !players[i].out) { determineHand(i); showHand(i); } } /* figure out who has the lowest hand */ recentLoser = determineLowestHand();...
[ "function completeStripPhase () {\n /* strip the player with the lowest hand */\n stripPlayer(recentLoser);\n updateAllGameVisuals();\n}", "function completeContinuePhase () {\n\t/* show the player removing an article of clothing */\n\tprepareToStripPlayer(recentLoser);\n updateAllGameVisuals();\n\t\n...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Retrieves a single activity's wait times for a date.
async getActivityWaitTimes(id, date) { let found; try { log_1.default.debug(`Searching for waittimes for activity ${id} on ${date}`); found = await this.models.activity.getWaittimes(id, [date]); } catch ({ message, code }) { throw new common_1.Internal...
[ "function waitTimes(){\r\n if (times = getTimesFromPage()){\r\n // save the times on this page\r\n saveSetting('waitTimes', times.toString().replace(/,/g, \";\"));\r\n return times;\r\n }\r\n else {\r\n // use known times\r\n times = getSetting('waitTimes', 'times').split...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
reads the tweets from the tweets.txt file this is a very inefficient way of fetching tweets but for this assignment we will use the .txt file as our database we can use a more aggressive caching. Instead of waiting for the method to be executed we could cache the tweets in the initialization. With that we would save ti...
function readTweets(callback) { if (cache.tweets && cache.tweets.length > 0) { callback(null, cache.tweets); return; } try { fs.readFile(path.join(__dirname, '/../assets/tweets.txt'), function (err, data) { if (err) throw err; var tweets = []; co...
[ "function loadTweetData() {\n T.get(\"friends/list\", { screen_name: userName, count: 5 }, function(\n err,\n data,\n response\n ) {\n if (err) {\n // console.log(err);\n throw err;\n } else {\n myFriends = data.users;\n // console.log(data.users);\n }\n });\n\n T.get(\...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
make nice html for a definition. def is (def symbol ) lambdaexpr is (\\lambda vardecllist body) used for toplevel definitions, or embedded in dt/dd inside proof (see htmlProofString).
function htmlDefString(def) { var args = def.getArgs(); var sym = args[0]; var lamEx = args[1]; var lArgs = lamEx.getArgs(); var vdl = lArgs[0]; var body = lArgs[1]; var result = '<b>def</b>'; result += '\\(\\ '; result += sym.getArg(0); result += "("; result += latexVarDeclL...
[ "function htmlProofString(pf, level)\n{\n var i, vardecllist, vdlArgs;\n var result = '<dl class=\\\"proof\\\">';\n\n level = level || 0;\n\n result += '<dt>' + pf.label + ': </dt>\\n';\n result += '<dd><b>proof</b></dd>\\n';\n\n result += '<dt></dt><dd><dl class=\\\"proof\\\">'; // descripti...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Change function of the slider mass of object b
function massOfObjBChange(scope) { mass_ball_b = scope.mass_of_b; getChild("ball_b").scaleX = 0.5 + (scope.mass_of_b - 1) / 20; getChild("ball_b").scaleY = 0.5 + (scope.mass_of_b - 1) / 20; ball_b_radius = (getChild("ball_b").image.height * getChild("ball_b").scaleY) / 2; }
[ "function massOfObjAChange(scope) {\n mass_ball_a = scope.mass_of_a;\n getChild(\"ball_a\").scaleX = 0.5 + (scope.mass_of_a - 1) / 20;\n getChild(\"ball_a\").scaleY = 0.5 + (scope.mass_of_a - 1) / 20;\n ball_a_radius = (getChild(\"ball_a\").image.height * getChild(\"ball_a\").scaleY) / 2;\n}", "function sliderMov...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Generates a schema object that matches a Buffer data type
function BufferType() { BufferType.super_.call(this); }
[ "deserialize(any) {\n const desc = this.lookupDescriptor(any);\n let bytes = any.value;\n if (typeof bytes === \"undefined\") {\n bytes = new Buffer(0);\n }\n return desc.decode(bytes);\n }", "function makeBuffer(data) {\n\tvar buff = new Buffer(0), chunk;\n\tvar i = 0, j;\n\tfor(; i < data.l...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
ducnq 12/07/2012 ham hien thi popup chi tiet thong bao
function dsp_popup_chi_tiet_thong_bao(p_loai_giao_dien, p_loai_trang) { if (p_loai_trang > 0) { url = "/ajax/thong_bao/index/" + p_loai_giao_dien + "/" + p_loai_trang; show_box_popup('', 640, 600); AjaxAction('_box_popup', url); } else { alert('Mã thông báo không tồn tại!'); } }
[ "function ntv_huy_theo_doi() {\n\tvar url = '/ajax/ntv_quan_tri_theo_doi_tin_tuyen_dung/popup_huy_theo_doi/';\n\tshow_box_popup('', 420, 250);\n\tAjaxAction('_box_popup', url);\n\n}", "function showpopup(msg_id, process_name, top_value) {\n GetFullDetailMessage(msg_id, process_name);\n}", "function showQuest...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Decycles objects with circular references. This is used to print cyclic structures in development environment only.
function decycle(obj) { var seen = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : new Set(); if ( !obj || _typeof$1(obj) !== 'object') { return obj; } if (seen.has(obj)) { return '[Circular]'; } var newSeen = seen.add(obj); if (Array.isArray(obj)) { ...
[ "function recursiveDispose ( object ) {\n\n\t\t\tfor ( var i = object.children.length - 1; i >= 0; i-- ) {\n\n\t\t\t\trecursiveDispose( object.children[i] );\n\t\t\t\tobject.remove( object.children[i] );\n\n\t\t\t}\n\n\t\t\tif ( object instanceof PANOLENS.Infospot ) {\n\n\t\t\t\tobject.dispose();\n\n\t\t\t}\n\t\t\t...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
returns whether the phase is PHASE_DONE
get done() { return this.phase === PHASE_DONE; }
[ "isFinished() {\n\t\treturn this.staircases.every(function(s) {return s.staircase.isComplete();});\n\t}", "function completed () {\n return this.resolved.length === this.chain.__expectations__.length;\n}", "function isTodoCompleted(todo) {\n return todo.isDone;\n }", "end() {\n\t\treturn this.prog....
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
validating /////////////////////////////////////////////////////////////////// validate probe clone
function validateProbeClone() { console.log("validateProbeClone()"); if (vm.apiDomain.derivedFromAccID == undefined || vm.apiDomain.derivedFromAccID == "") { return; } if (vm.apiDomain.derivedFromAccID.inc...
[ "validate() {\n this.verifTitle();\n this.verifDescription();\n this.verifNote();\n this.verifImg();\n console.log(this.errors);\n console.log(this.test);\n if (this.test !== 0) {\n return false;\n }\n return true;\n }", "function PlateValidation() {\n\n /* Flags for standard pl...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
simple plugin to provide server.app.config in request.app.config
function appConfigPlugin(server) { server.ext("onRequest", (request, h) => { request.app.config = server.app.config; return h.continue; }); }
[ "configurationRequestHandler (context, request, callback) {\n callback(null);\n }", "config() {\n if (this.isBound(exports.names.APP_SERVICE_CONFIG)) {\n return this.get(exports.names.APP_SERVICE_CONFIG);\n }\n else {\n throw new Error('configuration object not yet l...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Retrieve partner object by Id.
static get(id = null){ let kparams = {}; kparams.id = id; return new kaltura.RequestBuilder('partner', 'get', kparams); }
[ "static getPublicInfo(id = null){\n\t\tlet kparams = {};\n\t\tkparams.id = id;\n\t\treturn new kaltura.RequestBuilder('partner', 'getPublicInfo', kparams);\n\t}", "getTrainerById(id) {\n logger.debug(`get trainer by id: ${id}`);\n return this.store.findOneBy(this.collection, {\n id: id\n });\n }", ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Undeploy and deregister the element
function undeployComponent(type, element, deleteFromModel) { return ComponentService.undeploy(ENDPOINT_URI + "/deploy/" + type + "/" + element.data("id")).then( function(response) { element.data("deployed", false); element.removeData("depError"); element.removeClass...
[ "function stopObservingElement(element) {\r\n // Do a manual registry lookup because we don't want to create a registry\r\n // if one doesn't exist.\r\n var uid = getUniqueElementID(element), registry = GLOBAL.Event.cache[uid];\r\n // This way we can return early if there is no registry.\r\n if (!reg...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Row chart to show the top 10 countries with the highest suicide rate
function show_countries_with_highest_suicide(ndx) { //Data dimension for country let country_dim = ndx.dimension(dc.pluck('country')); //Data group for no of suicides per 100k people for each country let total_suicide_by_country = country_dim.group().reduceSum(dc.pluck('suicides_100k')); //To set th...
[ "filterTopTenCountries(data) { \n let header = data['columns'].map(header => header);\n let lastEntryInHeaders = (header[header.length - 1])\n \n //sort data in descending order by total numbers\n let countriesSortedByTotalNumbers = data.sort(compareTotal);\n function compareTotal(a, b...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Creates an IFolder intance given a base object and either an absolute or server relative path to a folder
async function folderFromPath(base, path) { return (isUrlAbsolute(path) ? folderFromAbsolutePath : folderFromServerRelativePath)(base, path); }
[ "function folderFromServerRelativePath(base, serverRelativePath) {\n return Folder([base, extractWebUrl(base.toUrl())], `_api/web/getFolderByServerRelativePath(decodedUrl='${encodePath(serverRelativePath)}')`);\n}", "function fileFromServerRelativePath(base, serverRelativePath) {\n return File([base, extrac...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
This Col component offers us the convenience of being able to set a column's "size" prop instead of its className We can also omit the col at the start of each Bootstrap column class, e.g.size = "md12" instead of className = "colmd12"
function Col(props) { const size = props.size .split(` `) .map(s => `col-${ s}`) .join(` `); return <div className={size}>{props.children}</div>; }
[ "function ColumnLayout({\n mobileSize,\n tabletSize,\n desktopSize,\n children\n}) {\n\n let errorJsx = [];\n if (mobileSize === undefined && tabletSize === undefined && desktopSize === undefined) {\n throw new Error(\"Please set at least one of mobileSize, tableSize, and desktopSize\");\n }\n\n let colu...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
sorts locations in "my library" before groups and group subfolders
function isMyLibraryComparator(a, b) { if (isMyFolder(a) && !isMyFolder(b)) { return -1; } else if (!isMyFolder(a) && isMyFolder(b)) { return 1; } else { return 0; } }
[ "function sortVideosArray() {\n\tlet mainObject = {\"type\": \"folder\"}; // Object that will hold array of objects\n\t// Loop through videos array\n\tlet currObject;\n\tfor (let i = 0; i < videos.length; i++) {\n\t\tlet folderArray = videos[i].folder.split(\"->\"); // Split folder name into array of separate strin...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
remove all children of node from expandedIDs
removeExpandedChildren(expandedIDs, node) { if ("children" in node) { for (var i = 0; i < node.children.length; i++) { var index = expandedIDs.indexOf(node.children[i].id); //get index of child ID if (index !== -1) { //if child ID is in expandedIDs expandedIDs.splice(index,...
[ "function removeChildren(node) {\n\t\tjQuery(node).empty();\n\t}", "function expandChildren(node)\n{\n node.children = node._children;\n node._children = null;\n}", "function delete_all_children() {\n var theRightSide = document.getElementById(\"rightSide\");\n var theLeftSide = document.getElementById(...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Grabs image from form and formats for meme
function graphic(){ let memeImage = document.createElement("img"); memeImage.className = "memeImage"; memeImage.src = image.value; return memeImage; }
[ "function get_img(i,f){var b,a=__CONF__.img_url+\"/img_new/{0}--{1}-{2}-1\",g=__CONF__.img_url+\"/img_src/{0}\",c=\"d96a3fdeaf68d3e8db170ad5\",d=\"43e2e6f41e3b3ebe22aa6560\",k=\"726a17bd880cff1fb375718c\",j=\"6ea1ff46aab3a42c975dd7ab\";i=i||\"0\";f=f||{};ObjectH.mix(f,{type:\"head\",w:30,h:30,sex:1});if(i!=\"0\"){i...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
A filter to invert the colors in the image
invertFilter() { let canvasID = `canvasID:${this.state.canvasID}`; let c = document.getElementById(canvasID); let ctx = c.getContext("2d"); let imgData = ctx.getImageData(0, 0, c.width, c.height); // invert colors var i; for (i = 0; i < imgData.data.length; i += 4) { imgData.data[i] =...
[ "function invertColours()\n{\n\t'use strict';\n\t\n\t// Get the canvas, context, and image data\n\tvar canvas = document.getElementById(\"canvas\");\n\tvar context = canvas.getContext(\"2d\");\n\tvar imgData = context.getImageData(0, 0, canvas.width, canvas.height);\n\t\n\t// Loop to modify the colours in the image...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Function for set the properties of theme object into styles.
function setTheme(themValueObj) { for (const key in themValueObj) { document.documentElement.style.setProperty(`--${key}`, themValueObj[key]); } }
[ "function updateStyle() {\r\n\tif (settings.darkThemeSettings) {\r\n\t\t//dark theme colors\r\n\t\troot.style.setProperty(\"--background-color\", \"#0F0F0F\");\r\n\t\troot.style.setProperty(\"--foreground-color\", \"#FFFFFF\");\r\n\t\troot.style.setProperty(\"--red-color\", \"#a53737\");\r\n\t} else {\r\n\t\t//ligh...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
overridable: getHassState will be called for getting a name/tele/HASS_STATE payload (should be chained)
getHassState() { let hass_state = super.getHassState(); let gate_state = this.status; hass_state[ 'Uptime' ] = this.secondsToDTHHMMSS( this.getUpTime() ); hass_state[ 'Last Connected' ] = gate_state.lastOpened; hass_state[ 'Last Message' ] = gate_state.lastMessage; hass_state[ 'Last Error' ] = gate_state.la...
[ "function buildHueState(hue, bri, trans) {\n return JSON.stringify({\n on: true,\n bri: bri,\n hue: hue,\n sat: 254,\n transitiontime: trans/100\n })\n}", "function readState(data) {\n\n gamestate = data.val();\n\n}", "retrieveState(){\n if(this.storePath()){\n ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Debtor offers section end Debtor Offer line section start Only show those col for edit having visible true.
function dxGridDebOfferLines_OnEditingStart(e) { editingIndex = e.component.getRowIndexByKey(e.key); var grid = $("#dxGridDebtorOfferLine").dxDataGrid('instance'); manageDebCellVisibility(grid); }
[ "showAdditionalDepartments(el) {\n if (el.parents('.drop').find('.reception-add-review').is(':visible')) {\n el.parents('.drop').find('.reception-add-review').hide();\n } else {\n el.parents('.drop').find('.reception-add-review').find('.department-select-row').show();\n el.parents('.drop').find...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Generate the examplebegin indices; shuffle them randomly.
generateExampleBeginIndices_() { // Prepare beginning indices of examples. this.exampleBeginIndices_ = []; for ( let i = 0; i < this.textLen_ - this.sampleLen_ - 1; i += this.sampleStep_ ) { this.exampleBeginIndices_.push(i); } console.log('exampleBeginIndices_'); con...
[ "generateExampleBeginIndices_() {\n // Prepare beginning indices of examples.\n this.exampleBeginIndices_ = [];\n for (let i = 0;\n i < this.textLen_ - this.sampleLen_ - 1;\n i += this.sampleStep_) {\n this.exampleBeginIndices_.push(i);\n }\n\n // Randomly shuffle the beginning ind...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Property is to get whether the browser has MSPointer support.
static get isMSPointer() { if (isUndefined(window.browserDetails.isMSPointer)) { return window.browserDetails.isMSPointer = ('msPointerEnabled' in window.navigator); } return window.browserDetails.isMSPointer; }
[ "get isTouch()\n {\n return \"ontouchstart\" in window;\n }", "function isReallyTouch(e){//if is not IE || IE is detecting `touch` or `pen`\nreturn typeof e.pointerType==='undefined'||e.pointerType!='mouse';}", "function isMediaDevicesSuported(){re...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
generates an date object of the match date
function fetchMatchDate(matchObj) { const TIME_EPOCH = matchObj.start_time; var date = new Date(0); date.setUTCSeconds(TIME_EPOCH); return date; }
[ "function createDate() {\n theDate = new Date();\n }", "function getDates(result) {\n var currentTime = new Date(),\n rDate, \n opened,\n releaseDate;\n if (result.release_dates.theater) {\n rDate = result.release_dates.theater.split(\"-\");\n ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Method jsTabControl.turnTabOff() This function switches a tab into the off state given the tabID. Parameters: tabID (String) the ID of the tab to act on. Returns: nothing.
function _jsTabControl_turnTabOff(tabID) { document.getElementById('tab' + tabID + 'text').style.backgroundImage = "url(" + IMG_TAB_OFF[1].filename + ")"; document.images['tab' + tabID + 'left'].src = IMG_TAB_OFF[0].filename; document.images['tab' + tabID + 'right'].src = IMG_TAB_OFF[2].filename; }
[ "function stopTimer(tabId) {\n if (tabIntervals[tabId]) {\n window.clearInterval(tabIntervals[tabId].intervalID);\n tabIntervals[tabId] = null;\n }\n}", "function _jsTabControl_turnTabOn(tabID) {\n\tdocument.getElementById('tab' + tabID + 'text').style.backgroundImage = \"url(\" + IMG_TAB_ON[1].filename +...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
metghod creating a game object and adding it to the team's games array
addGame(opponent, teamPoints, opponentPoints) { const game = { opponent, teamPoints, opponentPoints } //pushes to an array this._games.push(game) }
[ "addGame(opponentName, teamPoints, opponentPoints) {\n let game = {\n opponent: opponentName,\n teamPoints: teamPoints,\n opponentPoints: opponentPoints\n }\n // adds the new game to the _games array\n this._games.push(game);\n }", "init_teams(teams)\n {\n console.log(teams);...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Returns a union of this set with another Set or iterable.
union(otherSet) { let newSet = new BetterSet(this); newSet.addAll(otherSet); return newSet; }
[ "function unionOfIterators() {\n var iterators = [];\n for (var _i = 0; _i < arguments.length; _i++) {\n iterators[_i - 0] = arguments[_i];\n }\n if (iterators.length === 0) {\n return intSet.empty;\n }\n var values = []...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Called by PluginManager upon receiving the __FxComponentUnLoadComplete event
function onUnloaded() { Media.log('PluginComponent::onUnloaded ' + id()); assert(pluginObj); pluginObj.onObjectUnloaded(); }
[ "unregisterLoadCallback () {\n this.loadCallback = null;\n }", "static finishedRenderingComponent() {\n\t\trenderingComponents_.pop();\n\t\tif (renderingComponents_.length === 0) {\n\t\t\tIncrementalDomUnusedComponents.disposeUnused();\n\t\t}\n\t}", "function loadComponent() {\n Media.log...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Function that checks whether it is necessary to load new data Loads news data if necessary Returns correct noCandlesTrans
checkAvailData() { return new Promise((resolve, reject) => { // check if it is necessary to load new data if (this.dataPointer-this.noCandles < 0) { var dir = 'left'; var message = createMessageForDataLoad(this.dtArray[0], dir); } else...
[ "loadXMLData(XMLData) {\n let transactionsDetails;\n try {\n transactionsDetails = xmlParser.parseStringSync(XMLData).TransactionList.SupportTransaction;\n } catch(err) {\n logger.warn('Invalid syntax.');\n this.lastDataLoadErrorCount++;\...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Return displayable mentions per party for the specified topic. If too many, a random sample of matching mentions is returned. Mentions are returned in chronological order.
function findMentions(topic) { return data.parties.map(function(party, i) { var mentions = topic.parties[i].mentions; if (mentions.length > maxMentions) { shuffle(mentions).length = maxMentions; mentions.sort(orderMentions); mentions.truncated = true; } return mentions; }); }
[ "async function loadPublicMemes() {\n const response = await fetch(url + '/api/memes/filter=public');\n if (response.ok) {\n const pubmemes = await response.json();\n return pubmemes.map(m => new Meme(m.id, m.title, url + m.url, m.sentence1, m.sentence2, \n m.sentence3, m.cssSentences...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
The AWS::Config::DeliveryChannel resource describes where AWS Config sends notifications and updated configuration states for AWS resources. Documentation:
function DeliveryChannel(props) { return __assign({ Type: 'AWS::Config::DeliveryChannel' }, props); }
[ "function DeliveryStream(props) {\n return __assign({ Type: 'AWS::KinesisFirehose::DeliveryStream' }, props);\n }", "function cfnBucketNotificationConfigurationPropertyToCloudFormation(properties) {\n if (!cdk.canInspect(properties)) {\n return properties;\n }\n CfnBucket_Notific...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Get TreeNode props with Tree props.
function getTreeNodeProps(key, _ref2) { var expandedKeys = _ref2.expandedKeys, selectedKeys = _ref2.selectedKeys, loadedKeys = _ref2.loadedKeys, loadingKeys = _ref2.loadingKeys, checkedKeys = _ref2.checkedKeys, halfCheckedKeys = _ref2.halfCheckedKeys, dragOverNodeKey = _ref2.dragOv...
[ "extractProps(node) {\n if (Element$1.isAncestor(node)) {\n var properties = _objectWithoutProperties(node, [\"children\"]);\n\n return properties;\n } else {\n var properties = _objectWithoutProperties(node, [\"text\"]);\n\n return properties;\n }\n }", "function get...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Verify that only indicators are used in favourites
function validateFavoriteDataItems() { //Data elements from favorites var issues = []; for (var type of ["charts", "mapViews", "reportTables"]) { for (var i = 0; metaData.hasOwnProperty(type) && i < metaData[type].length; i++) { var item = metaData[type][i]; for (var dimItem of item.dataDimensionItems) { ...
[ "function checkOwnFavs(){\n if( ! conf.ownFavs || ! tweet.favorited ){\n return checkFinal();\n }\n checkOwnFavourite( tweet.id_str, function( favourited ){\n if( favourited ){\n console.log('Keeping tweet favourited by self');\n return nextTw...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Check if an object is in an array, return index of the object if true
function arrayContains(arr, obj){ for (var i=0; i < arr.length; i++){ if (arr[i] == obj){ return i; } } return false; }
[ "static isExistInArray(arr, value, index=0){\n\t\tif( typeof arr === 'object'){\n\t\t\tlet arrList = [];\n\t\t\tforEach( arr, (item, key) => {\n\t\t\t\tif(item.id){\n\t\t\t\t\tarrList.push(item.id);\n\t\t\t\t}\n\t\t\t});\n\t\t\tif(indexOf(arrList, value, index) >= 0){\n\t\t\t\treturn true;\n\t\t\t}\n\t\t\treturn fa...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
The stackLetter function should accept the array as the sole argument
function stackLetters (alphabet) { for (var i=0; i < alphabet.length; i++) { stack += alphabet[i] console.log(stack) }; }
[ "function fillDisplayWord (letter) {\n\n}", "function makeHappy(arr){\n let result = arr.map(word => \"Happy \" + word)\n return result\n}", "print() { \n let str = \"\"; \n for (var i = 0; i < this.size(); i++) \n str += this.stack[i] + \" \"; \n console.log(str); \n }"...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Modeled after the pushPayload for emberdata/serializers/rest
pushPayload(store, payload) { const documentHash = { data: [], included: [], }; Object.keys(payload).forEach(key => { const modelName = this.modelNameFromPayloadKey(key); const serializer = store.serializerFor(modelName); const type = store.modelFor(modelName); makeArra...
[ "function _push(object) {\n var payload = null;\n var callback = null;\n var error_callback = function (jqXHR,status,err) {\n //console.log(jqXHR,status,err.get_message());\n };\n var user_options = {};\n var url;\n for (var i = 0; i < arguments.length; i++) {\n switch(typeof arguments[i]) {\n cas...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
allSettled() when passed an iterable containing either a single nonthenable value or a single thenable that resolves successfully should resolve to a singleelement array containing the resolved value
testSingleFulfilled() { const expectedValue = {}; function subtest(iterable) { return new AllSettledTestCaseBuilder() .setInputIterable(iterable) .setExpectedResults([newFulfilledValue(expectedValue)]) .test(); } return Promise.all([ subtest([expectedValue]), ...
[ "function test5_1() {\n var promise1 = Promise.resolve(3);\n var promise2 = new Promise((resolve, reject) => {\n setTimeout(reject, 100, 'foo')\n });\n var promises = [promise1, promise2];\n\n Promise.allSettled(promises).then((results) => results.forEach((result) => console.log(result.status)...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
LOCAL FUNCTIONS function: getLineBreak description: returns line break based on platform
function getLineBreak(theForm){ var retVal; var selInd = theForm.WhichPlatform.selectedIndex; switch (selInd){ case 0: retVal = "\r\n"; break; case 1: retVal = "\r"; break; case 2: retVal = "\n"; break; } return retVal; }
[ "get lineBreak() {\n return this.facet(EditorState.lineSeparator) || '\\n'\n }", "insertLinebreak() {\n const prompt = this.prompt;\n const model = prompt.model;\n const editor = prompt.editor;\n // Insert the line break at the cursor position, and move cursor forward.\n ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Undo buttton click handler
undoButton() { this.state.undo(); }
[ "undoAction() {\n this.element.executeOppositeAction(this.details);\n }", "handleUndoClick() {\n const newStep = this.state.currStep === 0 ? 0 : this.state.currStep - 1;\n let numCount = this.countNums(this.state.history[newStep].board);\n this.setState({\n currStep: newStep,\n numCou...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Class for managing objects that need to be downloaded/parsed in memory/saved to disk. This class support resuming jobs with the following features: DownloadToFile will be skipped if target file exists. DownloadToMemory will actually read from disk if file exists. SaveToDisk will be skipped if file exists and will first...
function DownloadableObject() { // Construct object. this.Init = function(filepath, url) { this.filepath = filepath; this.url = url; }; // Check that we can write the target file. this.TargetFileExists = function(onComplete) { fs.access(_that.filepath, fs.constants.W_OK, function(err) { var file_exist...
[ "downloadModelOBJ() {\n\t\tthis.emitWarningMessage(\"Preparing OBJ file...\", 60000);\n\t\tthis.props.loadingToggle(true);\n\t\twindow.LITHO3D.downloadOBJ(1, 1, 1, true).then(() => {\n\t\t\tthis.props.loadingToggle(false);\n\t\t\tthis.emitWarningMessage(\"File is ready for download.\", 500);\n\t\t})\n\t\t\t.catch(e...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Contacts Balancer's The Graph API endpoint to query pool data
async function getBalancerGraph() { // Balancer's The Graph API URL const APIURL = "https://api.thegraph.com/subgraphs/name/balancer-labs/balancer-polygon-v2"; // query request with result settings const poolsQuery = ` query { pools(first: 100, orderBy: totalLiquidity, orderDirection: desc)...
[ "queryPool() {\n const request = new types.staking_query_pb.QueryPoolRequest();\n return this.client.rpcClient.protoQuery('/cosmos.staking.v1beta1.Query/Pool', request, types.staking_query_pb.QueryPoolResponse);\n }", "function PoolRequests (){ \n return myContract.methods.getRequestCount...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
gets all the values of a circuit object, returns array of all values and DELETES exercise key so exercises need to be extracted with extractExercisesFromCircuits before using this function
function getValuesFromCircuit(circuit) { //circuitsArr.forEach(c => delete c["exercises"]); let valuesArr = []; // for (let c in circuitsArr) { // let tempArr = []; // Object.entries(circuitsArr[c]).forEach(([key, value]) => { // tempArr.push(value) // }) //...
[ "static getCryptoValueArray() {\n var coinArray = [];\n for(var i = 0; i < CryptoExchanger.cryptoExchangerArray.length; i++) {\n coinArray.push({\n name: CryptoExchanger.cryptoExchangerArray[i].getCoinName(),\n population: CryptoExchanger.cryptoExchangerArray[i].getCurrentValue(),\n })...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Defines a moment where the first registered observer is used to asynchronously execute a request, returning a single result If no result is returned (undefined) no further action is taken and the result will be undefined (i.e. additional observers are not used)
function moments_request() { return async function (observers, ...args) { if (!isArray(observers) || observers.length < 1) { return undefined; } const handler = observers[0]; return Reflect.apply(handler, this, args); }; }
[ "_createWatcher() {\n const _watcher = Looper.create({\n immediate: true,\n });\n _watcher.on('tick', () => safeExec(this, 'fetch'));\n\n this.set('_watcher', _watcher);\n }", "requestAnalysis() {\n return __awaiter(this, void 0, void 0, function* () {\n yield this.update(Analy...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Load Consumer of given user
function loadConsumer(recipientId, user) { if (user == null) return; return function (dispatch) { return new parse_1.default.Query(ParseModels_1.Consumer).equalTo('user', user).first().then(function (consumer) { if (consumer) { dispatch({ type: types.CONSUMER_LOADED, ...
[ "function loadUser() {\n console.log(\"loadUser() started\");\n showMessage(\"Loading the currently logged in user ...\");\n osapi.jive.core.users.get({\n id : '@viewer'\n }).execute(function(response) {\n console.log(\"loadUser() response = \" + JSON.stringify(response));\n user = response.data;\n ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Check to see if 'Lost' is in the phrase (using some).
function lostCarcosa (input) { return input.some(x => x.includes('Lost')); }
[ "checkWord(word){\n this.nonTerminalSymbols.forEach(item => {\n if (word.indexOf(item) !== -1) {\n this.wordExist = true;\n }\n });\n }", "function doesWordExist(wordsArr, word) {\nif(wordsArr.includes(word)){\n return true;\n}else{\n ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Inserts into Search Table Accepts the following api/search?lifetime=(int)&type=(string)&netFood=(int)&posFood=(int)&negFood=(int)&members=(json[])
function search(err, client, done, req, res) { if(err) { return console.error('error fetching client from pool', err); } var reqArr = [req.body.lifetime, req.body.type, req.body.netFood, req.body.posFood, req.body.negFood, req.body.members]; var jsonQuery = ""; var i; jsonQuery += "array...
[ "function pushFood(){\n for(var i = 0; i < data.length; i++){\n nutrifit_db_food.push(data[i]);\n }\n}", "createOne (json: jsonUpdate, callback: mixed) {\n\t\tlet val = [json.headline, json.category, json.contents, json.picture, json.importance];\n\t\tsuper.query(\n\t\t\t\"insert into NewsArticle (he...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Send a PM to the given username
sendPrivateMessage(username, message) { return this.sendMessage('/mp ' + username + ' ' + message); }
[ "function sendPrivateMessage(user, name, text) {\n var target;\n var message = text.split(' ');\n message.splice(0, 2);\n message = message.join(' ');\n\n target = User.getUserByName(name);\n if(target) {\n target.sendPrivateMessage(user, message);\n } else {\n user.notify('Sorry,...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
PUBLIC FUNCTION / Fonction d'initialisation du "content managment"
function initContentmanagment() { _carouselResponseId = 0; _emptyBreadcrumbContent = $(BREADCRUM_ID).html() }
[ "function InitializeContentArea() {\n\tvar $content = $('.content');\n\tvar height = GetAvailableHeight() - GetVerticalMargin($content);\n\t$content.css('min-height', height);\n}", "function loadContent() {\n\t\tMassIdea.loadHTML($contentList, URL_LOAD_CONTENT, {\n\t\t\tcategory : _category,\n\t\t\tsection : _s...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Chapter 101 RopeGroup Heather collars the player as her slave
function C101_KinbakuClub_RopeGroup_PlayerCollared() { Common_PlayerOwner = CurrentActor; Common_ActorIsOwner = true; PlayerLockInventory("Collar"); CurrentTime = CurrentTime + 50000; }
[ "function C101_KinbakuClub_RopeGroup_WillLucyTie() {\n\tif (ActorGetValue(ActorLove) >= 3 || ActorGetValue(ActorSubmission) >= 2) {\n\t\tOverridenIntroText = GetText(\"LucyNotTieYou\");\n\t\tC101_KinbakuClub_RopeGroup_CurrentStage = 600;\n\t} else C101_KinbakuClub_RopeGroup_PlayerTied();\n}", "function C101_Kinba...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Parse the given text with the given context. Parsing works via loaded subparsers each responsible for their own mutually exclusive syntax. Parsers come in two flavors: Start parsers use syntax which can only occur at the start of a line, such as section headers and lists. These are expected to consume the entire line a...
parse(text,context){ const title=context.title||"",s1=new Section(1,[new Text(title)]), article=new Article(title,[s1]),tl=text.length; context=context||{}; context.self_close=context.self_close||(()=>false); this.pos=0; this.cur=article.subsections[0]; this.path=[]; while(this.pos<tl){ let...
[ "parse_start(text,context){\n\t\tfor(const parser of this.start_parsers){\n\t\t\tconst res=parser.call(this,text,context);\n\t\t\tif(res){\n\t\t\t\treturn res;\n\t\t\t}\n\t\t}\n\t\t\n\t\treturn null;\n\t}", "get_parsers(text,context){\n\t\tconst EOL=/$/gm;\n\t\tEOL.lastIndex=this.pos;\n\t\tEOL.test(text);\n\t\tco...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Get zoneName Validation Response
getZoneNameValidation(zoneName) { return this.$http .get(`${this.swsProxypassOrderPath}/new`, { params: { zoneName, }, }) .then(response => response.data) .catch(err => this.$q.reject(err)); }
[ "function getZone(axios$$1, zoneToken) {\n return restAuthGet(axios$$1, '/zones/' + zoneToken);\n }", "get zoneType() {\n return this.getStringAttribute('zone_type');\n }", "get parentZoneName() {\n return this.getStringAttribute('parent_zone_name');\n }", "orderZoneName(zoneName, mini...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Name: storeYArray() (Store Year Array) variables: a (array), startYear, endYear Purpose: This function takes in an empty array, the start year, and the end year. Then the array is filled with each year.
function storeYArray(a, startYear, endYear) { var i = 0, year = startYear; //while(year <= endYear) { while(year < endYear) { a[i] = year; year++ i++; } return a; }
[ "function createYearsArray(size,year) {\n\t// Validate parameter value\n\tif (size+\"\" == \"undefined\" || size == null) \n\t\treturn null;\t\n\tthis.length = size;\n\tfor (var i = 0; i < size; i++) {\n\t\tthis[i] = year++; \n\t}\n\treturn this;\n}", "function generateEndYears(selectedDatabaseMask) {\n va...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Deletes dictionary entry and mirrors change to files on disk. Returns true after successful deletion.
function deleteEntry(key){ if(existsInDictionary(key)){ delete contents[key]; var json = JSON.stringify(contents); fs.writeFile(jsonFilePath, json, 'utf8', function(){}); return true; } return false; }
[ "delete(word) {\n\t\t// Helper function:\n\t\t// Works through the levels of the word/key\n\t\t// Once it reaches the end of the word, it checks if the last node\n\t\t// has any children. If it does, we just mark as no longer an end.\n\t\t// If it doesn't, we continue bubbling up deleting the keys until we find a ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Creates an observable where all callbacks are executed inside a given zone
function runInZone(zone) { return (source) => { return new rxjs__WEBPACK_IMPORTED_MODULE_2__["Observable"](observer => { const onNext = (value) => zone.run(() => observer.next(value)); const onError = (e) => zone.run(() => observer.error(e)); const onComplete = () => zone...
[ "createEventObservable(eventName, layer) {\n return new rxjs__WEBPACK_IMPORTED_MODULE_2__[\"Observable\"](observer => {\n this._layers.get(layer).then(m => {\n m.addListener(eventName, e => this._zone.run(() => observer.next(e)));\n });\n });\n }", "createEventObser...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
The highFive function prints the numbers from 0 to the number passed in. If the number is 5 it instead prints "High Five!". Nothing is returned by the function. Result: We are not calling this function so there is no result.
function highFive(num){     for(var i=0; i<num; i++){         if(i == 5){             console.log("High Five!");         }         else{             console.log(i);         }     } }
[ "function multipleOfFive(num){\n return num%5 === 0 \n}", "function divisionBy5(num) {\n\treturn (num / 5);\n}", "function five (num) {\n if (num>=5) {\n return \tparseInt(num/5)+five(parseInt(num/5));\n }\n else {\n return 0;\n }\n }", "function divByFive...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
The static method means we do not have to instantiate this class(Make it an object) in order to use the CurrencyWidthIdentifier
static createCurrencyWidthIdentifier(identifier){ switch (identifier) { case Currency.currencyList.nigeria: let nigerianCurrency = new Currency(identifier, 1, 0.0021, 0.0028, 'N'); return nigerianCurrency; break; case Currency.currencyList.britain: let britishCurrency ...
[ "function CurrencyHandler() {\n\t\tthis.type = 'currency';\n\t}", "static getCurrencyName(code) {\n let currencyName = this.getPhrase(code, \"CurrencyCode\");\n if (currencyName != \"\" && currencyName.length > 0)\n return currencyName;\n else\n return code;\n }", "...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
HandicapPair le asiga parejas a los jugadores dependiendo de su handicap.
function HandicapPair() { db.transaction(function(transaction) { transaction.executeSql('DROP TABLE IF EXISTS equipos'); transaction.executeSql('CREATE TABLE IF NOT EXISTS equipos(EquipoId INTEGER NOT NULL PRIMARY KEY, jugadorId INTEGER NOT NULL, numEquipo INTEGER NOT NULL, numPareja INTEGER NOT ...
[ "function initPoses() {\n let num = 0;\n this.joints = {\n // wrist\n Wrist: new _JointObject.JointObject(\"wrist\", num++, this),\n // thumb\n T_Metacarpal: new _JointObject.JointObject(\"thumb-metacarpal\", num++, this),\n T_Proximal: new _JointObject.JointObject(\"thumb-phalanx-pro...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
set up modal transaction status
function setModal(textColor, statusTx, transactionAddress) { function removeClass(index, className) { return (className.match(/\btext-\S+/g) || []).join(' '); } $('#contain-status-modal').removeClass(removeClass); if (transactionAddress != null) { let addressTxCompress = transactionAddress.substring(0, ...
[ "function TxStatus(_util) {\n\t\tconst _$e = $(`\n\t\t\t<div class='TxStatus'>\n\t\t\t\t<div class='clear'>clear</div>\n\t\t\t\t<div class='status'></div>\n\t\t\t</div>\n\t\t`);\n\t\tconst _opts = {};\n\t\tconst _$clear = _$e.find(\".clear\").hide();\n\t\tconst _$status = _$e.find(\".status\");\n\n\t\t_$clear.click...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Language: Mizar Description: The Mizar Language is a formal language derived from the mathematical vernacular.
function mizar(hljs) { return { name: 'Mizar', keywords: 'environ vocabularies notations constructors definitions ' + 'registrations theorems schemes requirements begin end definition ' + 'registration cluster existence pred func defpred deffunc theorem ' + 'proof let take assume then ...
[ "function menutoshowlang(){\n}", "function footerLanguage(){\r\n\tif(fileName==\"espana.html\"){\r\n\t\tfooterSpanish();\r\n\r\n\t} else if(fileName!=\"espana.html\"){\r\n\t \tfooterGerman();\r\n\t}\r\n}", "function updateLanguage(select_language, select_dialect) {\n var list = langs[select_language.selected...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Puts a border on active slider's dot
function setCurrentDotActive($dot) { $sliderDots.removeClass('active'); $dot.addClass('slider-dot active'); }
[ "drawSlider() {\n let c = color(255, 255, 255);\n fill(c);\n noStroke();\n rect(this.x, this.y + this.topPadding + this.lateralPadding, this.width, this.height, 1, 1, 1, 1);\n }", "function f_refectSpEditBorder(){\n // set #sp-taginfo-border-width value.\n var bw = $('#sp-taginfo-bo...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Function takes an array of jQuery objects and shows/hides each according to whether their text equals the search params.
function searchList(searchArray, target) { for(var i = 0; i < searchArray.length; i++) { var current = $(searchArray[i]); var possible = current.text().substring(0, target.length).toLowerCase(); if(target === '') { // Re-shows items if search input is cleared current.show(); }...
[ "function setup(array) {\n let searchInput = document.getElementById(\"search-field\");\n searchInput.addEventListener(\"input\", (event) => {\n let value = event.target.value.toLowerCase();\n let foundLists = array.filter((show) => {\n let toLowerCaseName = show.name.toLowerCase();\n let toLowerC...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Creates a performer All new items needs to pass through this function
function createPerformer(obj) { if (!obj._hash) { console.log('No hash on obj, returning null'); return; } if (_performersHash[obj._hash]) { console.log(obj, 'has already been seen'); return; } Utils.middleware(obj); _performersHash[obj._hash] = obj; ob...
[ "get performer() {\n\t\treturn this.__performer;\n\t}", "createLesson() {\n this.lessonService\n .createLesson(this.props.courseId, this.props.moduleId, this.lesson,\n () => {\n this.findAllLessonsForModule();\n });\n }", "_fetchFromAPI() {\n...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Does the message have options?
function hasOptions() { if (typeof currMsg.opt == 'undefined' || currMsg.opt.length == 0) { return false; } return true; }
[ "function isMessageValid() {\n return $message.val().length > 0;\n }", "function isTheMessageACommand(message) {\n if (message.content.toLowerCase().startsWith('!clear')) {\n clearMessages(message);\n }\n if (message.content.toLowerCase().startsWith('!theelders')) {\n firstUsers(message);\n }\n ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Put lyric in the tablature
_setLyric(x, lyric) { var block, text; block = this.model.rect(x - 5, 84, 700, 16, 9, 9); block.attr({ fill: this.notes_color_map[lyric[0]] }); return text = this.model.text(x, 97, lyric).attr({ "font-size": 12, "font-family": "Arial" }); ...
[ "function displaySimpleLyric(data,songArtist,songName)\n{\n if(data.lyrics==undefined){\n alert(\"Sorry no lyric found\");\n document.getElementById('lyricSimple').innerHTML=\"<h1></h1>\";\n }\n else{\n const lyric = data.lyrics.replace(/(\\r\\n|\\r|\\n)/gi,'<br>');\n const stri...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Roll a random background pic
function bgRoll() { const bgm = ['../../resources/SBISL02.png','../../resources/MTLSL04.png','../../resources/OSCSL08.png','../../resources/PGTSL04.png','../../resources/PTWSL02.png','../../resources/STCSL01.png']; $('body').css({ 'background-image' : 'url('+ bgm[Math.floor(Math.random() * bgm.length)...
[ "function randomBG(){\n var BG = 0;\n BG = Math.floor(Math.random() * 3 ) + 1; // generates a random background from the 3 background images. \n // console.log(BG);\n if (BG === 1){\n return 'background1.jpg' // if the random number of 1 is chosen the background.jpg will be chosen\n } els...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
teamDataSavedListener React to team data being saved, by storing the match id
function teamDataSavedListener () { debug('match data saved, resolving state promise') module.exports.internal.teamDataSavedPromiseResolver() }
[ "function findMatch () {\n module.exports.internal.dataObj.seasons[module.exports.internal.seasonId].matches.forEach((match) => {\n if (match.id === module.exports.internal.matchId) {\n module.exports.internal.matchData = match\n }\n })\n}", "function saveMatch(fixture) {\n Match.findOne({ MatchCode...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
jshint W097 / globals module Defines a channel that syncs data to Firebase
function FirebaseChannelConfig() { this.databaseURL = null; this.serviceAccount = null; }
[ "openChannel(params) {\n\n // define a couple potential payloads for the firebase add. \n const channelPayloadOptions = [\n // Option 1: new channel, n members, no admin. \n {\n channelName: \"\",\n members: members,\n thread: [ message ]\n }, \n // option 2: new chann...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Whether the current user is a board member
isBoard(state) { return state.oauth.user !== null && state.oauth.user.level === 'board'; }
[ "isMember(state) {\n return state.oauth.user !== null && ['board', 'member'].indexOf(state.oauth.user.level) !== -1;\n }", "function isMember()\r\n{\r\n var userInfo = JSON.parse(sessionStorage.gUserInfo);\r\n\r\n if (userInfo && userInfo[\"m\"] && 0 < userInfo[\"m\"].length)\r\n {\r\n ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
roundEnded: Called when the round has been ended. If it's the first call after the round was continuing, we update buttons, stop the timer counter and induce a backend query to update the list of all words.
function roundEnded() { if (roundCont == true) { clearInterval(interval); targetDate = null; roundCont = false; // document.myForm.round.disabled = false; updateButtons(); getWords(); } }
[ "endRound() {\n console.log(`Round ${this.round} completed.`)\n\n // update progress bar\n let point = this.round - 1;\n if (point >= 0) {\n // calc width for the bar\n let width = Math.round(100 / (totalRounds - 1) * point);\n progressBar.find('.active-line').animate({\n ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Load the database JSON file
load() { let database = fs.readFileSync(__dirname + '/database.json', 'utf8'); return JSON.parse(database); }
[ "function loadJSON() {\n var client = new XMLHttpRequest();\n client.open(\"GET\", databasefilename, true);\n client.onreadystatechange = function () { //callback\n if (client.readyState === 4) {\n if (client.status === 200 || client.status === 0) {\n ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Functions ====== Fill tourList table with data
function populateTable(){ // Empty Content String var tableContent = ''; // jQuery AJAX call for JSON $.getJSON('/tours', function( data ){ tourList = data; // For each item in our JSON, add a table row and cells to the content string $.each(data,function(){ tableContent += '<tr>'; tableContent +...
[ "function fill_table(list){\n $('#incidentListTable tbody tr').remove();\n $.each(list, function(i, item) {\n var $tr = $('<tr>').append(\n $('<th>').text(item.id),\n $('<td>').text(item.start),\n $('<td>').text(item.end),\n $('<td>').text(item.tags),\n $('<td>').text(item.su...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
============================================================================= factory for handling tokens inject $window to store token clientside
function AuthToken($window){ var authTokenFactory = {} //get the token out of local storage authTokenFactory.getToken = function(){ return $window.localStorage.getItem('token') } //set the token or clear the token authTokenFactory.setToken = function(token){ if(token) $window.localStorage.se...
[ "function getToken() {\n return localStorage.getItem('token');\n}", "function getToken() {\n\treturn localStorage.getItem('token')\n}", "getByToken(){\n return http.get(\"/Employee/token/\" + localStorage.getItem('login').toString().split(\"Bearer \")[1]);\n }", "function fetchTokens() {\n _.e...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Resizes the width for scrollable table to a minimum size tableid the id of the table to resize return none Compatibility: IE, NS6
function i2uiShrinkScrollableTable(tableid) { var tableitem = document.getElementById(tableid); var headeritem = document.getElementById(tableid+"_header"); var dataitem = document.getElementById(tableid+"_data"); var scrolleritem = document.getElementById(tableid+"_scroller"); if (tablei...
[ "function i2uiResizeTable(mastertableid, minheight, minwidth, slavetableid, flag)\r\n{\r\n //i2uitrace(0,\"ResizeTable = \"+mastertableid);\r\n var tableitem = document.getElementById(mastertableid);\r\n var headeritem = document.getElementById(mastertableid+\"_header\");\r\n var dataitem = document...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Captures the tag name from the start of the tag to the current character index, and converts it to lower case
function captureTagName() { var startIdx = currentTag.idx + (currentTag.isClosing ? 2 : 1); return html.slice(startIdx, charIdx).toLowerCase(); }
[ "function cleanTagName( name ) {\n\t\treturn name.split( ':', 1 )[ 0 ].replace( /[^a-zA-Z]/g, '' ).toLowerCase();\n\t}", "function convert_attr_name_to_lowercase(code)\n{\n\tr = /(style=[\"'][^\"']*?[\"'])/gi;\n\treturn code.replace(r,function(s1,s2){\n\t\t\t\t\t\t\ts2 = s2.replace(/;?([^:]*)/g,function(d1,d2){re...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
get total number of wild cards in a word
function totalWC(word) { return word.split("").filter(char => char == "*").length; }
[ "function count(regex, str) {\n return str.length - str.replace(regex, '').length;\n }", "function spoccures(string, regex) {\n return (string.match(regex) || []).length;\n }", "function aCounter(word) {\n let count = 0;\n let index = 0\n while (index < word.length) {\...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Enter a parse tree produced by ObjectiveCPreprocessorParserpreprocessorDef.
enterPreprocessorDef(ctx) { }
[ "enterPreprocessorParenthesis(ctx) {\n\t}", "enterPreprocessorBinary(ctx) {\n\t}", "enterPreprocessorDefined(ctx) {\n\t}", "enterPreprocessorImport(ctx) {\n\t}", "enterPreprocessorConditional(ctx) {\n\t}", "enterPreprocessorConstant(ctx) {\n\t}", "enterPreprocessorConditionalSymbol(ctx) {\n\t}", "ente...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Consumes tokens from a Tokenizer to parse an At Rule node.
parseAtRule(tokenizer) { let name = undefined; let nameRange = undefined; let rulelist = undefined; let parametersStart = undefined; let parametersEnd = undefined; if (!tokenizer.currentToken) { return null; } const start = tokenizer.currentTok...
[ "parseRule(tokenizer) {\n // Trim leading whitespace:\n const token = tokenizer.currentToken;\n if (token === null) {\n return null;\n }\n if (token.is(token_1.Token.type.whitespace)) {\n tokenizer.advance();\n return null;\n }\n else...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
checkForPropertyClash() Because we are dynamically adding property names, we need to ensure that the name does not clash with any existing javaScript property names. Check the passed in property name. If it matches a javaScript property, return an amended property name.
function checkForPropertyClash(property) { if (property === 'length') { return 'len'; } return property; }
[ "function shortenIfExists(obj, property) {\n if (obj[property]) {\n obj[property] = shorten(obj[property]);\n }\n}", "function jptr(obj, prop, newValue) {\n if (typeof obj === 'undefined') return false;\n if (!prop || typeof prop !== 'string' || (prop === '#')) return (typeof newValue !== 'unde...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
return array of nodes that are domains
function getAllDomains(){ var domains = []; var nodes = flattenAll_BF(root); for(var i in nodes){ if(nodes[i].type == "domain") domains.push(nodes[i]); } return domains; }
[ "function getDomains(data, tld){\n var vals = data.getValues(); \n var dot_coms = [];\n \n for (var i = 0; i < vals.length; i++) {\n for (var j = 0; j < vals[i].length; j++) {\n var cellVal = vals[i][j]\n \n if (typeof cellVal !== \"string\") continue; // skip non-string cells\n \n ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
hide the pop up => display none and zindex negativ => empty the title and content
function hidePopup () { $('#popup').css('z-index', -20000); $('#popup').hide(); $('#popup .popup-title').text(''); $('#popup .popup-content').text(''); $('.hide-container').hide(); $('.container').css('background', '#FAFAFA'); }
[ "function hide_popup()\n{\n\t$('.overlay').hide();\n\t$(\"#tooltip\").toggle();\n}", "function showPopup () {\n $('#popup').css('z-index', '20000');\n $('#popup .popup-title').text($('#title').val());\n $('#popup .popup-content').text($('#content').val());\n $('.hide-container').show()...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Checks with the scheduler to see if a process is executing or queued to execute.
function krnCheckExecution() { return _Scheduler.processEnqueued; }
[ "needsReschedule() {\n if (!this.currentTask || !this.currentTask.isRunnable) {\n return true;\n }\n // check if there's another, higher priority task available\n let nextTask = this.peekNextTask();\n if (nextTask && nextTask.priority > this.currentTask.priority) {\n ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Enables only the markers in the specified timerange, all other markers are hidden
function selectMarkers(start, end) { for(index in markers) { current = markers[index].frameNo; if(current >= start && current <= end) { markers[index].setVisible(true); } else { markers[index].setVisible(false); } } markerCluster.repaint(); resetInfoWindow(); }
[ "function showMarkersWithinRange(range)\n{\n\t// the range is in miles\n\tvar milesToMeters = 1609.34;\n\trange = range*milesToMeters;\n\t// Try W3C Geolocation (Preferred)\n\tif(navigator.geolocation) {\n\tbrowserSupportFlag = true;\n\tnavigator.geolocation.getCurrentPosition(function(position) {\n\t initialLocat...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Se encarga de mostrar la puntuacion para obtener el autoclic :
function mostrarAutoclic() { $autoclic.innerHTML = "Autoclic de 5 seconds avec un score de : " + aupoints() + " Cookies "; }
[ "function colocarNome(nome){\n app.activeDocument.layers[0].visible = true;\n app.activeDocument.layers[0].textItem.contents=nome;\n }", "function onOpen(e) {\n DocumentApp.getUi().createAddonMenu()\n .addItem('Crypt It', 'doCrypt')\n .addItem('DeCrypt It', 'doDecrypt')\n .addToUi();\n}",...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Determine whether the given properties match those of a `CognitoUserPoolConfigProperty`
function CfnGraphQLApi_CognitoUserPoolConfigPropertyValidator(properties) { if (!cdk.canInspect(properties)) { return cdk.VALIDATION_SUCCESS; } const errors = new cdk.ValidationResults(); if (typeof properties !== 'object') { errors.collect(new cdk.ValidationResult('Expected an object, b...
[ "function CfnAnomalyDetector_VpcConfigurationPropertyValidator(properties) {\n if (!cdk.canInspect(properties)) {\n return cdk.VALIDATION_SUCCESS;\n }\n const errors = new cdk.ValidationResults();\n if (typeof properties !== 'object') {\n errors.collect(new cdk.ValidationResult('Expected a...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Renders the input list of hashes as tiles in the index section
function renderHashes(hashes) { $('#new-note-btn').hide(); $("#new-note-hr").hide(); $("#note-index-container").css('height', '410px'); clearNotesDisplay("hashes"); hashes.forEach(function(hash) { $(".note-index").append('<div class="note-tile btn btn-block transition-quick" data-id=' + has...
[ "function renderMemeImagesAsHexagons() {\n gState.renderMode = 'hexagons';\n var elImagesContainer = document.querySelector('.images-container');\n var strHtml = '';\n strHtml += '<ul id=\"hexGrid\">';\n gImages.forEach(function (image, imageIndex) {\n\n strHtml += '<li class= \"hex\" onclick=...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
MG Issue 1062 Allow Paste only Digists , Comma, and decimal
function checkPasteSigned(element) { var key = window.event.keyCode; if (key == 9 || (key >= 35 && key <= 40)) return; // First Trim spaces while (element.value.indexOf(' ') > 0) element.value = element.value.replace(' ', ''); //Check if numeric if (!isNumeric(element.value.repl...
[ "function addCommaToIncomeInput(e){\n let val = Number(e.target.value.replaceAll(',',''))\n e.target.value = val.toLocaleString()\n}", "function putMask_Number_Value(aValue, aintDigits, aintDecimals)\n{\n lstrValue = \"\"+aValue;\n re = new RegExp(\",\",\"g\");\n lstrValue = lstrValue.replace(re,\"...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Returns the linear regression of a data set over a number of days. Data should be in the form of [Date, number]
function getLinearRegression (data, days) { if (typeof days !== "undefined") { data = getRecentData(data, days); } var reg = regression.linear(data); return reg; }
[ "function addFittedLine(series, chartId) {\n var index = 0;\n _.each(series, function (currentSeries) {\n var regressionOutput = dhcStatisticalService.getLinearFit(currentSeries.data);\n var color = dhcSeriesColorService.get(\"chart\" + chartId, currentSeries.name);\n ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Function: _fnGetObjectDataFn Purpose: Return a function that can be used to get data from a source object, taking into account the ability to use nested objects as a source Returns: function: Data get function Inputs: string|int|function:mSource The data source for the object
function _fnGetObjectDataFn( mSource ) { if ( mSource === null ) { /* Give an empty string for rendering / sorting etc */ return function (data) { return null; }; } else if ( typeof mSource == 'function' ) { return function (data) { return mSource( data ); }; ...
[ "getObject() {\n return this.object;\n }", "getValueSource() {\n return this._source;\n }", "getFabricObject(ag_objectID) {\n let canvas_objects = this._room_canvas.getObjects();\n let fab_buffer;\n canvas_objects.forEach(function (item, i) {\n if (item.isObje...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
1. Add 1 Write a function called addOne that takes an array of numbers and returns an array with each number incremented by 1. E.g. addOne([1,2,3]), should return [2,3,4]
function addOne(inputArray) { return inputArray.map(item => item + 1); }
[ "function addOne(array) {\n\tfor (var i = 0; i < array.length; i++) {\n\t\tconsole.log(array[i] + 1);\n\t}\n}", "function add1ToEach(array) {\n return array.map (function (value2) { return value2 += 1; })\n}", "function addOne(arr) {\n let carry = 1\n let result = []\n for (let i = arr.length - 1; i >= 0;...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
buildWatchBtn uses adds watch button to stocks information window
function buildWatchBtn(stockSym) { var watchBtn = $("<button>"); watchBtn.addClass("ml-2 btn btn-success btn-sm watch-button"). attr("stock-id", stockSym). html("+ Watchlist"); return watchBtn; }
[ "function buildWatchBtn(stockSym) {\n var watchBtn = $(\"<button>\");\n\n watchBtn.addClass(\"ml-2 btn btn-success btn-sm watch-button\").\n attr(\"stock-id\", stockSym).\n html(\"+ Watchlist\");\n // html(\"Add to &#x2605;\");\n\n return watchBtn;\n }", "function onWatc...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Check whether a value is a sequence (e.g. array of numbers).
function isSequence(val) { return val.length !== undefined; }
[ "function ISARRAY(value) {\n return Object.prototype.toString.call(value) === '[object Array]';\n}", "function ArraySeq(array){\n this.sElem = 0;\n this.sequence = array;\n}", "static isArray(input) {\n return input instanceof Array;\n }", "function regularBracketSequence1(sequence) {\n co...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Splits a mnemonic phrase into words, handling extra whitespace anywhere in the phrase.
function splitMnemonic(mnemonic) { return __spread(mnemonic.trim().split(/\s+/)); }
[ "function tokenize(phrase) {\n\n const tokenArray = [];\n let currToken = \"\";\n\n for (let i = 0; i < phrase.length; i++) {\n if(phrase[i] !== \" \") {\n currToken += phrase[i];\n } else {\n tokenArray.push(currToken);\n currToken = \"\";\n }\n }\n...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Mostrar datos de local Storage en listas
function localStorageListo() { var tweets; tweets = obtenerTweetsLocalStorage(); tweets.forEach(function cicloEach(val) { agregarTweetsAListas(val); }) }
[ "function obtenereCursosLocalStorage () {\n let cursosLS;\n\n //Comprobamos si hay items en el local storage\n if(localStorage.getItem('cursos') === null) {\n //si no hay cursos en el LS inicias como array vacio\n cursosLS = [];\n }else{\n cursosLS = JSON.parse(localStorage.getItem('cursos'));\n }\n ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
create Leaflet Map on index page
function createMap(myLatitude, myLongitude) { // Leaflet Map on index page L.tileLayer('https://api.tiles.mapbox.com/v4/{id}/{z}/{x}/{y}.png?access_token=pk.eyJ1IjoiZW5qb3ltcmJhbiIsImEiOiJjam5hY3EwcDQwZ2hiM3BwYWQ2dWt4a2x1In0.nlX1GeaPE2DQn3aZH0IJaA', { maxZoom: 18, minZoom: 4, attribution: ...
[ "function createMap(){\n\n // Add place searchbar to map\n L.Control.openCageSearch(options).addTo(map);\n\n // Add zoom control (but in top right)\n L.control.zoom({\n position: 'topleft'\n }).addTo(map);\n\n // build easy bar from array of easy buttons\n L.easyBar(buttons).addTo(map);\...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Get flow From flowCollector Server
function getFlows (socket) { return (data) => { UDPServer.send(JSON.stringify({ event : 'GET_FLOWS_MONITOR', data : [] }), 6000, '127.0.0.1') } }
[ "function getRemoteCollector (name, host) {\n\tvar col=host + \"-\" + name;\n\tif (!remoteList) remoteList = [];\n\tif (!remoteList[col]) {\n\t\tvar RC = require('../class/RemoteCollector');\n\t\tremoteList[col] = new RC(name, host);\n\t}\n\treturn remoteList[col];\n}", "function __getFlow (fullUri) {\n\t// defau...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
play a sound via Web Audio API (external dependencies: vars masterGain, playbackVolume; input: stream ArrayBuffer (Uint8Array), relVolume: Number 0..1, callback: function)
function playWebSound(stream, volume, callback, id) { try { var source, gainNode, timer, relVolume; if (!audioContext) audioContext = new AudioAPI(); if (!masterGain) { masterGain = (audioContext.createGain) ? audioContext.createGain() : audioContext.createGainNode(); masterGain.connect(audioContext.destin...
[ "function playsound() {\r\n audio1.play();\r\n }", "playSample(name)\n {\n if(name in this.bufferLookup)\n {\n let player = this.audio_context.createBufferSource();\n player.buffer = this.bufferLookup[name];\n player.loop = false;\n player.connect(t...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
get an option from argv or config before program.parse
function preParseOption(l, s, argv) { // look for the option in argv covering when it's `--opt=foobar` var i = argv.indexOf(l); if (i === -1) i = argv.indexOf(s); // maybe it's come in --argument=value style if (i === -1) { for (var ii = 0; ii < argv.length; ii++) { // --long=value i = argv[...
[ "function handle_options(optionsArray) {\n var programName = [];\n var currentItem = optionsArray.shift();\n var defaults = amberc.createDefaultConfiguration();\n\n while (currentItem != null) {\n switch (currentItem) {\n case '-C':\n defaults.configFile = optionsArray.s...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Message Event This event is called when a message is sent to your page. The 'message' object format can vary depending on the kind of message that was received. Read more at For this example, we're going to echo any text that we get. If we get some special keywords ('button', 'generic', 'receipt'), then we'll send back...
function receivedMessage(event) { var senderID = event.sender.id; var recipientID = event.recipient.id; var timeOfMessage = event.timestamp; var message = event.message; console.log("Received message for user %d and page %d at %d with message:", senderID, recipientID, timeOfMessage); co...
[ "function onMessageReceived(e) {\n var data = JSON.parse(e.data);\n\n switch (data.event) {\n case 'ready':\n onReady();\n break;\n\n case 'playProgress':\n onPlayProgress(data.data);\n break;\n\n case 'pause':\n onPause();\n break...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }