query stringlengths 9 34k | document stringlengths 8 5.39M | negatives listlengths 19 20 | metadata dict |
|---|---|---|---|
Sanity check before mutating any stats. Returns whether sanity check passed. | mutateStatCheck() {
if (!this.levelInfos.has(this.curLevelNum)) {
console.error('Tried to mutate stat but Bookkeeper does not have current level?');
return false;
}
return true;
} | [
"_isModify(orgUnit) {\n return Object.keys(orgUnit).length > 0;\n }",
"function checkInitialised() {\n\n ns.log.functionEntryPoint() \n\n if (ns.properties === null ||\n ns.log === null ||\n ns.trialLength === null ||\n ns.fullLength === null) {\n \n th... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Converts page information received from device into PageDescription object that is sent to debugger. | _buildPageDescription(
deviceId: string,
device: Device,
page: Page,
): PageDescription {
const debuggerUrl = `${this._serverBaseUrl}${WS_DEBUGGER_URL}?device=${deviceId}&page=${page.id}`;
const webSocketDebuggerUrl = 'ws://' + debuggerUrl;
// For now, `/json/list` returns the legacy built-in... | [
"function getPageRecord(page){\n var record = {'name' : page.name};\n if(page.info !== undefined){\n record.info = page.info;\n }\n return record;\n}",
"async copyTo(page, publish = true) {\n // we know the method is on the class - but it is protected so not part of the interface\n page.setCo... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
deleteInvites() removes all invites for an invited id. `invitedId` can be any form of identifier, like user id or phone number. | deleteInvites(invitedId) {
return new Promise((resolve, reject) => {
this.client.del(
`${this.namespace}:user:${invitedId}:${STATE_KEY.invited}`,
(err, res) => {
if (err) { reject(err); }
debug(`Deleted all invites for ${invitedId}`);
return resolve(res);
... | [
"updatePendingInvites(userInvites){\n for(let i of userInvites){\n if(!this.session.settings.invites.hasOwnProperty(i)){\n this.session.settings.invites[i] = {}\n }\n }\n for (let i of Object.keys(this.session.settings.invites)){\n if(!userInvites... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Event handler for changing the theme of the editor (light or dark) | function handleThemeChange() {
setTheme(theme === "light" ? "dark" : "light");
} | [
"function changeTheme(){\n\tvar new_theme = $('#theme').val();\n\teditor.setTheme(\"ace/theme/\"+new_theme);\n}",
"_onThemeChanged() {\n this._changeStylesheet();\n if (!this._disableRedisplay)\n this._updateAppearancePreferences();\n }",
"function updateStyle() {\r\n\tif (settings.d... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
putMask_Number_Value() ================ Method to put the number format to the field Parameters Return value | function putMask_Number_Value(aValue, aintDigits, aintDecimals)
{
lstrValue = ""+aValue;
re = new RegExp(",","g");
lstrValue = lstrValue.replace(re,"");
// Curtailing Blank spaces from the begining and end of the entered text
lstrValue = trimString(lstrValue);
if( lstrValue == null || lstrValu... | [
"function putMask_Number(aField, aintDigits, aintDecimals)\n{\n var lreComma = new RegExp(\",\",\"g\");\n\n lstrValue = aField.value;\n lstrValue = lstrValue.replace(lreComma,\"\");\n\n // Curtailing Blank spaces from the begining and end of the entered text\n lstrValue = trimString(lstrValue);\n\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Deploys the contract on enter being pressed. | handleHolderKeyPress(event) {
// If the key code is ENTER (13), select the time
if ((event.keyCode ? event.keyCode : event.which) == 13) {
event.preventDefault();
this.deployContract();
}
} | [
"function enterobs(e){\n if(e.which == 13 && !e.shiftKey){\n $('#pubob').click();\n e.preventDefault();\n }\n}",
"function submitToBot(event) {\r\n\tif(event && event.keyCode != 13){\r\n\t\treturn false;\r\n\t}\r\n\tvar v = textInput.value.trim();\r\n\tif(v.length > 0) {\r\n\t\tnewInput(v);\r\... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
returnes true if we have duplicated targets in this.nodes array ( two or more Spichonees loves another one ) | hasDuplicatedTargets () {
return this.targets.some((target, position) => {
return this.targets.indexOf(target) !== position;
})
} | [
"hasMultipleConnections() {\n let result = false;\n this.getConnections().forEach(connection => {\n this.getConnections().forEach(_connection => {\n if (_connection.id !== connection.id) {\n if (_connection.source.node === connection.source.node) {\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Is an element in the model | isElementOverModel (element) {
// NTS: Element here is the div
return this.modelDivHelper.elementOver (element);
} | [
"exists() {\n return this.element ? true : false;\n }",
"contains(element) {\n return this.set.indexOf(element) !== -1;\n }",
"exists(el)\n {\n if(typeof(el) != 'undefined' && el != null) { return true; } // If not undefined or null, then exists.\n return false;\n }",
"inDOM(... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
`_getContextEndReader` gets the next reader function at the end of a context | _getContextEndReader() {
const contextStack = this._contextStack;
if (!contextStack.length)
return this._readPunctuation;
switch (contextStack[contextStack.length - 1].type) {
case 'blank':
return this._readBlankNodeTail;
case 'list':
return this._readListItem;
case 'formula':... | [
"_readRDFStarTail(token) {\n if (token.type !== '>>') return this._error(`Expected >> but got ${token.type}`, token); // Read the quad and restore the previous context\n\n const quad = this._quad(this._subject, this._predicate, this._object, this._graph || this.DEFAULTGRAPH);\n\n this._restoreContext(); //... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Trace depend system equipment. | function traceDepend(selectedAssetId, drawingController) {
drawingController.resetDrawingHighlights();
var dataSource = View.dataSources.get('traceDepend_ds');
dataSource.clearParameters();
dataSource.addParameter('eqDependId', selectedAssetId);
var records = dataSource.getRecords();
for (var i ... | [
"function onFootStrike() {\n if(applicationStarted){\n stepTracker();\n }\n}",
"function onGenerateDebugInfo() {\n clearTimeout(timer);\n if (po.obj.lstatus.match(/ready/g) == \"ready\") {\n blockUI_confirm(\"Confirm to discard current log and generate new one\",\n sendobjects_setRefreshTim... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
returns a string from the objects in an array, given a starting position, and separating them with a coman and space: "0, 1, 2..."" Arguments: array expects array of numbers starting position first array item that should be displayed | function displayArray(array, startPosition) {
let text = array[startPosition].toString();
for (let j = startPosition + 1; j < array.length; j++) {
text = text + ", " + array[j].toString();
}
return text;
} | [
"function numToString(array) {\n let strings = array.map(function(num) {\n return num.toString();\n });\n return strings;\n}",
"function arrayToString()\n{\n\tif ( ! arguments.length ) { return '/' + this.map( mapValue ).join( '/' ) ; } // jshint ignore:line\n\telse { return '/' + Array.prototype.slice.app... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Record a capture against in this match result. | recordCapture(options) {
try {
jsiiDeprecationWarnings.aws_cdk_lib_assertions_MatchCapture(options);
}
catch (error) {
if (process.env.JSII_DEBUG !== "1" && error.name === "DeprecationError") {
Error.captureStackTrace(error, this.recordCapture);
... | [
"listenToMatchingAction (matcher, handler, deferExecution) {\n this._actionListeners.push({matcher, handler, deferExecution});\n }",
"function AddCaptureMove(move) {\n\tBoard.moveList[Board.moveListStart[Board.ply+1]] = move;\n\tBoard.moveScores[Board.moveListStart[Board.ply+1]++] = MvvLvaScores[CAPTURED(move... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
This function is used for masking sensitive information Like DOB,Credit card/Debit card and SSN | function maskPaymentInformation() {
var validationType = $(this).attr("validation");
var value = $(this).val();
if ((validationType != undefined && validationType != "undefined" && value != "" && value != undefined) && (validationType == "SSN" || validationType == "credit" || validationType == "debit" ||... | [
"function putMask_BillNo(aField)\n {\n var lstrValue = aField.value;\n var finalString = '';\n\n if(lstrValue.length==8){ // Curtailing Blank spaces from the begining and end of the entered text\n lstrValue = trimString(lstrValue);\n lstrValue = lstrValue.toUpperCase();\n\n finalString = lstrVal... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
CODING CHALLENGE 348 Create a left rotation and a right rotation function that returns all the left rotations and right rotations of a string. | function leftRotations(str) {
const a = [str];
for (let i = 0; i < str.length - 1; i++) {
a.push(a[i].slice(1, a[i].length) + a[i].slice(0,1));
}
return a;
} | [
"function rotationalCipher(input, rotationFactor){\n\n //Input validation. Check and make sure that input is a valid string and the rotationFactor is a valid number\n const sol = [] //['3','4']\n let newChar = ''\n//i = 2 input.length=2\n for(let i = 0;i<input.length;i++){\n //code = 50\n let code = inp... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
MARK Functions for Flow hover effects applyFlowEffects(flow, opacity, styles): Update a flow & its related labels based on the hover state: | function applyFlowEffects(f, o, s) {
// Use overall 'opacity' because f might use either a fill or stroke:
d3.select(`#${f.dom_id}`).attr('opacity', o);
[f.source, f.target].filter((n) => n.label?.bg)
.forEach((n) => {
d3.select(`#${n.label.bg.dom_id}`)
.attr('fill', s.fill)
... | [
"function turnOnFlowHoverEffects(_, f) {\n f.hovering = true;\n applyFlowEffects(f, f.opacity_on_hover, hlStyle.hover);\n }",
"function hoverEffects() {\n\t//Save current \"<a>\" tag colour of unordered list with class=\"categories-actors-list\"\n\tvar originalActorNameColor = $(\".categories-actors-list l... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Visit a parse tree produced by PlSqlParserselected_tableview. | visitSelected_tableview(ctx) {
return this.visitChildren(ctx);
} | [
"visitTableview_name(ctx) {\n\t return this.visitChildren(ctx);\n\t}",
"visitSelect_only_statement(ctx) {\n\t return this.visitChildren(ctx);\n\t}",
"visitContainer_tableview_name(ctx) {\n\t return this.visitChildren(ctx);\n\t}",
"visitSelected_list(ctx) {\n\t return this.visitChildren(ctx);\n\t}",
"vis... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
We follow the Scheme original here, and provide a builtin function apply_in_underlying_javascript. | function apply_primitive_function(fun,args) {
return apply_in_underlying_javascript(
primitive_implementation(fun),
args);
} | [
"function apply_primitive_function(fun, argument_list) {\n return apply_in_underlying_javascript(\n primitive_implementation(fun),\n argument_list);\n}",
"async callJS(fnName, args) {\n let fn = globalThis;\n for (const el of fnName.toJs()) {\n fn = fn[el];\n }\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Updates the headers with player in first and player in last with the players in first and in last in the season. If this is the first session and no one has any points, do not display the player in first and player in last headings | function fillPlayerHeaders() {
// Get season ID and players
const urlParams = new URLSearchParams(window.location.search);
const seasonId = urlParams.get('seasonId');
// Get all players in season
$.getJSON("http://league-tracker-rest-api-java-2.mybluemix.net/seasons/" + seasonId + "/players",
... | [
"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 populateLeaderboardTable() {\n\t// Ordeno el json dependiendo ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Update state of splitview and option elements | function _updateUIStates() {
var spriteIndex,
ICON_CLASSES = ["splitview-icon-none", "splitview-icon-vertical", "splitview-icon-horizontal"],
layoutScheme = MainViewManager.getLayoutScheme();
if (layoutScheme.columns > 1) {
spriteIndex = 1;
} else if (layoutS... | [
"function toggleOptions() {\n\t\t\tif (optsView.className.indexOf('adi-hidden') !== -1) {\n\t\t\t\tremoveClass(optsView, 'adi-hidden');\n\t\t\t} else {\n\t\t\t\taddClass(optsView, 'adi-hidden');\n\t\t\t\tpathView.textContent = '';\n\t\t\t\tattrView.querySelector('.adi-content').innerHTML = '';\n\t\t\t\trefreshUI();... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Adds objects to the scene based on the number of objects and the gap between them | function addWorldObjects() {
//Number of rendered objects
let numObjects = 60;
let gap = 6.28 / 60;
for (let i = 0; i < numObjects; i++) {
let rnd = Math.random();
if (rnd <= 0.25) {
addObject(false, i * gap, true);
} else if (rnd > 0.2... | [
"function addSegments() {\n for (let i = 0; i < newSegments; i++){\n // We're just taking the very last element of our snake and\n // duplicating that onto the end of our snake.\n snakeBody.push({ ...snakeBody[snakeBody.length - 1] })\n }\n // The snake needs to stop growing.\n newS... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
hide start page of the quiz | function hideFirstPage() {
quizFirstPage.style.display = "none";
} | [
"function setUpQuestionPage() {\n $('.start-page').hide();\n $('.question-page').show();\n $('#questionButton').show();\n $('.nav-items').show();\n $('.question-result').hide();\n}",
"function showFirstQuizQuestion(){\r\n\r\n\t// we want to remove the initial heading of lets play the quiz and make the screen... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Hides the widget menu for a specific widget | function hideMenu(widgetId) {
$("#widget-" + widgetId + "-menu").hide();
} | [
"function ViewerToolsHide() {\r\n if( G.VOM.viewerDisplayed ) {\r\n G.VOM.toolbarsDisplayed=false;\r\n ViewerToolsOpacity(0);\r\n }\r\n }",
"hideContextMenu() {\n this.contextMenuType = '';\n this.moveMenuVisibility = false;\n }",
"function hideBuilder(){\n\tbuilder.s... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Calculate a deterministic reputation item hash and return a Buffer hash value | function calculateReputationItemHash(repItem) {
let idBytes = Buffer.alloc(4)
idBytes.writeUInt32BE(repItem.id)
let calBlockHeightBytes = Buffer.alloc(4)
calBlockHeightBytes.writeUInt32BE(repItem.calBlockHeight)
let calBlockHashBytes = Buffer.from(repItem.calBlockHash, 'hex')
let prevRepItemHashBytes = Buff... | [
"function hash(uuid) {\n var hash = 0, i, chr;\n if (uuid.length === 0) return hash;\n for (i = 0; i < uuid.length; i++) {\n chr = uuid.charCodeAt(i);\n hash = ((hash << 5) - hash) + chr;\n hash |= 0; // Convert to 32bit integer\n }\n if (hash < 0) {\n hash += 1;\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Set internal data by dotprop key and value, or object containing update information | set(key, value = null) {
// If only argument is an Object, merge Object with internal data
if (key instanceof Object && value == null) {
const updateObj = key;
Object.assign(this.__data, updateObj);
this.__fullUpdate = true;
return;
}
// Add change to internal updates set
th... | [
"updateInfo(key, newValue) {\n let info = this.props.info;\n info[key] = newValue;\n this.props.updateShipInfo(info);\n }",
"set(id, data) {\n let oldData = this.raw();\n oldData[id] = data;\n this._write(oldData);\n }",
"update(key, updater, cb) {\n this.set(key, updater(th... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Tries to load a .babelrc and returns the parsed object if successful | function loadFromPath(babelConfigPath) {
var config = void 0;
if (_fs2.default.existsSync(babelConfigPath)) {
var content = _fs2.default.readFileSync(babelConfigPath, 'utf-8');
try {
config = _json2.default.parse(content);
config.babelrc = false;
logger.info('=> Loading custom .babelrc');
... | [
"function loadConfig() {\n\tconfig_file = fs.readFileSync(\"./config.json\");\n\tconfig = JSON.parse(config_file);\n}",
"function getCliConfig(): RNConfig {\n const cliArgs = minimist(process.argv.slice(2));\n const config = cliArgs.config != null\n ? Config.loadFile(path.resolve(__dirname, cliArgs.config))\... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Indicates that an operation failed. This metric applies only to the IssueCertificate operation. | function failure(change) {
return metric("Failure", change);
} | [
"failure(correlationId, component, operation, error, duration) {\n this.logTrace(correlationId, component, operation, error, duration);\n }",
"function metricsFailed(response) {\n if (destroyed) {\n return;\n }\n\n failureCount++;\n if (scope.noData) {\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Given an array of patterns, returns an array of paths to search. Duplicates and paths under other included paths are filtered out. | function getSearchPaths(patterns) {
// Ignore negate patterns
patterns = patterns.filter(x => !x.negate);
// Create a map of all search paths
const searchPathMap = {};
for (const pattern of patterns) {
const key = IS_WINDOWS
? pattern.searchPath.toUpperCase()
: patter... | [
"function getFilePaths(options) {\n\tif (Array.isArray(options.filePaths)) {\n\t\treturn Promise.resolve(options.filePaths.concat([]));\n\t}\n\treturn getGlobIgnore(options.cwd, options)\n .then(ignore => glob('**/*', {\n\tcwd: options.cwd,\n\tdot: false,\n\tignore,\n\tnodir: true\n}));\n}",
"function match(pa... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Checks if setting a parameter to a specific value is supported. `name` name of the parameter `value` parameter value | canSetParameter(name, value) {
return true;
} | [
"function ServerBehavior_setParameter(name, value)\n{\n if (this.bInEditMode)\n {\n this.applyParameters[name] = value;\n }\n else\n {\n this.parameters[name] = value; \n }\n}",
"function isParam( paramName, paramValue ) {\r\n\r\n // When comparing, using the coersive equals since we ma... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Ins alias for write | ins() {
this.write.apply( this, arguments );
} | [
"function CustomWritable() {\r\n Writable.call(this);\r\n}",
"function FileWriter() {\n}",
"setWriteEnable(writeEnable) {\n this.writeEnable = writeEnable;\n }",
"putc() {\n this.writechar.apply( this, arguments );\n }",
"write(patch) {\n if (this[completed]) {\n throw new Err... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Get Sass version information | function getVersionInfo() {
return [
['node-sass', package.version, '(Wrapper)', '[JavaScript]'].join('\t'),
['libsass ', package.libsass, '(Sass Compiler)', '[C/C++]'].join('\t'),
].join(eol);
} | [
"function getVersion() {\n var contents = grunt.file.read(\"formulate.meta/Constants.cs\");\n var versionRegex = new RegExp(\"Version = \\\"([0-9.]+)\\\";\", \"gim\");\n return versionRegex.exec(contents)[1];\n }",
"function getFontAwesomeVersion() {\n return new Promise((resolve, reject)... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Setter for this.study, tells the model whether we're doing the study. This flag affects: study welcome frame browser check frame phq frame transition frames before and after app demographics collection we could potentially bundle more of the config items under the study flag to reduce the number of config options | set_study(value) {
this.study = value;
return this;
} | [
"set details(details) {\n if (Lang.isNull(details)) return;\n let detailsObj = new Details();\n detailsObj.value = details;\n this._study.details = detailsObj;\n }",
"function overrideMusicStudio () {\n function logAndSend (msg, detail) {\n var m = ['Will send:', m... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Resets the game board array to null values for use in other modules to restart the game. | function resetBoard() {
gameboard.forEach(function(space, index) {
this[index] = null;
}, gameboard)
_render()
} | [
"function resetBoard() {\n $tileArray.each(function (i, value) {\n var removeGreen = $($tileArray[i]).removeClass(\"green\");\n turnCounter = 0;\n greenTileCount = 0;\n });\n }",
"function resetGameOfLife()\n{\n // RESET ALL THE DATA STRUCTURES TOO\n gridWidth = canvasWidth... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Set mode, repaint ui, and flag for reload | function set_mode(new_mode)
{
set_mode_no_update(new_mode);
need_reload = true;
repaint_ui_now();
} | [
"function updateMode(newMode) {\n mode = newMode; // sets global 'mode' variable\n\n // Toggle the correct mode button\n d3.select('div#modes')\n .selectAll('button')\n .attr('class', null);\n d3.select('div#modes')\n .selectAll('button#' + mode)\n .attr('class', 'hidden');\n\n //... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Redraw split track axis or hide it, and show/hide the legend, as determined by current layout parameters and data | updateSplitTrackAxis(categories) {
const legend_axis = this.layout.track_split_legend_to_y_axis ? `y${this.layout.track_split_legend_to_y_axis}` : false;
if (this.layout.split_tracks) {
const tracks = +categories.length || 0;
const track_height = +this.layout.trac... | [
"toggleSplitTracks() {\n this.layout.split_tracks = !this.layout.split_tracks;\n if (this.parent.legend && !this.layout.always_hide_legend) {\n this.parent.layout.margin.bottom = 5 + (this.layout.split_tracks ? 0 : this.parent.legend.layout.height + 5);\n }\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Given an array of mentions, computes the start and end point of the context excerpt, and then collapses any overlapping excerpts. | function collapseMentions(mentions) {
var sentenceRe = /([!?.)]+)\s+/g, // sentence splitting requires NLP
i,
n = mentions.length,
d0,
d1;
// First compute the excerpt contexts.
for (i = 0; i < n; ++i) {
d0 = mentions[i];
d0.start = excerptStart(d0);
d0.end = excerptEnd(d0);
... | [
"decorations(node, decorations) {\n var leaves = [_objectSpread$5({}, node)];\n\n for (var dec of decorations) {\n var rest = _objectWithoutProperties(dec, [\"anchor\", \"focus\"]);\n\n var [start, end] = Range.edges(dec);\n var next = [];\n var o = 0;\n\n for (var leaf ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
find all matches starting at the two given positions p1, p2: the two positions to search from m1: list of positions comprising the match so far for the first position m2: list of positions comprising the match so far for the second position matches: results array counts: counts by sequence visited: tracks which cells w... | function omnimatches(p1, p2, m1, m2, matches, counts, visited, seq, diagonal) {
var r1 = p1[0]; var c1 = p1[1];
var r2 = p2[0]; var c2 = p2[1];
if (r1 == r2 && c1 == c2) return false; // positions are the same
if (visited[r1][c1]) return false; // already visited this position
if (visited[r2][c2]) return false;... | [
"function findOverlap(word1, word2) {\n\t\t\tif(!canMatchBegin(word1, word2) || !canMatchEnd(word1, word2) || !canMatchLength(word1, word2)) {\n\t\t\t\treturn null;\n\t\t\t}\n\t\t\tlet [word1Pattern, word2Pattern] = [wordPattern(word1), wordPattern(word2)]; \n\t\t\tfor(let i = 0, wordMatch; i < word1Pattern.length;... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
getLayerScaling / public methods getBoundingBox() Return a T5.Geo.BoundingBox for the current map view area | function getBoundingBox() {
var rect = self.getViewRect();
return new T5.Geo.BoundingBox(
T5.GeoXY.toPos(T5.XY.init(rect.x1, rect.y2), radsPerPixel),
T5.GeoXY.toPos(T5.XY.init(rect.x2, rect.y1), radsPerPixel));
} | [
"function getBoundingBox() {\n if (!bounds) { return } // client does not want to restrict movement\n\n if (typeof bounds === 'boolean') {\n // for boolean type we use parent container bounds\n var sceneWidth = owner.clientWidth;\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
generate a polygon using functions | function genpoly()
{
find_coordinates(420,0,820,230,numberOfDivsion,1);
//console.log("****************");
find_coordinates(0,230,420,460,numberOfDivsion,0);
draw_polygon(m_context);
//render(mycanvas_context);
push_into_stack();
empty();
//console.log("****************");
find_coordinates... | [
"function drawSVG_Polygon()\n {\n var polygon = scene.create( { t: \"path\", d:\"polygon points:30,0 60,60 0,60\",\n strokeColor: 0x000000ff, strokeWidth: 2, fillColor: 0xFFFF00ff, parent: bg, x: 50, y: 50} );\n\n return polygon;\n }",
"function createPolygon(pointsArray){\n\t... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Send an article for the Pebble to display | function sendArticleToPebble(article, isNew) {
Pebble.sendAppMessage({
ARTICLE: article.title,
IS_NEW: isNew,
DISTANCE: article.distanceAway.toFixed(1)
},
function(e) {
console.log('Article info sent to Pebble successfully!');
},
function(e) {
console.log('Error sending article info to Peb... | [
"function onShareClick() {\n $('.js-email-button').click(function(e) {\n const id = $(this).closest('article').attr('data-id')\n const petObj = getPetFromStore(id)\n window.location.href = `mailto:?&subject=Pet available for adoption from ${petObj.organization.name}&body=Pet Name: ${petObj.attributes.name... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
creates a texture given a context and options | function makeTexture(gl, options) {
const texture = gl.createTexture();
if (texture === null) {
throw new Error("problem creating texture");
}
// flip the order of the pixels, or else it displays upside down
gl.pixelStorei(gl.UNPACK_FLIP_Y_WEBGL, true);
// bind the texture after creating... | [
"function textureHelper(obj, texUrl) {\n setTexture(obj.name, texUrl);\n}",
"function mTexture() {\n texture(...[...arguments]);\n}",
"function initTexture() {\n planetTexture = gl.createTexture();\n planetTexture.image = new Image();\n planetTexture.image.onload = function () {\n configur... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
When contenttype is selected, no need to wait for lupicka to be clicked. Fire the overlay right away. | function open_overlay_on_ct_selection() {
var ct_id = $(this).val();
if ( ! ct_id ) return;
var content_type = id2ct(ct_id);
var id_input_id = this.id.replace(/ct$/, 'id');
if (id_input_id == this.id) {
carp('Error attempting to attach open_overlay to select.target_ct... | [
"static onSelect() {\n const node = Navigator.byItem.currentNode;\n if (MenuManager.isMenuOpen() || node.actions.length <= 1 ||\n !node.location) {\n node.doDefaultAction();\n return;\n }\n\n ActionManager.instance.menuStack_ = [];\n ActionManager.instance.menuStack_.push(MenuType.MA... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Hours LED Display Double check | function updateHours()
{
let nowHours = new Date();
let nowHoursString = "";
if (nowHours.getHours() === 0 && militaryTime === 0) {
hoursMath.innerHTML = `1 + 2 = 12`;
hours.innerHTML = "Hours";
ledFirst(hours11, hours12, hours14, hourOnLED, hourOffLED, 1);
ledSecond(hours21... | [
"function onMouseDownEvent()\n{\n let clickedTime = calculateClickedTime();\n let minute = (30 * clock.indicators.m.angle) / (Math.PI + 15);\n let hour = (6 * clock.indicators.h.angle) / (Math.PI + 3);\n let threshold = 0.25;\n\n if((clickedTime[0] < minute + threshold) && (clickedTime[0] > minute - threshold... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
method to set values of internal members | set(x, y) {
this.a = x; // indirectly accessing private members
this.b = y;
} | [
"_setData() {\n this._global[this._namespace] = this._data;\n }",
"_setDataToUI() {\n const data = this._data;\n if (data === undefined) return;\n console.log('View#_setDataToUI', this);\n\n if (data instanceof Object) {\n eachEntry(data, ([name, val]) => this._setFieldValue(name, val));\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
function Action(event: Object, next: function, fail: function) creates a callback function for db operations. if successful event.data will be set and next() will be called. if the operation returned an error, fail(error) will be called instead. | function Action(event, next, fail){
return function(err, data){
if(err) return fail(err);
event.data = data;
next();
}
} | [
"insertEvent(event, callback) {\r\n return this.DB.run(\r\n `INSERT INTO event (name,category,type,RSO_name,description,date, \r\n time,address,contact_phone,contact_email) VALUES (?,?,?,?,?,?,?,?,?,?)`,\r\n event, (err) => {\r\n callback(err)\r\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
ZmProfileGroupController is use to retrieve user list from services | function groupCtrl(zmProfileGroupService) {
var vm = this;
vm.user = {
id:''
};
/** Get group list from service */
zmProfileGroupService.readListOfGroups(function(data){
vm.group = data;
});
/** Get user list from service */
zmProfileGroupService.readGroupDetail(function(id){
vm.users = data.lists.peop... | [
"async getUserList () {\n return await this.Config.userStore.getUserList();\n }",
"async index({ params, response }) {\n const group = await Group.find(params.group_id)\n if (!group) return response.notFound({ message: 'group not found!' })\n\n return group.users()\n .orderBy('id', 'desc')\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Add a custom JS to the audience condition to bucket the visitor | function updateAudience(obj, aid) {
var advanced_js = {
dimension_id: 1234567890,
value: "window.bucketFromAudience(" + obj.id + ");"
};
var level1 = ["or", advanced_js];
var level2 = ["or", level1];
DATA.audiences[aid].conditions[DATA.audiences[aid].conditions.length] = le... | [
"function bucketMVT(obj) {\n var ready = false;\n // check if this experiment has an audience\n var audiences = getAudience(obj);\n if (audiences === null) {\n // no audience so perform the bucketing now\n findBucket(obj);\n } else {\n // the experiment ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Debugging function to write the JSON representation of this object to the console. | dump() {
console.log(`\n"${this.constructor.name}": ${JSON.stringify(this, null, 4)}`);
} | [
"constructor() {\n\t\tthis._prettyJson = false;\n\t}",
"saveToJSON () {\n\t\tlet digimonJSON = JSON.stringify(this);\n\n\t\treturn digimonJSON;\n\t}",
"toJSON() {\n return JSON.stringify(\n this.configuration,\n function(key, val) {\n return (typeof val === 'function'... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
returns a random string from a dictionary | function get_single_string(myDict) {
var count = 0;
for (var key in myDict) {
count++;
}
var randomint = getRandomInt(0, count-1);
return myDict[randomint];
} | [
"function get_single_key(myDict) {\n var count = 0;\n var newArray = [];\n for (var key in myDict) {\n count++;\n newArray.push(key);\n }\n var randomint = getRandomInt(0, count-1);\n return newArray[randomint];\n}",
"function madlibs(template) {\n const dictionary = {\n adject... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Visit a parse tree produced by PlSqlParsertransaction_control_statements. | visitTransaction_control_statements(ctx) {
return this.visitChildren(ctx);
} | [
"function parse_StatementList(){\n\t\n\n\t\n\n\tvar tempDesc = tokenstreamCOPY[parseCounter][0]; //check desc of token\n\tvar tempType = tokenstreamCOPY[parseCounter][1]; //check type of token\n\n\tif (tempDesc == ' print' || tempType == 'identifier' || tempType == 'type' || tempDesc == ' while' || tempDesc == ' if... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Home slider height fix | function homeSliderHeightFix() {
$('#home').height( $(window).height() );
} | [
"function setSlidesHeight() {\n let tallest = 0;\n\n $.each(self.find('.walkthrough__slide'), function () {\n tallest = $(this).height() > tallest ? $(this).height() : tallest;\n });\n\n $('.walkthrough__slide').css('height', tallest);\n }",
"function fullscreenImgHeight() {\n $('#home, .back... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
the editors affiliated node Syncs the content item to it's tree node this occurs on first load and after saving | function syncTreeNode(content, path, initialLoad) {
if (!$scope.content.isChildOfListView) {
navigationService.syncTree({ tree: "media", path: path.split(","), forceReload: initialLoad !== true }).then(function (syncArgs) {
$scope.currentNode = syncArgs.node;
});
... | [
"onNodeSave(){\n const treeList = deepcopy(this.props.value.treeList);\n\n const {selectedNode} = this.props.value;\n\n this.findNode(treeList, selectedNode.id, node => {\n node.iconUrl = selectedNode.iconUrl;\n node.priority = selectedNode.priority;\n node.modu... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Gets all information related to a game including clues/hints | async function getGameInfo(data) {
// Grabs the game based on id
const game = await prisma.game
.findUnique({
where: {
id: data,
},
})
.then((res) => {
return res;
});
// Grabs all clues related to the game
const clue = await prisma.clueshint
.findMany({
wher... | [
"function updateGameInfo() {\n\t\tvar $ = jewel.dom.$;\n\t\t$(\"#game-screen .score span\")[0].innerHTML = gameState.score;\n\t\t$(\"#game-screen .level span\")[0].innerHTML = gameState.level;\n\t}",
"function get_details(id){\n console.log(\"You clicked Game ID: \" + id);\n fetch_by_id(id);\n}",
"async funct... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
this function create a object data_export which contain data and simopt (if the user clic on save parametters) | function clicSaveEverything() {
var data_export = {};
data_export["market"] = data;
data_export["simulation"] = simopt;
var save = JSON.stringify(data_export);
document.location="data:text/csv;base64,"+btoa(save);
} | [
"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"
]
]
}
} |
Check the current state of the map vs the previous. The algorithm is optimised for when the keys do no change. | check(map) {
this._reset();
let insertBefore = this._mapHead;
this._appendAfter = null;
this._forEach(map, (value, key) => {
if (insertBefore && insertBefore.key === key) {
this._maybeAddToChanges(insertBefore, value);
this._appendAfter = inser... | [
"function checkSolution() {\r\n if (tileMap.empty.position !== 3) {\r\n return false;\r\n }\r\n\r\n for (var key in tileMap) {\r\n if (key == 1 || key == 9) {\r\n continue;\r\n }\r\n\r\n var prevKey = key == 4 ? 'empty' : key == 'empty'... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Predicate that returns true once. | function once$1() {
let first = true;
return async () => {
if (first) {
first = false;
return true;
}
return false;
};
} | [
"function short_circuiting_predicate(predicate, args) {\n var previous = args[0];\n for(var i = 1; i < args.length; i++) {\n if(!predicate(previous, args[i])) {\n return false; // short circuit\n }\n }\n return true; // no short circuit, all true\n }",
"function once(callback) {\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Gets whether a value is the end of the main range. | _isRangeEnd(value) {
return isEnd(value, this.startValue, this.endValue);
} | [
"isEnd(editor, point, at) {\n var end = Editor.end(editor, at);\n return Point.equals(point, end);\n }",
"inRange (number, start, end) {\n if (end === undefined) {\n end = start\n start = 0\n }\n if (start > end) {\n let temp = end\n end = start\n start = temp\n }... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
config options config.fs provide a gitfs interface implementation config.db provide a gitdb interface implementation config.bare boolean declaring this a bare repo If you provide fs, but no db, a db interface that uses the fs will be used. if you want a bare repo, the fs part can be omitted. | function createRepo(config) {
var bare = !!config.bare;
var init = !!config.init;
var db = config.db;
var fs = config.fs;
if (!fs && !bare) {
throw new Error("Full repos are required to have a fs backend");
}
if (!db && !fs) {
throw new Error("Either a db or fs interface must be provided for bare ... | [
"function gitInit(args, repo) {\n if (repo) throw new Error(\"Repository already exists\");\n return new Repo();\n}",
"extend(config) {\n\t\t\t// Add '~/shared' as an alias.\n\t\t\tconfig.resolve.alias.shared = resolve(__dirname, '../shared');\n\t\t\tconfig.resolve.alias['~shared'] = resolve(__dirname, '../... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
function to slice medicine name to 8 characters | function sliceMedicinename(med) {
var len = med.length;
if(len>8){
return med.slice(0,8);
}
else{
return med;
... | [
"function shortenName(name){\n var split, partA, partB, finalName;\n\n if($.getSizeClassification('medium_up') && name.length > 35){\n split = Math.floor((name.length - 1) / 4);\n partA = name.substring(0,split);\n partB = name.substring(name.length-split);\n finalName = partA + '.... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
the exchange hasAttachments of this event readonly attribute boolean hasAttachments; | get hasAttachments()
{
return this._hasAttachments;
} | [
"function isAttachment(session) { \n var msg = session.message.text;\n if ((session.message.attachments && session.message.attachments.length > 0) || msg.includes(\"http\")) {\n //call custom vision\n customVision.retreiveMessage(session);\n\n return true;\n }\n... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
void Initialize (IObjectId, EncodingType, string) | Initialize(IObjectId, EncodingType, string) {
} | [
"function ObjectId(id) {\n if(typeof id === \"string\" && id.match(/^[0-9a-f]{24}$/i)) {\n this.id = id\n } else if(typeof id === \"undefined\") {\n this.id = generateObjectId()\n } else {\n throw new Error(\"Only hex string ids are supported\")\n }\n}",
"InitializeEncode(RequestClientInfoClientId, s... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Trigger an event and/or a corresponding method name. Examples: `this.triggerMethod("foo")` will trigger the "foo" event and call the "onFoo" method. `this.triggerMethod("foo:bar")` will trigger the "foo:bar" event and call the "onFooBar" method. | function triggerMethod(event) {
for (var _len = arguments.length, args = Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
args[_key - 1] = arguments[_key];
}
// get the method name from the event name
var methodName = getOnMethodName(event);
var method = getOption.call(this, methodName);
... | [
"trigger( event, data ) {\n var listeners, listener;\n\n listeners = this._listeners[ event ];\n\n if ( listeners ) {\n for ( var i = 0, l = listeners.length; i < l; i++ ) {\n listener = listeners[ i ];\n listener.fn.call( listener.ctx || this, data );\n... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
TIPUS DE MISSATGES: 1 Servidor rep un missatge, i l'ha d'assignar el nom d'usuari que ha enviat el missatge i fer un broadcast als clients. 2 S'envia la llista de clients en mode Broadcast 5 S'envia al client el missatge amb el usuari corresponent. Called when a string message 'msg' from 'con' is received | onConnectionMessage(con, msg) {
var data = JSON.parse(msg);
switch (data.type) {
case "1":
var userMessage = {
type: "5",
user: this.listClients.get(con).getUsername(),
missatge: data.msg
}
var userMessageString = JSON.stringify(userMessage);
... | [
"function alertClients(user, msg, type) {\n console.log(\"SocketIO alerting clients: \", msg);\n io.broadcast('alert', {user: user, message: msg, time: new Date(), type});\n}",
"function broadcast(connections, msg) {\n //For Each connection will send the message\n connections.forEach(function (conn) {\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
BigNat > Int > Int | function h$ghcjsbn_indexBigNat(b, i) {
h$ghcjsbn_assertValid_b(b, "indexBigNat");
h$ghcjsbn_assertValid_s(i, "indexBigNat");
var bl = b[0];
return i >= bl ? 0 : b[i+1];
} | [
"static int64(v) { return n(v, -64); }",
"static int128(v) { return n(v, -128); }",
"static int8(v) { return n(v, -8); }",
"static int208(v) { return n(v, -208); }",
"isBigInt() {\n return !!(this.type.match(/^u?int[0-9]+$/));\n }",
"function bool(i) /* (i : int) -> bool */ {\n return $std_cor... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
This function constructs the character selection pallete based on user choices. | function pallete(passwordChoices,charArray){
var atLeastOneChar = false;
var palleteStr="";
atLeastOneChar = passwordChoices[0] || passwordChoices[1] || passwordChoices[2];
do {
/* Note using confirm and alert should preferably be replaced by jQuery form with radio buttons */
passwordChoices[0] = c... | [
"function choose(choice) {\n console.log(\"choice: \"+choice);\n for (var ch in cursors) {\n // get the plaintext of the current prefix.\n prefix = $(\"#prefix\"+ch).html(); // + \"<br><br>\";\n\n // add the text of the selected choice.\n prefix += \"<div class=\\\"chosen\\\">\"+cursors[ch].choices[ch... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
save product URLS to file | function writeMedicinesFile(url) {
if (!url) {
console.log("item was empty");
}
fs.appendFile("medicine-urls.txt", JSON.stringify(url), err => {
if (err) throw err;
});
} | [
"function clicSaveEverything() {\r\n var data_export = {};\r\n data_export[\"market\"] = data;\r\n data_export[\"simulation\"] = simopt;\r\n var save = JSON.stringify(data_export);\r\n document.location=\"data:text/csv;base64,\"+btoa(save);\r\n\r\n}",
"function storeDownloadableFiles(files,website)... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Determine whether the given properties match those of a `HttpGatewayRoutePrefixRewriteProperty` | function CfnGatewayRoute_HttpGatewayRoutePrefixRewritePropertyValidator(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... | [
"function CfnGatewayRoute_HttpGatewayRouteHeaderMatchPropertyValidator(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('Ex... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Sets the theme, and generates heatmaps when needed. | function setTheme() {
theme = FPSMeter.theme[o.theme];
// Generate heatmaps
heatmaps = theme.compiledHeatmaps || [];
if (!heatmaps.length && theme.heatmaps.length) {
for (j = 0; j < theme.heatmaps.length; j++) {
heatmaps[j] = [];
for (i = 0; i <= heatDepth; i++) {
heatmaps[j][i] = hslTo... | [
"function setupTheme() {\n var theme = interactive.theme;\n\n if (arrays[\"a\" /* default */].isArray(theme)) {\n // [\"a\", \"b\"] => \"lab-theme-a lab-theme-b\"\n theme = theme.map(function (el) {\n return 'lab-theme-' + el;\n }).join(' ');\n } else if (theme) {\n theme = 'lab-... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
(10) Write a JavaScript program to check whether a string starts with 'Java' and false otherwise. | function starts_with_java(str){
const i = str.indexOf("Java");
if (i == 0) {
return true;
} else {
return false;
}
} | [
"function checkIfJavaAppears({ string }) {\n if(string.substr(0, 4) === \"Java\") {\n return string.slice(4,);\n }\n return string;\n}",
"function containsLowercaseLetter(string) {\n return /[a-z]/.test(string);\n}",
"function startsWithUppercase(str) {\n return /^[A-Z]/.test(str);\n}",
"fun... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
`fetchOrgs` fetches data for all published organizers. | fetchOrgs() {
this.orgsSerivce.find({query: this.defaultQuery})
.then(message => {
this.setState({orgs: message.data, orgsLoaded: true});
})
.catch(err => {
printToConsole(err);
displayErrorMessages('fetch', 'organizers', err, this.updateMessagePanel, 'reload');
thi... | [
"function load_orgs() {\n\tif (orgs.length > 0) {\n var org_list = [];\n orgs.forEach(function(item) {\n (item.type === 'repo') ? repos.push(item) : org_list.push(item);\n });\n\n if (org_list.length > 0) {\n org_list.forEach(function(item){\n var t ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Gets the host portion from url. | function getHost(url) {
return url.replace(/^(\w+:\/\/[^/]*)\/?.*$/, '$1');
} | [
"function getHost() {\n return location.protocol + '//' + location.host\n }",
"function extractHostname(t) {\n return (t.indexOf(\"//\") > -1 ? t.split(\"/\")[2] : t.split(\"/\")[0]).split(\":\")[0].split(\"?\")[0]\n}",
"function getDomainByUrl(url) {\n\n\t// returns the domain by the full url\n\treturn ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
3 dimension of each cube | function makeCube(h, x, z) {
return [
{ x: x - 1, y: h, z: z + 1 },
{ x: x - 1, y: 0, z: z + 1 },
{ x: x + 1, y: 0, z: z + 1 },
{ x: x + 1, y: h, z: z + 1 },
{ x: x - 1, y: h, z: z - 1 },
{ x: x - 1, y: 0, z: z - 1 },
{ x: x + 1... | [
"function arrFromCube(cube, num) {\n let newArr = [];\n if (num === 0) {\n for (let i = 0; i < 3; i += 1) {\n for (let j = 0; j < 3; j += 1) {\n newArr.push(cube[i][j]);\n }\n }\n }\n if (num === 1) {\n for (let i = 0; i < 3; i += 1) {\n for (let j = 3; j < 6; j += 1) {\n n... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Given arr, add 1 to odd elements ([1], [3], etc.), console.log all values and return arr. | function increment(arr) {
for (var x = 0; x < arr.length; x++) {
if (x%2 != 0) {
arr[x] += 1;
}
console.log(arr[x]);
}
return arr;
} | [
"function addOdds(evensOnlyArray) {\n var newArr = []\n for(var i = 0; i < evensOnlyArray.length; i++) {\n newArr.push(evensOnlyArray[i] + 1)\n }\n evensOnlyArray.unshift(1)\n return allNums = evensOnlyArray.concat(newArr)\n}",
"function processOddNums (arr) {\n // let finalIndex = arr.length -1;\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
given an n in [d1, d2], return a linearly related number in [r1, r2] | function map(n, d1, d2, r1, r2) {
var Rd = d2-d1;
var Rr = r2-r1;
return (Rr/Rd)*(n - d1) + r1;
} | [
"function usAndNumberBeetweenUs(n1,n2){\n\tif(n1<n2){\n\tvar arr=[];\n\tarr.push(n1);\n\tarr.push(n2);\n\n\tarr.reduce(function (x,y){\n\t for(i=n1;i<n2;i++){\n\t\tif(x<n2){\n\t\t\tarr.push(++x);\n\n\t\t}\n\t\t}\t\n\n\t})\n\tarr.shift();\n\tarr.shift();\n\tarr.unshift(n1);\n}\nif(n1>n2){\n\tvar arr=[];\n\tarr.push(... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Retrieves the easy to parse worldstate from WFCD | function getWorldState() {
switch (Cookies.get('platform').toLowerCase()) {
case 'ps4':
$.getJSON('https://ws.warframestat.us/ps4', (data) => {
worldState = JSON.parse(JSON.stringify(data));
updateTime = (new Date()).getTime();
updateDataDependencies();
updatePage();
});
break;
... | [
"function getMapState() {\n // Call a 'local' CGI script that outputs data in JSON format\n var query = \"out.json\";\n log(\"Debug: getMapState: Calling cgi script \\\"\" + query + \"\\\"\" );\n var doreq = MochiKit.Async.doSimpleXMLHttpRequest( query );\n doreq.addCallback( handleStateUpdate );\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Checking inputs. If communities have search fields return communities.results | computed_communities() {
const { communities } = this;
if (communities) {
if (communities.results) {
return communities.results;
}
return communities;
}
return false;
} | [
"_onSearchInputChanged(searchInput) {\n if(searchInput) {\n this.listedProjects = this.projects.filter(project => {\n return project.name.toLowerCase().includes(searchInput.toLowerCase());\n });\n } else {\n // no search input, show all projects that were loaded\n this.listedProject... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Optional Custom function : make secure ivr session to a given flow OBSOLETE | function transferIVRSessionToFlowId(newFlowId, newUserData) {
console.log('transferIVRSession:', newFlowId, newUserData);
loadConversatinList();
makeSecureIVRSession(newFlowId, newUserData);
console.log('Finish (paraemtric)');
} | [
"function makeSecureIVRSession(flowId, userData) {\r\n\tconsole.log('makeSecureIVRSession (flowId,userData)');\r\n\tif(typeof flowId !== 'string') {\r\n\t\tconsole.log('Parameter #1 is not a string');\r\n\t\treturn;\r\n\t}\r\n\tif(typeof userData !== 'string') {\r\n\t\tconsole.log('Parameter #2 is not a string');\r... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
initialize content of date popup | function initialiseDatePopup(element){
var output_date = getOutputFormat(element.parentNode.querySelector('.date'));
var date = moment(output_date, format.date.display);
var j = 0;
var order = [];
var split_format = format.date.edit.split('');
for(var i = 0; i < split_format.length; i++){
if(split_format[i] ==... | [
"function pgvar_dtpdfecha_inicial__init(){\n $('#pgvar_dtpdfecha_inicial').datepicker({\n language: \"es\",\n todayBtn: \"linked\",\n format: \"dd/mm/yyyy\",\n multidate: false,\n todayHighlight: true,\n autoclose: true,\n\n }).datepicker(\"setDate\", new Date());\n}"... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Produce a unique name. The name might be unique among different prefixes if any of the prefixes end in a digit so the prefix should be a constant string (not based on user input) and must not end in a digit. | uniqueName(prefix) { return `${prefix}${this.nextNameIndex++}`; } | [
"_makeNameUnique(name, map, appendNum = 0) {\n\n const newName = `${ name }${ appendNum || '' }`;\n return newName in map ? this._makeNameUnique(name, map, appendNum + 1) : newName;\n\n }",
"function createID(firstname, lastname) {\n\treturn firstname[0].toLowerCase() + lastname[0].toUpperCase() ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Is the selected color text valid. Currently only supports hexadecimal form. | function isValidColor(text) {
return hexColorRegEx.test(text);
} | [
"function colorValidate(){\n console.log(\"colorSelect is \"+colorSelect);\n var bGC = document.body.style.backgroundColor;\n console.log(\"color is \" + bGC);\n if (bGC === undefined || bGC === \"\" ){\n return false;\n } else {\n return true;\n }\n}",
"static test(color) {\n r... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
The function for count the upload pdf information and set the 'filename' value | function updateFileName() {
var file = $('#pdfbutn').get(0).files[0];
if (file) {
// var fileSize = 0;
// if (file.size > 1024 * 1024)
// fileSize = (Math.round(file.size * 100 / (1024 * 1024)) / 100).toString() + 'MB';
// else
// fileSize = (Math.round(f... | [
"function getNewName()\r{\r\tvar ext, docName, newName, saveInFile, docName;\r\tdocName = sourceDoc.name;\r\text = '_AB_nobleed_HR.pdf'; // new extension for pdf file\r\tnewName = \"\";\r\t\t\r\tfor ( var i = 0 ; docName[i] != \".\" ; i++ )\r\t{\r\t\tnewName += docName[i];\r\t}\r\tnewName += ext; // full pdf name o... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Funcao que pega todos os elementos do formulario e verifica se sao checkbox e se estao marcados. Se estao marcados, seta o valor do campo hidden pra 'S'. OBS.: o nome do campo hidden eh o nome correto e o nome do checkbox tem duas letras a mais antes. No caso foi adotado 'L_' de Lixo. | function valSetaCheckBox(oForm) {
for (i=0; i<oForm.elements.length; i++) {
oCheckBox = oForm.elements[i];
if (oCheckBox.type == "checkbox" && oCheckBox.checked) {
oHidden = valRetornaCampo(oForm,oCheckBox.name.substring(2,oCheckBox.name.length));
oHidden.value = "S";
}
}
return true;
} | [
"function checaVisibilidadePlano(){\n\n if($(\"#planoEstagio\").is(':visible')) {// checa se atributo esta visivel\n // faca nada\n }else{\n $( \"form > div > div\" ).hide();\n $(\"#planoEstagio\").show();\n }\n\n}",
"function renameCheckboxes(formObj, newName){\n var els = formObj.... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Pops from our _storage array. | pop() {
return this._storage.pop()
} | [
"_store() {\n try {\n window.sessionStorage.setItem('playQueue', JSON.stringify(this._array));\n } catch(e) {}\n }",
"getSavedImagesFromLocalStorage() {\n this.savedImagesInLocalStorage = [];\n\n const partialStorageArray = this.getPartialStorageArray();\n\n if (pa... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Gulp plugin that compiles the Handlebars expressions out of a file. | function gulpHandlebarsCompile() {
return through.obj(function(file, enc, callback) {
if (file.isNull()) {
this.push(null);
callback();
return;
}
if (file.isStream()) {
this.emit("error", new gulpUtil.PluginError(PLUGIN_NAME, "Streams are not ... | [
"function gulpHandlebarsRegisterHelpers() {\n return through.obj(function(file, enc, callback) {\n if (file.isNull()) {\n this.push(null);\n callback();\n return;\n }\n \n if (file.isStream()) {\n this.emit(\"error\", new gulpUtil.PluginErro... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
int OversampleH, OversampleV; // 3, 1 // Rasterize at higher quality for subpixel positioning. We don't use subpixel positions on the Y axis. | get OversampleH() { return this.internal.OversampleH; } | [
"blendSide(data, left) {\n let _sideLength = data.data.length\n let _sourceX = left ? 0 : this._imageWidth - BLEND\n let _sourceHeight = this._imageHeight + this._offset\n //let _sourceData = this._ctx.getImageData(0, 0, this._imageWidth, this._imageHeight + this._offset)\n le... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
handle current status of dragHandler and yearlabel send status of year to other modules | function update(){
let h = xAxis.invert(currentValue),
year = formatDateIntoYear(h);
sendYearAndMovingStatus(year,that.isMoving);
handle.attr("cx", xAxis(h));
label
.attr("x", xAxis(h))
.text(formatDateIntoYear(h));
} | [
"changeYear(newYear){\n this.yearReleased = newYear;\n }",
"handleYearChange(event) {\n this.setState({ selectedYear: event.currentTarget.value },() => { this.findVersions(); this.handleGetSchedule();});\n }",
"function updateYear(year) {\n homeControllerVM.homeSelectedRegistratio... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Load the component, add the data, add the component to the map and set the close button watcher | loadData () {
const map = this.mapObject
let heightGraphOptions = this.buildHeightGraphOptions()
this.hgInstance = this.leafletAcessor.control.heightgraph(heightGraphOptions)
this.controlRef = this.hgInstance.addTo(map)
this.addData(this.data)
this.isOpen = true
this.watchClose... | [
"function reShowMapPopUp(ev,feature,idx){\n //get which layer is active\n var activeLayer = $(\".map-ui li.active\").attr(\"id\");\n\n var map_id = activeLayer+\"-\"+feature.properties.N_Name;\n\n url = getPopupUrlFrom(activeLayer,feature);\n console.log(\"ulr: \" + url);\n// map_popups_currently_... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Visit a parse tree produced by PlSqlParservarray_type_def. | visitVarray_type_def(ctx) {
return this.visitChildren(ctx);
} | [
"visitType_declaration(ctx) {\n\t return this.visitChildren(ctx);\n\t}",
"visitType_body(ctx) {\n\t return this.visitChildren(ctx);\n\t}",
"visitType_definition(ctx) {\n\t return this.visitChildren(ctx);\n\t}",
"visitReplace_type_clause(ctx) {\n\t return this.visitChildren(ctx);\n\t}",
"visitSqlj_object... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Updates the `TRANSPLANTED_VIEWS_TO_REFRESH` counter on the `LContainer` as well as the parents whose 1. counter goes from 0 to 1, indicating that there is a new child that has a view to refresh or 2. counter goes from 1 to 0, indicating there are no more descendant views to refresh | function updateTransplantedViewCount(lContainer, amount) {
lContainer[TRANSPLANTED_VIEWS_TO_REFRESH] += amount;
let viewOrContainer = lContainer;
let parent = lContainer[PARENT];
while (parent !== null &&
((amount === 1 && viewOrContainer[TRANSPLANTED_VIEWS_TO_REFRESH] === 1) ||
(amo... | [
"childrenChanged() {\n if (true === this.adjustGroupWhenChildrenChange) {\n this.adjustChildrenVertically();\n this.adjustChildrenHorizontally();\n }\n }",
"repaintViews() {\n\n for (let viewport of this.viewports) {\n if (viewport.isVisible()) {\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Function to create a li element to hold a website | function createWebsiteElement(name, url) {
var ul = document.getElementById("websiteContainer");
var btn = document.createElement("button");
btn.setAttribute("class","pull-right btnDelete glyphicon glyphicon-trash");
var text = document.createTextNode(name);
var li = document.createElement("li");
li.setAttribu... | [
"function buildLi(elem){\n var a = document.createElement('a');\n a.href = '#' + elem.id\n a.rel = 'internal';\n a.textContent = elem.textContent;\n\n var li = document.createElement('li');\n li.appendChild(a);\n return li;\n}",
"function createWebsiteTree() {\n let finalListUI = '';\n websit... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Get number of clicks Display in element "finalscore" | function displayScore() {
var finalScore = document.getElementById('final-score');
finalScore.textContent = "Score: " + clicks;
} | [
"function score(){\n\t\t// if the click was done correctly\n\t\tif(tempClickConfirm == true){\n\t\t\t\n\t\t\t//The score is higher the smaller the triangle is on click.\n\t\t\ttempScore = 30 - sectionSize[j];\n\t\t\ttotalScore += tempScore;\n\t\t\t//Resetting scoretimer and tempClickConfirm for the next click.\n\t\... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
isTruthyString will be true if the provided string is recognized as a value representing true. | function isTruthyString (s) {
return s === '1' || s.toLowerCase() === 'true'
} | [
"function assertIsTruthy(a){\n return a_is_truthy(a);\n }",
"function bool_2(s) /* (s : string) -> bool */ {\n return (s !== (\"\"));\n}",
"function boolify(value) {\n if(typeof value === 'boolean') {\n return value;\n }\n if(typeof value === 'string' && value) {\n var lower = value.toLower... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Retrieve a KalturaDrmPolicy object by ID. | static get(drmPolicyId){
let kparams = {};
kparams.drmPolicyId = drmPolicyId;
return new kaltura.RequestBuilder('drm_drmpolicy', 'get', kparams);
} | [
"static deleteAction(drmPolicyId){\n\t\tlet kparams = {};\n\t\tkparams.drmPolicyId = drmPolicyId;\n\t\treturn new kaltura.RequestBuilder('drm_drmpolicy', 'delete', kparams);\n\t}",
"static update(drmPolicyId, drmPolicy){\n\t\tlet kparams = {};\n\t\tkparams.drmPolicyId = drmPolicyId;\n\t\tkparams.drmPolicy = drmPo... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Create a function that inserts an HTML representation of a food into the DOM | function addFoodToDom(foodString){
const foodDiv = document.querySelector(".foodList");
foodDiv.innerHTML += foodString
} | [
"function generateContents(foodName) {\n\tvar food = foodDict[foodName];\n\t\n\t\n\tvar nameText = '<h1 class=\"text-center\">' + foodName + '</h1>';\n\tvar foodURL = '<h5 class=\"text-center\"><a target=\"_blank\" href=\"' + food[\"url\"] + '\">' + food[\"url\"] + '</a></h5>';\n\tvar imgText = '<img style=\"paddi... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Funtion returns the polyline shape in json format | function generateJSONStringFromPolyLine(polyLine){
var shape = [];
polyLine.getGeometry().eachLatLngAlt(function (lat, lng, alt, idx) {
var tempShape = [];
tempShape.push(parseFloat(parseFloat(lat).toFixed(6)));
tempShape.push(parseFloat(parseFloat(lng).toFixed(6)));
shape[shape.length] = tempShape;
... | [
"function draw_lines(results){\n\n for(i in results.distances){\n for(j in results.distances[i]){\n var line = results.distances[i][j].line;\n // Construct the polygon\n var poly = new google.maps.Polyline({\n path: google.maps.geometry.encoding.decodePath(... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Reads 4 bytes from array starting at offset as bigendian unsigned 32bit integer and returns it. | function readUint32BE(array, offset = 0) {
return ((array[offset] << 24) |
(array[offset + 1] << 16) |
(array[offset + 2] << 8) |
array[offset + 3]) >>> 0;
} | [
"function byteopsLoad32(x) {\r\n var r;\r\n r = uint32(x[0]);\r\n r = (((r | (uint32(x[1]) << 8)) >>> 0) >>> 0);\r\n r = (((r | (uint32(x[2]) << 16)) >>> 0) >>> 0);\r\n r = (((r | (uint32(x[3]) << 24)) >>> 0) >>> 0);\r\n return uint32(r);\r\n}",
"function LEW(arr, off) {\n return arr[off+3]... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Custom function to calculate the shadow data from a Mikulas instance | function getShadowData(clock) {
var opacity = 0.2, // default opacity/angle values
angle = -45;
if (clock.getElapsedMinutes() < 1140 && clock.getElapsedMinutes() > 300) {
// calculate opacity based on minutes elapsed today
opacity = (Math.sin((clock.getElapsedMinutes() / 4 - 90) * Math.PI / 180)).toFi... | [
"get Shadowmap() {}",
"function projectShadows(cloudMask,TDOMMask,image, meanAzimuth,meanZenith,cloudHeights,dilatePixels){\n //Find dark pixels\n var darkPixels = image.select(['nir','swir1','swir2']).reduce(ee.Reducer.sum()).lt(irSumThresh);//.gte(1);\n \n //Get scale of image\n var nominalScale = cloudMas... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Recibe una consulta SQL y una respuesta a enviar | function ejecutarSQL(sql, OK, notOK){
// conecta con la base de datos
const client = new Client(connectionData)
client.connect()
// Envia la consulta
client.query(sql)
.then(response => { // si la consulta sale bien
client.end() // Finaliza la conexcion
OK(response.ro... | [
"_query(connection, obj) {\n if (!obj || typeof obj === 'string') obj = {sql: obj}\n return new Promise(function(resolver, rejecter) {\n let { sql } = obj\n if (!sql) return resolver()\n if (obj.options) sql = assign({sql}, obj.options)\n connection.query(sql, obj.bindings, function(err, r... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Ensure that the parent of the current choice exist | ensureParentExist() {
return __awaiter(this, void 0, void 0, function* () {
return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () {
const collection = this.database.collection('choices');
const parent = yield collection.findOne({
... | [
"function checkParent(element) {\n $(element).closest(\".checkbox-tree-ul\").parent().children(\".checkbox\").find(\":checkbox\").prop(\"checked\", true);\n $(element).closest(\".checkbox-tree-ul\").parent().children(\".checkbox\").find(\":radio\").prop(\"checked\", true);\n}",
"get parentItem()\n\t{\n\t\t/... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Creates the base GitHub object config.timeout = Optional timeout (in milliseconds) to use for remote connections (default 20000) config.beforeSend = Optional callback that will be called just before making a remote connection config.complete = Optional callback that will be called when a remote connection terminates co... | function GitHub(config) {
if (config == null) {
config = {};
}
this.config = config;
if (config.timeout == null) {
config.timeout = 20000;
}
if (config.beforeSend != null) {
config.beforeSend = function() {};
}
... | [
"_githubRequest(url, callback) {\n return request({url: url, headers: {'User-Agent': 'request'}, json: true}, callback);\n }",
"function AuthOAuth2ConnectorGithubConfig() {\n _classCallCheck(this, AuthOAuth2ConnectorGithubConfig);\n\n _defineProperty(this, \"clientID\", undefined);\n\n _definePropert... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Only deployments targeted to Secure subnet in Production require an additional permission | function isSecureServerRole(configuration) {
if (configuration.serverRole.SecurityZone === 'Secure') return true;
return false;
} | [
"function isAccessibleByTransportMode() {}",
"grantsAllowed() {\n return this.grantPrivileges().reduce((a, b) => (\n a | this._config.grantPrivileges[b]\n ), 0);\n }",
"async function adaptSecurity () {\n const user = newGeoserverUser;\n const userPw = newGeoserverPw;\n\n if (!user || !userPw || ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |