query stringlengths 9 34k | document stringlengths 8 5.39M | negatives listlengths 19 20 | metadata dict |
|---|---|---|---|
Testing button presses on page NOTE: Letters AZ go from 6590 for the key codes | function letterPressed(event) {
// Use the letter pressed for finding the button
var myBtn = "btn" + event.code;
if (modalIsOn) {
modalOff();
return;
}
// Make the function call if the space bar is clicked
if (event.keyCode === 32) {
//var currBtn = "btn" + getC... | [
"function hitKey(e){\n\tswitch(e.key){\n\t\tcase 's':\n\t\t\tstartButton.click();\n\t\t\tbreak;\n\t\tcase 'r':\n\t\t\tresetButton.click();\n\t\t\tbreak;\n\t\tcase 't':\n\t\t\trecordButton.click();\n\t\t\tbreak;\t\t\n\t}\n}",
"function presses(phrase) {\n var phraseArr = phrase.split('');\n var clicks = 0;\n fo... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Cancel bubbling of _toggle | function cancelbubbling(e) {
Event.stop(e);
} | [
"function cancelBubble(event) {\r\n\r\n if (event.stopPropagation) {\r\n event.stopPropagation();\r\n } else {\r\n event.cancelBubble = true;\r\n }\r\n}",
"_onInputFocusOut(e) {\n if (this.get('_show')) {\n e.stopPropagation();\n }\n }",
"function stopPropagati... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
function createDefinition(obj: Protobuf.Service, name: string, options: Options): ServiceDefinition; function createDefinition(obj: Protobuf.Type, name: string, options: Options): MessageTypeDefinition; function createDefinition(obj: Protobuf.Enum, name: string, options: Options): EnumTypeDefinition; | function createDefinition(obj, name, options, fileDescriptors) {
if (obj instanceof Protobuf.Service) {
return createServiceDefinition(obj, name, options, fileDescriptors);
}
else if (obj instanceof Protobuf.Type) {
return createMessageDefinition(obj, fileDescriptors);
}
else if (obj... | [
"function factory (type, config, load, typed) {\n // create a new data type\n function MyType (value) {\n this.value = value\n }\n MyType.prototype.isMyType = true\n MyType.prototype.toString = function () {\n return 'MyType:' + this.value\n }\n\n // define a new data type\n typed.addType({\n name:... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
WORKING ON IT var prestigeTemplate = _.template($('prestigeTemplate').html()); Updating Stats | function updateStats(){
var newStats = statsTemplate({
money:(f.format(player.money)), tick:player.tick/1000
});
$("#tabStats").html(newStats);
} | [
"compileTemplate() {\n var $el = $(this.template);\n return _.template($el.html());\n }",
"function setTemplate() {\n return {\n species: \"\",\n nickname: \"\",\n gender: \"\",\n ability: \"\",\n evs: statTemplate(0),\n ivs: statTemplate(31),\n nature: \"\",\n item: \"\",\n mov... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
=================== PRIVATE METHODS ================= bind block delete button | function deleteEvent() {
var delBtn = document.getElementsByClassName('m-textblock__del-block');
var delNum = delBtn.length;
for(var i = 0; i < delNum; i++) {
delBtn[i].addEventListener('click', function (event) {//BIND CLICK ON DEL BUTTONS
event.stopPropagation();
var btn = this;//PICK CLICKED BUTTON
... | [
"function deleteButton() {\n const idToDelete = $(this)\n .parent()\n .attr('data-id');\n console.log(idToDelete);\n\n API.deleteBill(idToDelete).then(() => {\n refreshBillList();\n });\n}",
"delete(event) {\n event.preventDefault()\n if (this.onDelete == \"reload\") {\n this.reload(event)... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
webpackBootstrap install a JSONP callback for chunk loading | function webpackJsonpCallback(data) {
/******/ var chunkIds = data[0];
/******/ var moreModules = data[1];
/******/
/******/
/******/ // add "moreModules" to the modules object,
/******/ // then flag all "chunkIds" as loaded and fire callback
/******/ var moduleId, chunkId, i = 0, resolves = [];
/******/ fo... | [
"function webpackPluginServe(_a) {\n var _this = this;\n var staticPaths = _a.staticPaths, historyApiFallback = _a.historyApiFallback, options = tslib_1.__rest(_a, [\"staticPaths\", \"historyApiFallback\"]);\n if (process.env.STORYBOOK) {\n return {};\n }\n var historyFallback = !!historyApiFa... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Stacked line chart to show the no of suicides(yaxis) for each year(xaxis), categorized by gender(stacked) | function show_no_of_suicides_by_year(ndx) {
//Data dimension for year
let year_dim = ndx.dimension(function(d) {
return new Date(d.year);
});
//Data group for no of suicides per 100k people for each gender
let male_suicides_per_year = year_dim.group().reduceSum(function(d) {
if (d.s... | [
"function show_no_of_suicides_by_age_group(ndx) {\n //Data dimension for age group\n let age_dim = ndx.dimension(dc.pluck('age'));\n\n //Data group for no of suicides per 100k people for each age group, categorized by gender\n let male_suicides_per_age_group = age_dim.group().reduceSum(function(d) {\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Returns hex of currently selected color, as in the colorBarComponent; or null if erasing or erasing same mode is activated | getColor() {
if (this.state.erasing) { // This ensures that upon erase tool selected, clicking will erase label and color
return null;
} else {
return this.colorBarRef.current.state.color;
}
} | [
"function getCurrentDrawColor() {\n let currentDrawColor = $('#js-buttonContainerLeft').find('.button-color-selected').first().attr('name')\n console.log('called for current draw color: ' + currentDrawColor);\n return currentDrawColor;\n }",
"function getCurrentColor() {\n\t\tlet expr = getStateExpr(Act... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
setG_strSWFVersion() CONTROLLED BY: io_sendSWFVersion This is called when sendSWFVersion = "true" Callback function for the ade_web_library.swf to indicate the version of ade_web_library.swf | function setG_strSWFVersion(strSWFVersion)
{
GD_at_setG_strSWFVersion++;
if (strSWFVersion)
{
// If have not seen this, then wiggle the layers and save
if (strSWFVersion != G_strSWFVersion)
{
G_strSWFVersion = strSWFVersion;
G_bUpdateSWFVersion = true;
// also do this if needed - implem... | [
"function setSWFIsReady() {\r\n\t\t// record that the SWF has registered it's functions (i.e. that JavaScript\r\n\t\t// can safely call the ActionScript functions)\r\n\t\tswfReady = true;\r\n\t\tconsole.log(\"swfReady\");console.log(swfReady);\r\n\t\tupdateStatus();\r\n\t}",
"function updateStatus() {\r\n\t\tif (... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
PillarPillarConnectionThroughMetalProfilesOnAxisAtThePier checkbox event handler | function OnPillarPillarConnectionThroughMetalProfilesOnAxisAtThePier_Change( e )
{
try
{
var newMeasuresOfEmergencyValue = Alloy.Globals.replaceCharAt( current_structural_elements_id * 13 + 5 , Alloy.Globals.ShedModeDamages["MEASURES_OF_EMERGENCY"] , $.widgetAppCheckBoxShedModeFormsDamagesMeasuresOf... | [
"function OnPillarPillarConnectionThroughMetalDishesAtTheEndOfThePier_Change( e )\r\n{\r\n try\r\n {\r\n var newMeasuresOfEmergencyValue = Alloy.Globals.replaceCharAt( current_structural_elements_id * 13 + 6 , Alloy.Globals.ShedModeDamages[\"MEASURES_OF_EMERGENCY\"] , $.widgetAppCheckBoxShedModeFormsDa... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
[ZScore, or Standard Score]( The standard score is the number of standard deviations an observation or datum is above or below the mean. Thus, a positive standard score represents a datum above the mean, while a negative standard score represents a datum below the mean. It is a dimensionless quantity obtained by subtra... | function z_score(x, mean, standard_deviation) {
return (x - mean) / standard_deviation;
} | [
"function zScores(array){\n\n function getVariance(arr, mean) {\n return arr.reduce(function(pre, cur) {\n pre = pre + Math.pow((cur - mean), 2);\n return pre;\n }, 0)\n }\n\n var sum = 0;\n for (var i = 0, l = array.length; i < l; i++){\n array[i]= parseInt(array[i]);\n... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
add fields to the output clause | output (fields) {
if ('string' === typeof fields) {
this._outputs.push(`INSERTED.${this._sanitizeField(fields)}`);
} else {
fields.forEach((f) => {
this._outputs.push(`INSERTED.${this._sanitizeField(f)}`);
});
}
} | [
"toString() {\n var statement = this._statement;\n this._applyHas();\n this._applyLimit();\n\n var parts = {\n fields: statement.data('fields').slice(),\n joins: statement.data('joins').slice(),\n where: statement.data('where').slice(),\n limit: statement.data('limit')\n };\n\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Creates a generic template message with an image, title, and subtitle | function createCard(title,subtitle,img){
return {
'attachment': {
type: 'template',
payload: {
template_type: 'generic',
elements: [{
title: title,
subtitle: subtitle,
image_url: img
}]
}
}
}
} | [
"buildTemplate(title, imagePath) {\n\n\t\tconst cssBlock = this.getStyling()\n\t\tconst inputtedImage = this.base64Image(imagePath)\n\n\t\treturn `\n\t\t\t<!DOCTYPE html>\n\t\t\t<html>\n\t\t\t\t<head>\n\t\t\t\t\t<meta charset=\"utf-8\">\n\t\t\t\t\t<style>${cssBlock}</style>\n\t\t\t\t</head>\n\t\t\t\t<body>\n\t\t\t\... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Updates the rects width. | function updateRectWidth(rect, rectWidth, rectAmount, magnification) {
// If the mouse is over this rect, add the magnification.
if (rect.isMouseInRect) {
rect.width = rectWidth + magnification;
} else { // if not subtract the magnification divided by the remaining rects.
rect.width = r... | [
"updateWidth() {\n if (this.setupComplete) {\n let width = this.headerData.getWidth();\n this.width = '' + width;\n this.widthVal = width;\n $(`#rbro_el_table${this.id}`).css('width', (this.widthVal + 1) + 'px');\n }\n }",
"function updateLineWidth(size... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Helper function, grabs the particular selector specified within 'tests.json' and returns a breakdown of it in object form / This function is necessary only in the case where we're looking for the tag The only attributes we usually find with the tag is "lang" and "manifest"... though "manifest is now deprecated" For now... | function filterSelector(sel) {
var thisSelector = sel, thisLang = null;
if (thisSelector.match(/:lang/)) {
var spl = thisSelector.split(':');
regExp = /\(["']([^)]+)["']\)/
matches = regExp.exec(spl[1]);
thisSelector = spl[0];
thisLang = 'lang="'+matches[1].toLowerCase()+'"';
}
return {selector:thisSelec... | [
"function get_selector(){\n var selector = '';\n\n $.each(fundamental_vars.filteredSelector,function(key,value){\n selector += value;\n });\n\n return selector;\n}",
"function createAvailabilitySelector(selector){\n if(selector.indexOf('.tldResults') < 0){\n selector = '.tldResults' +... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Set the caret position of the given element. | function setCaretPosition( element, caretPos ) {
if ( element != null ) {
if ( element.createTextRange ) {
var range = element.createTextRange();
range.move( "character", caretPos );
range.select();
} else {
if ( element.selectionStart ) {
element.focus();
... | [
"function setCaretPosition(position) {\n\tdocument.getElementById(\"content-editor\").setSelectionRange(position, position);\n\tdocument.getElementById(\"content-editor\").focus();\n}",
"function resetCursorPos(element) {\n element.selectionStart = 0;\n element.selectionEnd = 0;\n }",
"updateCa... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Calculate error between obs and sim | function errorOf() {
var obs = arguments[0];
var sim = arguments[1];
var err = 0;
for(var i = 0; i < obs.length; i++) {
err += Math.abs(obs[i] - sim[i]);
}
return err;
} | [
"function mse(errors) {\n let sum = 0;\n for (let errorIdx = 0; errorIdx < errors.length; ++errorIdx) {\n sum += Math.pow(errors[errorIdx], 2);\n }\n return sum / errors.length;\n }",
"error() {\n\t\tlet totalError = 0;\n\t\tfor (var j = 0; j < this.neurons.length; j++) {... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
List all the components in the order when the order row is clicked, in a new table. This is basically the same function as that for making the table for the orders. There is probably a nicer solution in making a 'createTable' function, but I don't have time to optimize rigth now. | function showComps(idx) {
console.log("Row " + idx + " clicked!");
var comps = orders[idx - 1].components;
var compDiv = document.getElementById('componentlist');
if (document.getElementById('componenttable') !== null) {
var compTable = document.getElementById('componenttable')
compDiv.removeChild(comp... | [
"function buildCartTable() {\r\n let table = document.getElementById('itemCart');\r\n let tbodyRef = table.getElementsByTagName('tbody')[0];\r\n for (let i = 0; i < this.itemsInCart.length; i++) {\r\n let row = tbodyRef.insertRow(0);\r\n let removeButtonContainer = document.createElement('but... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
It renders all: filters and publications. | function renderAll()
{
// Sorting filters arrays.
sortFilterArrays();
// Rendering filters
renderFilters();
// Rendering publications
renderPublications();
} | [
"function renderFilters()\n\t {\n\t \t\t// Selecting the most recent years as options for the Time filter.\n\t\t\t$(TIME_FILTER_CLASS_ID).html(\"\");\n\t\t $(TIME_FILTER_CLASS_ID).append(\"<li><a href='javascript:void(0);'>\" + ALL_TIME_TEXT + \"</a></li>\");\n\t \t\tfor (var i=0; i<yearsArray.length && i<NUMBER_O... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Handles when the active altitude slot changes in the sim. | handleAltSlotChanged() {
this.currentAltSlotIndex = this._inputDataStates.altSlot.state;
// console.log("alt slot changed to: " + this.currentAltSlotIndex);
//Prevent sim from changing to alt slot 1 automatically if we're trying to drive via
//VNAV and PATH
if (this.currentAltSlotIndex === 1 && thi... | [
"handleAltCaptured() {\n if (this.isAltitudeLocked) {\n this.currentVerticalActiveState = VerticalNavModeState.ALT;\n if (SimVar.GetSimVarValue(\"AUTOPILOT VS SLOT INDEX\", \"number\") != 1) {\n SimVar.SetSimVarValue(\"K:VS_SLOT_INDEX_SET\", \"number\", 1);\n }\n if (SimVar.GetSimVarVa... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Public: Creates a new instance of the bot. token An API token from the bot integration | constructor(token) {
this.slack = new Slack(token, true, true);
} | [
"sdk() {\n return new TelegramBot(this.$auth.token, {\n polling: false,\n });\n }",
"static create_token({ organizationId, createToken }) {\n return new Promise(\n async (resolve) => {\n try {\n resolve(Service.successResponse(''));\n } catch (e) {\n res... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Safely install process exit listener. | function _safely_install_exit_listener() {
const listeners = process.listeners(EXIT);
// collect any existing listeners
const existingListeners = [];
for (let i = 0, length = listeners.length; i < length; i++) {
const lstnr = listeners[i];
/* istanbul ignore else */
// TODO: remove support for lega... | [
"static createExitHandling() {\r\n process.on('exit', \r\n Application.exitProgram.bind(null, 0,\r\n {message: 'hjbot exit. \\r\\n'}));\r\n\r\n process.on('SIGINT', \r\n Application.exitProgram.bind(null, 0,\r\n {message: 'Keyboard interrupt'}));\r\n... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Arrays animals dedup to uniqueAnimals //WORKING | function unique(animals) {//Pass in animals arr
var result = [];//store dedup arr
$.each(animals, function(i, e) {//for each animal index, element
if ($.inArray(e, result) == -1) result.push(e);//if any element returns -1 push to result arr
});
return result;
} | [
"function uniqMethod() {\n\tvar testarray=[1,2,2,1,2,3,1,1,1,4,4,4,4,3,3,5,6,6,7,7];\n\tvar result=_.uniq(testarray);\n\tconsole.log(result);\n}",
"function uniteUnique(...uniqueArray) {\n// spreads ([1], [2,[1,0]], [3, 2,[1,0]]) to ([1], [2,1,0], [3,2,1,0])\n console.log(\"uniqueArray: \" + uniqueArray);\n \n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Lazy chunked Uint8Array (implements get and length from Uint8Array). Actual getting is abstracted away for eventual reuse. | function LazyUint8Array() {
this.lengthKnown = false;
this.chunks = []; // Loaded chunks. Index is the chunk number
} | [
"function toU8Array(ptr, length) {\n return HEAPU8.subarray(ptr, ptr + length);\n }",
"function readArrayBufferProgressively(res, callback) {\n if (!callback || !res.body)\n return res.arrayBuffer();\n let contentLength = res.headers.get('Content-Length');\n if (!contentLength)\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
find and return a new pixel in the image put in | function getnewPixel(image5,x,y){
var distance = 2*Math.floor(Math.random()*10 - 10/2);
var dx = x + distance;
var dy = y + distance;
var newinpix = image5.getPixel(Check(dx,image5.getWidth()), Check(dy,image5.getHeight()));
return newinpix;
} | [
"function get_pixel(piece, x, y)\n{\n\tvar index = x + y * piece.width;\n\tpixel = piece.map[index];\n\tif(pixel == undefined)\n\t{\n\t\treturn false;\n\t}\n\telse\n\t{\n\t\treturn pixel;\n\t}\n}",
"function setColorAtPixel(imageData, new_color, x, y) {\r\n const {width, data} = imageData\r\n \r\n data... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Return a class itself or null | function classOrNil(obj) { return (functionOrNil(obj) && (obj.prototype && obj === obj.prototype.constructor) && obj) || null; } | [
"getParent(el, cls) {\n while (el.parentNode) {\n el = el.parentNode;\n if (el.classList) {\n if (el.classList.contains(cls))\n return el;\n }\n }\n return null;\n }",
"function closest_ances... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Returns a string that spells out the contents of text by formatting the smileys appearing in smileys so that they resemble the letters. | function smiley_text(text, smiley_names, width)
{
var smiley_codes = new Array();
for each (var smiley in smiley_names) // Filters valid smileys
{
if (smileys.hasOwnProperty(smiley))
{
smiley_codes.push(smileys[smiley]);
}
}
text = text.toUpperCase... | [
"function constructText(ban) {\n var num = 0;\n var text = '';\n for(var iy=0; iy<nrow; iy++) {\n for(var ix=0; ix<nrow; ix++) {\n var index = nrow*iy + ix;\n if(ban[index]) {\n if(num > 0) {\n text += num;\n num = 0;\n }\n text += ban[index];\n }\n e... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
The first time this is called needToDecrement is true, after all the popping is finished, we decrement the piece count and then call this again with false TODO all the set state calls should use the callbacks, right now they implictly rely on ordering | popUntilDone(needToDecrement) {
let popMask = this.state.model.getToPopMask();
if (this.state.model.popCount(popMask) === 0) {
if (needToDecrement) {
this.state.model.decrementPieceCount();
this.setState({model: this.state.model});
setTimeout(() => this.popUntilDone(false), 500);
... | [
"prepareNextState() {\n this.setGameBoard();\n this.gameOrchestrator.changeState(new ChoosingPieceState(this.gameOrchestrator));\n }",
"removeOpponentPiece(board, row, col) {\n // if there was an opponent's piece at new index, get rid of that piece from board\n const opponentPiece = board[r... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
This method is used to make SSH connection with device | function ConnectToDevice(deviceIP,UserName,Password)
{
PasswordInfo = new dotNET.Renci_SshNet.PasswordConnectionInfo.zctor(deviceIP,UserName,Password)
SSHClient = new dotNET.Renci_SshNet.SshClient.zctor(PasswordInfo)
SSHClient.Connect() //method returns void
Log.Message("Created SSH Con... | [
"function SendCommand(Command)\n{\n var Output = SSHClient.RunCommand(Command)\n Log.Message(\"Output from Device is :- \"+ Output.Result)\n return Output.Result\n}",
"connect() {\n\t\tthis.socket.connect(this.testData.port, this.testData.host, ()=>{\n\t\t\tthis.sendWithCost('id', {robot: this.testData.robotNa... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
load Edit Spending page | function loadSpendingEditPage (data) {
mainView.router.loadContent(
'<!-- Top Navbar-->\n' +
'<div class="navbar">\n' +
' <div class="navbar-inner">\n' +
' <div class="left"><a href="#" class="back link"> <i class="icon icon-back"></i><span>Back</span></a></div>\n' +
' <div class="cente... | [
"function loadSpendingEdit(id) {\n if (mydb) {\n //Get all the cars from the database with a select statement, set outputCarList as the callback function for the executeSql command\n mydb.transaction(function (t) {\n t.executeSql(\"SELECT * FROM spending WHERE id=?\", [id], function (transaction... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Transforms `/ foo val` to (set foo (/ foo val)) | transformDivValToSet(divExp) {
const [_tag, exp, val] = divExp;
return ['set', exp, ['/', exp, val]];
} | [
"function set_value(vals, val, is_variable) {\n set_head(head(vals), val);\n set_tail(head(vals), is_variable);\n }",
"function setValue(key,val) {\r\n\tGM_setValue(PREFIX + key,val);\r\n\treturn val;\r\n }",
"transform(ref, op) {\n var {\n current,\n affinity\n } = ref... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Retrieves total revenue from database and sends it to the view. | function sendRevenueToView(){
$.ajax({
method: 'GET',
url: '/populateRevenue',
success: function(data, status) {
$("#total-revenue").html("");
let htmlString = "";
// If there are no orders in DB, there is no revenue either
... | [
"function generateTotalExpenses() {\n db.collection('budget')\n .doc('totalexpenses')\n .get()\n .then((doc) => {\n if (doc.exists) {\n totalExpense = doc.data().totalExpense;\n \n // rendering the respective element\n // headingEl.innerHTML... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
NOTE: session tasks are stopped when the index is cleared... XXX do we need to cache this... ...if yes then we'll need to also clear/update the cache every time a task is run/stopped... | get sessionTasks(){
return this.tasks
.filter(function(task){
return task.__session_task__ }) } | [
"function taskStarting() {\n tasksRunning += 1;\n return null;\n}",
"deleteTasks(){\n\t\tlocalStorage.clear();\n\t}",
"function refreshTasks() {\n APITaskService.getTasksReport().then(function (data) {\n $scope.tasksStatus = data.data;\n });\n APITaskService.get... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Build the site documents. | async function buildDocuments( site, env, source, target, layouts, engine, htmlproc ) {
// First need to assign each document a temporary build context.
let $build = {
env,
site,
source,
target,
layouts,
engine,
htmlproc... | [
"function buildDocs( docDirName, project )\n{\n //var root={ items : [] };\n\n //readDocs( root, path.join( docDirName.toString() ).toString() );\n\n var docDir=path.join( docDirName.toString() ).toString();\n var indexPath=path.join( dir, docDir, \"index\" );\n\n var indexJSON=fs.readFileSync( index... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Get binary file using XMLHttpRequest | function getBinary(file) {
let xhr = new XMLHttpRequest();
xhr.open("GET", file, false);
xhr.overrideMimeType("text/plain; charset=x-user-defined");
xhr.send(null);
return xhr.responseText;
} | [
"function getFileBlob(url, cb) {\n var xhr = new XMLHttpRequest() //creo una nueva instancia de XMLHttpRequest\n xhr.open('GET', url) //inicializo una peticion asincronica del url al server\n xhr.responseType = \"blob\" // declaro que el valor del tipo de respuesta es blob (para luego usarlo mas adel... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
setInvertLightness: Enable/disable invert lightness effect. | setInvertLightness(invertFlag) {
this._inverse.set_enabled(invertFlag);
} | [
"setInvertLightness(flag) {\n this._invertLightness = flag;\n if (this._magShaderEffects)\n this._magShaderEffects.setInvertLightness(this._invertLightness);\n }",
"getInvertLightness() {\n return this._invertLightness;\n }",
"turnOff() {\n\t\tthis.lightMap.makeDarkness();\... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
repeatSpeech play the same string again with a different pitch and rate | function repeatSpeech() {
let randomPitch, randomRate = Math.random();
let options = {
rate: randomRate,
pitch: randomPitch
};
responsiveVoice.speak(randomizedSpeech, "UK English Male", options)
} | [
"function speak() {\n var utterance = new SpeechSynthesisUtterance(placeholder.innerHTML);\n utterance.pitch = 1.2;\n utterance.rate = 1.1;\n synth.speak(utterance);\n}",
"function myLoop() {\n setTimeout(function() {\n let character = userInput.charAt(k).toLowerCase();\n //console.log('p... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
update tooltip with case study description data (image, text, etc.) linked to the currently hovered casestudy region | function updateTooltip(caseStudy) {
tpImage.style.backgroundImage = 'url("assets/' + caseStudy.name + '.png")'
tpHeader.innerHTML = caseStudy.name
tpRegion.innerHTML = caseStudy.region + ', ' + caseStudy.country
tpDescription.innerHTML = caseStudy.description
tpDescription2.innerHTML = caseStudy.description2
... | [
"function mouseoverHandler (d) {\n tooltip.transition().style('opacity', .9)\n tooltip.html('<p>' + d[\"country\"] + '</p>' );\n }",
"function wordLablelToolTip(){\n\t$('#wordLabel').popover();\n\tsetTimeout(function(){\n\t\t$('.label-div').expose();\n\t}, 300);\n\tsetTimeout(function(){\n\t\t$('#wordLab... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Bind a method to an object, so it doesn't matter whether you call object.method() directly or pass object.method as a reference to another function. | function bind (obj, method) {
var fn = obj[method];
obj[method] = function () {
fn.apply(obj, arguments);
};
} | [
"function addAndBind(methodName, lambda) {\n $ctrl.api[methodName] = (function () {\n return lambda(...arguments);\n }).bind($ctrl.ide);\n }",
"function lodashBindAll() {\n var originalBindAll = _.bindAll;\n\n _.bindAll = function(object, methodNam... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Calculate values for each repos in a project, in an async fashion param: `calculationFunction(repoName, doneCallback)` where `doneCallback(value)` param: `doneCallback(finalValue)` | function calculateValuesForRepos(repos, calculationFunction, doneCallback) {
if (repos.length == 0) {
doneCallback(0);
}
var accumulatedValues = [];
// for each repo
for(var i=0; i < repos.length; ++i) {
// run async function
calculationFunction(repos[i], function(v) {
... | [
"function calculateValuesForAllProjects(label, table, projects, calculationFunction, doneCallback) {\n\n var line = $('<tr/>');\n line.append(\"<th>\" + label + \"</th>\");\n table.append(line);\n\n // track which ones still pending\n var projectsToCalculate = projects.slice();\n\n function calcul... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Scroll to the first unseen comment. | goToFirstUnseenComment() {
if (!unseenCount || cd.g.autoScrollInProgress) return;
const comment = cd.comments
.slice(lastFirstTimeSeenCommentId || 0)
.find((comment) => comment.newness === 'unseen');
if (comment) {
comment.$elements.cdScrollTo('center', true, () => {
comment.regis... | [
"goToNextNewComment() {\n if (cd.g.autoScrollInProgress) return;\n\n const commentInViewport = Comment.findInViewport('forward');\n if (!commentInViewport) return;\n\n // This will return invisible comments too in which case an error will be displayed.\n const comment = reorderArray(cd.comments, comm... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Returns true when e is larger than all elements in S. This helps to avoid duplicates in the output. | function inOrder(e, S) {
for (var s in S)
if (e < s)
return false;
return true;
} | [
"function greaterThanSum(nums) {\n\tlet a = 0;\n\tfor (let i = 0; i < nums.length; i++) {\n\t\tif (a >= nums[i]) return false;\n\t\ta += nums[i];\n\t}\n\treturn true;\n}",
"static compare(r1, r2, e = 0.0001) {\n if (!r1) return !r2\n else if (!r2) return false\n\n return (\n r1.x > r2.x - e &&\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
End Your Code / 5.Fix the if statement to display "Hello World" if x is greater than y, otherwise alert "Goodbye". Start Your Code | function greater (){
if (x>y){
return "Hello World";
}
else {
return "Goodbye";
}
} | [
"function alert(guess) {\n\n if (guess < 0 || guess > 9) {\n\n console.log(`ERROR: ${guess} is out of range 0 - 9.`);\n }\n\n}",
"function sumGreater(n1, n2) {\n var sum = n1 + n2;\n\n if (sum > 50) {\n alert('Jumanji');\n }\n} // Create a function that multiplys three numbers and if the produc... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Set new menu item as Active based on current Window position | function setActiveMenu() {
var i;
if (windowResized) {
// reset after possible window resize
scrollPositions = getScrollPositions();
windowResized = false;
}
// Get top Window edge that is just under the Menu
var topEdge = $(window).scrollTop() + menuHeight;
// Special... | [
"function setMenuLocation() {\n\t\tlet menu = ActiveItem.element.getBoundingClientRect();\n\t\t\n\t\tlet x = menu.left + menu.width + 8;\n\t\tlet y = menu.top;\n\t\t\n\t\tctrColor.propMenu.style.left = `${x}px`;\n\t\tctrColor.propMenu.style.top = `${y}px`;\n\t}",
"function activateMenuElement(name){$(options.menu... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Finds out whether any dependency of the derivation has actually changed. If dependenciesState is 1 then it will recalculate dependencies, if any dependency changed it will propagate it by changing dependenciesState to 2. By iterating over the dependencies in the same order that they were reported and stopping on the fi... | function shouldCompute(derivation) {
switch (derivation.dependenciesState) {
case IDerivationState.UP_TO_DATE:
return false;
case IDerivationState.NOT_TRACKING:
case IDerivationState.STALE:
return true;
case IDerivationState.POSSIBLY_STALE: {
var p... | [
"shouldUpdateState(params) {\n return params.changeFlags.propsOrDataChanged;\n }",
"dependenciesAreComplete (actions, conversation) {\n return this.dependencies.every(dependency => dependency.actions.some(a => {\n const requiredAction = actions[a]\n if (!requiredAction) {\n throw new Error... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
This method evaluates if a section is valid. It returns an array of booleans. If the section is a list, each value indicates if the item for that index is valid, otherwise the array will have a only one value, indicating if the section is valid | static buildSectionValidationsArray(section, sectionValues) {
const validation = [];
if (section.type === 'list') {
if (Array.isArray(section.content)) {
section.content.forEach((item) => {
validation.push(Object.entries(item).findIndex(([id, value]) => {
... | [
"function validFlexValue() {\n\t\t\tvar list = [];\n\t\t\tfor (var i = 0; i < storeEdit.getCount(); i++) {\n\t\t\t\tvar flexValue = storeEdit.getAt(i);\n\t\t\t\tif (Ext.isEmpty(flexValue.get('name'))) {\n\t\t\t\t\tshowErrMessage('名称不能为空!');\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\t\t\t\tif (flexValue.get('name').trim... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
add frame with index to buffer list, if the buffer is considered sufficient, a frame will be fed to audio output | addFrame(frameData) {
if (frameData.index < this.next) {
// discard outdated frame
return;
}
this.frameList.push(frameData);
this.frameList.sort((a, b) => a.index - b.index);
this.sendConsequentialFrames();
while (this.frameList.length > minimumBufferFrame && this.frameList[0].inde... | [
"addBufferView(buffer) {\n const byteLength = buffer.byteLength || buffer.length;\n\n // Add a bufferView indicating start and length of this binary sub-chunk\n this.json.bufferViews.push({\n buffer: 0,\n // Write offset from the start of the binary body\n byteOffset: this.byteLength,\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Returns an array ids of selected images | function getSelectedImagesId() {
var imageIds = [];
$( '#sortable > li' ).each( function() {
imageIds.push( $( this ).attr( 'data-id' ) );
});
return imageIds;
} | [
"async function _extract_image_ids (variants){\n if (variants.length == 0 || typeof variants === 'undefined' || variants === null || !Array.isArray(variants)){\n throw new VError(`variants parameter not usable`);\n }\n\n let ids = [];\n\n /*\n * Defaults to plucking the first image. This is fine now but i... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Builds the global list of insula ids. | function makeInsulaIdsListShortNamesList(){
var currentInsulaId;
pompeiiInsulaLayer.eachLayer(function(layer){
if(layer.feature!=undefined){
currentInsulaId=layer.feature.properties.insula_id;
//if(layer.feature.properties.insula_id!=currentInsulaId){
if(insulaGroupIdsList.indexOf(currentInsulaId)==-... | [
"function generateCardIDs() {\n //for each card add its id to cardids list\n cards.forEach(card => {\n cardIDs.push(card.cardID);\n });\n}",
"function globalVariablizeIds (node){ \r\n var snap = XPOrderedSnap(node, 'descendant-or-self::*/@id');\r\n for (var i=0; i < snap.snapshotLength; i++)\r\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Generates seeds for fractal by analyzing frequency of audio source. | function genSeeds() {
analyser.getByteTimeDomainData(dataArray);
sliceSize = Math.floor(bufferLength / 5);
var sum = 0;
var scaleFactor = 138.0;
// Seed A
for (var i = 0; i < sliceSize; i++) {
var v = dataArray[i] / scaleFactor;
if (v > 1) { v = 1 };
sum += v;
}
seedA = sum / ... | [
"function goStream (stream) {\n var frequencyArray // array to hold frequency data\n\n // create the media stream from the audio input source (microphone)\n sourceNode = audioContext.createMediaStreamSource(stream)\n\n analyserNode = audioContext.createAnalyser()\n\n analyserNode.smoothingTimeConstant = 0.3 //... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Loads a rules file. The syntax is similar to an ini file. Blank lines and comments (beginning with '//') are ignored. Nonterminals are enclosed in square brackets, and everything up to the next nonterminal is a replacement. Replacements are one per line, optionally introduced by an +integer weight and a colon. Everythi... | rulesLoad(filename) {
var fp = new File(filename, "r");
if(!fp.open)
error("fatal", "Unable to open grammar file \"" + filename + "\" for reading.", "SimpleGrammar.rulesLoad");
var tmp = fp.read();
tmp = tmp.split(/\n+/);
var lines = [ ];
while(tmp.length) {
... | [
"function LoadInRuleSet(){\n //selected file\n var file = document.getElementById(\"inputfile\").files[0];\n if(file){\n var reader = new FileReader();\n reader.readAsText(file, \"UTF-8\");\n reader.onload = function (evt) {\n //document.getElementById(\"importRule\").textConten... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
This ajax function uses registration_data2.php and checks the username availability | function userCheck(){
var valueOfUsername = $("uname").value;
new Ajax.Request("registration_data2.php",
{
method: "post",
parameters: {screen:valueOfUsername},
onSuccess: displayResult
} );
} | [
"function emailCheck(){\r\n\tvar valueOfEmail = $(\"email\").value;\r\n\t\r\n\tnew Ajax.Request(\"registration_data3.php\",\r\n\t{\r\n\tmethod: \"post\",\r\n\tparameters: {email:valueOfEmail},\r\n\tonSuccess: displayResult2\r\n\t} );\r\n}",
"function check_name_exist() {\r\tvar parameters = '/users/checkExist?nam... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
function CreateWindowHeader () Creates the header of the Lattes window. Parameters: title: Title of the window imgsrc: Source (uri) of the lattes image lng: Interface Language Return Value: None | function CreateWindowHeader(title, imgsrc, lng)
{
text = "<html>\n";
text += " <head>\n";
text += " <title>" + title + "</title>\n";
text += " </head>\n";
text += " <body bgcolor=\"#FFFFFF\" link=\"#000080\" vlink=\"#800080\">\n";
text += " <form>\n";
text += " <table width=\"100%... | [
"function ShowExampleAppWindowTitles(p_open) {\r\n // By default, Windows are uniquely identified by their title.\r\n // You can use the \"##\" and \"###\" markers to manipulate the display/ID.\r\n // Using \"##\" to display same title but have unique identifier.\r\n SetNextWindowPos(new... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
schedule a draw for the next minute | function queueDraw() {
if (drawTimeout) clearTimeout(drawTimeout);
drawTimeout = setTimeout(function() {
drawTimeout = undefined;
draw();
}, 60000 - (Date.now() % 60000));
} | [
"function Timing() {\n\tvar timer = setInterval(Draw, 2);\n}",
"start(){\n this.picture = DRAWINGS[Math.floor(Math.random()*DRAWINGS.length)];\n this.setRoundTime(ROUND_TIME_VAR)\n }",
"function runClock() {\n\t\tcurrenttime = setInterval(updateRegularClock, 1000);\n\t}",
"function spawnPainting() {\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
See the data of the LASzip VLR U16 compressor 2 bytes U16 coder 2 bytes U8 version_major 1 byte U8 version_minor 1 byte U16 version_revision 2 bytes U32 options 4 bytes U32 chunk_size 4 bytes I64 num_points 8 bytes I64 num_bytes 8 bytes U16 num_items 2 bytes U16 type 2 bytes num_items U16 size 2 bytes num_items U16 ver... | function LazZipVlr(buffer) {
let dataView = new DataView(buffer);
let position = 0;
this.compressor = dataView.getUint16(position, true);
position += 2;
this.coder = dataView.getUint16(position, true);
position +=2;
this.version = {};
this.version.major = dataView.getUint8(position);
position += 1;
... | [
"static bytes28(v) { return b(v, 28); }",
"static bytes14(v) { return b(v, 14); }",
"function onMetaDone(comprBytes, metaInfo) {\n self.metaCache[metaInfo.name] = comprBytes;\n var ArrType = cbUtil.makeType(metaInfo.arrType);\n\n var bytes = comprBytes; // some Apache/InternetBr... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Validate a NONE command | function validateNone (data, command) {
// good job!
return true;
} | [
"function validateParry (data, command) {\n // no additional validation necessary\n return true;\n }",
"function validateRun (data, command) {\n // no additional validation necessary\n return true;\n }",
"function invalidCommand(cmd) {\n\t\tconsole.log('Invalid Command', cmd);\n\t\tswitch(Math.flo... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Adds a list data object the the lists property. | _addToLists(list) {
const listObj = {
index: this.lists.length,
name: list.getAttribute('name'),
element: list,
editable: this.isEditable(list),
};
if(this.lists.length === 0) this.activeList = listObj;
this.lists.push(listObj);
} | [
"addList(list) {\r\n this.#listList.set(list.listId, list);\r\n }",
"function addListToAppData(e, list){\n const newList = {\n id: list.getAttribute('data-id'),\n title: 'New List',\n tasks: []\n };\n appData.lists.board.push(newList)\n\n}",
"_addList(list) {\n let head = rdf.nil;\n... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Builds the Financials panel, displaying a table of a given company's revenue, earnings, assets, and liabilities over 3 years. | function setFinancials(company) {
const years = company.financials.years;
const revenues = company.financials.revenue;
const earnings = company.financials.earnings;
const assets = company.financials.assets;
const liabilities = company.financials.liabilities;
/* The '... | [
"function setCompanyList(companies) {\n const tableLoadingAnimation = document.querySelector('#stockDataLoadingAnimation');\n for (let company of companies) {\n let element = document.createElement('li');\n element.textContent = company.name;\n element.addEventListener... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Plays a random move on the board | randomPlay() {
let availablePositions = this.board.getEmptyPositions();
let totalPossibilities = availablePositions.length;
let rdm = Math.floor(Math.random() * totalPossibilities);
this.board.performMove(this.playerNo, availablePositions[rdm]);
} | [
"function randomMove() {\n\t\tvar availTiles = emptyTiles(board);\n\t\trandom = Math.floor( Math.random() * availTiles.length );\n\t\tmove = availTiles[random];\n\t\tcomputerPlays(move);\n \t}",
"function randomMove() {\n return Math.round(Math.random()*3) + 1;\n}",
"function aiMove(){\r\n\r\n let aiMoves... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Response to seek request of sender'media object | function onSeek(event) {
var seekTime = parseInt(event.data.currentTime);
if (seekTime >= duration - 1) {
seekTime = (duration > 1) ? duration - 1 : 0;
}
event.data.currentTime = seekTime;
printDebugMessage("onSeek", event);
player.mb.publish(OO.EVENTS.SEEK, seekTime);
window.mediaManager.onSeekOrig(e... | [
"get seek() {\n return this.api.currentTime()\n }",
"seek(position) {\r\n if (this.isSeeking)\r\n this.progress = position * 100;\r\n }",
"seek(delta) {\n const newTime = this.audioTarget.currentTime + delta\n const startTime = this.audioTarget.seekable.start(0)\n const e... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Updates the slider value when the text value is changed for the input named 'id' | function updateValue(val, id) {
var value = validate();
if (id == "slope_text") {
if(value != INVALID_VALUE) {
document.getElementById('slope_slider').value = parseFloat(value);
}
} else if (id == 'slope_slider') {
findSmallestFraction(val);
}
if(value !=... | [
"function updateSliderValue(sliderId, textboxId) {\n\tvar x = document.getElementById(textboxId);\n\tvar y = document.getElementById(sliderId);\n\tx.value = y.value;\n}",
"function updateSliderValues() {\n\t$('.slider_min').text(CLUB.lowValue);\n\t$('.slider_max').text(CLUB.highValue);\n}",
"updateValue() {\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Get a piece from a particular board cell | function getPiece(x, y) {
return board[y][x];
} | [
"function get_pixel(piece, x, y)\n{\n\tvar index = x + y * piece.width;\n\tpixel = piece.map[index];\n\tif(pixel == undefined)\n\t{\n\t\treturn false;\n\t}\n\telse\n\t{\n\t\treturn pixel;\n\t}\n}",
"function GetCell(y,x){ //*\r\n\tif(y<0 || y >= CELLS_VERT || x<0 || x >= CELLS_HORIZ) return null;\r\n\treturn aGro... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
get subset for future analysis | function subset ()
{
// get subset selected
var extent = d3.event.target.extent();
// look for points that were selected
var selection = get_brush_sel(extent);
// save current center for scaling
var subset_extent = d3.transpose([x_scale.domain(), y_scale.domain()]);
// compute subset center
subset_center = ... | [
"getDataSubset(allowed) {\n \n const subsetData = Object.keys(this.data)\n .filter(name => allowed.includes(name))\n .reduce((obj, key) => {\n obj[key] = this.data[key];\n return obj;\n }, {});\n\n return subsetData\n }",
"function buildSubsetJSON()\n{\n\t//This helps us det... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Transform `code` into a decimal character reference. | function toDecimalReference(code, next, omit) {
var value = '&#' + String(code)
return omit && next && !decimal(next) ? value : value + ';'
} | [
"function getLetterFromCode(num){\n return String.fromCharCode(num+96);\n}",
"function messageFromBinaryCode(code) {\n // we can split the string in the params every 8 characters to have an array to work with.\n let binaryArr = code.match(/.{8}/g)\n // we can have a variable that holds the string being deci... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Check for initialization of user roles | function initializeRoles() {
console.log("initializing roles");
Role.estimatedDocumentCount((err, count) => {
console.log(count);
if (!err && count == 0) {
new Role({
name: "user",
}).save((err) => {
if (err) {
console.log("error : " + err);
}
console.lo... | [
"function initRolesTabs(rolesToInit) {\n for(var role in rolesToInit) {\n tabsByRoles[role] = [];\n sortTabsByRoles(tabs[role], role);\n }\n }",
"function getAvailableRoles() {\n StaticDataFactory.getAvailableRoles().then(function (... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Gets the keyword for the selected value in the telemRunForm UI element | function getTelemRunFromForm() {
return document.getElementById("telemRunForm").value;
} | [
"function acHighlightedText() {\n return Selector(\".autocomplete-item.highlighted\").textContent;\n}",
"function getParcoursLabel(){\n return $(parcours_filter+\" option:selected\").html();\n}",
"async getFocusedValue() {\n const focusedInput = await this.getFocusedInput();\n if (focusedInput... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Applies plugin to a sculpt | applyTo(sculpt) {
this.sculpt = sculpt;
} | [
"function applyConfig() {\n if (config !== undefined) {\n for (var key in config) {\n plugin[key] = config[key];\n }\n }\n }",
"_applyCustomConfig() {\n\n this._backupSPFXConfig();\n\n // Copy custom gulp file to\n this.fs.copy(\n this.templatePath('gulpfile... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
I toggle the testing state for the given commit in staging. | function toggleTestingInStaging( commit ) {
var nextTesting = _.cycle( [ "inactive", "active" ], commit.staging.testing );
var nextStatus = commit.staging.status;
// If the testing got reset, move the status back to a pending state.
if ( nextTesting === "inactive" ) {
nextStatus = "pending";
}
deplo... | [
"function toggleTestingInProduction( commit ) {\n\n\t\tvar nextTesting = _.cycle( [ \"inactive\", \"active\" ], commit.production.testing );\n\t\tvar nextStatus = commit.production.status;\n\n\t\t// If the testing got reset, move the status back to a pending state.\n\t\tif ( nextTesting === \"inactive\" ) {\n\n\t\t... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
The event handler handling Yjs events of the _syncedModelNodes shared object. | _handleModelNodesChanged(event) {
event.changes.keys.forEach( (value, key) => {
if (value.action === 'add') {
let syncedModelNode = event.currentTarget.get(key);// event.object.get(key);
let modelNodeElement = this._addModelNode(syncedModelNode);
// check if the node was created local... | [
"modelChanged() {\n }",
"static sendUpdatedEvent (model) {\n const PluginHelper = require('../helpers/plugin');\n PluginHelper.events().emit('update', {\n action: 'updated',\n name: 'account',\n model\n });\n }",
"function onUpdatedGridData() {\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Creates a logger using winston | function createLogger() {
return new _winston2.default.Logger({
transports: [new _winston2.default.transports.Console({
level: defaultLogLevel,
colorize: true
})]
});
} | [
"function createLogger(debug) {\n const { splat, timestamp, colorize, combine } = winston.format;\n const logFilePath = path.join(app.getPath(\"userData\"), \"exilibrium.log\");\n let level = \"info\";\n\n if (fs.pathExistsSync(logFilePath) && fs.statSync(logFilePath).size > 4e6) {\n console.log(`Removing ${... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Builds an instruction with all the expressions and parameters for `classMap`. The instruction data will contain all expressions for `classMap` to function which includes the `[class]` expression params. | buildClassMapInstruction(valueConverter) {
if (this._classMapInput) {
return this._buildMapBasedInstruction(valueConverter, true, this._classMapInput);
}
return null;
} | [
"function getClassMapInterpolationExpression(interpolation) {\r\n switch (getInterpolationArgsLength(interpolation)) {\r\n case 1:\r\n return Identifiers$1.classMap;\r\n case 3:\r\n return Identifiers$1.classMapInterp... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
To get the widgets of the selected web layer and load in the widget select box | function getWebLayerWidgets(layerId, widgetObjName) {
showLoadingIcon();
objName = widgetObjName;
var params = getBasicParams();
params = params.concat("&layerId=");
params = params.concat(layerId);
loadContent("fetchWebLayerWidgets", $('#formCreateProject'), '', params, true, true);
} | [
"function getWidgetVersions(obj, objectName) {\n\tvar id = $(obj).val();\n\tfillSelectbox($(\"select[name='\"+ objectName +\"']\"), map[id], \"No Versions available\");\n}",
"function widgetOptions(id){\n\n }",
"function getAvailableWidgets() {\n var availWidgets = [];\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
=================================================================================== GENERIC CHART FUNCTIONS =================================================================================== Parses an array needed for generic charts (line, bar, column) | function genericChartParser(chartArray) {
var $ = jQuery,
chartOptions = {},
categories = chartArray[0],
series = [],
seriesData = [],
seriesCoutner = 0;
// loop through chartArray starting at the 2nd index
// this is because we already got the categories into it's own array
for (var o =... | [
"function makeChart(data1) {\n var i, j;\n\n titles = data1.columns;\n titles.shift(); // Since we dont need the 'timestamp' column\n //console.log(data1);\n //console.log(titles);\n\n // Pushing the object skeletons into the 'data' array object\n for (i = 0; i < titles.length; i++) {\n var data_obj... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Convert ISO8601 format to time HH:MM:SS | function ISO8601toDuration(input){
var H = formatTimeUnit(input, 'H');
var M = formatTimeUnit(input, 'M');
var S = formatTimeUnit(input, 'S');
if (H == "00") {
H = "";
} else {
... | [
"function getTime(time) {\n var tempTime;\n tempTime = replaceAt(time, 2, \"h\");\n tempTime = replaceAt(tempTime, 5, \"m\");\n tempTime += \"s\";\n return tempTime;\n }",
"function iso8601Str( startMilliseconds, endMilliseconds, t ) {\n s= new Date(t).toJSON()... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
This function is used by test_flip_flop_from_provisioner_menuitem to switch back from the account provisioner to the wizard. | function subtest_flip_flop_from_provisioner_menuitem(w) {
// We need to wait for the wizard to be closed, or else
// it'll try to refocus when we click on the button to
// open it.
wait_for_the_wizard_to_be_closed(w);
plan_for_window_close(w);
mc.click(new elib.Elem(w.window.document.querySelector(".existin... | [
"function subtest_can_switch_to_existing_email_account_wizard(w) {\n plan_for_window_close(w);\n plan_for_new_window(\"mail:autoconfig\");\n\n // Click on the \"Skip this and use my existing email\" button\n mc.click(new elib.Elem(w.window.document.querySelector(\".existing\")));\n\n // Ensure that the Account... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Return the default VLAN for a fabric. | function getDefaultVLAN(fabric) {
return VLANsManager.getItemFromList(fabric.default_vlan_id);
} | [
"function getUnusedVLANs(nic, ignoreVLANs) {\n var vlans = $filter(\"removeDefaultVLAN\")($scope.vlans);\n vlans = $filter(\"filterByFabric\")(vlans, nic.fabric);\n vlans = $filter(\"filterByUnusedForInterface\")(\n vlans,\n nic,\n $scope.originalInterfaces\n );\n\n // Remove the VLAN'... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Callback if you click on a bookmark in the bookmarks list. arg = the "bookmarkBackground" HTML div Calls back end via doXML to help | function bookmarkCB (div) {
updateBrain (function () {
doXML ("sendbookmark&" + div.getElementsByClassName("url")[0].innerHTML, null)
})
} | [
"function displayBookmark(myHeading,myURL){\n var mainBookmarksDisplay = document.getElementById(\"bookmarks\");\n var bookmark = document.createElement('div');\n\t\n var bookmarkText = document.createElement('a');\n\tbookmarkText.innerHTML = myHeading;\n\tbookmarkText.setAttribute('name', myHeading);\n\tb... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
If varPath contains variables or wildcards, it will return a path with the variables replaced by the keys found in fullPath. | static fillVariables(varPath, fullPath) {
if (varPath.indexOf('*') < 0 && varPath.indexOf('$') < 0) {
return varPath;
}
const keys = getPathKeys(varPath);
const pathKeys = getPathKeys(fullPath);
let merged = keys.map((key, index) => {
if (key === pathKeys[... | [
"static fillVariables2(varPath, vars) {\n if (typeof vars !== 'object' || Object.keys(vars).length === 0) {\n return varPath; // Nothing to fill\n }\n let pathKeys = getPathKeys(varPath);\n let n = 0;\n const targetPath = pathKeys.reduce((path, key) => {\n if... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Sends a request to the client for state values. | stateValuesRequest (path) {
this.send('state.values.request', { path })
} | [
"stateKeysRequest (path) {\n this.send('state.keys.request', { path })\n }",
"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.Asyn... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
method used to remove a given hotel | function removeHotel(hotelId) {
var positionToRemove = null;
var index;
// find the postion in the hotels array of the object that needs to be removed
for(index = 0; index < hotels.length; index++) {
var currentHotel = hotels[index];
if(currentHotel.id === hotelId) {
positionToRemove = index;
// the ... | [
"basketRemove(equipment) {\n for (var i = 0; equipmentBasket.length > i; i++) {\n if (equipmentBasket[i].id == equipment.id) {\n equipmentBasket.splice(i, 1);\n }\n }\n\n this.specify();\n }",
"function removeWantToVisitPark(visit){\nwantToVisitPark.splice(visit, 1);\n\n}",
"function ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Linearly approach target by at most delta. | function linearlyApproach (current, target, delta) {
if (Math.abs(current - target) < delta) {
return target
} else if (current < target) {
return current + delta
} else {
return current - delta
}
} | [
"static MoveTowards(current, target, maxDelta) {\n let result = 0;\n if (Math.abs(target - current) <= maxDelta) {\n result = target;\n }\n else {\n result = current + Scalar.Sign(target - current) * maxDelta;\n }\n return result;\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Exit a parse tree produced by Java9ParserpreIncrementExpression. | exitPreIncrementExpression(ctx) {
} | [
"enterPreDecrementExpression(ctx) {\n\t}",
"exitPreDecrementExpression(ctx) {\n\t}",
"enterPostDecrementExpression(ctx) {\n\t}",
"exitPostDecrementExpression(ctx) {\n\t}",
"function parse_IntExpr(){\n\tdocument.getElementById(\"tree\").value += \"PARSER: parse_IntExpr()\" + '\\n';\n\tCSTREE.addNode('IntExpr... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Call the type constructor of a directive instance on a given template node, inferring a type for the directive instance from any bound inputs. | function tcbCallTypeCtor(el, dir, tcb, scope, bindings) {
var dirClass = tcb.reference(dir.ref);
// Construct an array of `ts.PropertyAssignment`s for each input of the directive that has a
// matching binding.
var members = bindings.map(function (b) { return ts.createPropertyAssignment(... | [
"function tcbProcessDirective(el, dir, unclaimed, tcb, scope) {\n var id = scope.getDirectiveId(el, dir);\n if (id !== null) {\n // This directive has been processed before. No need to run through it again.\n return id;\n }\n id = scope.allocateDirectiveId(el, dir);... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Gets the scheme definitions from the Bumper Options | function getSchemeDefinition(options) {
let definedSchemesNames = Object.keys(definedSchemes);
// verify that its not custom and preset
if (options.scheme !== "custom" && definedSchemesNames.indexOf(options.scheme) !== -1)
return definedSchemes[options.scheme];
// Throw error if scheme is not de... | [
"function getPricingSchemesList() {\n $.get(\"api/pricing\", function(pricingSchemes) {\n console.log(pricingSchemes);\n });\n\n }",
"function normalizeOptions(options) {\n try {\n options.schemeDefinition = getSchemeDefinition(options);\n }\n catch (e) {\n conso... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
45.Write a function called union which accepts a variable number of arguments, which are all arrays. The function returns a new array of unique values from all the parameters. | function union(){
//let arg = [].slice.call(arguments);
let uniq = [];
let arr = [];
//solving it with CONCAT!!
for(let i=0; i<arguments.length; i++){
//CONACAT RETURNS A NEW ARR, which REFERENCE has to be saved in this case using the same arr var.
arr = arr.concat(arguments[i]);
}
//solving it with ... | [
"function joinArrays(...args){\n\tlet res = [];\n\tfor (let i of args) res.push(...i);\n\treturn res;\n}",
"function joinArrays(){\n var newArr = [...arguments];\n\tvar ret = [];\n\tnewArr.forEach(el => ret.push(...el));\n\treturn ret;\n}",
"function UnionTwoArrays(array1, array2) {\n var unionOfBothArrays ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
ArenaRestart FIXME: This is not a good replacement for map_restart in tourneys. | function ArenaRestart() {
// Respawn everybody.
for (var i = 0; i < level.maxclients; i++) {
var ent = level.gentities[i];
if (!ent.inuse) {
continue;
}
if (ent.s.arenaNum !== level.arena.arenaNum) {
continue;
}
if (ent.client.sess.team === TEAM.SPECTATOR) {
continue;
}
// Reset individua... | [
"function restart() {\n force.start();\n t = 1;\n }",
"function restart() {\n number = 60;\n start();\n }",
"function restartGame(){\r\n\r\n }",
"restart(){\n this._seed = []\n this._inGame = []\n this._numbersPuzzle = []\n this._sizePuzzle = 0\n this._count ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Draws animated speaker at center of screen | function speaker(){
drawCtx.save();
drawCtx.fillStyle = "blue";
drawCtx.lineWidth = 10;
drawCtx.strokeStyle = "green";
drawCtx.beginPath();
drawCtx.arc(canvasElement.width/2, canvasElement.height/2, speakerRadius, 0, Math.PI * 2, false);
drawCtx.closePath();
drawCtx.fill();
dra... | [
"show() {\n var pos = this.body.position;\n var angle = this.body.angle;\n\n push();\n translate(pos.x, pos.y);\n rotate(angle);\n rectMode(CENTER);\n\n drawSprite(this.birdspr);\n /* strokeWeight(1);\n stroke(255);\n fill(127);\n ellip... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Returns true if the scroller has a visible shadow. | get visibleShadow() {
return this.$.dropShadow.classList.contains('has-shadow');
} | [
"isVisible() {\n return this.toolbar.is(\":visible\");\n }",
"checkVisibility () {\n const vTop = window.pageYOffset\n const vHeight = window.innerHeight\n if (vTop + vHeight < this.box.top ||\n this.box.top + this.canvasHeight < vTop) {\n // viewport doesn't include canvas\n thi... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Converts an integer into its onehot representation and returns the data as a JS Array. | function flatOneHot(label, numClasses) {
var labelOneHot = new Array(numClasses).fill(0);
labelOneHot[label] = 1;
return labelOneHot;
} | [
"function getOutputActivations(mnistData, sampleId) {\n const l = getImageLabel(mnistData, sampleId);\n const oa = new Float32Array(10);\n oa[l] = 1.0;\n return oa;\n }",
"function dec2bin_array(array,no_of_variables)\n{\n\tvar bin_array = [];\n\tfor (var i = 0; i < array.length; i+... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Draw everything on the canvas | function draw() {
// clear the canvas
canvas.width = canvas.width;
drawBlocks();
drawGrid();
} | [
"draw(ctx) {\r\n if (this.isDistanced) {\r\n this.distanceGraph();\r\n }\r\n // draw all nodes and store them in grid array\r\n this.nodeList.forEach(node => {\r\n node.draw(ctx);\r\n storeNodeAt(node, node.x, node.y);\r\n });\r\n\r\n // draw all edges\r\n this.edgeList.forEach(e... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Select or deselect a folder from the list | function toggleFolderSelection(folderElement) {
const index = currentSet.ids.indexOf(folderElement.dataset.id);
if (index > -1) {
currentSet.ids.splice(index, 1);
}
else {
currentSet.ids.push(folderElement.dataset.id);
}
displayFolderCount();
... | [
"function clickFolder(e) {\n const folder = e.target.closest('.bookmark-folder');\n const subFolderBtn = e.target.closest('i.fa-level-down-alt');\n\n if (!folder) {\n return;\n }\n\n if (!!subFolderBtn) {\n if (parseInt(folder.dataset.folders) > 0) {\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Find Session by ID | static async find(id) {
let sessionData = await db.get(`session:${id}`)
return new Session(sessionData);
} | [
"function getSession(text) {\n\n return text.substring(text.search('Session ID:')).split('\\n', 1)[0];\n\n }",
"function getSessions(eventId) {\n return request.get(CONFIG.api.sessions + `/events/${eventId}/sessions`)\n}",
"function findUserSessions(userId) {\n let db = mongoStore.db;\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Validates the date for gap scan report | function validateDateForGapScan(date){
var valid = true;
var oneDay = 24*60*60*1000; // hours*minutes*seconds*milliseconds
var todayDateArray = getTodayDate().split("/");
var selDateArray = date.split("/");
var selDate = new Date(selDateArray[2],selDateArray[1]-1,selDateArray[0]);
var todayDate = new Date(todayD... | [
"function validateDepartureDate() {\n\tvar departureDate = document.getElementById(\"departureDate\").value;\t\t// Gets and stores value of departureDate.\n\tvar departureDateError = document.getElementById(\"departureDateError\");\t// Gets and stores departureDateError element.\n\tvar departureDateObject = new Dat... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Identify who has the most followers | function mostFollowers(){
var mostFollowersPersonId = 0;
var maxNumFollowers = 0;
for(var person in data){
var followersNumber = getFollowers(person).length;
if(maxNumFollowers <= followersNumber){
maxNumFollowers = followersNumber;
mostFollowersPersonId = person;
}
}
console.log("The ... | [
"function mostFollowersOver30(){\n var maxNumFollowersOver30 = 0;\n var mostFollowersOver30PersonId = 0;\n for(person in data){\n var followersOver30 = getFollowersArray(person).filter(function(follower){\n return follower.age > 30\n });\n if(maxNumFollowersOver30 <= followersOver30.length){\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Get or set the route path template for the current request. | get routePath() {
return this._routePath;
} | [
"function route(){\n switch(req.url){\n case '/cats': page = 'cats'; break;\n case '/cars': page = 'cars'; break;\n case '/cars/new': page = 'new'; break;\n default: page = 'error';\n }\n fs.readFile(`views/${page}.html`, 'utf8', render);\n }",
"... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Are progress events supported? | function supportAjaxUploadProgressEvents() {
var xhr = new XMLHttpRequest();
return !! (xhr && ('upload' in xhr) && ('onprogress' in xhr.upload));
} | [
"function expectedEventsDispatched()/* : Boolean*/\n {\n for (var i/*:uint*/ = 0; i < this._expectedEventTypes$_LKQ.length; ++i )\n {\n var expectedEvent/* : String*/ = this._expectedEventTypes$_LKQ[i];\n \tif ( this.expectedEventDispatched( expectedEvent ) == false )\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Select Bluray (bd) as input source | selectInputSourceBluray() {
this._selectInputSource("i_bd");
} | [
"selectInputSourceBluetooth() {\n this._selectInputSource(\"i_bt\");\n }",
"function applyBlur()\n\t\t\t\t{ TweenMax.set($('.main-img'), {webkitFilter:'blur('+ blurElement.a + 'px)'}); }",
"selectInputSourceSatCbl() {\n this._selectInputSource(\"i_sat_cbl\");\n }",
"onBlur(event) {\n le... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
The value may either be an array or a function that returns an array. An optional key function may be specified to control how data is bound; if no key function is specified, data is bound to nodes by index. Or, if no arguments are specified, this method returns all bound data. | function selection_data(value, key) {
if (!value) {
var data = new Array(this.size()), i = -1;
this.each(function(d) { data[++i] = d; });
return data;
}
var depth = this._depth - 1,
stack = new Array(depth * 2),
bind = key ? bindKey : bindIndex;
if (... | [
"function access(elem, keys) {\n\t\t\t\t// elem becomes thisArg for datasetChainable:\n\t\t\t\treturn elem && keys && keys.length ? map(ssvToArr(keys), datasetChainable, elem) : [];\n\t\t}",
"get(key) {\n key = normalizeKey(key);\n // validate(key);\n return this.internalRepr.get(key) || [];\... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
removeTorrents chains as many functions in this project, calls callback when done (no params) | function removeTorrents (callback) {
if (!$scope.checkedTorrents.length) return callback();
var firstTorrent = $scope.checkedTorrents[0];
api.removeTorrents(firstTorrent.id).then(function () {
var idx;
// cleaning data structures
if (idx = $scope.checkedTorrents.indexOf(firstTorrent), idx... | [
"prune(callback) {\n if (_.isArray(this.contents)) {\n const length = this.contents.length;\n\n if ((this.type === \"REPEAT\" && length > 0) || (this.type === \"REPEAT1\" && length > 1)) {\n // Any subtree may be removed\n for (let i = 0; i < length; i++) {\n const tree = _.clone... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Determines if user preferences indicate dark mode | function determineDarkMode() {
(userPreferences.darkMode) ? darkMode(true) : {};
} | [
"get isDarkTheme() {\n if (this._isDarkTheme == null) {\n this._isDarkTheme = localStorage.getItem('theme') === 'dark' || false;\n }\n return this._isDarkTheme;\n }",
"function getDarkMode() {\n chrome.storage.local.get(\"darkMode\", results => {\n let mode = results[\"darkM... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |