query stringlengths 9 34k | document stringlengths 8 5.39M | negatives listlengths 19 20 | metadata dict |
|---|---|---|---|
Hides the participants list | function participants_view_hide() {
DOM("PARTICIPANTS_CLOSE").style.backgroundColor = "rgba(0,0,0,.2)";
setTimeout(function() {
DOM("PARTICIPANTS_CLOSE").style.backgroundColor = "transparent";
participants_view_visible = false;
DOM("PARTICIPANTS_VIEW").style.top = "-100%";
setTimeout(function() {
DOM("PART... | [
"function showParticipant() {\n if (document.getElementsByClassName('participant').classList.contains('hide')){\n document.getElementsByClassName('chat').classList.add('hide');\n document.getElementsByClassName('participant').classList.remove('hide');\n }\n }",
"function hideStudents()\n{\n for... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Find all imports in the code, extracting their filename to populate combo with | extractImports(code) {
const
regex = /'\.\/(.*)';/g,
imports = [];
let result;
while ((result = regex.exec(code)) !== null) {
imports.push(result[1]);
}
return imports;
} | [
"static GetImporters() {}",
"searchUsedImportAlldModules(name) {\n for (let scope of this._importAllModules) {\n let resolve = scope.tryResolveExportedName(name);\n if (resolve !== null)\n return wrapInImportIfNecessary(resolve);\n }\n let matchingUsings =... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
parse through file and separate contacts into individual objects | function csvParse(fileContent) {
var lines = fileContent.split('\n');
var contacts = [];
for (var i = 1; i < lines.length; i++) {
var line = lines[i].split(',');
var info = {};
info.firstName = line[0];
info.lastName = line[1];
info.numMonthsSinceContact = line[2];
info.emailAddress = line[3];
contacts... | [
"function saveCSVContactInPhone(mContact) {\n var contact = new mozContact();\n \n var adr = [\n {\n type: [\"home\"],\n streetAddress: mContact[24],\n locality: mContact[28],\n region: mContact[29],\n postalCode: mContact[30],\... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
If this.stubs == null, fetch the secrets from AWS Secrets Manager. | static async fetch(region, secrets) {
if (this.stubs) {
// find any unstubbed secrets
const unstubbedSecrets = secrets.filter(secret => {
return !Object.keys(this.stubs).includes(secret);
});
if (unstubbedSecrets.length) {
// if there are any secrets that do not have equivale... | [
"async prepareCredentials() {\n if (this.env[DEFAULT_ENV_SECRET]) {\n const secretmanager = new SecretManager({\n projectId: this.env.GCP_PROJECT,\n });\n const secret = await secretmanager.access(this.env[DEFAULT_ENV_SECRET]);\n if (secret) {\n const secretObj = JSON.parse(secr... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
helpers for the path of the next / previous route | get nextPath() { return this.next && this.next.path } | [
"next(path) {\n if (path.length === 0) {\n throw new Error(\"Cannot get the next path of a root path [\".concat(path, \"], because it has no next index.\"));\n }\n\n var last = path[path.length - 1];\n return path.slice(0, -1).concat(last + 1);\n }",
"function navigateToPrevUrl() {\n... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Halt a running instance of a monitor thread | function stop() {
if (monitorThread) {
clearInterval(monitorThread);
monitorThread = null;
} else {
console.err("ERR: Attempted to halt monitor thread but no instance existed.")
}
} | [
"function stop_install_monitor(div_id){\n install.updater.stop();\n}",
"function maybeHalt() {\n taskEnding();\n maybeExit();\n return null;\n}",
"stop() {\n if (!this.stopped) {\n for (let timeout of this.timeouts) {\n clearTimeout(timeout);\n }\n cl... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
creditCARow calls creditCARow in index.aspx.cs clears any error message, displays Crediting message and disables buttons | function creditCARow(row){
if (formatAmount(document.getElementById('amtCreditCA_'+row),'CA')){
CCT.index.creditCARow(row,gOldCACreditAmt[row],document.getElementById('emailCreditCA_'+row).value
,docume... | [
"function creditCARowCallback(res){ \n document.getElementById(\"mCreditCATableDiv\").style.display = '';\n document.mForm.mCreditButton.disabled = false; \n \n if (!res.error && !res.value.error){ \n if (res.value.message == \"REFRESH... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Decodes the given IndexedDbcompatible string form of a resource path into a ResourcePath instance. Note that this method is not suitable for use with decoding resource names from the server; those are One Platform format strings. | function decode(path) {
// Event the empty path must encode as a path of at least length 2. A path
// with exactly 2 must be the empty path.
var length = path.length;
assert(length >= 2, 'Invalid path ' + path);
if (length === 2) {
assert(path.charAt(0) === escapeChar && path.charAt(1) === e... | [
"function Resource(wfsUrl) {\n this.uri = URI(wfsUrl);\n this.fsid = this.uri.host();\n this.wfs = new WebidaFS(this.fsid);\n this.pathname = decodeURI(this.uri.pathname());\n this.basename = Path.basename(this.pathname);\n this.localPath = getPathFromUrl(wfsUrl);\n}",
"function resourceToInstan... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Constructs a term from the given internal string ID | function termFromId(id, factory) {
factory = factory || DataFactory; // Falsy value or empty string indicate the default graph
if (!id) return factory.defaultGraph(); // Identify the term type based on the first character
switch (id[0]) {
case '?':
return factory.variable(id.substr(1));
case '_':... | [
"getById(id) {\n return TermGroup(this, id);\n }",
"function idOf(word) {\n return \".word_\" + word;\n}",
"constructor(term,nbUse){\r\n this.term = term;\r\n this.nbUse = nbUse;\r\n }",
"function crearLabel(id) {\n let label = document.createElement(\"LABEL\");\n label.set... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
family(id) Checks if the a prop or building family exists with the given IID and if so returns the family array. | family(id) {
let arr = this.families.get(id);
return arr || null;
} | [
"function load_family_ids() {\r\n\t\tids=[];\r\n\t\trequest('xw_controller=clan&xw_action=view&xw_city=1&xw_person='+User.id.substr(2)+'&mwcom=1&xw_client_id=8',function(page) {\r\n\t\t\tvar jpage=$('<div>'+page+'</div>');\r\n\t\t\tjpage.find('#member_list').find('.member_info').each(function(){\r\n\t\t\t\ttry {\r\... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
solveInverseDynamics: produces wheel velocities, torques and voltages, given a chassisVel and chassisAccel | solveInverseChassisDynamics(chassisVel, chassisAccel) {
let dynamics = new DriveDynamics();
dynamics.chassisVel = chassisVel;
dynamics.curvature = chassisVel.angular / chassisVel.linear;
if (Number.isNaN(dynamics.curvature))
dynamics.curvature = 0;
dynamics.chassisAcc... | [
"solveInverseKinematics(chassisState) {\n let wheelState = new WheelState(chassisState.usage);\n wheelState.left = (chassisState.linear -\n this.effWheelbaseRad * chassisState.angular) /\n this.wheelRadius;\n wheelState.right = (chassisState.linear +\n this.effW... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Call `setDefaultAssetId` on the parent `ScratchStorage` instance to register all builtin default assets. | registerDefaultAssets() {
const numAssets = DefaultAssets.length;
for (let assetIndex = 0; assetIndex < numAssets; ++assetIndex) {
const assetRecord = DefaultAssets[assetIndex];
this.parent.setDefaultAssetId(assetRecord.type, assetRecord.id);
}
} | [
"_onResetDefaults(event) {\n event.preventDefault();\n game.settings.set(\"core\", DrawingsLayer.DEFAULT_CONFIG_SETTING, {});\n this.object.data = canvas.drawings._getNewDrawingData({});\n this.render();\n }",
"async loadDefaults () {\n // No default config files for seeded assets right now.\n... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Double checks that dynamic content interpolated into a heredoc string does not include the end word. If it does, rewrites content on the buffer to use nonconflicting start and end words. If this functions fails to avoid a collision, it will fail with an exception, but this should not reliably occur unless an attacker c... | function fixupHeredoc (buf, heredocContext) {
const [ delim, contextStart, contextOffset, delimLength ] = heredocContext
let chunkLeft = 0
let startChunkIndex = -1
for (let i = 0, len = buf.length; i < len; ++i) {
chunkLeft += buf[i].length
if (chunkLeft >= contextStart) {
startChunkIndex = i
... | [
"async cleanUpDocString() {\n const removeStreams = /stream(.*?)endstream/gs\n const removeComments = /%(.[^(PDF)][^%EOF]*?)\\n/g\n const removeMultiSpace = /[^\\S\\n\\r]{2,}/g\n const addNewLine = /(%%EOF)/gms\n\n return this.docString = this.docString\n .replace(addNewLine, '%%EOF\\n')\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Returns the FIPS for the given city in the state with the given info. | async function fetchCityFips(city, stateFips, stateAcronym) {
// Remove periods from city name (e.g. "St. Paul") for easier comparison
const removePeriodsRegex = /[\.]/g;
city = city.replace(removePeriodsRegex, '');
const fileName = 'states/st' + stateFips + '_' + stateAcronym.toLowerCase() + '_place... | [
"function change_city(findCity) {\n let apiURL = `https://api.openweathermap.org/data/2.5/weather?q=${findCity}&appid=${apiKey}&units=${units}`;\n axios.get(apiURL).then(ShowCityTemp);\n//this portion is for forecast\n apiURL = `https://api.openweathermap.org/data/2.5/forecast?q=${findCity}&appid=${apiKey}&units... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Check to see if we should try to compress a file with gzip. | function shouldCompressGzip(req) {
const headers = req.headers;
return headers && headers['accept-encoding'] &&
headers['accept-encoding']
.split(',')
.some(el => ['*', 'compress', 'gzip', 'deflate'].indexOf(el.trim()) !== -1)
;
} | [
"function isGzip (buf) {\n if (!buf || buf.length < 3) return false\n\n return buf[0] === 0x1f && buf[1] === 0x8b && buf[2] === 0x08\n}",
"function gzipResponseHandler(request, response) {\n var urlPath = request.url.split('?')[0];\n var file = compressedFiles[ urlPath.replace('/base', '') ];\n\n if (!file) ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
moves the object to the specified coordinates | moveTo(x, y) {
let coordinates = this.getXY();
this.x = x + coordinates.x;
this.y = y + coordinates.y;
} | [
"moveAround() {\r\n\r\n\r\n }",
"moveToStartingPosition() {\r\n this.currentLocation.x = this.startingPosition.x;\r\n this.currentLocation.y = this.startingPosition.y;\r\n }",
"move() {\n this.change = this.mouthGap == 0 ? -this.change : this.change;\n this.mouthGap = (this.mouthGap + this.chang... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Construct a new session. id Session id, used for error reporting config Queue server configuration, used to establish connection notify Logging and errors setup The setup function, see below Beanstalkd requires setup to either use or watch a tube, depending on the session. The setup function is provided when creating t... | constructor(server, id, setup) {
this.id = id;
this.setup = setup;
this._config = server.config;
this._notify = server.notify;
this._connectPromise = null;
} | [
"function setupSessionController() {\n\n\tvar self = this;\n\tvar priv = PRIVATE.get(this);\n\n\t\n\tlogger.debug(\"connecting to Redis endpoint \" + JSON.stringify(priv.redis));\n\tpriv.redisClient = RedisConnection(\"DEFAULT\", priv.redis);\n\n\tpriv.redisClient.on(\"error\", function (err) {\n\t\tlogger.error(\"... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Render a chart visual on dashboard page for tracking class visits by date | function drawBasic() {
// Set up the data table to have a class name and visits associated w/ that specific class
var data = new google.visualization.DataTable();
data.addColumn('date', 'Date');
data.addColumn('number', 'Visits');
// Organize visit data through visit-by-date servlet
getToken().then(tok =... | [
"function drawTime() {\n\n // Set up the data table to have a class name and wait average associated w/ that specific class\n var data = new google.visualization.DataTable();\n data.addColumn('date', 'Date');\n data.addColumn('number', 'Wait');\n \n // Organize wait data through wait-time servlet\n getToken()... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Updates the key manager's active item to the given option. | setActiveOption(option) {
this._listKeyManager.updateActiveItem(option);
this._updateActiveOption();
} | [
"_updateActiveOption() {\n if (!this._listKeyManager.activeItem) {\n return;\n }\n this._activeOption?.deactivate();\n this._activeOption = this._listKeyManager.activeItem;\n this._activeOption.activate();\n if (!this.useActiveDescendant) {\n this._act... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Returns the true offsetLeft position of an anchor | function getOffsetLeft(anchorId) {
var anchorObject = atgCalendar_findElementById(anchorId);
var curleft = 0;
if (anchorObject.offsetParent)
{
while (anchorObject.offsetParent)
{
curleft += anchorObject.offsetLeft
anchorObject = anchorObject.offsetParent;
}
}
else if (anchorObject.x)
curleft += anch... | [
"function calculateOffsetLeft(r){\n return absolute_offset(r,\"offsetLeft\")\n}",
"function getLeftPosition() {\n return randomFunction(0, viewportWidth - 100);\n}",
"getElementX(el) {\n var parent = this.myRef.current;\n var center = parent.clientWidth / 2;\n var left = el.offsetLeft -... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
show polar chart of artist traits | function showPolarArea(traits, selector) {
var labels = [], data = [], graph = []
, traitsCanvas = $$(selector)
, traitsCx = traitsCanvas.getContext('2d')
, traitsChart
, traitsLegend = $$('.traits-legend');
traits.map(function(trait) {
graph.push({
... | [
"function drawRadar(data, overall, pronouns, theword, extras) {\n for (i = 0; i < data.length; i++) {\n var p = \".s3-\" + i;\n RadarChart(p, data[i].dataset[0], data[i], radarChartOptions, overall[i], pronouns, theword[i], extras[i]);\n }\n}",
"toggleChart() {\n this.pie.type = (this.pie.type == 'pie'... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
new GL.HitTest([t, hit, normal]) This is the object used to return hit test results. If there are no arguments, the constructed argument represents a hit infinitely far away. | function HitTest(t, hit, normal) {
this.t = arguments.length ? t : Number.MAX_VALUE;
this.hit = hit;
this.normal = normal;
} | [
"function HitDetector() {\r\n this.xOverlap = [0, 0];\r\n this.yOverlap = [0, 0];\r\n this.overlap = [0, 0, null]; // start, end, axis if any\r\n}",
"function new_Hitbox(hitbox)\n{\n\tif(null == hitbox)\n\t\treturn null;\n\treturn new Hitbox(hitbox.width, hitbox.height);\t\n}",
"evaluateHit(ray, source) {\n\... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
normalise_date is a function that sets the timing of the loan to 8am sharp, no matter the time of the actual borrowing. The reason for this is so that messages can be sent promptly at 8am in the morning. | function normalise_date(date) {
// console.log(date);
date.setHours(8,0,0,0);
// console.log(date);
// console.log(Date.parse(date));
return(date);
} | [
"function reset_date() {\n\tconsole.log('resetting or initing date format');\n\tconst RESET = '%q %d, %Y %I:%m%p';\n\tdocument.getElementById('dateFormat').value = RESET;\n\tsaveThing(LS_KEY_DATE, document.getElementById('dateFormat').value);\n\treturn RESET;\n}",
"function FixDateObject (date) {\n\tvar base = ne... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Given a WebID and a Resource that exposes information about the owner of the Pod it is in, returns whether the given WebID is the owner of the Pod. Data about the owner of the Pod is exposed when the following conditions hold: The Pod server supports exposing the Pod owner The current user is allowed to see who the Pod... | function isPodOwner(webId, resource) {
const podOwner = getPodOwner(resource);
if (typeof podOwner !== "string") {
return null;
}
return podOwner === webId;
} | [
"'entries.isOwner' (entryId) {\n console.log('see if user can access this entry');\n\n // If no user is logged in, throw an error\n if (!Meteor.user()) {\n console.log(\"No user is logged in!\");\n return false;\n }\n \n // Locate the entry\n le... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Handles what to do when the user presses 'select'. If multiple actions are available for the currently highlighted node, opens the action menu. Otherwise performs the node's default action. | static onSelect() {
const node = Navigator.byItem.currentNode;
if (MenuManager.isMenuOpen() || node.actions.length <= 1 ||
!node.location) {
node.doDefaultAction();
return;
}
ActionManager.instance.menuStack_ = [];
ActionManager.instance.menuStack_.push(MenuType.MAIN_MENU);
... | [
"function performSelectedAction(){\r\n\tswitch(selectedAction){\r\n\tcase GameScreenActionType.mainmenu:\r\n\t\tperformQuit();\r\n\t\tbreak;\r\n\tcase GameScreenActionType.hints:\t\r\n\t\ttoggleHints();\r\n\t\tbreak;\r\n\tcase GameScreenActionType.difficulty:\r\n\t\tperformDifficultyAction();\r\n\t\tbreak;\r\n\tcas... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
function opens Storj(V3) project using access grant and custom configuration. Input : None Output : Project(Object) | async configOpenProject(){
var project = await uplink.config_open_project(this.access).catch((error) => {
errorhandle.storjException(error.error.code,error.error.message);
});
var projectResultReturn = new ProjectResultStruct(project.project);
return(projectResultReturn);
... | [
"async openProject(){\n var project = await uplink.open_project(this.access).catch((error) => {\n errorhandle.storjException(error.error.code,error.error.message);\n });\n var projectResultReturn = new ProjectResultStruct(project.project);\n return(projectResultReturn);\n }... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
setup bootstrap multiselect input for region (kommun) | function setupRegionSelectBox(){
$(document).ready(function() {
$('#RegionId').multiselect({
buttonText: function(options, select) {
if (options.length === 0) {
return 'Välj kommuner ';
}
else if (options.length > 3) {
... | [
"function multipleSelectControlCreate(element, parent_div_id, control_name, control_label, has_cascaded_element, jsondata, appearance, username) {\n if (jsondata == null) {\n console.log(control_label + \" element cannot be created -mpower\");\n return;\n }\n var col_md = 12;\n if ('col_md... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Opens a dialog, where a new workspace can be chosen | newWorkspaceDialog() {
let Dialog_SelectWorkspace = require(path.join(__rootdir, "js", "dialogs", "selworkspace.js"))
new Dialog_SelectWorkspace(600, "", (result) => {
if(result === false)
return
let ws = wmaster.addWorkspace(result)
this.setWorkspace(ws)
// display loading indicator
this... | [
"showDeleteProjectDialog() {\n // hide project options dialog\n this.shadowRoot.getElementById(\"dialog-project-options\").close();\n\n // open delete dialog\n this.shadowRoot.getElementById(\"dialog-delete-project\").open();\n }",
"openProject(event) {\n const controller = event.data.controll... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Moves the language down in the list. | onMoveDownTap_() {
/** @type {!CrActionMenuElement} */ (this.$.menu.get()).close();
this.languageHelper.moveLanguage(
this.detailLanguage_.language.code, false /* upDirection */);
settings.recordSettingChange();
} | [
"onMoveUpTap_() {\n /** @type {!CrActionMenuElement} */ (this.$.menu.get()).close();\n this.languageHelper.moveLanguage(\n this.detailLanguage_.language.code, true /* upDirection */);\n settings.recordSettingChange();\n }",
"function moveDown() {\n\tmoveWrapper(this.ancestor(fieldWrappe... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
IMGUI_API bool BeginTabItem(const char label, bool p_open = NULL, ImGuiTabItemFlags flags = 0);// create a Tab. Returns true if the Tab is selected. | function BeginTabItem(label, p_open = null, flags = 0) {
// return bind.BeginTabItem(label, p_open, flags);
if (p_open === null) {
return bind.BeginTabItem(label, null, flags);
}
else if (Array.isArray(p_open)) {
return bind.BeginTabItem(label, p_open, flags... | [
"addTab() {\n this._insertItem(FdEditformTab.create({\n caption: `${this.get('i18n').t('forms.fd-editform-constructor.new-tab-caption').toString()} #${this.incrementProperty('_newTabIndex')}`,\n rows: A(),\n }), this.get('selectedItem') || this.get('controlsTree'));\n }",
"function crea... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
removes a parameter from node based on rank | function removeParameterToNode(node, name, minRank, maxRank) {
if (
getValueOfRank(node.r) >= getValueOfRank(minRank) &&
getValueOfRank(node.r) <= getValueOfRank(maxRank)
) {
delete node[name];
}
} | [
"function delete_parameter(p) {\n return (delete p);\n}",
"function removeParam (element) {\n\t$(element).closest('tr').remove ();\n}",
"removeNode(layerIndex) {\n const jsonLayerIndex = Object.keys(this.layers)[layerIndex];\n this.layers[jsonLayerIndex].neurons -= 1;\n }",
"function deleteN... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Public method to save a pattern and toggle and check button | function saveLockPattern() {
var node = document.getElementById("errorMessage"),
saveButton = document.getElementById("setPattern"),
checkButton = document.getElementById("checkPattern"),
length = password.length,
message;
if (password === "") {
message = "No Pattern Set. Please Set A Pattern and tr... | [
"function saveDesign(){\n\n var temp = { //this is common for all modules\n A: _this.A_slider.value()\n ,B: _this.B_slider.value()\n ,C: _this.C_slider.value()\n ,D: _this.D_slider.value()\n ,E: _this.E_slider.value()\n ,gearSize: _this.currentGearSize //number 1~4\n ,gearSi... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Send any requests that have been queued | sendQueuedRequests() {
this._startTimer();
} | [
"_sendRequestFromQueue () {\n while (this[ _requestQueue ].length > 0) {\n const request = this[ _requestQueue ].shift()\n this._sendRequest(request)\n }\n }",
"_sendAllPendingRequests() {\n return this._dbPromise.then(db =>\n // Get all pending requests\n db\n .transaction(Pe... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Validates and stores the formula entered by the user | saveFormula() {
try {
//Simple manual validation. Check if valid characters and placeholder used.
const regex = /[\/*-+($price)\d\.\(\)]*/gm;
if (!regex.test(this.input.value)) throw new Error("Regex not fullfilled");
//External library validation. Checks the exp... | [
"function chkFormula(obj,measName){\r\n\t\r\n\t//1. Hallamos la medida 1, el operarador y la medida2 (o number)\r\n\tvar formula = obj.value;\r\n\tif (formula == \"\"){\r\n\t\talert(MSG_MUST_ENTER_FORMULA);\r\n\t\treturn false;\r\n\t}\r\n\tvar esp1 = formula.indexOf(\" \");\r\n\tvar formula2 = formula.substring(esp... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Check if request URL is in provided basePaths | isUrlInBasePaths(request) {
const url = request.url.toLowerCase();
const path = this.basePaths.find(path => url.startsWith(path));
return Boolean(path);
} | [
"function isHttpEndpoint(pathname) {\n for (let index in httpEndpoints) {\n if (httpEndpoints[index][0] == pathname) {\n return true;\n }\n }\n return false;\n}",
"function isLocalhost(){\n return window.location.origin.includes(\"localhost:8088\");\n}",
"function CheckUrlEn... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
When the user goes back to the home screen, the sessionStorage values for datacenter, network, and farm are set to default values. | function setHomeDefaults() {
sessionStorage["datacen"] = "All";
sessionStorage["network"] = -1;
sessionStorage["farm"] = -1;
} | [
"function restoreSessionStorageFromLocalStorage() {\n var backupText = localStorage[\"sessionStorageBackup\"],\n backup;\n\n if (backupText) {\n backup = JSON.parse(backupText);\n\n for (var key in backup) {\n sessionStorage[key] = backup[key];\n }\n\n localStorage.removeItem... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
handleSubmit makes ajax request to send newUser to db. dispatches addUser action to change state. this.state is data passing along | handleSubmit(e) {
e.preventDefault();
axios.post('/api/users', this.state)
.then(res => res.data)
.then(newUser => {
store.dispatch(addUser(newUser))
console.log("new user dispatched:", newUser)
})
.catch(err => console.error(err))
} | [
"handleSubmit(event) {\n event.preventDefault();\n this.fetchUsers();\n }",
"handleSubmit(evt) {\n evt.preventDefault()\n const userId = this.props.singleUser.id\n this.props.modifyExistingUser(userId, this.state)\n this.setState({buttonDisabled: true})\n }",
"function addUser() {\... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
If true, the results will not be displayed in the popup. However, if a default index is specified, the default item will still be completed in the input. readonly attribute boolean typeAheadResult; | get typeAheadResult()
{
return true;
} | [
"function typeAhead(response) {\n\t\t// save the response in the parent scope\n\t\tarr = response;\n\t\t// Reset result list index to -1 (nothing selected)\n\t\tlIndex = -1;\n\t\t// Stop the waiting animation \n\t\tclearInterval(leftWaitingInterval);\n\t\tclearInterval(rightWaitingInterval);\n\t\t// Reset the text ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Deletes userId cookie Redirects to login page | function logout() {
$.removeCookie("userId");
/// redirect to login
window.location.replace("/");
} | [
"function logout() {\n sessionStorage.removeItem(\"userId\");\n sessionStorage.removeItem(\"jwt\");\n }",
"static clearCookie() {\n var cookies = document.cookie.split(\";\");\n\n for (var i = 0; i < cookies.length; i++) {\n var cookie = cookies[i];\n var eqPos = cookie.indexOf(\"=\");... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Handles key presses on a namevalue list (such as item options). Hitting on a namevalue list popsup its options dialog. The call to this handler is set up in NLField.java (NLField.getInputTag()) | function NLNameValueList_onKeyPress(evt, sFieldName, sOptionHelperSuffix)
{
var keyCode = getEventKeypress(evt);
if( keyCode == 32 ) // <SPACE>
{
// if the user hit <SPACE> find the helper icon which pops-up the options dialog and click it
var ndAction = document.getElementById(sFieldName +... | [
"function setup_input (input_field) {\n var name = input_field.attr('name');\n var values_input = $('<input type=\"hidden\" class=\"ub-values\" name=\"' + name\n + '\" id=\"ub-values-' + name + '\" />');\n\n var ul_box = $('<ul id=\"ub-drop-'+name+'\" class=\"ub-input... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
displayShapes() When we press space bar, sets the central position of the ellipse and handles mouse and keys inputs to change size, colors and sound | displayShapes() {
// Displays shapes when the space bar is pressed
if (keyIsDown(32)) {
// If the central position of the shape is not given...
if (this.positionIsGiven === false) {
// Set it to the mouse position
this.x = mouseX;
this.y = mouseY;
// And change state ... | [
"function displayControls(){\n noStroke();\n fill(fgColor);\n text(\"left player: WASD. right player: Arrow keys.\", width/2, height-15);\n}",
"display() {\n push();\n fill(255,0,0);\n ellipse(this.x, this.y, this.size);\n pop();\n // if (x < 0 || x > width || y < 0 || y > height) {\n // va... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
9.Write a program that deletes a given element e from the array a. Input: e = 2, a = [4, 6, 2, 8, 2, 2] | function deleteElement(a, e) {
var newArray = [];
for (var i = 0; i < a.length; i++) {
if (a[i] !== e) {
newArray[newArray.length] = a[i];
} else {
continue;
}
}
return newArray;
} | [
"function remove(array, element) {\n const index = array.indexOf(element);\n var item = array.splice(index, 1);\n return item;\n}",
"removeItem (array, item, f) {\n const i = this.indexOf(array, item, f)\n if (i >= 0) array.splice(i, 1)\n }",
"function removeArray(array, index)\n{\n array.spl... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
main function to retrieve, format, and send cgm data | function fetchCgmData(lastReadTime, lastBG) {
// declare local constants for time differences
var TIME_5_MINS = 5 * 60 * 1000,
TIME_10_MINS = 10 * 60 * 1000,
TIME_15_MINS = 15 * 60 * 1000,
TIME_30_MINS = TIME_15_MINS * 2;
// declare local constants for arrow trends
var NO_ARRO... | [
"function parserWebserverClientData(data) {\n let rx = JSON.parse(data);\n let protocolData = {\n cmdtype: rx.cmdtype,\n cmdData: rx.cmdData\n };\n if (protocolData.cmdtype == \"SensorDataNow\") {\n writeSensorDataNow2WebserverClient();\n }\n else if (protocolData.cmdtype == \... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Listener for debug mode: Saves variables to storage when the extension window is closed (this means the browser can be left open). | function addDebugListener() {
chrome.windows.onRemoved.addListener(winId => {
if (winId == windowId) {
chrome.storage.sync.set({
dailyCounts: dailyCounts,
lastUse: lastUse,
todayCount: todayCount
});
}
});
} | [
"function deactivate() {\n // this method is called when your extension is deactivated\n}",
"function saveUrlsOnWindowClosing(windowId) {\n chrome.storage.local.set({\"saved-urls\": urls}, null);\n}",
"function onClosed() {\n\t// dereference the window\n\t// for multiple windows store them in an array\n\t... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
======================================================================== 2. startServant: No existing servants were found, start a new servant. Get the EED public key. If the request fails the problem might be due to the EED certificate issue. ======================================================================== | function startServant(adviseLaunchInfo) {
showLoadingMessage(adviseLaunchInfo.translator.translate('LAUNCH_GET_PUBKEY'));
var eedTicket = adviseLaunchInfo.eedTicket,
eedURL = adviseLaunchInfo.eedURL,
pubKey = "",
pubKeyUrl = eedURL + '/execution/pubkey',
that = this;
... | [
"function start() {\n test();\n var httpService = http.createServer(serve);\n httpService.listen(ports[0], '0.0.0.0');\n\n var options = {\n key: key,\n cert: cert\n };\n var httpsService = https.createServer(options, serve);\n httpsService.listen(ports[1], '0.0.0.0');\n\n var ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Get indices of regular expression matches in the string. | function matchIndices(str, re) {
var result, indices = [];
while(result = re.exec(str)) {
indices.push(result.index); // Match found, push its index in the array
}
return indices; // return matches indices
} | [
"function allIndexOf(str, toSearch) {\n var indices = [];\n for (var pos = str.indexOf(toSearch); pos !== -1; pos = str.indexOf(toSearch, pos + 1)) {\n indices.push(pos);\n }\n return indices;\n}",
"function getIndicesOf(str, keywords) {\n\tvar searchlength = keywords.length;\n\tif (searchlength == 0) retu... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Set a mem address of a bitmask Generalizes all the "SET 2, (HL)" etc. instructions | setMem(bitmask) {
MMU.wb(regHL[0], MMU.rb(regHL[0]) | bitmask);
return 16;
} | [
"function setBit(number,i) {\n\treturn number | (1 << i);\n}",
"access(n, addr) {\n this.sets[addr.idx][n].access = 0;\n }",
"function setThirdBit(num) {\n\treturn (num | 4).toString(2)\n}",
"pollute(n, addr) {\n this.sets[addr.idx][n].dirty = true;\n }",
"function setargM( argz, name, p... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Called when user wants to save chosen application. It calls addApplication method of appscoapplicationaddsettings page. | _onAddApplication() {
this._showLoader();
this.$.appscoApplicationAddSettings.addApplication();
} | [
"_onApplicationSelect() {\n this._selected = 'appsco-application-add-settings';\n }",
"function setAppData(appData) {\n self.LApp.data = appData;\n $log.debug('success storing application data');\n }",
"function saveProgram() {\n var programName=programNameField.value;\... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
1.2 connect make the process of subscribling to store, checking for updated data, and triggering a rerender can be made more genetic c and resuable Each wrapper component is an individual subscriber to the Redux store | function connect(mapSteteToProps, mapDispatchToProps) {
return function(WrappedComponent) {
return class extends React.Component {
render() {
return (
<WrappedComponent
{...this.props}
{/*and addtitonal props calculated from redux store */}
{...mapSta... | [
"initConnectedComponent (withRef) {\n let result = connect(\n // note that we do not pass this.mapDispatchToProps directly since connect() needs to know that the function\n // has a single parameter, and this.mapDispatchToProps (being the result of calling bind() in the constructor) has zero para... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Sets up menu selection events. | function menuEvents () {
var chooseLibrary = document.getElementById('choose-library');
var viewArtists = document.getElementById('view-artists');
var viewAlbums = document.getElementById('view-albums');
var viewSongs = document.getElementById('view-songs');
chooseLibrary.addEventListener('click', emitEvent... | [
"function initSelection() {\n canvas.on({\n \"selection:created\": function __listenersSelectionCreated() {\n global.console.log(\"**** selection:created\");\n setActiveObject();\n toolbar.showActiveTools();\n },\n \"before:selection:cleared\": function __listenersBeforeSelectionCleared() {... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Implemet some performance test cases. The makeid function is from to generate 100 character string composed of characters picked randomly from the set [azAZ09] . | function makeid() {
var text = "";
var possible = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789";
for (var i = 0; i < 1000; i++) {
text += possible.charAt(Math.floor(Math.random() * possible.length));
return text;
}
} | [
"function generateIdChar(){\n var elegibleChars = \"abcdefghijklmnopqrstubwxyz\";\n var range = elegibleChars.length;\n var num = Math.floor(Math.random() * range);\n return elegibleChars.charAt(num);\n}",
"function makeGameId(){\n let result = '';\n let characters = 'ABCDEFGHIJKLMNOPQRS... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Opens the tab and returns the sheet name | function getTab(spreadsheetId,tabNumber) {
var tab = tabNumber;
var id = spreadsheetId;
var ss = SpreadsheetApp.openById(id);
var sheet = ss.getSheets()[tab];
sheet.activate();
Logger.log("readTab: " + sheet.getName());
return sheet;
} | [
"function openTab(sport){\n url = sport.concat(\"_calc.html\")\n const link = document.createElement('a');\n link.href = url;\n window.open(url, \"_self\");\n}",
"function gotoTab() {\n let url_string = window.location.href;\n let url = new URL(url_string);\n let tab = url.searchParams.get(\"... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Creates new Square.js at x, y | function genSquare(xP, yP) {
let s = new Square(xP, yP);
stage.addChild(s.view);
} | [
"function createSquare(x, y) {\ngameAreaContext.fillStyle = \"#568000\";\ngameAreaContext.fillRect(x * cellWidth, y * cellWidth, cellWidth, cellWidth)\n}",
"function Square() {}",
"constructor(x = 0, y = 0) {\n this.x = x; // position for x \n this.y = y; // position for y\n }",
"function add... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Get groups that userId is in | static async getByUser(userId) {
const result = await db.query(
`SELECT user_id, group_id
FROM user_groups
WHERE user_id = $1`,
[userId]);
return result.rows;
} | [
"userGroups (id) {\n return this._apiRequest(`/user/${id}/groups`)\n }",
"listGroupUsers (id) {\n assert.equal(typeof id, 'number', 'id must be number')\n return this._apiRequest(`/group/${id}/users`)\n }",
"function getGroupInfo(body){\n\t\treturn new Promise(function(resolve, reject) {\n\t\t\tvar s... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
when a post is deleted, decrement counter | function updateCategoryCountOnDelete (post) {
Categories.update({_id: {$in: post.categories}}, {$inc: {"postsCount": -1}}, {multi: true});
} | [
"function decrementCount(key) {\n if (counts[key] < 2) {\n delete counts[key];\n } else {\n counts[key] -= 1;\n }\n }",
"onDeleteClick(id){\r\n\t\tthis.props.removePost(id)\r\n\t}",
"async removePostFromUser(userId, po... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Setter for details The setter method is expecting a details sting The method will create a Details object and set the value to the detail string | set details(details) {
if (Lang.isNull(details)) return;
let detailsObj = new Details();
detailsObj.value = details;
this._study.details = detailsObj;
} | [
"setDetails ( googlePlaceDetails ) {\n this.phoneNumber = googlePlaceDetails.international_phone_number || 'unavailable';\n this.url = googlePlaceDetails.website || 'unavailable';\n this.detailsLoaded = true;\n }",
"get details() {\n if (this._study.details) {\n return th... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Internaul function to check variables role IDs aginst a role id array and see matching ones and return the name of the at one | function checkVariables(values, roles, i){ // Take in a role ID and see if it matches any of the IDs in the provided array of values, if it does, return the name, otherwise return undefined
const result = values.find( ({ id }) => id === roles[i] );
if (result === undefined) {
} else {
return result.n... | [
"function roleExists(roleName){\r\n for (i = 0; i < Z_ROLES.length; i++) {\r\n var z_userrole = Z_ROLES[i].toString().substring(0,25).trim();\r\n\t if(z_userrole.toUpperCase() == roleName.toUpperCase()) {\r\n return true;\r\n }\r\n }\r\n return false;\r\n}",
"function checkRoles(roles){... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
getEventArgs returns the event args from the transaction result, filtered by event_name. Returns the boolean `false` if no event with the given name was found. | function getEventArgs(transaction_result, event_name) {
for (var i = 0; i < transaction_result.logs.length; i++) {
var log = transaction_result.logs[i];
if (log.event == event_name) {
return log.args;
}
}
return false;
} | [
"function getEventAttendees(calendarName, eventid)\n{\n\tvar attendees = {\n\t\t\t'firstName': 'Test',\n\t\t\t'lastName': 'User'\n\t\t\t};\n\t\t\t\n\tvar myEvent = getEvent( calendarName, eventid );\n\t\n\treturn myEvent.attendees;\n}",
"function hasEvent(eventsNames, oneEvent){\n\t\t for (var i=0; i<eventsNam... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Create a channel which passes the react and receive results whenever react changes | createChannel(executeChannel = false) {
this.includeAggQuery();
// create a channel and listen the changes
const channelObj = manager.create(this.context.appbaseRef, this.context.type, this.react, 100, 0, false, this.props.componentId);
this.channelId = channelObj.channelId;
this.channelListener = channelObj.... | [
"createChannel() {\n\t\tlet depends = this.props.depends ? this.props.depends : {};\n\t\tvar channelObj = manager.create(depends);\n\n\t}",
"function setupChannel() {\n // Join the general channel\n generalChannel.join().then(function(channel) {\n print('Joined channel as <span class=\"me\">' + usernam... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Verifies that a value is a valid 65Hex Public Key string | function isValidPublicKey(value) {
if (typeof value == 'string') {
return /^[0-9a-f]{65}$/.test(value);
}
return false;
} | [
"validPublicKey(publicKey){}",
"function isValidHexCode(str) {\n\treturn /^#[a-f0-9]{6}$/i.test(str);\n}",
"validateKeyFormat(key) {\n if (key.split('-').length !== 3) {\n console.error('Invalid key format. Please try your command again.');\n process.exit(1);\n }\n ret... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Make a search tree from frequents for each list. Each node represents a prefix of a item text and contains the suggestions for that prefix. | function freqtreeInsert(tree, text, i) {
if (tree.items.length < nrOfSuggestions)
tree.items.push(text);
if (i >= Math.min(text.length, nrOfInitials))
return;
var c = text[i];
if (tree[c] == undefined)
tree[c] = {items: []};
freqtreeInsert(tree[c], text, i+1)
} | [
"function PrefixTrie() {\n\tthis._index = {};\n\tthis._root = new PrefixTrieNode();\n}",
"function makeLists() {\n\t// get reference to the list elements\n\tvar searchList = document.getElementById('searchList');\n\tvar selectedList = document.getElementById('selectedList');\n\n\t// iterate through the parsed dat... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Dispatches a pointer event on the current element if the browser supports it. | _dispatchPointerEventIfSupported(name, clientX, clientY, button) {
// The latest versions of all browsers we support have the new `PointerEvent` API.
// Though since we capture the two most recent versions of these browsers, we also
// need to support Safari 12 at time of writing. Safari 12 does... | [
"function PointerEventsPolyfill(t){if(this.options={selector:\"*\",mouseEvents:[\"click\",\"dblclick\",\"mousedown\",\"mouseup\"],usePolyfillIf:function(){if(\"Microsoft Internet Explorer\"==navigator.appName){if(null!=navigator.userAgent.match(/MSIE ([0-9]{1,}[\\.0-9]{0,})/)){if(parseFloat(RegExp.$1)<11)return!0}}... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
this gets the active stylesheet which has been set to disabled false | function getActiveStyleSheet() {
var i, a;
for(i=0; (a = document.getElementsByTagName("link")[i]); i++) {
if(a.getAttribute("rel").indexOf("style") != -1 && a.getAttribute("title") && !a.disabled) return a.getAttribute("title");
}
return null;
} | [
"disable_style() {\n this.enabledStyles.pop();\n }",
"function initStyleSwitcher() {\n var isInitialzed = false;\n var sessionStorageKey = 'activeStylesheetHref';\n var titlePrefix = 'style::';\n\n function handleSwitch(activeTitle) {\n var activeElm = documen... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
return a map of cids to how many miners count it as heads | get heads () {
const heads = {}
this.miners.forEach(m => {
const head = this.minersHeads[m]
if (!heads[head]) {
heads[head] = 0
}
heads[head]++
})
return heads
} | [
"getPlayersCardNums(state) {\n let players = (state || this).players, playerCardNums = {}\n for (let i in players) {\n if (players[i]) {\n playerCardNums[i] = players[i].cards.length\n }\n else {\n playerCardNums[i] = null\n }\n }\n return playerCardNums\n }",
"funct... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Executes a MySQL query to delete a artist specified by its ID. Returns a Promise that resolves to true if the artist specified by `id` existed and was successfully deleted or to false otherwise. | async function deleteArtistById(id) {
const [ result ] = await mysqlPool.query(
'DELETE FROM artist WHERE id = ?',
[ id ]
);
return result.affectedRows > 0;
} | [
"async function replaceArtistById(id, artist) {\n artist = extractValidFields(artist, ArtistSchema);\n const [ result ] = await mysqlPool.query(\n 'UPDATE artist SET ? WHERE id = ?',\n [ artist, id ]\n );\n return result.affectedRows > 0;\n}",
"async function deleteLikeById(id) {\n const [result] = awa... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Event handler for adding a new time zone | function handleAdd() {
if (selectedTimeZone) {
let newTimeZones = [...myTimeZones, selectedTimeZone]
setMyTimeZones(newTimeZones)
localStorage.setItem(TIME_ZONE_KEY, JSON.stringify(newTimeZones))
}
} | [
"function add_tz_to_fields() {\n add_user_tz();\n add_user_tz_to_form();\n format_exercise_date();\n}",
"function evAppendNewZone (event) {\n\tvar $button = $(event.target);\n\tvar $table = $button.parents('table');\n\tvar zn = getZoneCount();\n\taddZone();\n\t// zn is the number of the new zone\n\tvar $... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
add unique keys to the slot children (vue requires a unique key when the slot is the descendant of a transitiongroup) | addSlotKeys() {
this.$slots.default.forEach((item, index) => {
item.key = item.key!=null?item.key:index;
});
} | [
"function shiftSlotNodeDeeper(node) {\n if (!node.children) {\n return;\n }\n\n node.children.forEach((child) => {\n const vslotShorthandName = getVslotShorthandName(child);\n if (vslotShorthandName && child.name !== 'template') {\n const newSlotNode = cheerio.parseHTML('<template></template>')[0];... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Update the input for selected invitations | function updateSelectedInvitationsInput() {
// Loop through all the invitation checkbox and get the value
var selectedInvitations = [];
if (typeof($inputSelectedInvitations) != 'undefined' && $inputSelectedInvitations != null) {
$('.checkbox-invitation').each(function (i, obj) {
... | [
"function updateInvites() {\n var result = null;\n var xmlhttp = null;\n var element = document.getElementById('invitationsSection');\n\n if (window.XMLHttpRequest) {// code for IE7+, Firefox, Chrome, Opera, Safari\n\txmlhttp=new XMLHttpRequest();\n } else {// code for IE6, IE5\n\txmlhttp=new ActiveX... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
get name from fullname | function getName(fullname) {
let result = '';
const fullnameCut = fullname.split(' ');
result = fullnameCut[fullnameCut.length-1];
return result;
} | [
"function getFullName(first, middle, last) {\r\n\tvar fullname = first;\r\n\tif (middle) {\r\n\t\tfullname += \" \" + middle\r\n\t}\r\n\treturn fullname + \" \" + last;\r\n}",
"getNames( fullName ) {\n \"use strict\";\n // Return firstName, middleName and lastName based on fullName components ([0],[... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Converts the math node into a MathMLnamespaced DOM element. | toNode() {
const node = document.createElementNS("http://www.w3.org/1998/Math/MathML", this.type);
for (const attr in this.attributes) {
if (Object.prototype.hasOwnProperty.call(this.attributes, attr)) {
node.setAttribute(attr, this.attributes[attr]);
}
}
... | [
"toNode() {\n if (this.character) {\n return document.createTextNode(this.character);\n } else {\n const node = document.createElementNS(\"http://www.w3.org/1998/Math/MathML\", \"mspace\");\n node.setAttribute(\"width\", this.width + \"em\");\n return node;\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Update existing delivery profile. | static update(id, delivery){
let kparams = {};
kparams.id = id;
kparams.delivery = delivery;
return new kaltura.RequestBuilder('deliveryprofile', 'update', kparams);
} | [
"static update(id, distributionProfile){\n\t\tlet kparams = {};\n\t\tkparams.id = id;\n\t\tkparams.distributionProfile = distributionProfile;\n\t\treturn new kaltura.RequestBuilder('contentdistribution_distributionprofile', 'update', kparams);\n\t}",
"function updateDriver() {\n profileFactory.updateProfile(... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Output private & public part of the key in PKCS1 PEM format. | function _rsapem_privateKeyToPkcs1PemString() {
return hex2b64(_rsapem_privateKeyToPkcs1HexString(this));
} | [
"getPrivKey() {\n var output = PrivKeyAsn1.encode({\n d: this.key.priv.toString(10),\n }, \"der\")\n return output.toString('hex')\n }",
"showPrivateKey() {\n this.showKey(this.privateKey, true);\n }",
"async _publicKeyFromCertificate (crtPath) {\n let output = ''... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Get catecaches by categoryId | function getCateCacheByCategory() {
return new Promise((resolve, reject) => {
CateCache.findOne({ 'key': _categoryId }).exec((err, data) => {
if (err) return reject(err);
if (!data) return reject(err);
resolve(data.value);
})
});
... | [
"static get(id){\n\t\tlet kparams = {};\n\t\tkparams.id = id;\n\t\treturn new kaltura.RequestBuilder('category', 'get', kparams);\n\t}",
"function findByKeywordAndCategory() {\n getCateCacheByCategory()\n .then(catecaches => {\n // Check pagination\n _findQuery = _p... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
endregion region sendRenegotiationOffer Composes an SDP offer from the OFFER_READY media plugin event data and sends it to the server to renegotiate the AV session. | function sendRenegotiationOffer(sdp) {
var url = asSession.relatedHref('renegotiations');
assert(url, '"renegotiations" link is missing');
// cache operation id
var operationId = guid();
outAsRenegoOp... | [
"function sendOffer(offers) {\n assert(offers.length > 0);\n // construct content that contains all offers given by the media plugin\n function createOfferOptions(context) {\n var boundary = '9BCE36B8-2C7... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Walk through the MIME message structure and decrypt the body if there is something to decrypt | async decryptMimeTree(mimePart) {
EnigmailLog.DEBUG("persistentCrypto.jsm: decryptMimeTree:\n");
if (this.isBrokenByExchange(mimePart)) {
this.fixExchangeMessage(mimePart);
}
if (this.isSMIME(mimePart)) {
this.decryptSMIME(mimePart);
} else if (this.isPgpMime(mimePart)) {
this.de... | [
"function file_decrypt(username, message) {\n if (rtc.crypto_verified[username]) {\n hash = CryptoJS.SHA256(message).toString(CryptoJS.enc.Base64); \n \n message = RabbitCryptoJS.Rabbit.decrypt(JSON.parse(message),\n rtc.crypto_receive_symmetric_keys[username] ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
5. Define a function called evenNumbers that takes a random integer, from 0 to 100, and outputs all the even integers from 0 to that random number. | function evenNumbers (randomInteger) {
if ( randomInteger > 100 || randomInteger < 0){
return "number has to be between 0 and 100";
}
var even =[];
for (var i = 0; i <=randomInteger; i++) {
if (i%2 === 0) {
even.push(i);
}
}
return even
} | [
"function randomNegativeEvenNumber() {\n var randomNumber = getRandomIntInclusive(1,1000);\n if(randomNumber % 2 === 0) {\n return randomNumber;\n }\n\n return randomNegativeEvenNumber();\n}",
"function evenNumbers(numbers) {\n return numbers % 2 == 0;\n\n}",
"function even(){\n var eve... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
==========Today and future date function end here======== /==========Start and end time valid function start here======== | start_end_date($eve) {
var beginningDate = this.newRequestForm.value.event_start_date;
var endDate = this.newRequestForm.value.event_end_date;
if (beginningDate > endDate) {
this.newRequestForm.controls['event_start_date'].setValue('');
this.newRequestForm.controls['event... | [
"function isTestSchedule()\r\n{\r\n\t//alert (\"aaa\");\r\n\tvar currentTime=new Date();\r\n\t//console.log(currentTime + \" - \" + myQaObj.quizObj.startTime + \" - \" + myQaObj.quizObj.endTime);\r\n\tvar uStartTime = ((myQaObj.quizObj.startTime).split(\"-\")).join(\"/\");\r\n\tvar uEndTime = ((myQaObj.quizObj.endT... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
end set attribute form div remove label form | function myFunctionLabel(){
const labelForm = document.querySelector('.screen-reader-text');
const elementLabel = document.getElementsByTagName('label')[0];
elementLabel.setAttribute('id', 'label-id');
elementLabel.remove();
} | [
"function clickClearWarnings(label) {\n $(label + ' #input').validate().resetForm()\n $(\"div.ui-tooltip\").remove();\n}",
"function removeFormField() \n{\n\tid = parseInt(jQuery(\"#cont\").val());\n\tif(id >= 0){\n\t\tid = id - 1;\n\t\t\n\t\t/* pega valor inicial pelas ids dos elementos e guarda em vaiaveis */... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Create an entry and attach files if there are any | async function createEntry(model, entry, files) {
try {
const createdEntry = await strapi.query(model).create(entry);
if (files) {
await strapi.entityService.uploadFiles(createdEntry, files, {
model
});
}
} catch (e) {
console.log(e);
}
} | [
"async function createEntry({ model, entry, files }) {\n try {\n if (_.has(entry, 'files') || _.has(entry, 'featured_image') || _.has(entry, 'logo')) {\n delete entry.files;\n delete entry.featured_image;\n delete entry.logo;\n }\n\n if (model === 'article' || model === 'destination' || mod... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Tests that getCountriesByE164Code works correctly if multiple entries have the same e164_cc code. | function testGetCountriesByE164Code_multipleMatches() {
var countries = firebaseui.auth.data.country.getCountriesByE164Code('44');
var actualKeys = countries.map(function(country) {
return country.e164_key;
});
assertSameElements(['44-GG-0', '44-IM-0', '44-JE-0', '44-GB-0'], actualKeys);
} | [
"function testGetCountriesByIso2_multipleMatches() {\n var countries = firebaseui.auth.data.country.getCountriesByIso2('xk');\n var actualCodes = countries.map(function(country) {\n return country.e164_cc;\n });\n assertSameElements(['377', '381', '386'], actualCodes);\n}",
"function getCountryNames(){\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
To keep things simple, series ['cpu','memory','disk'] have been assumed Create graph using Chart.JS. Inserts html needed into page, creates JSON object and initializes graph | function createGraph(canvas){
var data={};
data["labels"]=[];
data["datasets"]=[];
var data_array=[];
for (var i=0; i<20; i++){
data.labels.push("");
data_array.push(0);
}
var categories = ['cpu','memory','disk'];
var colors = ['#f44336','#3f51b5','#4caf50']
for (var i = 0; i < categories.l... | [
"createGraph (){\n let selector = document.getElementById('container-graph');\n let html = '';\n let array = this.arrayDataObjects;\n for (let key in array) {\n this.createElementGraph(selector, `chart-${key}`);\n let title = array[key].title;\n let total = array[key].total;\n let it... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Checks whether the given userId refers to a Google user and calls the callback. Note that the callback will be called with the error information (if any) and the result of the query, if successful. | function isGoogleUser(userId, callback) {
var query =
'SELECT user_id ' +
'FROM GOOGLE_CREDENTIALS ' +
'WHERE user_id = $1 ';
db.query(query, {
bind: [userId]
})
.spread(function (results, metadata) {
// cast the result as a boolean: if a row was ... | [
"function validateId(user_id, callback){\n\tvar sel_q = \"SELECT id, user_name, xp_sent, xp_received, send_count, receive_count, last_activity FROM spg_users WHERE id = \" + user_id;\n\tc.query(sel_q, function(err, rows, fields) {\n\t\tr_val = {is_valid:false,user_obj:{}};\n\t\tif (!err) {\n\t\t\tif (rows.length ==... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Edit anime in the table | function editAnime(e){
const rowId = e.parentNode.parentNode.id;
var title = document.getElementById(rowId).cells[0];
var rating = document.getElementById(rowId).cells[1];
var status = document.getElementById(rowId).cells[2];
var comment = document.getElementById(rowId).cells[3];
// toggle edi... | [
"updateTable() {\n\t\tthis.manager.get(\"WWSUanimations\").add(\"announcements-update-table\", () => {\n\t\t\tif (this.table) {\n\t\t\t\tthis.table.clear();\n\t\t\t\tthis.find().forEach((announcement) => {\n\t\t\t\t\tthis.table.row.add([\n\t\t\t\t\t\tannouncement.title,\n\t\t\t\t\t\tannouncement.type,\n\t\t\t\t\t\t... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Renders the Dropdown input box for news outlets | render() {
//Grab all available news outlets and their names
const options = () => {
return(
Object.keys(newsFeeds).map(outlet => {
return(
<option value={outlet} key={outlet}>{newsFeeds[outlet].label}</option>
)... | [
"renderNewsTopicDropDown() {\n //Map and render the available feeds / topics\n const options = (outlet) => {\n return (\n Object.keys(newsFeeds[outlet].feeds).map(feed => {\n return (\n <option value={feed} key={feed}>{newsFeeds[outle... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Get configuration model for a given microservice identifier. | function getConfigurationModel(axios$$1, identifier) {
return restAuthGet(axios$$1, 'instance/microservice/' + identifier + '/configuration/model');
} | [
"function getGlobalConfiguration(axios$$1, identifier) {\n return restAuthGet(axios$$1, 'instance/microservice/' + identifier + '/configuration');\n }",
"GetConfig () {\n return { type: types.GET_CONFIG }\n }",
"function getTenantConfiguration(axios$$1, tenantToken, identifier) {\n return restAuthGet... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Returns true if any element of the iterable object is true. | function any( iterable )
{
var res = false;
foreach(function (x)
{
if ( x )
{
res = true;
throw StopIteration;
}
},
iterable);
return res;
} | [
"function all( iterable )\n {\n var res = true;\n \n foreach(function (x)\n {\n if ( !x )\n {\n res = false;\n throw StopIteration;\n }\n },\n iterable);\n \n return res;\n }",
"function every(array, value) {\n var boolean = true;\n array.forEach(el => {\n if (e... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Function to run the Bubble Sort function when an element is clicked. | function clicked(){
sorter(numbers);
} | [
"function bubbleSort(arr) {\n\n}",
"function sortAjax(e) {\n genericAjax();\n}",
"function selectionSort()\n{\n\tfor (var i = 0; i < dataArray.length; i++)\n\t\t{\n\t\tsSort(i);\n\t\tsleep(500);\n\t\tredraw();\n\t\t}\n}",
"insertionSort() {\r\n // eslint-disable-next-line\r\n if (this.disable... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Checks only if header is visible, if yes > close it. | function scrollCheck() {
if ($("header").is(":visible")) {
closeMenu();
}
} | [
"function checkMenu() {\n if ($(\"header\").is(\":visible\")) {\n closeMenu();\n } else {\n openMenu();\n }\n}",
"function scrollCheck() {\n if (document.body.scrollTop > height) {\n animateHeader = false;\n } else {\n animateHeader = true;\n }\n}",
"function hsCollapseAllVisible... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
prefills milestone edit forms | function prefillEditForm(ttl, desc, pri, comp, dcomp) {
$("#id_title","#editmilestoneform").val(ttl);
$("#id_title","#editmilestoneform").val(ttl);
$("#id_description", "#editmilestoneform").val(desc);
$("#id_private", "#editmilestoneform").val(pri);
$("#id_completed", "#editmilestoneform").val(comp);
$("#id_date... | [
"function editMilestone(vTaskID) {\n var tempTaskItem = JSGantt.LookUpTask(vGanttChart, vTaskID);\n $('#alertMilestone').hide();\n $('#milestoneName').val(tempTaskItem.getName);\n $('#milestoneDate').val(\n (tempTaskItem.getStart().getMonth() + 1) + '/'\n + tempTaskItem.getStart().getDate() + '/'\... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Function to detect a win with 4 in a column | function columnWin() {
for (var column = 0; column < 7; column++) {
var streak = 1;
var previousPlayer;
var previousPlayer = null;
var currentColumn = document.querySelectorAll(`[data-column='${column}']`);
for (var cell = 0; cell < currentColumn.length; cell++) {
var currentPlayer = current... | [
"function checkRowForWin() {\n var i, totalCount = 1;\n var leftSideComplete = false;\n var rightSideComplete = false;\n var cells = [];\n var row, col;\n \n for(i = 1; i < _config.col; i++){\n \n if (_config.... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
List cue point objects by filter and pager. | static listAction(filter = null, pager = null){
let kparams = {};
kparams.filter = filter;
kparams.pager = pager;
return new kaltura.RequestBuilder('cuepoint_cuepoint', 'list', kparams);
} | [
"static listAction(filter = null, pager = null){\n\t\tlet kparams = {};\n\t\tkparams.filter = filter;\n\t\tkparams.pager = pager;\n\t\treturn new kaltura.RequestBuilder('livechannelsegment', 'list', kparams);\n\t}",
"static listAction(filter = null, pager = null){\n\t\tlet kparams = {};\n\t\tkparams.filter = filt... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
This function will search for the first time a number appears in the game map string and will truncate the game map string to ignore everything that occurs before the first number (including the first number itself). This function will then return the first number in the game map string as an int. | function parseNum(){
var pattern = /[0-9]+/;
//If the we have set text to be the game map string, then we execute the following code.
if(text){
//This sets result to be either null (if the pattern was not found), or a string of
// what we are looking for. It parses text, looking for patt... | [
"function firstOcc(string, character) {\n for (var i = 0; i < string.length; i++) {\n if (string[i] === character) {\n return i;\n }\n }\n return -1;\n}",
"function findLastNumber(str) {\n for (let i = str.length - 1; i >= 0; --i) {\n const code = str.charCodeAt(i);\n if (... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
from better error messaging than gm.toBuffer() | function gmToBuffer (data) {
return new Promise((resolve, reject) => {
data.stream((err, stdout, stderr) => {
if (err) { return reject(err) }
const chunks = []
stdout.on('data', (chunk) => { chunks.push(chunk) })
// these are 'once' because they can and do fire multiple times for multiple ... | [
"* genFromBuffers (opts) {\n opts = opts === undefined ? {} : opts\n let res\n res = yield * this.expect(4)\n this.magicNum = new Br(res.buf).readUInt32BE()\n if (opts.strict && this.magicNum !== this.constants.Msg.magicNum) {\n throw new Error('invalid magicNum')\n }\n res = yield * this.... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Ajoute l'anime dans le select "liste" | function ajouterAnime(anime,liste){
liste.append('<option value=' + anime.id + '>' + anime.titre +'</option>');
} | [
"function ajouterListe(l,liste){\n liste.append('<option value=' + l.id + '>' + l.name +'</option>');\n}",
"function miseAjourDesSelecteurDeJoueurs () {\n $(\"#joueurs > td > select > option\").remove();\n\n $(\"#joueurs > td > select\").each(function (index) {\n let me = $(this);\n let opt... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
stops the heartbeat and displays the game over message | function stopHeartbeat() {
GAME_OVER = true;
addMessage("Game over! Score: &e0", "error");
delete_cookie("chocolateChipCookie");
clearInterval(nIntervId);
} | [
"function gameLose() {\n gameState.active = false;\n gameReset();\n var startBtn = \"Retry\";\n var startText = \"<div class=\\\"splashtext\\\">You died :(</div>\";\n gamescreen(startBtn, startText);\n}",
"function messageLosing() {\n\n $(`<section class=\"game-over\"><div class=\"message-bo... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
get object based on position | function getObject(position,array){
for (var i of array){
if (i.pos == position){
return i;
}
}
} | [
"function findObject(index) {\n return repository[index];\n }",
"get(pos) {\n let items = this.items;\n if (pos < 0 || pos >= items.length)\n return;\n return items[pos];\n }",
"posById(id){\n let slot = this._index[id];\n return slot ? slot[1] : -1\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Returns the canonical form of a locale name lowercase with `_` replaced with ``. | function normalizeLocale(locale) {
return locale.toLowerCase().replace(/_/g, '-');
} | [
"function makeStandardJSName(s){\n return s.replace(/_([a-z])/g, function (g) { return g[1].toUpperCase(); });\n }",
"function camelize(name, forceLower){\n if (firstDefined(forceLower, false)) {\n name = name.toLowerCase();\n }\n return name.replace(/\\-./g, function(u){... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Function to load View for a given year and ICDCode | function loadViewForYear(jahr, icd, description) {
// Set sideNav to false
sideNav = false;
// show details div
$('#some-details').show();
$('#pieChart').show();
// Set new headers
setAllHeaders(icd, description, "", jahr);
// Add Year Overview Button
addYearOverviewButton();
// Add button... | [
"function loadViewForAllYears(icd, text) {\r\n\r\n\t// set sideNav to true\r\n\tsideNav = true;\r\n\r\n\r\n\r\n\t// Hide tooltip to prevent it from staying after click\r\n\t$(this).tooltip('hide');\r\n\r\n\tsetSectionHeader(\"2000 - 2014\");\r\n\r\n\t// remove stacked barchart\r\n\tremoveBarChart(960, 500);\r\n\r\n... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Factory to deescape a value, based on a list at `key` in `ctx`. | function factory(ctx, key) {
return unescape;
/* De-escape a string using the expression at `key`
* in `ctx`. */
function unescape(value) {
var prev = 0;
var index = value.indexOf('\\');
var escape = ctx[key];
var queue = [];
var character;
while (index !== -1) {
queue.push(valu... | [
"function SanitizeCtx(ctx) {\n let r = {};\n for (const key in ctx) {\n if (!key.startsWith('_')) {\n r[key] = ctx[key];\n }\n }\n return r;\n}",
"function setLiteral(source, key, rules) {\n const item = (source[key] || { type: 'literal' });\n item.rules = rules;\n source[key] = item;\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Creates a new MorphTarget | function MorphTarget(/** defines the name of the target */name,influence,scene){if(influence===void 0){influence=0;}if(scene===void 0){scene=null;}this.name=name;/**
* Gets or sets the list of animations
*/this.animations=new Array();this._positions=null;this._normals=null;this._tangents=null;... | [
"function MorphTargetManager(scene){if(scene===void 0){scene=null;}this._targets=new Array();this._targetInfluenceChangedObservers=new Array();this._targetDataLayoutChangedObservers=new Array();this._activeTargets=new BABYLON.SmartArray(16);this._supportsNormals=false;this._supportsTangents=false;this._vertexCount=... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |