query stringlengths 9 34k | document stringlengths 8 5.39M | negatives listlengths 19 20 | metadata dict |
|---|---|---|---|
resolveSchemaPath try to resolve reference to a subschema within schema (document) // TODO current assumes that `` or `root` component of relative path (fragment) is not included in the list of segments | function resolveSchemaPath(schemaMap, refSegments) {
var currSchema;
var refPathSegment = refSegments[0];
if (typeof schemaMap === "object" && refPathSegment in schemaMap) {
currSchema = schemaMap[refPathSegment];
// last path in reference
// found sub-schema
... | [
"resolve(schema) {\n if (!schema) {\n return this\n }\n\n let path = this.get('reference').split('/').map(fragment => {\n return this._unescapeURIFragment(fragment)\n }).slice(1)\n\n let resolved\n if (schema instanceof Schema) {\n resolved ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
push scripts from activated categories to allowed values in script cookies | addScriptsFromAllowedCatToCookie(catTitleEncoded) {
const getCatScripts = this.getElementByValue(this.cookieBannerScripts, 'script_category', catTitleEncoded);
for (let i = 0; i < getCatScripts.length; i++) {
const title = encodeURIComponent(getCatScripts[i].script_title);
this... | [
"setCookieConsentScriptsArray(){\n\n let title;\n const json_data = this.cookieBannerScripts;\n\n if(json_data.length > 0 ){\n for(let i = 0; i < json_data.length; i++) {\n //get all scripts and activate them\n if(this.cookieConsent === \"allow\"){\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
TODO(justjavac): maybe also `getCombinedCodeFix` | function getCodeFixesAtPosition(fileName, start, end, errorCodes, formatOptions, preferences) {
const codeFixActions = tsLs.getCodeFixesAtPosition(fileName, start, end, errorCodes, formatOptions, preferences);
for (const errorCode of errorCodes) {
const fixes = codefi... | [
"get preUglyCode () {\n // Always wrap this in a function\n return \"const ASS_Entry=\" + (this.useFunctionParam ? this.rawCode : `(()=>{${ this.rawCode }})`) + \";ASS_Entry()\";\n }",
"fixToReadableStringInContext() {\n if (!this.suggestedFix)\n return ''; // no changes, nothin... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
do the insert of new tweeters + update of existing tweeters + insert connections of friends | function createTweeters() {
console.log("tweeters explored that need to be inserted/updated:");
console.log(AlltweetersFromApi);
if (fullOrCustomized == "customized" && counterCustomizedIndication == 1)
indicationUser("Found tweeters..");
var allNewTweeters = [];
var allTweetersToUpdate = ... | [
"function insert(hashtags, tweetId) {\n [...new Set(hashtags)].forEach(hashtag => {\n db.data.run(`INSERT INTO hashtags (hashtag) VALUES ('${hashtag}') ON \\\n CONFLICT (hashtag) DO UPDATE SET frequency=frequency + 1`, function(err) {\n if (err) {\n con... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
hide main search upon load (view) | function hideMainSearch() {
$("#main-search").hide();
$("#rulette-search").hide();
} | [
"function renderAfterSearch() {\n\n // Hide article details\n $('.articleTitle').hide();\n $('.helpArticleWrapper').hide();\n $('.relatedTopicsWrapper').hide();\n\n // Show search result\n $('.searchResult').show();\n $('.helpItemList').show();\n }",
"function d... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Gets the first `LContainer` in the LView or `null` if none exists. | function getFirstLContainer(lView) {
return getNearestLContainer(lView[CHILD_HEAD]);
} | [
"function getFirstLContainer(lView) {\n return getNearestLContainer(lView[CHILD_HEAD]);\n }",
"function getFirstLContainer(lView) {\n return getNearestLContainer(lView[CHILD_HEAD]);\n}",
"function getFirstLContainer(lView) {\n return getNearestLContainer(lView[CHILD_HEAD]);\n}",
"function getConta... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Handle Offline When a client detects that a service it uses is `not available` or returning a 'bad gateway' the Discovery Service Lifecycle expects the client to notify that the service is 'Offline' | handleOffline(offlineMessage, socket) {
debug(offlineMessage);
let serviceId = offlineMessage.serviceId;
this.model.findServiceById(serviceId).then((service) => {
if(service) {
service.status = this.model.STATUS_OFFLINE;
model.updateService(service).then((service) => {
debug(... | [
"notifyOffline() {\n this.handleNotification({ message: 'notices.offline', level: 'warning' });\n }",
"_onOffline() {\n // this._connection.disconnect(\"gone_offline\");\n this._connection._doDisconnect();\n }",
"_changeToOffline() {\n if (this.isOnline) {\n this.isOnline = false;\n... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Chapter 12 After Class As a Domme, Amanda can force the player into some random bondage | function C012_AfterClass_Amanda_ForceRandomBondage(BondageType) {
if ((BondageType == "Full") || (BondageType == "Hug") || (BondageType == "Gag")) {
PlayerRandomGag();
if (!Common_PlayerGagged && (BondageType == "Gag")) OverridenIntroText = GetText("CantFindRestrain" + (BondageType == "Hug") ? "ForHug" : "");
}
... | [
"function C012_AfterClass_Jennifer_ForceRandomBondage(BondageType) {\n\tif ((BondageType == \"Full\") || (BondageType == \"Gag\")) {\n\t\tPlayerRandomGag();\n\t\tif (!Common_PlayerGagged && (BondageType == \"Gag\")) OverridenIntroText = GetText(\"CantFindRestrain\");\n\t}\n\tif ((BondageType == \"Full\") || (Bondag... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Get a promise to root node | getRootNode () {
return this.getNode(this.rootId);
} | [
"getRootAsync() {\n\t\treturn this.ready.then(() => {\n\t\t\t// find the root task\n\t\t\tfor(let [_, task] of this._tasks) {\n\t\t\t\tif(!task.parent) {\n\t\t\t\t\treturn task;\n\t\t\t\t}\n\t\t\t}\n\t\t});\n\t}",
"function getRootResource() {\n const engineRef = getEngine();\n if (!engineRef) {\n re... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
sets the group of the object | setGroup(group) {
this.group = group; // a real implementation may need to do more than just this
} | [
"setGroup(group) { \r\n this.group = group; // a real implementation may need to do more than just this\r\n }",
"set(group) {\n this._group = group;\n if (group) {\n group.add(this);\n }\n }",
"setDomGroup( prop, val ) {\n if ( this.group ) {\n this.group.setAttribute( prop, val... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Gets class buttons by boolean value and returns list | function getClassesString (bool) {
classes = []
filter = ".class-btn[value='" + bool + "']"
$(filter).each(function(){
classes.push($(this).attr('id'))
})
return classes
} | [
"function trueAndFalseButtons(){\n console.log(document.querySelector('.true-false-list').children[0].innerText)\n return trueFalse\n}",
"buttonClasses() {\n\n\t\t\t\t\tconst self = this;\n\n\t\t\t\t\treturn self.buttonState.join(' ');\n\t\t\t\t}",
"function getButtons(obj) {\n return keyWith(obj, 'Button');... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
perform import of password registrations | importPasswordRegistrations() {} | [
"exportPasswordRegistrations() {}",
"_importPasswords() {\n let sourceLoginsJson = this._sourceProfileDir.clone();\n sourceLoginsJson.append(\"logins.json\");\n let sourceKeyDb = this._sourceProfileDir.clone();\n sourceKeyDb.append(\"key4.db\");\n let targetLoginsJson = Services.dirsvc.get(\"ProfD\... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Prepend space if the length of the number is odd. | prependSpaceIfLengthIsEven($ascii_number, $length) {
if (this.isOdd($length)) {
return ` ${$ascii_number}`;
}
return $ascii_number;
} | [
"function addPadding(number) {\n return (number > 0) ? ' ' : '';\n}",
"function padToEven(a) {\n return a.length % 2 ? '0' + a : a\n }",
"function padToEven(a) {\n return a.length % 2 ? \"0\" + a : a;\n}",
"function padToEven(a) {\n return a.length % 2 ? \"0\" + a : a;\n}",
"funct... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Return the length of the first word in a collection. | function getWordLengthFromCollection( string, collection, dateObject ) {
// Grab the first word from the string.
var word = string.match( /\w+/ )[ 0 ]
// If there's no month index, add it to the date object
if ( !dateObject.mm && !dateObject.m ) {
dateObject.m = coll... | [
"function getWordLengthFromCollection(string,collection,dateObject){// Grab the first word from the string.\n// Regex pattern from http://stackoverflow.com/q/150033\nvar word=string.match(/[^\\x00-\\x7F]+|\\w+/)[0];// If there's no month index, add it to the date object\nif(!dateObject.mm&&!dateObject.m){dateObject... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Bit manipulation Set a register of a bitmask Generalizes all the "SET 2, C" etc. instructions | setReg(bitmask, register) {
register[0] |= bitmask;
return 8;
} | [
"setMask(mask) { this.maskBits |= mask; }",
"setAll(x) { return grok_BitSet_SetAll(this.d, x); }",
"function set(num, bit) {\n\tnum |= bit;\n\treturn num;\n}",
"set(i, x) { return grok_BitSet_SetBit(this.d, i, x); }",
"setMem(bitmask) {\n var i = MMU.rb(regHL[0]);\n i |= bitmask;\n MMU.wb(regHL[0],... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
register module event listener for every api module except 'globalEvent'. | function registerModuleEventListener (name, module, meta) {
if (name !== 'globalEvent') {
module['addEventListener'] = function (evt, callbackId, options) {
return addEventListener.call(this, name, evt, callbackId, options)
}
module['removeAllEventListeners'] = function (evt) {
return removeAl... | [
"addGlobalEventListeners() {}",
"function registerModuleEventListener (name, module, meta) {\n if (name !== 'globalEvent') {\n module['addEventListener'] = function (evt, callbackId, options) {\n return addEventListener$1.call(this, name, evt, callbackId, options)\n };\n module['removeAllEventListe... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Updates visibility of empty folder UI. | updateUI_() {
const currentRootType = this.directoryModel_.getCurrentRootType();
const currentVolumeInfo = this.directoryModel_.getCurrentVolumeInfo();
let svgRef = null;
if (util.isRecentRootType(currentRootType)) {
svgRef = RECENTS_EMPTY_FOLDER;
} else if (currentRootType === VolumeManagerC... | [
"show() {\n this.emptyFolder_.hidden = false;\n }",
"hide() {\n this.emptyFolder_.hidden = true;\n }",
"updateUI_() {\n const currentRootType = this.directoryModel_.getCurrentRootType();\n\n const isRecent = util.isRecentRootType(currentRootType);\n const isTrash = currentRootType === VolumeMan... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
function that will prompt the user what kind of characters they want to use. if none selected, user will receive all prompts again until they select at least one type of character | function selection() {
specialUse = confirm("Would you like to include special characters?");
numericUse = confirm("Would you like to include numeric characters?");
lowercaseUse = confirm("Would you like to include lower case characters?");
uppercaseUse = confirm("Would you like to inclu... | [
"function charTypes() {\n\n //Prompt for uppercase characters\n function upperCasePrompt() {\n response = window.prompt(\"Include uppercase letters? Y/N\", \"Y\");\n if (response === null) {\n return;\n } \n response = response.toUpperCase();\n if (response === \"Y\") {\n selections++;\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
SearchByName : given a name attribute (composed by a name and surname), this method tries to search it in the data store. If the full name is not matched then tries to find it by the first or surname text. param nameToSearch : the full text name and surname separated by a space to search return itemId : the id of the f... | searchByName( nameToSearch ) {
let itemId = this.ItemNotFound;
let list = this.state[this.townName];
let nameToSearchLowerCase = nameToSearch.toLocaleLowerCase();
let nameToSearchSplit = nameToSearchLowerCase.split(' ');
let name0ToSearch = nameToSearchSplit[0];
let name1ToSearch = n... | [
"function findItemName(name){\n for(i = 0; i < items.length; i++){\n if(items[i].name === name || items[i].otherNames.indexOf(name) !== -1){\n return items[i];\n }\n }\n return null;\n}",
"findByName(name, cb) {\n\t\tthis.db.view('item', 'by_name', {key: name}, (err, itemByName) => {\n\t\t\tif (err)... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Makes a summary based on the given note's body. | function noteSummary(note) {
return note.body.length > 50 ?
note.body.substr(0, 50) + "..." :
note.body;
} | [
"static addSummary() {\n\t\tvar body = document.querySelector(this.summarySelector);\n\t\tvar summary = new Summary(body, this.summaryItemsSelector);\n\t\tbody.insertBefore(summary.html(), body.firstChild);\n\t}",
"function createSummary(content) {\n const blocks = content.blocks;\n let firstParagraphText;\n\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Table view MeasuresOfEmergency click event handler | function OnTableViewAeDESModeFormsSectionEightMeasuresOfEmergency_Click( e )
{
try
{
Alloy.Globals.createAndOpenControllerExt( 'AeDESModeFormsSectionEightMeasuresOfEmergency' , { measures_of_emergency_id: e.index , father_title: e.row.children[0].text , is_synchronized: current_is_synchronized } ) ;... | [
"function OnTableViewTools_Click( e )\r\n{\r\n try\r\n {\r\n if( bCanClickOnTableView )\r\n {\r\n BeginAsyncBusyAction( $.activity_indicator , controls , function()\r\n {\r\n var bRet = false ;\r\n\r\n bCanClickOnTableView = false ;\r\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
When the schema is changed / added, there may be values set in the config that do not conform to the schema. This will reset make them conform. | resetSettingsForSchemaChange(source) {
if (source == null) {
source = this.mainSource;
}
return this.transact(() => {
this.settings = this.makeValueConformToSchema(null, this.settings, {
suppressException: true
});
const selectorsAndSettings = this.scopedSettingsStore.propert... | [
"_setValues() {\n let wiring = window.HAXWiring,\n schema = wiring._getHaxJSONSchemaProperty(this.fields, wiring);\n for (let prop in this.value) {\n if (schema[prop]) schema[prop].value = this.value[prop];\n }\n //form won't refresh unless we set it to null. notifyPath wasn't enough to refres... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
external sqrt_rem: t > (t t) Provides: ml_z_sqrt_rem Requires: bigInt, ml_z_root, caml_invalid_argument, ml_z_normalize | function ml_z_sqrt_rem(z) {
z = bigInt(z);
var zero = bigInt(0);
if (z.lt(zero)) {
caml_invalid_argument("Z.sqrt_rem: square root of a negative number");
}
var root = bigInt(ml_z_root(z, 2));
var mul = root.multiply(root);
var diff = z.subtract(mul);
return [0, ml_z_normalize(root), ml_z_normalize(d... | [
"function ml_z_sqrt_rem(z1, z2) {\n\n}",
"function ml_z_sqrt(z1) {\n var z = bigInt(z1);\n var zero = bigInt(0);\n if (z.lt(zero)) {\n caml_invalid_argument(\"Z.sqrt: square root of a negative number\");\n }\n return ml_z_root(z, 2);\n}",
"function ml_z_sqrt(z1, z2) {\n\n}",
"function ml_z_rem(z1, z2)... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Function which chek if there are anchor changes, if there are, sends the ajax petition | function checkAnchor(){
//Check if it has changes
if(currentAnchor != document.location.hash){
currentAnchor = document.location.hash;
//if there is not anchor, the loads the default section
if(!currentAnchor)
query = "section=myProfile";
else
{
//Creates the string callback. This converts t... | [
"function checkAnchor(){ \n //Check if it has changes \n if(currentAnchor != document.location.hash && document.location.hash != ''){ \n currentAnchor = document.location.hash; \n\n //if there is not anchor, the loads the default section \n if(!currentAnchor) {\n\n } el... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
This function returns the aqi from the data at the specified index. If the aqi is unknown at that index, it will return 1. | function getAQI(griddedData, index) {
let aqi = -1;
const row = griddedData.data[index.row];
if (row) {
if (row[index.col]) {
aqi = row[index.col];
}
}
return aqi;
} | [
"function calculateAQIIndex(value) {\r\n let aqiIndex;\r\n AQI.range.forEach((elem, index) => {\r\n if (value >= elem) {\r\n aqiIndex = index;\r\n }\r\n });\r\n return aqiIndex;\r\n}",
"at(index) {\n var current = this.findNode(index);\n if (current) {\n return current.data... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Parental_lockModel class derived from SubModel. | function Parental_lockModel( parentModel ) {
SubModel.call( this, parentModel, Parental_lockModelDefines );
// --------------------------------------------------------------
// Objects
// --------------------------------------------------------------
// PinMemorised
this.registerInt... | [
"function classParentSupport(Model) {\n\t\t\tvar storage = Model.private('_sys');\n\t\n\t\t\tif(isCreatingBaseProcess) {\n\t\t\t\treturn Model;\n\t\t\t}\n\t\n\t\t\tvar parentStorage = this.private('_sys');\n\t\n\t\t\t// support of inherits Model subPrototype\n\t\t\tvar parentSubProto = parentStorage.subProto,\n\t\t... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
creates a row with tdelements of inputfields and a button to delete row TableID = string of the tablename sourceForm = string of the form with the input fields | function createRow(targetTable,sourceForm) {
//get table to append row
var Table = opener.document.getElementById(targetTable);
//get number of rows in the table
var rows = Table.getElementsByTagName("tr");
if ((rows == 0) || (rows == null)) {
}
else {rows = rows.length - 1;}
//append row at the la... | [
"function createTable(tableName, jsonTable, deleteBtnText) {\n jsonTable = jsonTable || [];\n\n var header = jsonTable[0];\n if(!header) return;\n\n var table = document.createElement('table');\n var thead = document.createElement('thead');\n var tbody = document.createElement('tbody');\n var h... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Function method to get league subtitle | function getLeagueSubtitle() {
return "Fall 2016";
} | [
"function getLeagueSubtitle(){\n return \"Fall 2016\";\n }",
"function subtitle(titleinfo) /* (titleinfo : titleinfo) -> string */ {\n return titleinfo.subtitle;\n}",
"function get_auto_subtitle_xml_url(){\n // use data from different souce\n var json = '';\n if(youtube_playerResponse_1c7 ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Hide elements with undefined content | hideUndefinedElements() {
const badgesElement = document.querySelectorAll('.badge');
badgesElement.forEach(badEle => {
(badEle.textContent.indexOf("undefined") > -1) ? badEle.classList.add("hide") : badEle.classList.remove("hide");
});
} | [
"function showHiddenElements(ele) {\n var eles = ele.querySelectorAll(\"[data-hidden]\");\n Array.from(eles).forEach(function(ele) {\n ele.style.removeProperty(\"display\");\n });\n }",
"function hideElements() {\n const elementsArr = [\n $userProfile,\n $submitForm... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
For holding socket configiguration Function: setOption Private function used to set socket related configuration option Parameters: name : Socket config property value : property value type : property type Exception: If value type and type doesn't match then throws type error exception | function setOption(name, value, type) {
if (typeof value !== type) {
throw new TypeError("'"+ name +"' must be of type '"+ type + "'");
}
ioConfig[name] = value;
} | [
"function setsockopt(sockfd, level, optname, optval) {\n return libsys.syscall(platform_1.SYS.setsockopt, sockfd, level, optname, optval, optval.length);\n}",
"set socket(socket) {\n // No data socket should be open in any case where the control socket is set or upgraded.\n this.dataSocket = unde... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Given a SerializedHightlight and the current set of word ranges, return a DOMHighlight representing the SerializedHighlight. If the SerializedHighlight is not valid given the list of word ranges, throw an error. | function deserializeHighlight(serializedHighlight, wordRanges) {
var _serializedHighlight$ = serializedHighlight.range,
firstWordIndex = _serializedHighlight$.firstWordIndex,
lastWordIndex = _serializedHighlight$.lastWordIndex;
var firstWord = wordRanges[firstWordIndex];
if (!firstWor... | [
"function deserializeHighlight(serializedHighlight, wordRanges) {\n var {\n firstWordIndex,\n lastWordIndex\n } = serializedHighlight.range;\n var firstWord = wordRanges[firstWordIndex];\n\n if (!firstWord) {\n throw new Error(\"first word index \".concat(firstWord, \" is out of bounds: \") + \"must be... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
given the view and projection matrices of the camera, get a ray starting from the camera position, heading in the viewing direction of the camera. | function getCameraRay(viewMatrix, projectionMatrix) {
var mousePos = clipspaceMousePos()
var vp = []
mat4.multiply(vp, projectionMatrix, viewMatrix)
var inverseVp = []
mat4.invert(inverseVp, vp)
var v = []
vec3.transformMat4(v, [mousePos[0], mousePos[1], 0], inverseVp)
var camPos = cameraPosFromView... | [
"function Raytracer(viewmatrix, projectionmatrix, viewport) {\r\n viewport = viewport || gl.getParameter(gl.VIEWPORT);\r\n var m = viewmatrix;\r\n this.viewport = viewport;\r\n\r\n var minX = viewport[0], maxX = minX + viewport[2];\r\n var minY = viewport[1], maxY = minY + viewport[3];\r\n this.ray00 = vec3.u... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
This is a function for repositoriesWorkspaceRepoSlugPullrequestsPullRequestIdMergePost / Merges the pull request. | repositoriesWorkspaceRepoSlugPullrequestsPullRequestIdMergePost(
incomingOptions,
cb
) {
const Bitbucket = require('./dist');
let defaultClient = Bitbucket.ApiClient.instance;
// Configure API key authorization: api_key
let api_key = defaultClient.authentications['api_key'];
api_key.apiKey... | [
"function handleMerge(payload, config) {\n\tconst repo = payload.repository.html_url,\n\t\tbase = payload.pull_request.base.ref, // target of the original PR\n\t\tuser = FRONTEND_MEMBERS[payload.pull_request.user.id]\n\n\tlet labels = [],\n\t\treviews = []\n\n\t// Get the issue, not the PR\n\trequest(Github.get(pay... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
This will blocks the usage of Function Construction | function getBlockedFunctionConstructor() {
function FakeFunction(execCode) {
var code = "FUNCTION_CONSTRUCTOR_DETECTED";
var message = "function constructor with code: " + execCode;
error = {code: code, message: message};
return function() {};
}
return FakeFunction;
} | [
"function Bare() {}",
"function reserved(){}",
"function unsafeFunction() {\n return function() {\n return function() {\n throw new Error();\n };\n };\n }",
"function SampleBlock() {}",
"function StupidBug() {}",
"function makeSafe(init){\n var value = init ;\n return functio... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Whether or not the crumb is the last element in the list | isLast(item) {
return this.crumbs.indexOf(item) === this.crumbs.length - 1;
} | [
"function isLastItem() {\n var curListItem = $(this).closest(\".listItem\");\n var totalItems = $(this).closest(\".list\").find(\".listItem\").length;\n var itemInd = $(curListItem).index(); // this starts at 1\n return totalItems === itemInd;\n}",
"get isLast() {\n return this.index === this.l... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Updates child location for row. | updateChildLocationForRow(top, rowWidget) {
let spacing = 0;
if (rowWidget.ownerTable.tableFormat.cellSpacing > 0) {
spacing = HelperMethods.convertPointToPixel(rowWidget.ownerTable.tableFormat.cellSpacing);
}
for (let i = 0; i < rowWidget.childWidgets.length; i++) {
... | [
"updateChildLocationForCell(top, cellWidget) {\n for (let i = 0; i < cellWidget.childWidgets.length; i++) {\n cellWidget.childWidgets[i].x = cellWidget.childWidgets[i].x;\n cellWidget.childWidgets[i].y = top;\n if (cellWidget.childWidgets[i] instanceof TableWidget) {\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
gameId > timeout id Starts timer for autovotes to happen Any player that hasn't voted will receive a random vote | function startAutovoteTimer(game, socket) {
console.log(`Autovote timer started for {timeout} ms`);
// Clear previous timeout
if (autovoteTimeoutMap[game.id]) {
clearInterval(autovoteTimeoutMap[game.id]);
}
// Tick for some time, then autovote
let time = AUTOVOTE_TIMEOUT;
const INTERVAL = 1000; // tick every... | [
"function voteForSelfToDie() {\n voteForUser(getParticipantID());\n stopTimer();\n}",
"autovote() {\n\t\tif (this.state === StateEnum.WAIT_FOR_VOTERS) {\n\t\t\tconst judge = this.getCurrentJudge();\n\t\t\tlet voters = judge.votes.map(function(vote) {\n\t\t\t\treturn vote.player.id;\n\t\t\t});\n\n\t\t\tfor (... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
test_switch(clause_type, test_type, feedback, optimize); | function test_switches(opt) {
var test_types = ['symbols', 'strings', 'oddball', 'smi', 'heapnum'];
function test(clause_type) {
var values = clause_values[clause_type];
test_types.forEach(function(test_type) {
test_switch(clause_type, test_type, 'all', opt);
test_switch(clause_type, test_type... | [
"function CaseStatement() {\n}",
"function _switch(discriminant, cases) {\n\tvar dispatchIndex = -1;\n\tvar awaitBody;\n\touter: {\n\t\tfor (var i = 0; i < cases.length; i++) {\n\t\t\tvar test = cases[i][0];\n\t\t\tif (test) {\n\t\t\t\tvar testValue = test();\n\t\t\t\tif (testValue && testValue.then) {\n\t\t\t\t\... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Create the Tabs Container, as well as the toolbar | function ac_createTabs() {
//Create Tabs Container
$("#ac_tool_box").append('<ul id="ac_toolbar" class="clearfix"></div>');
// Configuration Icon
$("#ac_toolbar").append('<li id="ac_tool_cfg" class="ac_tool ac_tool_off"> </li>');
$("#ac_tool_cfg").attr('style', 'background-image:url(' + AC_IMAGE_CONFIG + ')... | [
"function makeTabs(tabCont){\n\tvar tabs = require(['dojo/parser','dijit/layout/TabContainer','dijit/layout/ContentPane'],\n\tfunction(parser,TabContainer,ContentPane){\n\t\tvar tc = new TabContainer({\n\t \t\tdoLayout:false,\n\t\t \tid: 'tab-cont',\n\t\t\tstyle:'width:50em',\n \t\tcontrollerWidget: 'dijit.lay... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Function that waits so quiz taker can tell if they got question correct | function waitBeforeNextQuestion() {
setTimeout(function nextQuestion() {
questionIndex++;
if (questionIndex === 4) {
submitScore();
} else {
showQuestion();
}
}, 1000);
} | [
"function waitTime() {\n nextQuestion();\n }",
"function waitBeforeGoingNextAutomatically() {\n setTimeout(goToNextQuestion, 1000 * 5);\n}",
"checkSubmitQuiz(){\r\n let areQnsAnswered = this.checkAllQnsAnswered(this.numOfQns);\r\n // All questions are answered\r\n if(areQnsAns... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Extract current theme colors and inject a style tag in the body | applyTheme({
currentTheme,
currentFontFamily = 'Menlo',
currentFontSize = 14,
accentColor = null,
scrollbars = true
} = {}) {
// Extract colors
if (currentTheme && currentTheme.colors) {
const {
backgroun... | [
"applyCSS() {\n document.querySelectorAll('head style[luigi-injected]').forEach(luigiInjectedStyleTag => {\n luigiInjectedStyleTag.remove();\n });\n const vars = lifecycleManager.currentContext?.internal?.cssVariables;\n if (vars) {\n let cssString = ':root {\\n';\n Object.keys(vars).forE... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
The onEvents is only for low level status messages. For the usual status management you should use the onXXX (for example the onCallStateChange callbacks). Example: call onEvents() function passing a callback Deprecated! Use onEvent instead ("event" type)! | function onEvents(callback){if(!callback||typeof(callback)!=='function'){return;}webphone_api.evcb.push(callback);} | [
"function registerCallEvents() {\n currentCall.on('remoteMediaStream:change', () => updateRemoteStream());\n currentCall.on('localMediaStream:change', () => updateLocalStream());\n currentCall.on('change:receivingVideo', () => updateIncomingVideo());\n currentCall.on('change:receivingAudio', () => updateIncomin... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Get the first extra item from result | getFirstExtraItem() {
return this.extraItem.first();
} | [
"function extractFirstItem (result) {\r\n const data = extractAllItems(result);\r\n if (!data) return null;\r\n \r\n if (data.length > 1) throw new Error(`service.find expected 0 or 1 objects, not ${data.length}. (extractFirstItem)`);\r\n\r\n return data.length ? data[0] : null;\r\n}",
"getFirstResultItem() ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Return true if node is `Identifier` | function isIdentifier(node) {
return node.kind === ts.SyntaxKind.Identifier;
} | [
"static isIdentifier(node) {\r\n return node.getKind() === typescript_1.SyntaxKind.Identifier;\r\n }",
"function isIdentifierNode(mixed) {\n if (!type_util_1.isObjectWithOwnEnumerableKeys()(mixed, [\n \"type\",\n \"identifiers\",\n ])) {\n return false;\n }\n return (mix... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Render a competition item | function renderCompetition(res, data, requestedItem, requestedYear, requestedRoundOrGroup) {
var tournamentData = getData(config.paths.tournamentData, requestedItem, requestedYear);
var groupsData = getData(config.paths.groupsData, requestedItem, requestedYear);
var requestedGroup = requestedRoundOrGroup... | [
"function renderGameItem(gameItemIndex) {\n var gameItemContainer = document.createElement('article');\n var gameItemContent = '<h3>' + gameItemIndex.gameName +\n '</h3><p class=\"features\"><i class=\"fa fa-user\"></i>' + gameItemIndex.minPlayers +\n '-' + gameItemIndex.maxPlayers + ' <i class=\"fa fa-cloc... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Generates a random pattern of given density. | generateSoup(density) {
let i;
for (i = 0; i < this.rows*this.cols; ++i) {
if (Math.random() < density) {
this.cells[i] = 1;
} else {
this.cells[i] = 0;
}
}
} | [
"function generate() {\n pattern = [];\n for (var i = 0; i < 20; i++) {\n pattern.push(Math.floor(Math.random() * 4) + 1);\n }\n }",
"initializeRandomly (density) {\n this._curGen = 0;\n this._curGenIdx = 0;\n this._oldestGenIdx = 0;\n for (var xIdx = 0; xIdx < this._gridDoubleSize; xId... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Validate a kernel message object. | function validateMessage(msg) {
validateProperty(msg, 'metadata', 'object');
validateProperty(msg, 'content', 'object');
validateProperty(msg, 'channel', 'string');
validateHeader(msg.header);
if (msg.channel === 'iopub') {
validateIOPubContent(msg);
}
} | [
"function validateKernelMessage(msg) {\n for (var i = 0; i < MESSAGE_FIELDS.length; i++) {\n if (!msg.hasOwnProperty(MESSAGE_FIELDS[i])) {\n throw Error('Invalid Kernel message');\n }\n }\n validateKernelHeader(msg.header);\n if (Object.keys(msg.parent_header).length > 0) {\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
format origin as CSS percentage string | function _formatCSSOrigin(origin) {
return (100 * origin[0]) + '% ' + (100 * origin[1]) + '%';
} | [
"function _formatCSSOrigin(origin) {\n\t return (100 * origin[0]) + '% ' + (100 * origin[1]) + '%';\n\t }",
"function _formatCSSOrigin(origin) {\n return (100 * origin[0]).toFixed(6) + '% ' + (100 * origin[1]).toFixed(6) + '%';\n}",
"function cssPercent(value) {\n return (value * 100) + \"%\";\n... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Final method called on cleanup. Commits the result of the drag & drop to the group | _complete() {
if(this.get('isDestroyed') || this.get('isDestroying')){
return;
}
invokeAction(this, 'onDragStop', this.get('model'));
this.set('isDropping', false);
this.set('wasDropped', true);
this._tellGroup('commit');
} | [
"function finishDrop(e, grp) {\n var ok = (grp !== null\n ? grp.addMembers(grp.diagram.selection, true)\n : e.diagram.commandHandler.addTopLevelParts(e.diagram.selection, true));\n if (!ok) e.diagram.currentTool.doCancel();\n }",
"function finishDrop(e, g... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Perform the REST call that gets the denominator data, and set the component's state. Sort expansions by numerator, Sort groups by expansion, Initialize showNumerator states, Update component state for denom, groups, expansions. | getDenomData() {
let denom = this.denom;
return fetchDenom(denom).then(res => {
// Sort decimal expansions by numerator.
res.expansions.sort((a, b) => a.numerator - b.numerator);
// Sort expansion groups numerically. The sort compares the strings, since all are the same length.
res.group... | [
"get denominator () {\r\n\t\treturn this._denominator;\r\n\t}",
"function FractionEstimator_() { // constructor\n this.fracList = {}; // Object holds lists of acceptable fractions\n}",
"function divide() {\n self.prevOperator = 'divide';\n self.equalsOnly = false;\n self.resetAllowed = ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Gett for comment object | @computed get getCommentObject() {
return this.commentObject;
} | [
"static async getComment(token, id) {\n let res = await this.request(`comments/${id}`, token, {}, 'get');\n return { comment: res.comment };\n }",
"get comments() {\r\n return new Comments(this);\r\n }",
"getComment(parent, args, content, ast) {\n const feathersParams = convertArgs(args,... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
stores customer email, id and checks if customer is manager, then sends to appropriate page | function CustomerLocal(customer){
localStorage.clear();
localStorage.setItem("customerId", parseInt(customer.id));
localStorage.setItem("customerEmail", customer.email);
if(customer.id == 1){
window.location.href = "ManagerProduct.html";
}
else {
window.location.href = "CustomerI... | [
"function getCustomerId(){\n var me = AdminDirectory.Users.get(Session.getEffectiveUser().getEmail())\n Logger.log(me.customerId)\n return me.customerId\n}",
"function attachCustomer(manager, id) {\n var customer = manager.createEntity('Customer', {\n CustomerID: id,\n CompanyNa... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Method used to register an event handler on a namespace | function registerNamespaceEventHandler(eventKey, callback, context) {
if( !isUndefined(context) ) {
callback = callback.bind(context);
}
var handlerSubscription = this._subscribe('event.' + eventKey, callback).enlistPreserved();
this.eventHandlers.push(handlerSubscription);
return handlerSubscription;
} | [
"_registerEvent() {}",
"registerHandler(prefix, handler) {\n this.handlers_.push({ prefix: prefix, fn: handler });\n }",
"registerEventListener(handler) {\n this.emitter.on('gsn', handler);\n }",
"set_event_handler(name, callback) {\n this.event_handlers[name] = callback\n }",
"funct... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
extracts and setup a valid year range from the opts object | function setupYearRange () {
var startyear, endyear;
if (opts.startdate.constructor == Date) {
startyear = opts.startdate.getFullYear();
} else if (opts.startdate) {
if (yearRegEx.test(opts.startdate)) {
startyear = opts.startdate;
} else if (dateRegEx.test(opts.startdate)) {
opts.st... | [
"function setupYearRange() {\n\n var startyear, endyear;\n if (opts.startdate.constructor == Date) {\n startyear = opts.startdate.getFullYear();\n } else if (opts.startdate) {\n if (yearRegEx.test(opts.startdate)) {\n startyear = opts... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Watch Task for Building Typescript onchange 1 Runs 'build:typescript' 2 Watches fro changes in 'src' 3 Rns 'build:typescript' on change | function watch_TS(done) {
gulp.watch('src/**/*', gulp.parallel('build:all'));
done();
} | [
"function watchTypescript() {\n gulp.watch(['**/*.ts', '!{node_modules,node_modules/**}'], {delay: 300}, compileTypescript);\n}",
"function watchTsFiles() {\n watch([\n \"src/Typescript/**\"\n ], \n series(processTsFiles));\n}",
"function watch(){\n gulp.watch('src/**/*',\n function(){\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Read or update the right hand value of a node representing an assignment either as a plain expression or as a variable declaration with a initializer. If no 2nd argument is given the value is not modified. | function assignment(node, nval) {
var i
, d
if (node.type === 'ExpressionStatement' &&
node.expression.type === 'AssignmentExpression'
) {
return node.expression = (nval || node.expression)
}
if (node.type === 'VariableDeclaration') {
for (i = 0; i < node.declarations.length; i++) {
... | [
"function rewriteAssignment(node) {\n if (node.name !== 'assignmentExpr')\n return node;\n if (node.children.length !== 2)\n throw new Error('Assignment expressions should have two children');\n var left = node.children[0];\n var right = validateNode(node.children[1], 'assignmentExprRight'... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
parse an for loop | parseFor() {
// skip characters 'for'
this.skipKw("for");
// grab the for loop condition
const cond = this.parseExpression();
// check the content of the expression
const tok = { type: "for", cond: cond, body: this.parseProg() };
return tok;
} | [
"function parse_for() {\n //input.croak(\"For loops are currently not supported\");\n skip_kw(\"for\");\n var params = delimited(\"(\", \")\", \";\", parse_expression);\n var then = parse_expression();\n return {\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Breaking the name into two lines if nescessary | function breakLines(text){
let multiLineName = {
first : "",
second : ""
};
let splitedText = text.split(" ");
if (splitedText.length > 2) {
for (var i = 0; i < 2; i++) {
if (i > splitedText.length) { //??
break;
}
multiLineName.first = multiLineName.... | [
"function formatLineName(name) {\n return hyphenate(name);\n}",
"function extractWrappedWord(name, isFirstLine) {\n if (name == null || name.trim().length == 0){\n return name;\n }\n var words = name.split(' ');\n if(words.length >= 3 && isFirstLine){\n return words[0] + ' ' + words[1];\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Push the PFAF (Plants For A Future, database to powerplant server. | async function pushPfaf() {
let mysqlConfig = {
host: 'localhost',
port: 3306,
user: 'root',
password: 'password',
database: 'permaflorae'
};
Object.assign(mysqlConfig, parseOption('mysqlConfig'));
const connection = await mysql.createConnection(mysqlConfig);
const [rows, fields] = await connection.quer... | [
"async function pushPfaf() {\n\tlet mysqlConfig = {\n\t\thost: 'localhost',\n\t\tport: 3306,\n\t\tuser: 'root',\n\t\tpassword: 'password',\n\t\tdatabase: 'permaflorae'\n\t};\n\n\tObject.assign(mysqlConfig, parseOption('mysqlConfig'));\n\tconst connection = await mysql.createConnection(mysqlConfig);\n\tconst [rows, ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Used to check if size is between 1 and 64 when resizing, if it is not user is prompt to enter a value again. | function checkPrompt(input) {
if (input >= 1 && input <= 64) {
changeSize(input);
}
else {
input = prompt("Your size did not work! Please choose between 1 and 64!");
checkPrompt(input);
}
} | [
"function promptSize() {\n while (true) {\n let newSize = Number.parseInt(\n window.prompt(\"Please enter a new number of tiles per side for the grid\"));\n\n if (Number.isNaN(newSize)) {\n continue;\n }\n\n if (newSize <= 0) {\n continue;\n }\n... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
store results in local storage | function storeResults() {
let resultsStringified = JSON.stringify(Product.allProducts);
localStorage.setItem('results', resultsStringified);
} | [
"function saveResults(result) {\nlet results;\nif(localStorage.getItem(\"results\") === null ){\nresults = [];\n}else{\nresults = JSON.parse(localStorage.getItem(\"results\"));\n}\nresults.push(result);\nlocalStorage.setItem(\"results\", JSON.stringify(results));\n}",
"function storeResults() {\n\t\tif (Modernizr... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Renders the AWS CloudFormation properties of an `AWS::WAFv2::LoggingConfiguration.MatchPattern` resource | function cfnLoggingConfigurationMatchPatternPropertyToCloudFormation(properties) {
if (!cdk.canInspect(properties)) {
return properties;
}
CfnLoggingConfiguration_MatchPatternPropertyValidator(properties).assertSuccess();
return {
All: cdk.objectToCloudFormation(properties.all),
... | [
"function cfnApplicationLogPatternSetPropertyToCloudFormation(properties) {\n if (!cdk.canInspect(properties)) {\n return properties;\n }\n CfnApplication_LogPatternSetPropertyValidator(properties).assertSuccess();\n return {\n LogPatterns: cdk.listMapper(cfnApplicationLogPatternPropertyTo... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Fire any function calls on loaded event | function fireLoaded() {
var i;
pageloaded = true;
// For browsers with no DOM loaded support
if (!domready) {
fireReady();
}
for (i = 0; i < loadedfn.length; i += 1) {
loadedfn[i]();
}
loadedfn = [];
} | [
"function addLoadEvent( f ) { addOnloadHook( f ); }",
"function DoLoad()\n{\n for (var i = 0; i < _g_onload_functions.length; ++i)\n {\n if (\"function\" == typeof(_g_onload_functions[i]))\n {\n _g_onload_functions[i]();\n }\n }\n _g_is_loaded = true;\n}",
"loadEvents() {\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
AvailableActions Flow interface. Platform injects an array of the navigation actions available to the screen | @api
get availableActions() {
return this._availableActions || new Map();
} | [
"function getAvailableActions() {\n return actionNames;\n }",
"availableActions()\n {\n return this.actions;\n }",
"function getAvailableActions(){\n \n}",
"getActions() {\n return [];\n }",
"function getActions() {\n ret... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Test if json webtoken is expired Always returns true if atob is not available on the global object | function tokenExpired() {
if (_token && _token !== '' && window.atob) {
var toks = _token.split('.');
var payload = (toks.length === 3) && JSON.parse(window.atob(toks[1].replace('_', '/')));
return payload.exp ? ((payload.exp * 1000) - new Date().getTime()) < 5000 : true;
}
return true;
... | [
"static isTokenExpired() {\n const token = this.getToken();\n try {\n const decoded = decode(token);\n return decoded.exp < Date.now() / 1000;\n } catch (err) {\n return false;\n }\n }",
"isTokenExpired(token) {\n const now = Date.now().valueOf() / 1000;\n const payload = jsonweb... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Get selected filters, remake the filter html and lastly update the search modal | function get_filters() {
let ele = $(".search-filters .search-filter-selected").get();
filter_results = ele.map((x) => $(x).text().toLowerCase());
modal_filters = make_modal_body_filters(filters, filter_results);
update_search(filter_results);
} | [
"function updateFilters() {\n $('#filters').empty().append($('<table class=\"mara-table table table-condensed table-sm\"><tbody/></table>'));\n query.filters.forEach(function (filter, pos) {\n updateFilterRow(pos);\n });\n }",
"function populateFilters() {\n\n // populate the... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Pushbutton Break 2 Extends mxShape. | function mxShapeElectricalPushbuttonBreak2(bounds, fill, stroke, strokewidth)
{
mxShape.call(this);
this.bounds = bounds;
this.fill = fill;
this.stroke = stroke;
this.strokewidth = (strokewidth != null) ? strokewidth : 1;
} | [
"function mxShapeElectricalPushbuttonMakeSwitch2(bounds, fill, stroke, strokewidth)\n{\n\tmxShape.call(this);\n\tthis.bounds = bounds;\n\tthis.fill = fill;\n\tthis.stroke = stroke;\n\tthis.strokewidth = (strokewidth != null) ? strokewidth : 1;\n}",
"function mxShapeElectricalPushbuttonTwoCircuitSwitch2(bounds, fi... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Quit out of the autocomplete UI while in command search and suggest mode | cancel() {
this._inputController.$commandInput.prop('selectionStart', this.initialRange.start);
this._inputController.$commandInput.prop('selectionEnd', this.initialRange.end);
this._inputController.$commandInput.focus();
this.initialRange = {};
this.targetRange = {};
th... | [
"function removeAutocompletion() {\n\t\t\t$input.unautocomplete();\n\t\t}",
"function autocomplete()\n{\n\tvar locationInformation = collectDetailsAboutTheCurrentSelection();\n\t//showObject(locationInformation);\n\n\t// If first in a line, complete unfinished environment.\n\tif(locationInformation.firstPlaceInLi... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Create diagnostics for any duplicate function declarations | diagnosticFindDuplicateFunctionDeclarations(callableContainersByLowerName) {
//for each list of callables with the same name
for (let [lowerName, callableContainers] of callableContainersByLowerName) {
let globalCallables = [];
let nonGlobalCallables = [];
let ownCall... | [
"function makeDuplicateDeclarationError(node, data, kind) {\n const context = [];\n for (const decl of data) {\n if (decl.rawDeclarations === null) {\n continue;\n }\n // Try to find the reference to the declaration within the declarations array, to hang... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Prompt the user and tell them about how to start using Storyteller. | function promptInformingAboutUsingStoryteller(warnAboutOpeningAProject) {
//notify the user that they can use storyteller
let message = 'You can use Storyteller by selecting \'Storyteller: Start Tracking This Project\' from the command palette or clicking the \'Start Storyteller\' button below. ';
if(warnA... | [
"function startPlaybackToMakeAComment() {\n //if storyteller is active\n if(isStorytellerCurrentlyActive) {\n //start a playback at the end so the user can add a comment to the latest code\n startPlayback(true);\n } else { //storyteller not active\n //tell the user how they can use sto... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Given the camera's rotation about the x and y axes, as well as the location of a touch event relative to the center of the screen (and scaled) this function returns a vec3 of the location of the touch event in coordinate space of the camera. | function getSceneTouchLocation(camPhi, camTheta, horizontalShift, verticalShift, height) {
const posX = Number(-Math.sqrt(DISTANCE)*Math.sin(camTheta)) + Number(horizontalShift*Math.cos(camTheta))
const posY = Number(Math.sqrt(DISTANCE)*Math.sin(camPhi)) + Number((verticalShift + height)*Math.cos(camPhi))
c... | [
"function getpositiontouch(event) {\n if(event.touches) {\n if (event.touches.length == 1) { // Only deal with one finger\n var touch = event.touches[0]; // Get the information for finger #1\n touchX=touch.pageX-touch.target.offsetLeft;\n touchY=touch.pageY-touch.target.offsetTop;\n... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
valid for anything that wants clickchangeposition/value motion event target is the slider bar, div is the div containing handle actionClick must have input arguments (value,max) the handle that changes postion must have calssname "handle" | function clickOnSliderBar(event, div, actionClick, axis) {
var mcoords = findDocumentCoords(event);
//var div = event.target;
// var bar=event.target;
var canva;
// if (div.lastElementChild != null)
// var canva = div.lastElementChild;
// else return;
if (div.getElement... | [
"function handleSlider(e) {\n e.target.id === \"size-range\"\n ? setArrLength(e.target.value)\n : setSpeed(e.target.value);\n }",
"function mouseEnterSliderBar(event,div,actionHover,acionLeave,actionEnter){\n \n var mcoords = findDocumentCoords(event);\n //var div = event.... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Evaluates the mathematical expression of the pair of numbers combined by op. | function evalPair(num1, num2, op) {
var eval = 0;
switch(op) {
case '+':
eval = num1+num2;
break;
case '-':
eval = num1-num2;
break;
case '*':
eval = num1*num2;
break;
case '/':
eval = num1/num2;
break;
}
return eval;
} | [
"function evaluate1(numArr, opArr) {\n const left = evalPair(parseFloat(numArr[0]),parseFloat(numArr[1]),opArr[0]);\n const right = evalPair(parseFloat(numArr[2]),parseFloat(numArr[3]),opArr[2]);\n \n return evalPair(left,right,opArr[1]);\n}",
"function operator(op) {\n //If chaining operations together, w... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Calculates the bounds of the cached sprite | _calculateCachedBounds() {
this._bounds.clear();
this._cacheData.sprite.transform._worldID = this.transform._worldID;
this._cacheData.sprite._calculateBounds();
this._lastBoundsID = this._boundsID;
} | [
"getDrawnArea() {\r\n var resource = Resources.get(this.sprite.path);\r\n return {\r\n x: this.currentLocation.x,\r\n y: this.currentLocation.y + this.sprite.heightPadding,\r\n width: resource.width,\r\n height: resource.height - this.sprite.heightPadding - 20\r\n };\r\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Returns the first row where all cells have colSpan == 1 | function getHeaderRowForTable(table) {
var rows = table.querySelectorAll('tr');
for (var rowIndex = 0; rowIndex < rows.length; rowIndex++) {
var row = rows[rowIndex];
var cells = row.children;
var good = true;
for (var colIndex = 0; colIndex < cells.length... | [
"function findFirstEmptyRow(sheet) {\n var row2start = 1;\n if (sheet) {\n var row2start = 1;\n var FirstCol = sheet.getRange(row2start, 1).getValue();\n while (FirstCol != '') {\n row2start++;\n FirstCol = sheet.getRange(row2start, 1).getValue();\n }\n row2start++;\n }\n \n return row... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Creates an instance of a opensearchdashboardsmap with a single baselayer and assigns it to the this._opensearchDashboardsMap property. Clients can override this method to customize the initialization. | async _makeOpenSearchDashboardsMap() {
const options = {};
const uiState = this.vis.getUiState();
const zoomFromUiState = parseInt(uiState.get('mapZoom'));
const centerFromUIState = uiState.get('mapCenter');
options.zoom = !isNaN(zoomFromUiState) ? zoomFromUiState : this.vis.params.mapZoom... | [
"function dashboardMap() {\n var data = {\n \"US\": 298,\n \"SA\": 200,\n \"DE\": 220,\n \"FR\": 540,\n \"CN\": 120,\n \"AU\": 760,\n \"BR\": 550,\n \"IN\": 200,\n \"GB\": 120\n };\n this.data = d... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
renders the detailed information or a button that can be clicked to show the info | render() {
const info = this.props.charInfo;
if (!this.state.expanded) {
return <p className="btn btn-warning" onClick={this.open}>Show info</p>
}
return (
<div className="user-details">
<p className="btn btn-secondary" onClick={this.close}>Hide ... | [
"showInfo() {\r\n if (this.state.infoShown) {\r\n return (\r\n <Text> {this.getDescription(this.state.standShown)} </Text>\r\n );\r\n }\r\n return;\r\n }",
"renderDetail() {\n if (this.state.detailVisible) {\n return <FilmDetails\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Chapter Common Achievements, stops the image being overridden | function C999_Common_Achievements_ResetImage() {
C999_Common_Achievements_Image = "";
} | [
"function changeToOppositeImg(entry) {\n\t\tvar tr = entry['_ref'];\n\t\tvar img = getImg(tr);\n\t\tif (img.src.indexOf(\"plus.gif\") > -1) {\n\t\t\timg.src = img.src.substring(0, img.src.length - 8) + \"minus.gif\";\n\t\t\tentry['_imgplus'] = false;\n\t\t} else if (img.src.indexOf(\"minus.gif\") > -1) {\n\t\t\timg... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Creates a new Oracle Standard Edition instance engine. | static oracleSe(props) {
return new OracleSeInstanceEngine(props.version);
} | [
"static oracleSe1(props) {\n return new OracleSe1InstanceEngine(props.version);\n }",
"static oracleEe(props) {\n try {\n jsiiDeprecationWarnings.aws_cdk_lib_aws_rds_OracleEeInstanceEngineProps(props);\n }\n catch (error) {\n if (process.env.JSII_DEBUG !== \"1\... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Validate before submitting modify storage request | function validateModifyExistingStorage(){
if( document.getElementById("actionFormId:existingVolId:0").checked == true){
var actionOnStorageSave = new Hashtable();
actionOnStorageSave.put("actionFormId:newTargetVolId", "Volume,required");
return validateFormData(MessageTypeEnum.ERROR,actionOnStorag... | [
"function validatePut() {\n return true\n}",
"function validateForm(){\n // make sure that if they cancelled deleting an ingredient they put a new quantity\n for (let i = 0; i<content.length; i++){\n if(content[i].quantity<1){ return false }\n }\n return name.length > 0 && content.length > 0\n... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Create table cell with object id | function create_id_cell(id) {
return $("<td>", {
class: "objects-id",
}).append(
$("<span>", {
class: "objects-label",
text: "ID:",
}),
$("<span>", {
text: String(id),
})
);
} | [
"function TableCellFactory() {}",
"function createCell(cell, text, style, id) {\n //cell.innerHTML = '<span id=\"' + id + '\" ></span>' + cell.innerHTML;\n \n var div = document.createElement('span'), // create DIV element\n txt = document.createTextNode(text); // create text node\n div.appendC... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
first return value is the actual size. second return value is whether the type is dynamic both will be undefined if type is a mapping or internal function third return value is resulting allocations, INCLUDING the ones passed in | function abiSizeAndAllocate(dataType, userDefinedTypes, existingAllocations) {
switch (dataType.typeClass) {
case "bool":
case "address":
case "contract":
case "int":
case "uint":
case "fixed":
case "ufixed":
case "enum":
return {
... | [
"function calldataSizeAndAllocate(definition, referenceDeclarations, existingAllocations) {\n switch (DecodeUtils.Definition.typeClass(definition)) {\n case \"bool\":\n case \"address\":\n case \"contract\":\n case \"int\":\n case \"uint\":\n case \"fixed\":\n cas... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Render a table of BuildItem objects, which are allocated against a particular BuildLine | function renderBuildLineAllocationTable(element, build_line, options={}) {
let output = options.output || 'untracked';
let tableId = `allocation-table-${output}-${build_line.pk}`;
// Construct a table element
let html = `
<div class='sub-table'>
<table class='table table-condensed table-st... | [
"createLineItems(lineItems) {\n let lLineItems;\n const self = this;\n lLineItems = lineItems.map(function(lineItem) {\n return (\n <div key={lineItem.id}>\n <LineItemComponent\n id={lineItem.id}\n invoic... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
funcion para configurar los parametros de la peticion a mapbox | get paramsMapbox() {
return {
// api key configurado en archivo .env configurando el modulo dotenv
'access_token': process.env.MAPBOX_KEY,
'limit': 5,
'language': 'es'
}
} | [
"get paramsMapbox(){\n return {\n access_token: process.env.MAPBOX_KEY,\n limit: 5,\n language: 'es'\n }\n }",
"function initGuiParams() {\n\n //Mapping\n this.Xscaler = 1000;\n this.Yscaler = 1000;\n\n //Playback\n this.playSpeed = 0.5;\n\n}",
"setupMap3D(... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
return element at index | getElementAtIndex(index) {
return this.data[index];
} | [
"function getElement(index) {\n return elements[index];\n }",
"getElementAtIndex(index) {\r\n return this.data[index];\r\n }",
"elementAt(index) {\n const elements = this.allElements;\n if (elements && elements.length && elements.length >= index) {\n return elements[index];\n } el... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Sets all tiles to grey. | function setAllGrey() {
for (let i = 0; i < squares.length; i++) {
squares[i].style.background = "grey";
}
rotateGrid();
setTimeout(() => toggleGridClickable(), 500);
} | [
"function updateTileColor() {\r\n var grid, i, count;\r\n\r\n grid = this;\r\n\r\n for (i = 0, count = grid.allNonContentTiles.length; i < count; i += 1) {\r\n grid.allNonContentTiles[i].setColor(config.tileHue, config.tileSaturation,\r\n config.tileLightness);\r\n }\r\n }",
"resetTiles... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Function calculates the difference between 2 date objects by comparing the objects milliseciond conversion of valueOf() | function getDateDiff( date1, date2 ){
if(date1 instanceof Date && date2 instanceof Date){
var d1 = date1.valueOf(), d2 = date2.valueOf();
return d2 - d1;
}
else { return 0; }
} | [
"function getDurationofDates(date1, date2) {\n var a1 = new GlideDateTime(date2);\n var b1 = new GlideDateTime(date1);\n return (date1 == date2) ? 0 : ((a1.getNumericValue() - b1.getNumericValue()) / 1000);\n}",
"function diffDates(date1, date0) { // date1 - date0\n if (largeUnit) {\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
display the accumulated male, female and population per county value | function displayAccumulatedCountyData(total_male,total_female,total_population)
{
const total_male_area = document.querySelector("#total-male b");
const total_female_area = document.querySelector("#total-female b");
const total_population_per_county = document.querySelector("#total-population b");
total... | [
"function accumulatePopulationPerCounty(male_per_county,female_per_county)\n{\n let population_pre_county = [];\n for (let i = 0; i < male_per_county.length; i++)\n {\n population_pre_county.push(male_per_county[i] + female_per_county[i])\n }\n return population_pre_county;\n}",
"function ac... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Describing property type "ObjectCollection" | function ObjectCollectionType()
{
ObjectCollectionType.$parent.apply(this, arguments);
} | [
"get isCollection() {\n return this._objType.isCollection;\n }",
"primitiveType() {\n return this.collectionType;\n }",
"function ObjectPropertyDescriptor() {}",
"GetProceduralPropertyDescriptions() {}",
"function isCollection(obj) {\n return isTerm(obj) && obj.termType === _types__WEBPACK_IMPORTED... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Extract package name from tarball url or path. | function getPackageName(installPackage) {
if (installPackage.match(/^.+\.(tgz|tar\.gz)$/)) {
return getTemporaryDirectory()
.then((obj) => {
let stream;
if (/^http/.test(installPackage)) {
stream = hyperquest(installPackage);
} else {
stream = fs.createReadStream(... | [
"function getPackageName(installPackage) {\n if (installPackage.match(/^.+\\.(tgz|tar\\.gz)$/)) {\n return getTemporaryDirectory()\n .then((obj) => {\n let stream;\n if (/^http/.test(installPackage)) {\n stream = hyperquest(installPackage);\n } else {\n stream = fs.cr... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Export the required load_ipython_extension | function load_ipython_extension() {
return new Promise(function(resolve) {
requirejs([
'nbextensions/noworkflow/index',
'base/js/namespace',
'base/js/events',
'base/js/utils',
'notebook/js/codecell',
'd3-selection',
'@noworkflow/trial',
'@noworkflow/history',
... | [
"function load_ipython_extension() {\n\t !(__WEBPACK_AMD_DEFINE_ARRAY__ = [__webpack_require__(1), __webpack_require__(2)], __WEBPACK_AMD_DEFINE_RESULT__ = function (Extension, $) {\n\t Extension.register_renderer($);\n\t Extension.render_cells($);\n\t }.apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__), __WEBPA... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Return the tsid, x, and y for the entrance INTO this house Unfortunately, x/y is the location of the door in the inside. You probably want pols_get_entrance_outside() | function pols_get_entrance(){
var links = this.geo_links_get_incoming();
for (var id in links){
if (links[id].source_type == 'door'){
return {
tsid: links[id].street_tsid,
x: links[id].x,
y: links[id].y
};
}
}
return {};
} | [
"function pols_get_entrance_outside(){\r\n\tvar links = this.geo_links_get_outgoing();\r\n\tfor (var l in links){\r\n\t\tif (links.length == 1 || (links[l].deco_class && links[l].deco_class.indexOf('entrance') >= 0) || (links[l].door_id && links[l].door_id == 'door_out')){\r\n\t\t\treturn {\r\n\t\t\t\ttsid: links[l... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Given a graph, a start position, and an end position return true if there is a path from start to end and false otherwise. | function hasPath(graph, start, end) {
const stack = [];
const visited = new Set();
stack.push(start);
visited.add(start);
while (!stack.length == 0) {
let currentNode = stack.pop();
if (currentNode == end) {
return true;
}
let neighbors = graph[currentNode] || [];
for (let neighbor of neighbors) ... | [
"function isPath(graph) {\n\tvar start = null;\n\tvar endPoints = 0;\n\tvar nodeLists = graph.getVertices();\n\tfor (v in nodeLists) {\n\t\tvar degree = graph.getDegree(nodeLists[v]);\n\t\tif (degree == 1) {\n\t\t\tendPoints++;\n\t\t} else if (degree != 2) {\n\t\t\treturn false;\n\t\t}\n\t}\n\tif (endPoints != 2)\n... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
this function is used to sync local lists with the server | function syncListsUpstream() {
console.log("syncListsUpstream In syncLists");
var defer = $q.defer();
var promises = [];
global.db.transaction(function (tx) {
var query = "select * from list where listServerId = ''";
tx.executeSql(query, [], function (tx, result) {
//... | [
"function refresh_list_from_server() {\r\n var new_list = send_to_server(\"api/models\", \"GET\", \"\");\r\n if (same_lists(last_list, new_list))\r\n return;\r\n else {\r\n refresh(new_list);\r\n last_list = new_list;\r\n }\r\n}",
"function XHRSyncListLayer() {\n\n}",
"syncStora... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
executePanelStateChangeRequests() Panel specific code should use this method to execute all panel updates once the state change requests have been added to the stateChangeRequests array This function simply executes a lower level call, passing in a the global data array and true to ensure that the mainline lockout vari... | function executePanelStateChangeRequests()
{
executePanelStateChangeRequestsLowLevel(stateChangeRequests, true);
} | [
"function executePanelStateChangeRequestsLowLevel(setArray, honorMainlineLock)\n{\n\tif((setArray != null) && (setArray != undefined))\n\t{\n\t\tvar serverSetArray = new Array();\n\t\n // Create the array of server items to change\n\t\twhile(setArray.length > 0)\n\t\t{\n\t\t\tvar scr = setArray.shift();\n\t\... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Draws palette colour pack titles | function drawColourPackString() {
ctx.clearRect(35, 410, 250, 63);
ctx.drawImage(palette[0], 35, 410, 250, 63);
} | [
"function setupPalette(){\n palette.style.border = simpleBorder;\n palette.style.width = paletteDimensionX + \"px\";\n paletteCreated = true;\n}",
"function drawPaletteSelect () {\n var\n palette_list = topCmap._palette_list_,\n palette_count = palette_list.length,\n div_list = []... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
write a function name display which takes an argument value and display it to screen and get the element td which has the id of screen and add the current value | function display(v){
var tr = document.getElementById("screen")
tr.value += v
} | [
"function display(value) {\n // Add values to screen \n screen.textContent = value;\n // console.log(screen.textContent)\n}",
"function insert_in_display(value) {\n display.innerHTML = value\n}",
"function displayInScreen(dispStr){\r\n document.querySelector(\"#screen_value\").innerHTML=dispStr;\r\... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
pageView (switchcase function) will check the currentView and return the respective page this is how you are able to change view on the fly without reloading need to pass down functions here so you can use them in child components as this.props | pageView() {
const { currentView } = this.state;
switch (currentView) {
case 'login page':
return <Login
handleLoginSubmit={this.handleLoginSubmit}
favoriteCount={this.favoriteCount}
handleLinks={this.handleLinks}
/>;
case 'register page':
retu... | [
"renderPage() {\n if(this.state.page === \"LogIn\") {\n return this.renderLogIn();\n }\n if(this.state.page === \"SignUp\") {\n return this.renderSignUp();\n }\n else if(this.state.page === \"Home\") {\n return this.renderHome();\n }\n else if(this.state.page === \"Quiz\") {\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
remove clicked song from userSong array | removeSong(selectedSong){
this.userSetlist.pop(selectedSong);
} | [
"function deleteSong(a){\n songs.splice(a, 1);\n displaySongs();\n }",
"function removeSong() {\n}",
"function deleteSong(a) {\n songs.splice(a, 1);\n displaySongs();\n}",
"function remove(song_id, user_id){\n return db('savedSongs').del().where({song_id}).andWhere({user_id})\n}",
"function removeS... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Delete single file from meta data DB. | static deleteEntry(path) {
Databases.fileMetaDataDb.remove({path: path}, (err, numDeleted) => {
if (err) {
console.log(err);
}
});
} | [
"function removeDeletedFileFromDb(fileObject) {\n var db = ScriptDb.getMyDb();\n db.remove(fileObject);\n}",
"handleDelete(docID, filePath) {\n // delete metadata in firestore\n this.firestoreFileCollection.doc(docID).delete().then( () => {\n // delete file \n this.storageRef.child(filePath).del... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |