query stringlengths 9 34k | document stringlengths 8 5.39M | negatives listlengths 19 20 | metadata dict |
|---|---|---|---|
Format score in k (thousands) format | function FormatScore(score) {
return score.substring(0, score.length-3)+"k";
} | [
"formatScore(leveledScore) {\n return Math.round(leveledScore.score*100)/100;\n }",
"function kmFormatter(v, axis){\r\n\treturn v.toFixed(axis.tickDecimals) + \" km\";\r\n}",
"formatLevel(leveledScore) {\n return leveledScore.level;\n }",
"formatFee(leveledS... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
lastchange by wujuhui 201919 / The js file have function as follows createPie(provinceName,peopleData) // in order to create pie and show on tip | function createPie(provinceName, peopleData) {
var dataset = [];
var percentage = [];
var peopleNum; //提升变量为了检测是否为无数据,以便于不显示饼图
peopleData.forEach(function (d, i) {
if (d.provinceName == provinceName) {
peopleNum = d.peopleNum
var menNum = parseInt(d.menNum)
... | [
"function drawProvincesPieChart() {\n const data = new google.visualization.DataTable();\n data.addColumn('string', 'Ethnic Group');\n data.addColumn('number', 'Count');\n data.addRows(CHINA_PROVINCES_TABLE);\n\n const options = {\n title: CHARTS_TITLES.MINORITIES_PIE_CHART,\n width: 700,\n... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Gets the user profile of the current user. | get userProfile() {
return spPost(ProfileLoaderFactory(this, "getuserprofile"));
} | [
"get ownerUserProfile() {\n return spPost(this.getParent(ProfileLoaderFactory, \"_api/sp.userprofiles.profileloader.getowneruserprofile\"));\n }",
"function getUserInfo() {\n return user;\n }",
"function getStoredFBProfile() {\n return window.localStorage.getItem(globalValues.... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
format the action URI for a client event | function formatActionURiClient(resource) {
return (ev.STR.SERVICE_NAME + '/' + resource).toLowerCase();
} | [
"function formatActionURI(req) {\n\t\tconst str = getFirstAction(req);\n\t\tif (str) {\n\t\t\tconst parts = str.split('.');\n\t\t\tif (parts && parts.length >= 2) {\n\t\t\t\treturn (parts[0] + '/' + parts[1]).toLowerCase();\n\t\t\t}\n\t\t}\n\t\treturn ev.STR.SERVICE_NAME + '/' + get_last_word_in_path(req);\t\t\t// ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Return an object of all brews, according to type. | function loadBrewsByType(brewList) {
// These are all know types of brews on tap at various bars; some may be
// empty.
var brews = {
brewDogBeers: [],
guestBeers: [],
ciders: [],
craftyDevilTakeover: [],
};
var ranges = getRanges(brewList);
if (ranges) {
// Brutely check through each ... | [
"findAllTI(type, instance) {\n\t\tlet query = { type, instance, group: 0 };\n\t\tlet index = bsearch.lt(this.records, query, compare);\n\t\tlet out = [];\n\t\tlet record;\n\t\twhile (\n\t\t\t(record = this.records[++index]) &&\n\t\t\trecord.type === type &&\n\t\t\trecord.instance === instance\n\t\t) {\n\t\t\tout.pu... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
This module.. can get confused with the AIC module (AIC module is the rainonly sensor) Broadcast: Light control status | function decode_light_control_status(data) {
data.command = 'bro';
data.value = 'light control status - ';
// Examples
//
// D1 D2
// 11 01 Intensity=1, Lights=on, Reason=Twilight
// 21 02 Intensity=2, Lights=on, Reason=Darkness
// 31 04 Intensity=3, Lights=on, Reason=Rain
// 41 08 Intensity=4, Lights=on... | [
"controlViaOnOff() {\n console.log(\"entrou ONOFF\")\n this.output = this.getTemp() < this.setpoint ? 1023 : 0;\n this.board.pwmWrite(19 , 0, 25, 10, this.output);\n }",
"function Light_2(){\n this.brightness = 0;\n this['turnon'] = function turnon (){\n this.brightness += 1 ;\n }\n this['turnoff... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
function to handle the logic behind making multiple getBlock calls. Takes head block number and iterates back 10 blocks, passing in each block number as a parameter to getBlock | async function loopBlocks(headBlockNumber){
try {
let blockList = [];
let delay = 50;
for (let callNumber = 0; callNumber <= 10; callNumber++){
//uses helper function to time out each endpoint call. without helper function, endpoint returns overload error
await setAsy... | [
"async blocks(n = 1, prevHash, blocks = []) {\n if(n == 0) return blocks\n\n const hash = prevHash || await bitcoind.call('getbestblockhash')\n\n const block = await this.getBlock(hash)\n\n blocks.push(block)\n\n return await this.blocks(n-1, block.prevhash, blocks)\n }",
"function getNextBlock ()... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Create a connection details contract from connection credentials. | static createConnectionDetails(credentials) {
let details = new connection_1.ConnectionDetails();
details.options['host'] = credentials.host;
if (credentials.port && details.options['host'].indexOf(',') === -1) {
details.options['port'] = credentials.port;
}
details.o... | [
"function createConnection(config) {\r\n return new Connection(config).connect();\r\n}",
"function createFromConnectionConfig(config) {\n ConnectionConfig.validate(config, { isEntityPathRequired: true });\n config.getManagementAudience = () => {\n return `${config.endpoint}${config.ent... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Given a RoomKeyRequest, cancel it and delete the request record unless andResend is set, in which case transition to UNSENT. | _sendOutgoingRoomKeyRequestCancellation(req, andResend) {
_logger.logger.log(`Sending cancellation for key request for ` + `${stringifyRequestBody(req.requestBody)} to ` + `${stringifyRecipientList(req.recipients)} ` + `(cancellation id ${req.cancellationTxnId})`);
const requestMessage = {
action: "reque... | [
"function cancelMentorshipRequest() {\n return confirm(\"Are you sure you want to cancel your ongoing Mentorship Request?. No record of your current application will be kept.\");\n}",
"function cancelQuery() {\n if (cwQueryService.currentQueryRequest != null) {\n var queryInFly = mnPendingQueryKeep... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Attempt to create a function to forge a public key based on a private key using nodeforge | function forgeKey(privateKey) {
return function() {
// convert PEM-formatted private key to a Forge private key
const forgePrivateKey = forge.pki.privateKeyFromPem(privateKey);
// get a Forge public key from the Forge private key
const forgePublicKey = forge.pki.setRsaPublicKey(
forgePrivateKey.... | [
"function genKeys(cb){\n // gen private\n cp.exec('openssl genrsa 368', function(err, priv, stderr) {\n // tmp file\n var randomfn = './' + Math.random().toString(36).substring(7);\n fs.writeFileSync(randomfn, priv);\n // gen public\n cp.exec('openssl rsa -in '+randomfn+' -pubout', fu... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Name: get_uiMode Purpose: Wrapper function for getting current uiMode of the Media Player. | function get_uiMode()
{
// Note: Per WMP SDK, uiMode is a string: "none", "mini", "full"
// If accessing the old 6.4 properties
if (fHasWMP64)
{
if (MediaPlayer.ShowControls==false &&
MediaPlayer.ShowTracker==false &&
MediaPlayer.EnableTracker==false && ... | [
"getMode() {\n errors.throwNotImplemented(\"getting mode (dequeue options)\");\n }",
"function determineMode() {\n\t\t\tswitch(gleam.campaign.campaign_type) {\n\t\t\t\tcase \"Reward\": return \"undo_all\"; // Instant-win\n\t\t\t\tcase \"Competition\": return \"undo_none\";\t// Raffle\n\t\t\t\tdefault: return ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
2: Show me how to get an array of items that cost between $14.00 and $18.00 USD | function question2() {
let cost = [];
for (i = 0; i < data.length; i++) {
let value = data[i].price;
if (value >= 14 && value <= 18)
cost.push(value)
}
console.log(cost)
} | [
"function priceHeavierThan(num){\ngreaterThanNum = [] \nfor (i=0; i < products.length; i++ ){\n if (products[i].weight >= num){\n greaterThanNum.push(products[i]);\n } else {\n continue;\n }\n}\nreturn greaterThanNum;\n}",
"function getDetails(money) {\n // let salePriceArray = Object.values(sale... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Apply an UTF8 transformation if needed. | handleUTF8() {
var decodeParamType = support.uint8array ? "uint8array" : "array";
if (this.useUTF8()) {
this.fileNameStr = utf8decode(this.fileName);
this.fileCommentStr = utf8decode(this.fileComment);
} else {
var upath = this.findExtraFieldUnicodePath();
... | [
"function ConvertToUTF8(text) {\r\n var t = text;\r\n t = ReplaceAll(t, \"è\", \"\\u00e8\");\r\n t = ReplaceAll(t, \"à\", \"\\u00e0\");\r\n t = ReplaceAll(t, \"ù\", \"\\u00f9\");\r\n return t;\r\n}",
"function make_unicode(data) {\r\n var table = { 13: '\\r' }, // New line conversion... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
send hlr for gsm number of current user | function sendHlrExample(oProfile) {
if(oProfile.getAttr('gsm','') == '') {
oProfile.setAttr('gsm',
prompt("Your profile GSM number is unspecified.\nEnter GSM number",oProfile.getAttr('gsm',''))
);
}
log("Check roaming status of GSM number <b>" + oProfile.getAt... | [
"function countTrouserMwiPlus() {\n\t\t\tinstantObj.noOfTrouserMWI = instantObj.noOfTrouserMWI + 1;\n\t\t\tcountTotalBill();\n\t\t}",
"switchUser() {\n this.currentPlayer = this.currentPlayer == 1 ? 0 : 1;\n this.io.to(this.id).emit('g-startTurn', this.players[this.currentPlayer]);\n }",
"funct... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Define a new tag. If `parent` is given, the tag is treated as a subtag of that parent, and [highlighters](highlight.tagHighlighter) that don't mention this tag will try to fall back to the parent tag (or grandparent tag, etc). | static define(parent) {
if (parent === null || parent === void 0 ? void 0 : parent.base)
throw new Error('Can not derive from a modified tag')
let tag = new Tag([], null, [])
tag.set.push(tag)
if (parent) for (let t of parent.set) tag.set.push(t)
return tag
} | [
"function add(node, parent) {\n var children = parent ? parent.children : tokens;\n var prev = children[children.length - 1];\n\n if (\n prev &&\n node.type === prev.type &&\n node.type in MERGEABLE_NODES &&\... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Render the template, injecting the file into `page.file`. Switch templates by settings `meta.template` on the file. Template variables: page: Vinyl object page.meta: Frontmatter properties page.tree: Site tree page.subtree: Subtree rooted at this file page.contents: Main content of the current page The nodes in the tre... | function render_tmpl() {
var cache = {};
var compile_template = function (filename) {
return Q
.fcall(function () {
if (cache[filename]) return cache[filename];
plugins.util.log('loading template: ' + filename);
return Q
.nfcall(fs.readFile, filename)
.then(function (tmpl_content) {
... | [
"function render(file, context, options, callback) {\n winston.verbose('rendering: ' + file);\n options = options || {};\n options.cache = options.cache || objCache;\n options.cacheKey = file;\n options.hoganOptions = options.hoganOptions || {};\n\n getTemplate(file, options, function(err, t) {\n callback(... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
FUNCTIONS FOR SCHEDULE Initialize the create schedule page by hiding the practice event creation form | function loadCreateSchedule() {
document.getElementById('practice-other-form').style.display = 'none';
} | [
"function cronJobCreateForm() {\n log(COL_TIMESTAMP, new Date())\n // Check for scheduled lessons from Wed to Wed\n var from = new Date();\n from.setDate(from.getDate() - from.getDay() + 3); // Get Wednesday of current week\n Logger.log('from %s', from.toString())\n var until = new Date(from);\n until.setDat... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Clear token array and set timer. | initTokens() {
while (this.tokens.length > 0 && Date.now() > this.tokens[0].expires) this.tokens.shift();
if (this.tokens.length > 0) {
Timers.token.start(this.tokens[0].expires);
} else {
Timers.token.stop();
}
//Sort by expriation.
this.tokens.sort((a, b) => a.expires - b.expires);
... | [
"restartTokenDetection() {\n if (!this.selectedAddress) {\n return\n }\n // this.detectedTokensStore.putState({ tokens: [] })\n this.detectNewTokens()\n this.interval = DEFAULT_INTERVAL\n }",
"reset () {\n this.total = this.seconds * 1000.0;\n this._remaining = this.total;\n this._cl... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
object.fire(element, eventName[, memo]) > Event memo (?): Metadata for the event. Will be accessible through the event's `memo` property. Fires a custom event of name `eventName` with `element` as its target. | function fire(eventName){
var memo = $A(arguments), eventName = memo.shift();
memo.unshift(this);
returning(this, function(){
if (!this._eventHandlers || !this._eventHandlers[eventName]) return;
this._eventHandlers[eventName].each(function(handler) {
if (Object.isFunction(handler)) handl... | [
"function simulateEvent($event, eventElement) {\n $(eventElement).trigger($event);\n}",
"fire(name, ...args) {\n if (this._cb.hasOwnProperty(name)) {\n this._cb[name](...args);\n }\n }",
"trigger( event, data ) {\n var listeners, listener;\n\n listeners = this._listeners[ event ];\n... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
_unsafe_. The cancelation exception. User code should never throw this exception as it cannot be caught (but it is respected by `finally` blocks). It is used internally to `finalize` effect handlers that do not resume. | function unsafe_cancel_exn() /* () -> exception */ {
return exception("computation is canceled", Cancel);
} | [
"function errorCancel() {\n vm.onErrorCancel();\n }",
"verifyNotTerminated() {\n if (this.asyncQueue.isShuttingDown) throw new K(q.FAILED_PRECONDITION, \"The client has already been terminated.\");\n }",
"function rejected(x){\n\t if(async) context = cat(future.context, cat(asyncContext, context)... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
========= ModConfirmResponseLinkExamToGrades ================ PR20220614 PR20230502 | function ModConfirmResponseLinkExamToGrades(response) {
console.log(" --- ModConfirmResponseLinkExamToGrades --- ");
// hide loader
el_confirm_loader.classList.add(cls_hide)
const has_grades = response.response_link_exam_has_grades
// el_confirm_msg_container.classList.add("border... | [
"function ModConfirm_link_exam_to_grades_Open() {\n console.log(\" ----- ModConfirm_link_exam_to_grades_Open ----\")\n\n // values of mode are : \"delete\", 'json', 'copy', 'save'\n // values of table are : \"ete_exam\" \"duo_exam\" 'duo_grade_exam'\n\n mod_dict = {mode: \"link_exam_t... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
deletes a tour date from the "tours" db | function destroy(id) {
return db.none(`DELETE FROM tours WHERE id=$1`, [id]);
} | [
"delete_reservation(attraction, account_id, res_time, res_date) {\n let sql = \"DELETE FROM reservations WHERE attractionRideName=$attraction AND time=$time AND date=$date AND user=$user\";\n this.db.run(sql, {\n $attraction: attraction,\n $time: res_time,\n $date: res... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Returns the exclusive mode options. | function getExclusiveModeOptions(ModeIcon, modes, selectedModes) {
const {
exclusiveModes
} = modes;
return supportedExclusiveModes.filter(({
mode
}) => exclusiveModes && exclusiveModes.includes(mode)).map(({
isActive,
label,
mode
}) => ({
id: mode,
selected: !selectedModes.some(_i... | [
"function getModeOptions(ModeIcon, modes, selectedModes, selectedCompanies, supportedCompanies) {\n return {\n primary: getPrimaryModeOption(ModeIcon, selectedModes),\n secondary: getTransitCombinedModeOptions(ModeIcon, modes, selectedModes, selectedCompanies, supportedCompanies),\n tertiary: getExclusive... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
replace all instances of _ with , for topic display | function commas(text)
{
return text.replace(/_/g, ", ");
} | [
"function removeUnderscores() {\n for (i = 0; i < 4; i++) {\n var catBtnText = $(\"#categoryBtn-\" + i).text();\n var formattedText = catBtnText.replace(/_/g, \" \");\n $(\"#categoryBtn-\" + i).text(formattedText);\n }\n }",
"function addunderscores( str ){ return... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Replace the contents of our game board with that given to us in the SYNC message. | function replaceGameBoard(syncMsg)
{
if (typeof (syncMsg) == 'undefined' || syncMsg == null)
throw "The SYNC message is unassigned."
// Remote paddle.
syncRemotePaddle(syncMsg);
// The ball.
syncBall(syncMsg);
// The bricks.
syncBricks(syncMsg);
// The scores.
syncScores(syn... | [
"sync_nearby ()\n {\n loot.CallRemoteCell('loot/sync/basic', this.cell.x, this.cell.y, JSON.stringify(this.get_basic_sync_data()));\n }",
"function updateBoard(index, marker) {\r\n board[index] = marker;\r\n\r\n /* HTML5 localStorage only allows storage of strings - convert our array to a string */... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
increment hits of specified key(or ip) | function incr(key, done) {
const _done = _.isFunction(done) ? done : _.noop;
hit(key, 1, false, _done);
} | [
"function hit(key, increment, reset, done) {\n // build criteria\n const criteria = ({ key });\n const updates = (\n reset ?\n ({ $set: { hits: increment || 0 } }) :\n ({ $inc: { hits: increment || 1 } })\n );\n const options = ({ upsert: true, new: true, setDefaultsOnInsert: true });\... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Value of the Age header, in seconds, updated for the current time. May be fractional. | age() {
let age = this._ageValue();
const residentTime = (this.now() - this._responseTime) / 1000;
return age + residentTime;
} | [
"function getAge(itemAge) {\n return Math.round((Date.parse(currentUTCTime) - Date.parse(new Date(itemAge.concat('Z')))) / 60000);\n}",
"age() {\n\t\tif (this._lastRun.time) {\n\t\t\treturn (Date.now() - this._lastRun.time) / 1000;\n\t\t}\n\n\t\treturn 0;\n\t}",
"getAge(millisec) {\n\n var seconds = (mi... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Recursive function to iterate through all the clients by calling getClientsPage | async function getClients(management, pagination) {
let allClients = [];
var clientPage = await getClientPage(management,pagination)
allClients.push( clientPage );
if ( clientPage.length > 0 ) {
pagination.page = pagination.page + 1;
console.log ( 'We got ' + clientPage.length + ' result... | [
"function iterateServersFunction( folderFunction ){\r\n\r\n\tvar service = Components.classes[\"@mozilla.org/messenger/account-manager;1\"]\r\n\t\t.getService(Components.interfaces.nsIMsgAccountManager);\r\n\t\r\n\tvar servers = service.allServers;\r\n\r\n\tvar alreadyProcessed = new Object();\r\n\r\n\tfor( var k =... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Adds an warning issue | function warning(message) {
command_1.issue('warning', message);
} | [
"warn(entry) {\n this.write(entry, 'WARNING');\n }",
"function addWarnings(warnings) {\n const existingWarnings = store.getters.warnings.concat();\n const existingCodes = existingWarnings.map((e) => e.code);\n const newWarnings = (warnings || []).filter((e) => existingCodes.indexOf(e.code) === -1);\n\n if... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Resolve port from requested property. | function resolvePort(type, property, value) {
var availablePorts = type === 'output' ? outputPorts : inputPorts,
length = availablePorts.length,
resolvedPorts = [],
i;
// Go through each port and compare property.
for (i = 0; i < length; i++) {
// Check if port has the property and if it ma... | [
"function resolvePort(type, property, value) {\n var availablePorts = (type === 'output' ? outputs() : inputs()),\n resolvedPorts = [];\n\n // Go through each port and compare property.\n for (var i = 0; i < availablePorts.length; i++) {\n // Check if port has the property and if it matches the request.... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Renames the given table, giving it a new name. | function renameTable(tblData, tblName, newTblName, db, overwrite) {
if (overwrite) {
dropTable(tblData, newTblName, db);
}
tblData[newTblName] = tblData[tblName];
delete tblData[tblName];
executeSimpleSQL(db, "ALTER TABLE " + tblName +
" RENAME TO " + newTblName);
} | [
"renameTable(from, to) {\n this.pushQuery(\n `alter table ${this.formatter.wrap(from)} rename to ${this.formatter.wrap(\n to\n )}`\n );\n }",
"function rename(record) {\n record.updateWith(function () {\n if (record.name === oldFull) record.name = newFull;\n if (re... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Adds a real or virtual file. | addFile(fileName, value) {
if (value) {
const fo = SpigFiles.createFileObject(fileName, {virtual: true});
fo.spig = this;
fo.contents = Buffer.from(value);
return fo;
}
const fo = SpigFiles.createFileObject(fileName);
fo.spig = this;
return fo;
} | [
"function addFile(file) {\n files.set(file._template, file);\n fileView.appendChild(file.getTemplate());\n}",
"async function addFile(){\n\t\trouter.push(`/files/${filetype}/create${filetype}/${fileFolderID}`)\n\t}",
"addFile(fileName, fileType) {\n if (fileType == \"js\" || fileType == \"html\" ||... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Hardcode the height one both collapse elements and the whole accordion | _hardcodeDimensions() {
const currentHeight = this._current && this._current.getBoundingClientRect().height || 0;
let tallestHeight = 0;
// Hardcode the height of each collapse to allow CSS transition
this._elements.forEach(el => {
el.classList.remove('is-ready');
el.style.height = 'auto';
... | [
"function slideContentHeight() {\n var contentHeight = $('.active-content').height();\n $('.radio-slide-content').css('height', contentHeight + 25);\n }",
"function ShowAccordion() {\n // Hide other commands\n if (dojo.coords(\"divAppContainer\").h > 0) {\n dojo.replaceClass(\"divAppCont... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Original thought: Originally I thought O(n) or linear. I thought this ends up being linear because only one action is performed for the inner for loop each time. The inner for loop basically becomes a constant, so I'm dropping it. It's basically a for loop with a for loop inside of it that isn't actually needed. the br... | function breakTheLoop() {
for (let i = 0; i < 45; i++) {
for (let j = 1; j < 47; j++) {
console.log(i, j);
break;
}
}
} | [
"function anotherFunChallenge(input) {\n let a = 5; // O(1)\n let b = 10; // O(1)\n let c = 50; // O(1)\n\n for (let i = 0; i < input; i++) {\n let x = i + 1; // O(n)\n let y = i + 2; ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Determine whether the given properties match those of a `HttpRouteMatchProperty` | function CfnRoute_HttpRouteMatchPropertyValidator(properties) {
if (!cdk.canInspect(properties)) {
return cdk.VALIDATION_SUCCESS;
}
const errors = new cdk.ValidationResults();
if (typeof properties !== 'object') {
errors.collect(new cdk.ValidationResult('Expected an object, but received:... | [
"function CfnRoute_HttpPathMatchPropertyValidator(properties) {\n if (!cdk.canInspect(properties)) {\n return cdk.VALIDATION_SUCCESS;\n }\n const errors = new cdk.ValidationResults();\n if (typeof properties !== 'object') {\n errors.collect(new cdk.ValidationResult('Expected an object, but... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Gets the current progress based on the min, max, and current value. | function getProgress(min, max, value) {
if (min >= max) {
throw new RangeError("A progress range must have the min value less than the max value");
}
if (typeof value !== "number") {
return undefined;
}
if (value > max || value < min) {
throw new RangeError("A progress value ... | [
"_updateHandleAndProgress(newValue) {\n const max = this._effectiveMax;\n const min = this._effectiveMin;\n\n // The progress (completed) percentage of the slider.\n this._progressPercentage = (newValue - min) / (max - min);\n // How many pixels from the left end of the slider will be the p... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
This function is the callback of showPowerLines | function showPowerLinesCallBack(data, options){
var powerLineList = data.split("*");
var powerLines=[];
for (var i=0; i<powerLineList.length-1; i++) {
var powerLine = powerLineList[i].split("!");
var location = powerLine[0];
var color=powerLine[1];
var powerLineId=powerLine[2].trim();
var startLat = locati... | [
"function showSavedPowerLines(){\n\tajaxRequest(\"showPowerLines\", {}, showPowerLinesCallBack, {});\n}",
"function drawPoweLineCallBack(data, options){\n\tvar newLineShape = options[\"lineShape\"];\n\tvar path = options[\"path\"];\n\tvar dataArray = data.split(\"!\");\n\tvar powerLineId = dataArray[0];\n\tvar co... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
calculate MessageDigest accord to source message that inputted | function calcDigest() {
var digestM = hex_sha1(document.SHAForm.SourceMessage.value);
document.SHAForm.MessageDigest.value = digestM;
} | [
"digesting() {}",
"function hashMessage(message, algorithm) {\n const hash = crypto.createHash(algorithm);\n hash.update(message);\n const hashValue = hash.digest('hex')\n console.log(hashValue);\n return hashValue;\n}",
"calculateHash(data, timestamp, previousHash, nonce) {\n return SHA25... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Client stub for the UserAPIUtilityLibrary PHP Class | function UserAPIUtilityLibrary(callback) {
mode = 'sync';
if (callback) { mode = 'async'; }
this.className = 'UserAPIUtilityLibrary';
this.dispatcher = new HTML_AJAX_Dispatcher(this.className,mode,callback,'http://4288.7431.m.edge-cdn.net/userstub.php?','JSON');
} | [
"function UsersRawRestClient(webContext) {\n this.webContext = webContext;\n }",
"function initialize(callback){\n\n\tsoap.createClient(apiInfo.wsdl, { endpoint: apiInfo.endpoint }, function(err,client){ \n\t\tif(err){ console.log(err); callback(err); }\n\t\telse {\n\t\t\tclient.setSecurity(new soap.Bas... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
check if the regex `re` matches one of the elements in the array `arr`. if so, return the match array, otherwise return false | function matchInArray(re, arr) {
let match;
// input check
if (!re || !(re instanceof RegExp) ||
!arr || !(arr instanceof Array)) {
return false;
}
for (let i = 0; i < arr.length; ++i) {
match = re.exec(arr[i]);
if (match) {
return match;
}
}
... | [
"function includesOneOf(str, arr) {\n for (let i = 0; i < arr.length; i++) {\n if (str.includes(arr[i])) return true;\n }\n return false;\n}",
"function containsAny(str, arr){\n\tif(str == null){\n\t\treturn false;\n\t}\n\treturn arr.map(function(elem){\n\t\treturn str.toLowerCase().indexOf(elem.toLowerCase... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Give an warning message to the user when there are employees in the waiting room. | function isWaitingListExisting() {
var waitingList = spaceExpressConsoleDrawing.employeesWaiting;
if(waitingList.length > 0) {
return true;
} else {
return false;
}
} | [
"static needPlayers() {\n\t\talert('There\\'s not enough players in the room');\n\t}",
"function _assignEmployeeAfterWarning(event) {\r\n var empPk = $(this).data(\"employee-pk\");\r\n var schPk = $(this).data(\"schedule-pk\");\r\n var strCalDate = calDate.format(DATE_FORMAT);\r\n $.post(\"add_employe... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
permaLink: redirect to an email permalink | function permaLink(id, type) {
var t = 'thread'
if (prefs.groupBy == 'date') {
t = 'permalink'
}
var eml = findEml(id)
if (eml) { // This is so, in case you move to another list software, you'll keep back compat
id = eml['message-id']
}
window.open("/" + t + ".html/" + id, "_... | [
"function addImsEmail(l) {\r\n\tvar email = getURLParam(\"e12\");\r\n \tif(email!=\"\") l.href += \"&e12=\" + email;\r\n}",
"onSubmitFeedbackTap() {\n this.$.submitFeedback.href += window.location.pathname;\n }",
"sendSignInLinkEmail (voterEmailAddress) {\n Dispatcher.loadEndpoint('voterEmailAddressSave'... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Check if both pw1 and pw2 match. | function CheckPasswordsMatch(pwd1, pwd2) {
if(pwd1 === pwd2){
return true;
}
return false;
} | [
"function isEqualPass(obj1,obj2){\r\n\t var pw1 = obj1.value;\r\n\t var pw2 = obj2.value;\r\n\t \r\n\t if(pw1.length ==0 || pw2.length ==0){\r\n\t\t return true;\r\n\t }\r\n\t if(pw1 == pw2){\r\n\t\t return false;\r\n\t }\r\n\t \r\n\t return true;\r\n }",
"async function comparePassword(originalSecret, storedHash... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
gets frameworks from a specific directory | function frameworksFromDir(frameworkDir, callback) {
if(frameworkDir == null || !fs.existsSync(frameworkDir)) {
callback(null, []);
return;
}
var r = /(.*)\.framework$/;
fs.readdir(frameworkDir, function(err,paths) {
if (err) return callback(err);
var fw = paths
.map(function(v) {
var p = path.join(f... | [
"function systemFrameworks(callback) {\n\tif (sysframeworks) {\n\t\treturn callback(null, sysframeworks, sysframeworkDir);\n\t}\n\tsettings(function(err,config){\n\t\tif (err) {\n\t\t\treturn callback(err);\t\n\t\t} \n\t\tsysframeworkDir = path.join(config.simSDKPath,'System','Library','Frameworks');\n\t\tframework... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
End of init / Populates the Salary Select basedon the CS0x level selected | function populateSalary () {
removeChildren(stepSelect);
if (levelSel.value >0 && levelSel.value <= 5) {
createHTMLElement("option", {"parentNode":stepSelect, "value":"-1", "textNode":"Select Salary"});
for (var i = 0; i < salaries[(levelSel.value-1)].length; i++) {
createHTMLElement("option", {"parentNod... | [
"function selectSalary () {\r\n\t//if (!(levelSelect.value > 0 && levelSelect.value <= 5))\r\n\tif (parts && levelSel.value >0 && levelSel.value <= 5) {\t// if you have a start date, and a CS-0x level\r\n\t\tlet startDate = getStartDate();\r\n\t\tstartDateTxt.value = startDate.toISOString().substr(0,10)\r\n\t\tlet ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Format value to correct format for selectize | function formatOption(value) {
return {
text: value,
value: value
}
} | [
"function formatValore(field)\n{\n\tformatDecimal(field,9,6,true);\n}",
"function getValueFromSelect(select,input,valueFormat)\n{\n\tvar selectValue=select.options[select.selectedIndex].value;\n\tvar len=selectValue.length;\n\tvar obj={S:0,E:len};\n\t\n\tif (valueFormat)\n\t\tobj=parseValueFormat(valueFormat,obj,... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Prepare a model instance for serialisation to a JSON string. We make a shallow clone of the instance and then remove the reference to the Kudu application. The clone is necessary so the original instance keeps its reference to the app. | toJSON() {
const obj = Object.assign({}, this);
delete obj.app;
return obj;
} | [
"static createModel(inobj) {\n\t\tconst model = super.createModel(inobj);\n\t\tmodel.creationDate = new Date();\n\t\tmodel.pid = process.pid;\n\t\treturn model;\n\t}",
"toJson() {\n const obj = Object.assign({}, this.get());\n\n // Remove Password from the object\n delete obj.password;\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
reverse the current allocation journal entry that is set on the vendor bill record. | function reverseAllocJournalEntry(arrAllocJrnl)
{
//var arrAllocJrnl = recBill.getFieldValues('custbody_svb_allocation_journal');
if(arrAllocJrnl)
{
for(var i=0; i<arrAllocJrnl.length; i++)
{
var stAllocJrnlId = arrAllocJrnl[i];
nlapiSubmitField('journalen... | [
"rev() {\n this.amount = -this.amount;\n return this;\n }",
"function createAllocJournalEntry(recBill,IS_INTERCO,stTrigFrom)\r\n{\r\n nlapiLogExecution('DEBUG','createAllocJournalEntry','BEGIN - Create Allocation Journal Entry');\r\n \r\n var stBillsSubs = recBill.getFieldVa... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
get a list of ids of carers that chatted with a certain label | function getCarersAskingAboutLabel(con, label, callback){
var sql = "SELECT carer_id FROM chat_labels WHERE label ='" + label + "'";
con.query(sql, function(err, result){
if (err) throw err;
var carers = JSON.parse(JSON.stringify(result));
callback(carers);
});
} | [
"function getAppearedLabels(){\n\tvar arr = [] \n\tfor (var i = 0; i<labels.length; i++) {\n\t\tarr.push(labels[i].name.label);\n\t}\n\tvar appearedLabelsUnsort = arr.filter( onlyUnique );\n\t// manually add \"treeSphere\" and \"treeCube\" as their names are saved as \"vegetation\"\n\tappearedLabelsUnsort.push('tre... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
counts the number of committees for an author in the current date range | function nrCommittees(x){
var count=0;
for (var j=0; j < x.committees.length; j++){
var committee = x.committees[j];
if (conferences[committee.conference.series] && withinRange(committee)){
count++;
}
}
return count;
} | [
"function committees(x, conf){\n\t\tif (conf == undefined){\n\t\t\treturn x.committees.length;\n\t\t} else {\n\t\t\tvar count = 0;\n\t\t\tfor (var i=0; i < x.committees.length; i++){\n\t\t\t\tvar committee = x.committees[i];\n\t\t\t\tif (committee.conference.series == conf && withinRange(committee)){\n\t\t\t\t\tcou... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
funccion que controla el cronometro asigno intervalors y variables para augmentar los segundos y minutos | function cronometro() {
var mili = 0;
var seconds = 0;
var minutes = 0;
stopWatch = setInterval(function () {
mili++;
document.getElementById("milisegundos").innerHTML = mili;
if (mili == 60) {
mili = 0;
seconds++;
document.getElementById("seg... | [
"function schedule_commands(msg, interval, duration, command, args) {\n msg.channel.send(\"Schedule has been created, will execute \" + command + \" \" + args +\n\t\t \" \" + \"every\" + \" \" + interval + \" \" + \"minutes\" + \" \" + duration + \" \" + \"times\");\n //scheduler that will cause the bot to... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Utility function which asserts a SDL document is valid by throwing an error if it is invalid. | function assertValidSDL(documentAST) {
var errors = validateSDL(documentAST);
if (errors.length !== 0) {
throw new Error(errors.map(function (error) {
return error.message;
}).join('\n\n'));
}
} | [
"function hc_documentinvalidcharacterexceptioncreateelement1() {\n var success;\n var doc;\n var badElement;\n doc = load(\"hc_staff\");\n \n\t{\n\t\tsuccess = false;\n\t\ttry {\n badElement = doc.createElement(\"\");\n }\n\t\tcatch(ex) {\n success = (typeof(ex.code) != 'u... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
function to create markers of ports in a country of interest. takes in list of ports of a country as parameter. | function setMarkers(portList)
{
for (let i = 0; i < portList.length; i++)
{
let port = portList[i];
let coord = new mapboxgl.LngLat(port.lng, port.lat);
if (i == 0) {map.panTo(coord);} //Using the first port to pan to the country of interest.
let marker = new mapboxgl.Marker({"color":"#808080"});//... | [
"function genMarkers(length, colorLine, icon, color){\n\tvar list;\n\tvar listItem;\n\n\t// creating stations locations & markers\n\tfor (var i = 0; i < length; i++) {\n\t\tstation = new google.maps.LatLng(colorLine[i][\"Lat\"], colorLine[i][\"Lng\"]);\n\t\tstationArray[i] = station;\n\t\t\n\t\t// create markers\n\... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
when day select changed, show the tips | function showDayTips (dayStart, dayEnd) {
var dayStart = parent.$(dayStart).val(),
dayEnd = parent.$(dayEnd).val();
if(dayStart == '' || dayEnd == '') {
parent.$(".day-tips").hide();
return;
}
if(parseInt(dayStart) > parseInt(dayEnd)) {
parent.$(".day-tips").show().find("... | [
"function allDayState(all_day_box) {\n\tif($(all_day_box).is(':checked')) {\n\t\t$('#id_start_time_1').hide();\n\t\t$('#id_end_time_1').hide();\n\t\t$(\"label[for='id_start_time_0']\").text('Day'); \n\t\tif($(\"#id_repeats\").is(':checked')) {\n\t\t\t$('#start-row').hide();\n\t\t\t$('#end-row').hide();\n\t\t} else ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Formats the date the article was created. If no month is inputted, the day will not be included | function assembleDateCreated(){
assemblePublisher();
formatMonthMade();
if (yearCreated.value===""){
dateCreatedAssembled="n.d. ";
}
else if(monthMade==="" && yearCreated.value != ""){
dateCreatedAssembled= yearCreated.value + ". ";
}
else {
dateCreatedAssembled= dayCreated.value + " " + monthMade + " " ... | [
"dateformat(date) { return \"\"; }",
"function formatPostDate(date) {\n \tvar date = date.split('T')[0];\n var d = new Date(date),\n month = '' + (d.getMonth() + 1),\n day = '' + d.getDate(),\n year = d.getFullYear();\n\n if (month.length < 2) month = '0' + month;... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Crossplatform code generation for component vmodel | function genComponentModel(el, value, modifiers) {
var ref = modifiers || {};
var number = ref.number;
var trim = ref.trim;
var baseValueExpression = '$$v';
var valueExpression = baseValueExpression;
if (trim) {
valueExpression = "(typeof " + baseValueExpression + " === 'string'" + "? " + baseValueExpr... | [
"function genComponent(componentName, el) {\n var children = el.inlineTemplate ? null : genChildren(el, true);\n return \"_c(\" + componentName + \",\" + genData(el) + (children ? \",\" + children : '') + \")\";\n }",
"function getComponentModel(params) {\n var componentInfo = params.componentNa... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Sorts the selected values based on a predicate function. | sort(predicate) {
if (this._multiple && this.selected) {
this._selected.sort(predicate);
}
} | [
"function sort_by(sort_criterion){\r\n return function(x,y){\r\n return (x[sort_criterion] < y[sort_criterion]) ? -1 : (x[sort_criterion] > y[sort_criterion]) ? 1 : 0;\r\n }\r\n}",
"function sort() {\n var sortBy = sortOptions.value;\n\n if (sortBy === \"lname\") sortByLname();\n else if (sortBy ===... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
this function handles the button's pointerout event | function onButtonOut() {
this.isOver = false;
if (this.isDown) {
return;
}
this.texture = textureButton;
} | [
"function mouseouthandler(event) {\n //console.log(\"the mouse is no longer over canvas:: \" + event.target.id);\n mouseIn = 'none';\n }",
"function pointerUp(e) {\n let newMouse = {x: (e.clientX/window.innerWidth)*2-1, y: (e.clientY/window.innerHeight)*-2+1};\n if (mouse.x == newMouse.x && mouse.y =... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Get the poly's index of the given text. | function getIndexOfPolyByText(text) {
if (text != null) {
for (var i=0; i<polys.length; ++i) {
if(polys[i].fabricText === text) {
return i;
}
}
}
return polys.length;
} | [
"function getIndexOfPoly(poly) {\n if (poly != null) {\n for (var i=0; i<polys.length; ++i) {\n if(polys[i].fabricPoly === poly) {\n return i;\n }\n }\n }\n return polys.length;\n}",
"function getPhraseIndex(arr){\n const phraseIndex = arr.indexOf(chose... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
lol sorry, couldn't help the name! method to render a horizontal bar that dynamically changes with score. cashed a little dirty trick to get the dotted line just so ;) side note i apologize for the rat's nest of inline styling! it was the most intuitive way i could think of doing this at the time, and something i would... | barMethod() {
const wide = Math.abs(this.props.qual.score / 10.0).toString() + "vw";
const color = this.props.qual.color;
let style1 = {
width: wide,
backgroundColor: color,
paddingTop: "0.3vw",
paddingBottom: "0.3vw"
};
let style3 = {
marginLeft: "6vw"
};
let... | [
"function setBarLine(){\n\tmusicalElements += \"| \";\n}",
"function drawBar(objName, length, value, aColor, isFloating){\n\t\tif (objName != null) {\n\t\t\tif (isFloating == null) {\n\t\t\t\tisFloating = true;\n\t\t\t}\n\t\t\tobj = document.getElementById(objName);\n\t\t\tif (obj != null) {\n\t\t\t\tif (aColor =... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
ONCE THE LOGGED IN USER CLICKS THE EDIT ANSWER LINK SHOW THE EDITABLE TEXTBOX | showEditableAnswer(e){
e.preventDefault();
document.getElementById('editAnswerContent').style.display = "inherit";
document.getElementById('answerContent').style.display = "none";
document.getElementById('clickEdit').style.display = "none";
document.getElementById('submitAnswer').style.display = "in... | [
"function clickonnote(){\r\n\t\t$(\".noteheader\").click(function(){\r\n\t\t\tif(!editMode){\r\n\t\t\t\t//update activenote variable to id of note\r\n\t\t\t\tactivenote = $(this).attr(\"id\");\r\n\t\t\t\t// fill text area\r\n\r\n\t\t\t\t$(\"textarea\").val($(this).find(\".text\").text());\r\n\t\t\t\tshowHide([\"#no... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Get Percentage based on citizen. | function getPercentage(annualAmount,citizenType)
{
var PercentageValue;
if(citizenType == "general")
{
if(annualAmount<=500000)
{
PercentageValue = 10;
}
else if(annualAmount<=1000000)
{
... | [
"function percentCoveredCalc(claimant){\n\tvar percentage = 0;\n\tvar careType = claimant.visitType;\n\n\tswitch(careType){\n\t\tcase \"Optical\":\n\t\t\tpercentage = 0;\n\t\t\tbreak;\n\t\tcase \"Specialist\":\n\t\t\tpercentage = 10;\n\t\t\tbreak\n\t\tcase \"Emergency\":\n\t\t\tpercentage = 100;\n\t\t\tbreak;\n\t\t... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Process dict with count to sorted dict without count value | function sortAndRemoveCount(dict) {
var toRtn = JSON.parse(JSON.stringify(dict));
for(var i=0; i<toRtn.length; ++i) {
toRtn[i]["moroword"].sort(function(a, b) {
return parseFloat(b["count"]) - parseFloat(a["count"]);
});
var moroWordsArray = []
... | [
"function Perform_Word_Count(content)\n{\n\tvar ocurrences = {}\n for(var i=0; i<content.length; i++)\n {\n //if this key is in the dict\n if(content[i] in ocurrences)\n {\n ocurrences[content[i]]++; //add 1 to the counter\n }\n else //this is a new key in the dic... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Creates a single Cesium layer to represent the OpenLayers tile layer. | createSingle_() {
asserts.assert(this.layer != null);
asserts.assert(this.view != null);
olEvents.listen(this.layer, EventType.PROPERTYCHANGE, this.onLayerPropertyChange_, this);
this.activeLayer_ = tileLayerToImageryLayer(this.layer, this.view.getProjection());
if (this.activeLayer_) {
// u... | [
"function createLayer(key) {\n undoLayer();\n var main = new L.tileLayer('https://api.tiles.mapbox.com/v4/k3nnythe13ed.1oe7h7kd/{z}/{x}/{y}.png?access_token=sk.eyJ1IjoiazNubnl0aGUxM2VkIiwiYSI6ImNpdXBramh1MjAwMWUyb3BrZGZpaHRhNmUifQ.SVIjk10IlrzAkWopvYzMtg',\n {\n attribution: 'Map data © ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Loads a ZapProvider from a given Web3 instance | async function initProvider(web3) {
// loads the first account for this web3 provider
const accounts = await web3.eth.getAccounts();
if (accounts.length == 0)
throw ('Unable to find an account in the current web3 provider');
const owner = accounts[0];
console.log("Loaded account:", owner);
... | [
"_setOriginWeb3Instance() {\n const oThis = this,\n wsProvider = oThis.ic().configStrategy.originGeth.readOnly.wsProvider;\n\n oThis.web3Instance = web3Provider.getInstance(wsProvider).web3WsProvider;\n }",
"_setAuxWeb3Instance() {\n const oThis = this,\n wsProvider = oThis.ic().configStrategy... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
generate a version 2 ValueSet that matches the CodeSystem we are building... | function makeV2ValueSet() {
var vsSuffix = '-cf-v2-vs';
var cs = $scope.cs; //the codeset we are copying from
var v2vs = {resourceType:'ValueSet',status:'draft'};
var isCFUrl = appConfigSvc.config().standardExtensionUrl.clinFHIRCreated;
... | [
"function mapValueSetToCTS2Entry(data) {\n return {\n \"valueset\" : {\n \"about\": data['id'],\n \"formalName\": data['name'],\n \"valueSetName\": data['id'],\n \"sourceAndRole\": [\n {\n \"source\": {\n \"uri\": \"http://www.projectphema.org/authoring-tool\",\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Add the form header to the drawer content | addHeader() {
let
xPos = 0,
yPos = 0
this.formHeader = new Element(this.scene, {hasOutline: false}),
this.formHeader.width = this.width
this.formHeader.height = this.form.submitButton.height + this.styles.padding.top + this.styles.padding.bottom
this.formHeader.setPosition(this.formHead... | [
"function drawEpisodesHeader() {\n let $header = $(\"<h2>\").text(episodes[0].Show_name + \" - Season \" + episodes[0].Season_num);\n let div = $(\"<div class='header'>\").append($header);\n $(\"#adminEpisodePH\").prepend(div);\n}",
"function makeHeader() {\n updateTime();\n $(\"#calendarHeader\").... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
A GradebookSettings to encapsulate all the settings page features | function GradebookSettings($container) {
this.$container = $container;
this.categories = new GradebookCategorySettings($container.find("#settingsCategories"));
this.gradingschemas = new GradebookGradingSchemaSettings($container.find("#settingsGradingSchema"));
} | [
"static generate_settings() {\n // Initialise variables\n var html_content = {}\n var html_heading = {}\n\n // Setup content and heading variables\n for (var item of this.settings_json[\"categories\"]) {\n html_content[item] = \"\"\n\n html_heading[item] = th... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Initialize the settings for the color sets select box | function initColorsSelectBox() {
var SelectNode = document.getElementById("ColorSet");
var colorSetKeys = Object.keys(colorSetsObj);
var key;
for (key in colorSetKeys) {
var option = document.createElement("option");
option.value = colorSetKeys[key];
option.text = colorSetsObj[colorSetKeys[key]].picker_label;... | [
"function setupColorControls()\n{\n dropper.onclick = () => setDropperActive(!isDropperActive()) ;\n color.oninput = () => setLineColor(color.value);\n colortext.oninput = () => setLineColor(colortext.value);\n\n //Go find the origin selection OR first otherwise\n palettedialog.setAttribute(\"data-palette... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Returns whether the focus is currently within the list. | _containsFocus() {
const activeElement = _getFocusedElementPierceShadowDom();
return activeElement && this._element.nativeElement.contains(activeElement);
} | [
"get focusChanged() {\n return (this.flags & 1) /* Focus */ > 0\n }",
"isWindowActive() {\n if (this.windowHandle === null) {\n this.windowHandle = Winhook.FindWindow(this.windowTitle);\n if (!this.windowHandle) {\n return false;\n }\n }\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
compute the center of some circles by maximizing the margin of the center point relative to the circles (interior) after subtracting nearby circles (exterior) | function computeTextCentre(interior, exterior) {
// get an initial estimate by sampling around the interior circles
// and taking the point with the biggest margin
var points = [],
i;
for (i = 0; i < interior.length; ++i) {
var c = interior[i];
... | [
"function findCenter(c1, c2, c3) {\n\tvar x = (c1.x + c2.x + c3.x) / 3;\n\tvar y = (c1.y + c2.y + c3.y) / 3;\n\tvar z = (c1.z + c2.z + c3.z) / 3;\n\t\n\treturn {x: x, y: y, z: z};\n}",
"function greatCircleDistPart(lat, cosLat, sinLat, cosLngDelta) {\n var d = sinLat * Math.sin(lat * rad) +\n cosLat... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
method created to validate occupancy | validateOccupancy(){
if(this.occupancy ==''|| this.occupancy < 0 || this.occupancy > 180){
return "Occupancy cannot be empty, should not be negative and should not be morethan 180";
}
else{
return this.occupancy;
}
} | [
"function changeOccupation()\n{\n changeElt(this); // espand abbreviations and fold value to upper case\n let occupation = this.value;\n let form = this.form;\n let censusId = form.Census.value;\n let censusYear = censusId.substring(censusId.length - 4);\n let lineNum = this.na... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
setting the the bet Horse to the corresponding horse name. So that, to check the condtion on line 60 | function betHorses(){
if(bet == 1) bet = 'horse1';
if(bet == 2) bet = 'horse2';
if(bet == 3) bet = 'horse3';
if(bet == 4) bet = 'horse4';
} | [
"function adjustBet(hilo, baseBet, decks){\r\n var weight = decks >= 6? 2: 1;\r\n var weight = Math.floor(decks/2);\r\n if (this.runningBankroll>0){\r\n if (this.winScore()>=0){\r\n if (hilo >= 8*weight) this.hand.objHands[0].bet = 4*baseBet;\r\n else if (hilo >= 6*weight) this.hand.objHands[0].bet ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
fonction de remplissage tableau ticket P1 et SLA, vidageTab= 1 pour vider les tableau + nbticket | function remplirTableauTicketP1SLSA(object, vidageTab){
if(vidageTab==1){
//vidage des tableaux
//tableau P1
$("#tableTicketP1 tbody").html('');
//clear titre
var str = ' Liste des tickets P1 sur la période - total: 0';
$('#tableTicketP1 caption').html(str);
//tableau SLA
$("#tableSLA tbody").html('... | [
"function actualizarTablaVida(oponente, jsonPartida){\n\tif(!jsonPartida.tiros1 || !jsonPartida.tiros2)\n\t\treturn true;\n\n\t//se ajustan las vidas al maximo\n\tpuntajePortaaviones.innerHTML = \"5/5\";\n\tpuntajeAcorazado.innerHTML = \"3/3\";\n\tpuntajeFragata.innerHTML = \"3/3\";\n\tpuntajeSubmarino.innerHTML = ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Listen to players by roomID | function listenToPlayers(roomId, callback) {
roomsRef.child(`${roomId}/players`).on('value', snapshot => {
return callback(snapshot.val());
});
} | [
"function getPlayersList(roomId) {\n return roomsRef.child(`${roomId}/players`).once('value');\n}",
"static sPlayerLeft(sid, room, username) {\n // Sending new state of the room.\n Signals.emit(sid, \"sPlayerLeft\", {\n \"username\": username, \"playerList\": getPlayerList(room.users),\n... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Exit a parse tree produced by Java9ParserpackageModifier. | exitPackageModifier(ctx) {
} | [
"exitMemberModifier(ctx) {\n\t}",
"exitPackageOrTypeName(ctx) {\n\t}",
"exitModularCompilation(ctx) {\n\t}",
"exitInheritanceModifier(ctx) {\n\t}",
"visitExit_statement(ctx) {\n\t return this.visitChildren(ctx);\n\t}",
"exitTypeProjectionModifierList(ctx) {\n\t}",
"exitMethodModifier(ctx) {\n\t}",
"e... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Chain conversions given the request and the original response Also sets the responseXXX fields on the jqXHR instance | function ajaxConvert(s,response,jqXHR,isSuccess){var conv2,current,conv,tmp,prev,converters={}, // Work with a copy of dataTypes in case we need to modify it for conversion
dataTypes=s.dataTypes.slice(); // Create converters map with lowercased keys
if(dataTypes[1]){for(conv in s.converters){converters[conv.toLowerCa... | [
"function ajaxHandleResponses(s,jqXHR,responses){var contents=s.contents,dataTypes=s.dataTypes,responseFields=s.responseFields,ct,type,finalDataType,firstDataType;// Fill responseXXX fields\nfor(type in responseFields){if(type in responses){jqXHR[responseFields[type]]=responses[type];}}// Remove auto dataType and g... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Fonction pour creer un nouveau morceau de Snake en bouffant une fourmis | function CreerMorceauSnake (x, y, width, height, dx, dy, historique, color) {
Compteur = Compteur +1;
//On prepare un tableau vide pour etre passe en parametre de la creation de morceau. Ce tableau contiendra plus tard les objets historiques
window['Tab'+ Compteur] = [];
//On instancie un... | [
"function CreerMorceauSnakeInit (x, y, width, height, dx, dy, TailleTableauSnake, color) {\n \n window['Tab'+ TailleTableauSnake] = [];\n console.log(\"valeur de la taille du tableau envoyee: \", TailleTableauSnake);\n //On instancie un nouveau morceau de snake\n \n console.log(\"nom de la valiabl... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Listen to external consent flow iframe's response with consent string and metadata. | enableExternalInteractions_() {
this.win.addEventListener('message', (event) => {
if (!this.isPromptUiOn_) {
return;
}
let consentString;
let metadata;
const data = getData(event);
if (!data || data['type'] != 'consent-response') {
return;
}
if (!da... | [
"onXHRComplete(inName, inResponse) {\n\t\tconsole.debug(`Loaded raw audio data for '${inName}', doing decode...`);\n\t\tlet ctx = new AudioContext();\n\t\tthis[inName].context = ctx;\n\t\tctx.decodeAudioData(inResponse, \n\t\t\tfunction(inBuffer) { ALL_LOADED_AUDIO.onDecodeAudioSuccess(inName, inBuffer); },\n\t\t\t... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Parses the manifest, creates components, and adds them to the specified BOM. | function parseManifest(bom, manifest) {
let buildroot = JSON.parse(fs.readFileSync(manifest, 'utf8'));
for (let key in buildroot) {
let lib = buildroot[key];
if (lib.virtual === true) {
continue; // Do not include virtual packages
}
// Create a new CycloneDX component and populate identity inf... | [
"function createManifest () {\n fs.writeFile(manifestPath + 'manifest.json', JSON.stringify(manifest))\n}",
"function writeBom(bom, output) {\n if (output.endsWith(\".xml\")) {\n fs.writeFile(output, bom.toXML(), () => {});\n } else if (output.endsWith(\".json\")) {\n fs.writeFile(output, bom.toJSON(), (... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
this will publish current block hash to a Plasma contract this will mine and submit new block | async function mineAndSubmitBlock(){
//PROCESS DATA
let obj = dataPool.pop()
const encryptedData = await encryptData(pubKey, obj.data)
const d = await new Data(encryptedData, address, obj.meta)
//MINE NEW BLOCK
let lastBlock = await storage.getItem(nonce.toString());
newBlockHash = awai... | [
"minePendingTransaction(miningRewardAddress){\r\n let block = new Block(Date.now(), this.pendingTransactions);\r\n block.previousHash = this.getLatestBlock().hash;\r\n block.mineBlock(this.difficulty);\r\n\r\n console.log('Block sucessfully mined');\r\n this.chain.push(block);\r\n... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Function to return user auth token | static getUserToken(){
let token = JSON.parse(localStorage.getItem('USER')).token;
return token;
} | [
"function getToken() {\n return localStorage.getItem('token');\n}",
"function getToken() {\n\treturn localStorage.getItem('token')\n}",
"function getToken(email) {\n //console.log(\"cleanAuth-getToken\", email);\n const token = jwt.sign(\n {\n user_id: email,\n },\n process.env.TOKEN_KEY,\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
checks if components accessing a vector are legal. components can be illegal if they mix sets (e.g. `v.rgzw`) or contain characters outside of any set (e.g. `v.lmno`) | function checkLegalComponents(comps, vec) {
const check = (range, domain) => {
let inside = 0;
let outside = 0;
for (const c of range) {
domain.includes(c) ? inside++ : outside++;
}
return inside === inside && !outside;
};
const inLen = typeStringToLength(... | [
"function hasVectorMask() {\n var hasVectorMask = false;\n try {\n var ref = new ActionReference();\n var keyVectorMaskEnabled = app.stringIDToTypeID('vectorMask');\n var keyKind = app.charIDToTypeID('Knd ');\n ref.putEnumerated(app.charIDToTypeID('Path'), app.charIDToTypeID('Ordn'), keyVectorMaskEnab... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Hammer control single tap and double tap | function addHammerRecognizer(theElement) {
// We create a manager object, which is the same as Hammer(), but without //the presetted recognizers.
//alert("dfadfad");
var mc = new Hammer.Manager(theElement);
// Tap recognizer with minimal 2 taps
mc.add(new Hammer.Tap({
... | [
"function gestureStart(e)\n{\n if (!gesture.on) {\n gesture.on = true;\n gesture.x2 = gesture.x1 = e.touches[0].clientX;\n gesture.y2 = gesture.y1 = e.touches[0].clientY;\n gesture.opacity = document.body.style.opacity;\n }\n gesture.touches = e.touches.length;\n}",
"_onTap(x,y){\n console.l... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
For listening to events other than the most common ones (available via Output properties). Can be called after the chart emits that it's "ready". Returns a handle that can be used for `removeEventListener`. | addEventListener(eventName, callback) {
const handle = this.registerChartEvent(this.chart, eventName, callback);
this.eventListeners.set(handle, { eventName, callback, handle });
return handle;
} | [
"disconnectedCallback() {\n super.disconnectedCallback();\n document.removeEventListener('incoming-custom-event', this.handleIncoming)\n }",
"get __chartEventNames() {\n return {\n /**\n * Fired when a new series is added.\n * @event chart-add-series\n * @param {Object} detail.ori... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Stops the FakeServer and removes all configured responses and/or filters. | restore() {
this.__responses = [];
this.removeFilter(this.__filter);
this.__filter = null;
this.__fakeServer.restore();
this.__fakeServer = null;
} | [
"stop() {\n if (!this.isStarted()) {\n throw new Error('cannot stop backend: not started yet');\n }\n this.started = false;\n this.logWriter.writeLine(`stopping backend for ${this.previewUriScheme}:// at port ${this.serverPort}`);\n this.server.stop();\n }",
"funct... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Determines which contrast guidelines have been met for two colors. Based on the [contrast calculations recommended by W3]( | function meetsContrastGuidelines(color1, color2) {
var contrastRatio = getContrast(color1, color2);
return {
AA: contrastRatio >= 4.5,
AALarge: contrastRatio >= 3,
AAA: contrastRatio >= 7,
AAALarge: contrastRatio >= 4.5
};
} | [
"function isContrastCompliant(background, foreground, compliance) {\n if (compliance === void 0) { compliance = \"normal\"; }\n var ratio;\n switch (compliance) {\n case \"large\":\n ratio = exports.LARGE_TEXT_CONTRAST_RATIO;\n break;\n case \"normal\":\n rati... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Convert hex string to ArrayBuffer. | function hexToBuffer(hex) {
var tokens = hex.match(/[0-9a-fA-F]{2}/gi);
var arr = tokens.map(function(t) {
return parseInt(t, 16);
});
return new Uint8Array(arr).buffer;
} | [
"function hexToBuffer(hex) {\n if (hex.length % 2) {\n hex = '0' + hex\n }\n const buf = new Uint8Array(hex.length >>> 1)\n for (let i = 0; i < hex.length >>> 1; i++) {\n const val = hex.slice(2 * i, 2 * i + 2)\n buf[i] = parseInt(val, 16)\n }\n return buf\n}",
"function hex_str_to_byte_array(in_st... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
send a list of all lobbies to user | function ListLobbies(ws) {
// TODO: also send number of players/spectators //
var returnMessage = {
"type": "lobby-list",
"data": {
"lobbies": [ ]
}
}
returnMessage["data"]["lobbies"] = Object.keys(lobbies);
ws.send(JSON.stringify(returnMessage));
} | [
"function getLobbies() {\n var lobbyObjects = [];\n for (var lobby of lobbies) {\n // Don't send details of unlisted lobbies\n if (!lobby.unlisted) {\n var players = [];\n for (var player of lobby.players.keys()) {\n players.push({\n name: users.get(player).name\n });\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Initializes the items array if needed. This will collect items/elements from the specified root control. | function initItems() {
if (!items) {
items = [];
if (root.find) {
// Root is a container then get child elements using the UI API
root.find('*').each(function(ctrl) {
if (ctrl.canFocus) {
items.push(ctrl.getEl());
}
});
} else {
// Root is a control/widget then get... | [
"function createInternalItemsSource() {\n internalItemsSource = options.itemsSource;\n internalItemsSource = setupSorting(internalItemsSource);\n internalItemsSource = setupFilters(internalItemsSource);\n internalItemsSource = setupIndex(internalItemsSource);\n }",
"_initElements ()... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Collapses an expanded container. id the id of the container to collaspe return none Compatibility: IE, NS6 | function i2uiCollapseContainer(id)
{
var obj;
var nest = 1;
obj = document.getElementById(id+"_toggler");
if (obj != null)
{
var i2action = obj.getAttribute("onclick")+" ";
if (i2action != null)
{
var at = i2action.indexOf("this,");
if (at != -1)
nest = i2action.... | [
"function i2uiExpandContainer(id)\r\n{\r\n var nest = 1;\r\n var obj;\r\n\r\n obj = document.getElementById(id+\"_toggler\");\r\n if (obj != null)\r\n {\r\n var i2action = obj.getAttribute(\"onclick\")+\" \";\r\n if (i2action != null) \r\n {\r\n var at = i2action.indexOf(\"this,\");\r\n if (... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Applies datainformed logic to the batter's chance of swinging at the pitch based on the current count. | function applyCountLogicToSwingChance(chanceOfSwinging){
var countSwingPercs;
var percsForBallCount;
var avgSwingForCount = 0;
var difference = 0;
countSwingPercs = (__.isPitchInStrikeZone(pitch.location) ? battingConstants.COUNT_SWING_PERCS.zone[pitch.atBatHandedness] : battingConstants.COUNT_SWING_PER... | [
"function applyPitchTypeLogicToSwingChance(chanceOfSwinging){\n\t\t\tvar countPosition = __.batterCountPosition(gamePlayService.balls(), gamePlayService.strikes());//ahead, behind or even\n\t\t\tvar pitchType = (pitch.pitchSubType ? pitch.pitchSubType : pitch.pitchType);\n\t\t\tvar pitchTypeSwingPercentages = pitch... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
removes the elems of obj that prop === val | function removeby(obj, prop, val) {
for (var k in obj) {
var v = obj[k]
if (obj[k][prop] === val)
delete obj[k]
}
return obj
} | [
"function arr_removeby(arr, prop, val) {\n\tfor (var i = 0; i < arr.length; i++) {\n\t\tif (arr[i][prop] === val) {\n\t\t\tremove(arr, i)\n\t\t\ti--\n\t\t}\n\t}\n\treturn arr\n}",
"function arr_filter_out(arr, prop, val) {\n\treturn arr.filter(function (v) { return v[prop] !== val })\n}",
"function filter(obj, ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Function to handle changes in deviceType configurable | function onDeviceTypeChange(inst, ui)
{
if(inst.deviceType === "zc" || inst.deviceType === "zr"
|| inst.deviceType === "znp")
{
ui.nwkMaxDeviceList.hidden = false;
if(inst.deviceType === "zc" || inst.deviceType === "znp")
{
ui.zdsecmgrTcDeviceMax.hidden = false;
... | [
"function getDeviceTypes() {\n \n}",
"function updateDeviceType(axios$$1, token, payload) {\n return restAuthPut(axios$$1, '/devicetypes/' + token, payload);\n }",
"function selectTrigger(device, type) {\n vm.selectedDevice = angular.copy(device);\n vm.selectedType = angular.copy(type);\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
/ Get Period Game Odds Line Movement / / The GameID of an NHL game. GameIDs can be found in the Games API. Valid entries are 13096 or 13110 | getPeriodGameOddsLineMovementPromise(gameid){
var parameters = {};
parameters['gameid']=gameid;
return this.GetPromise('/v3/nhl/odds/{format}/AlternateMarketGameOddsLineMovement/{gameid}', parameters);
} | [
"async function getGameID(game_time,home_team_id, away_team_id){\n let result = await DButils.execQuery(`SELECT gameid FROM Games Where GameDateTime = '${game_time}' AND\n ((HomeTeamID = ${home_team_id} AND AwayTeamID = ${away_team_id}) OR\n (HomeTeamID = ${away_team_id} AND AwayTeamID = ${home_team_id}))`)\n i... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
This handler is attached to the window object (on the capture phase) to emulate pointer capture. onTouchMove is still attached to the tracked element, so stop propagation to avoid processing twice. | function onTouchMoveCaptured( tracker, event ) {
handleTouchMove( tracker, event );
$.stopEvent( event );
} | [
"function stopDrag(){\n\t detector_container.removeEventListener(\"pressmove\", moveDrag); \n}",
"function onTouchMoveLightbox(e) {\n e.preventDefault();\n}",
"_onTap(x,y){\n console.log('tap!', x, y)\n //save screen coordinates normalized to -1..1 (0,0 is at center and 1,1 is at top right)\n... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Multiplies two numbers together, defaults the second value to the memory property | multiply(value1, value2 = this.memory) {
if(value2!==undefined) {
this.memory = value1 * value2;
console.log(`${value1} x ${value2} = ${this.memory}`);
return this.memory;
} else {
console.log(new Error('Must input two values to multiply'));
... | [
"function calculateMultiply(num1, num2){\n \n return num1 * num2 \n}",
"function multiplizieren(a,b) {\r\n return a * b ;\r\n}",
"function product (a, b){\n return a*b;\n}",
"function multiplyBy10(result) {\r\n return 10 * result;\r\n}",
"function multiplicacion(a, b) {\n //tu codigo debajo\n l... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Called when disabled state is changed. Used to add or remove 'binvalid' class for the invalid field based on current disabled state. | onDisabled() {
this.updateInvalid();
} | [
"updateOptionsDisabledState() {\n this.options.forEach((option) => option.setDisabledByGroupState(this.disabled));\n }",
"set disabled(value) {\n const isDisabled = Boolean(value);\n if (this._disabled == isDisabled)\n return;\n this._disabled = isDisabled;\n this._safelySetAt... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
LastWeeksSheetName /// Generate last weeks sheet name | function LastWeeksSheetName(){
var d = new Date();
//return d.getFullYear().toString() + "-" + (d.getMonth() + 1).toString().padStart(2, '0') + "-" + LastLastSunday();
return d.getFullYear().toString().substr(-2) + (WeekOfYear() - 1);
} | [
"function SheetName(){\r\n var d = new Date();\r\n //return d.getFullYear().toString() + \"-\" + (d.getMonth() + 1).toString().padStart(2, '0') + \"-\" + LastSunday();\r\n return d.getFullYear().toString().substr(-2) + WeekOfYear();\r\n}",
"function excel_define_sheet_name(excel) {\n var excel = excel... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
a generic version of eachOf which can handle array, object, and iterator cases. | function eachOfGeneric (coll, iteratee, callback) {
return eachOfLimit$2(coll, Infinity, iteratee, callback);
} | [
"function for_each(){\n var param_len = arguments[0].length;\n var proc = arguments[0];\n while(!is_empty_list(arguments[1])){\n var params = [];\n for(var j = 1; j < 1+param_len; j++) {\n params.push(head(arguments[j]));\n arguments[j] = tail(arguments[j]);\n }\n... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |