query stringlengths 9 34k | document stringlengths 8 5.39M | negatives listlengths 19 20 | metadata dict |
|---|---|---|---|
Delete a row with selected Tshirts, update the number of Tshirts in the basket badge in the nav bar, update the cookie storing the number of selected number of Tshirts, and update the cookie storing details about Tshirts | function deleteRowTs(row) {
var a_row = row.parentNode.parentNode.rowIndex;
// alert("in deleteRow a_row is " + a_row);
var del_no = document.getElementById("basket_table").rows[a_row].cells[1].innerHTML;
var del_int = parseInt(del_no);
//alert("in deleteRow del_no is " + del_no +" del_int "+ del_int);
... | [
"function deleteRowStick(row) {\r\n var a_row = row.parentNode.parentNode.rowIndex;\r\n\t\t\t//\talert(\"in deleteRow a_row is \" + a_row);\r\n\tvar del_no = document.getElementById(\"basket_table\").rows[a_row].cells[1].innerHTML;\r\n\tvar del_int = parseInt(del_no);\r\n\t//alert(\"in deleteRow del_no is \" + de... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
NetworkElement object PUBLIC Constructor The network elements are the nodes of the map. There is a predefined shape and dimension for each network element, but there are a lot of parameters which can be cofigured to give the network element different looks and change these initial shape and dimension. By default, a net... | function NetworkElement(name, xPos, yPos) {
this.name = name == null || name == "null" ? "noName" : name;
this.id = null;
this.extendedInformation = null;
this.rectid = null;
this.x = xPos == null || xPos == "null" ? 0 : eval(xPos);
this.y = yPos == null || yPos == "null" ? 0 : eval(yPos);
this.height = 5... | [
"function MwNetworkElement(id){\n\tthis.id = id\n\tthis.mwAirInterfaceArr = [];\n\n\tthis.getId = function(){\n\t\treturn this.id;\n\t}\n}",
"function DottedNetworkElement() {\n\t\tthis.x = null;\n\t\tthis.y = null;\n\t\tthis.width = null;\n\t\tthis.height = null;\n\t\tthis.write = writeDottedNE;\n\t\tthis.alloca... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
If the decorator expressions are nonidentifiers, hoist them to before the class so we can be sure that they are evaluated in order. | function applyEnsureOrdering(path) {
// TODO: This should probably also hoist computed properties.
var decorators = (path.isClass() ? [path].concat(path.get('body.body')) : path.get('properties')).reduce(function (acc, prop) {
return acc.concat(prop.node.decorators || []);
}, [... | [
"function applyEnsureOrdering(path) {\n\t\t // TODO: This should probably also hoist computed properties.\n\t\t var decorators = (path.isClass() ? [path].concat(path.get('body.body')) : path.get('properties')).reduce(function (acc, prop) {\n\t\t return acc.concat(prop.node.decorators || [])... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Request the user to input one of a list of values. The input is caseinsensitive, but the return value is always a verbatim member of the list. | async one_of(prompt, one_of_list, defaultValue) {
if (prompt) {
console.log(prompt);
}
// keep a list of lowercase values for case insensitive lookup
const one_of_list_lowercase = one_of_list.map(s => s.toLowerCase());
while (true) {
const raw = await this.question(`[${defaultValue}] `... | [
"function restrictedListValidation(input, allowableValues){\n let isValid = false;\n for (let i = 0; i < allowableValues.length; i++) {\n const value = allowableValues[i].toLowerCase();\n if (input == value) {\n isValid = true;\n }\n }\n\n return isValid;\n}",
"function autoCompletePatientName(p... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
function to get the average temperature of the next 5 days, and return the appropriate temperature rating | function temp_ (OBJ){
let kelvin = 273.15;
let sum = 0;
for(let i =0;i<OBJ.length;i++){
sum = sum + (OBJ[i].main.temp - kelvin)
//console.log(OBJ[i].main.temp - kelvin)
}
console.log("--> Average Temperature for the next 5 days:", (sum/OBJ.length).toFixed(3), " C")
return deter... | [
"function averageTempCalc(){\n var tempTotal = 0;\n var tempArray = currentReturn.slice($scope.startDate, $scope.endDate + 1);\n for(var i = 0; i < tempArray.length; i++){\n tempTotal += tempArray[i].temperatureMax;\n }\n return (tempTotal / tempArray.length);\n }",... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Returnes whether an a11yspecific key is currently pressed | get a11yKeyIsPressed() {
return this.f6KeyIsPressed ||
this.upArrowKeyIsPressed ||
this.downArrowKeyIsPressed ||
this.tabKeyIsPressed ||
this.tildeKeyIsPressed ||
this.lKeyIsPressed;
} | [
"isKeyPressed(keyCode){\n return this.activeKeys[keyCode] || false;\n }",
"isKeyPressed(keyCode) {\n return this.activeKeys[keyCode] || false;\n }",
"isKeyReleased(keyCode){\n if(this.activeKeys[keyCode])\n return false;\n else\n return true;\n }",
"f... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Deleted an article with a specific ID under Article in firebase | function delete_button_pressed(obj)
{
firebase.database().ref('Article').child(obj).remove().then(function()
{
window.alert("Message Deleted");
window.location.reload(false);
}).catch(function(error){
});
} | [
"deleteArticle(article) {\n helper.deleteArticle(article).then(deletedArticle => {\n console.log('Article deleted: ', deletedArticle);\n });\n // Get new list from database after deletion\n this.getArticlesFromDB();\n }",
"function deleteArticle(id) {\n\n console.log('Deleting Article ' + id ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Function to play a song with mediaResponseTemplate. Needs to specify a song object fetched from database, and also whether conversation should continue after the song. | function playMedia(app, song, continueConversation, comments = "") {
let songName = song.title;
let author = song.author;
let imageUrl = song.image;
let songUrl = song.url;
let description;
if (comments == "") {
description = song.description;
} else {
description = comments;
}
let mediaRes... | [
"function playMedia(app, song, continueConversation, comments = \"\") {\n let songName = song.title;\n let author = song.author;\n let imageUrl = song.image;\n let songUrl = song.url;\n let description;\n if (comments == \"\") {\n description = song.description;\n } else {\n description = comments;\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
returns next number based on numFormat decrements number if direction is "" otherwise increments number | function getNextNumber(num, numFormat, direction)
{
var numDecPlaces = 0;
var newNumStr = "0", newNum, i;
if (numFormat.indexOf(".") !== -1) {
newNumStr += ".";
numDecPlaces = +numFormat.replace(/\D*\d+(\.)?/, "")
.replace(/\D+/, "");
for (i = 1; i < ... | [
"function updateCurrNum(value) {\n\t\tif (currNum.init) {\n\t\t\tcurrNum = value;\n\t\t\tcurrNum.init = false;\n\t\t\t//need to fix logic for preventing leading zeros\n\t\t} else if (currNum != '0') {\t\t\t\n\t\t\tcurrNum += value;\n\t\t}\n\t\tupdateScreen(currNum);\n\t\t\t\n\t}",
"function lead(num){\n if (num... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
get shades from hex | function getShades (hex, isFont) {
var luminosity = 0.1;
var shadesLength = 6;
var lumInc = 1 / shadesLength;
var i, j, c, diff, newColor, darkColors = [], lightColors = [];
hex = cleanHex(hex);
if(lumInc > 0.08) { lumInc = 0.08; }
for(i = 0; i < shadesLength; ++i){
newColor = '';
for(j = 0; j < 3... | [
"function getRGB(hexColor) {\n\n}",
"function getBackgroundShades (hex) {\n\t\tvar rgb = hexToRgb(hex);\n\t\tvar rgbString = rgb.r + ',' + rgb.g + ',' + rgb.b + ',';\n\t\tvar shadesLength = 6;\n\t\tvar alpha = 0.12;\n\t\tvar colors = [];\n\t\tvar i = 0;\n\n\t\tfor(i; i < shadesLength; ++i) {\n\t\t\tif(i === 0) { ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Take in state and convert it to read only props In this example, we mapStateToProps will generate this.state.balance and this.state.latestTransactions This function is called everytime the store state changes. Each field needed returns as a prop in an object for the wrapped component. | function mapStateToProps(state, ownProps) {
return {
balance : state.balance,
latestTransactions : selectLatestTransactions(state, 10)
};
} | [
"function mapStateToProps(state) {\n return {\n frozenData: state.frozen,\n meatData: state.meat,\n produceData: state.produce\n };\n}",
"function mapStateToProps(state, ownProps) {\n \n return {\n data: state.charts,\n selection: -1,\n value: \"\" \n };\n}",
"function mapStateToProps... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
WEEK NAVIGATION // WEEK 1st STEP : Pull dates based on today | function pullDays(){
var week = [0,1,2,3,4,5,6];
var currentDay = 0;
for(var i = 0; i < week.length; i++){
week[currentDay].index = currentDay;
currentDay++;
renderWeek(week[currentDay]);
}
console.log('This is the CurentDay being passed -->');
console.log(currentDay);
} | [
"static getCurrentWeekStartDate() {\n try {\n let currentDate = new Date();\n let firstDayOfWeek = currentDate.getDate() - currentDate.getDay();\n currentDate.setDate(firstDayOfWeek-7);//added -7 to fetch the test data remove it later\n return libSup.formatDate(cur... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Creates a file system with the given configuration, and initializes BrowserFS with it. See the FileSystemConfiguration type for more info on the configuration object. | function configure(config, cb) {
getFileSystem(config, function (e, fs) {
if (fs) {
initialize(fs);
cb();
}
else {
cb(e);
}
});
} | [
"function getFileSystem(config, cb) {\n var fsName = config['fs'];\n if (!fsName) {\n return cb(new ApiError(ErrorCode.EPERM, 'Missing \"fs\" property on configuration object.'));\n }\n var options = config['options'];\n var waitCount = 0;\n var called = false;\n function finish() {\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
A type guard that tests whether a string is a valid AWS _partition_ (from the standpoint of a ARN) | function isArnPartition(partition) {
return typeof partition === "string" && /(aws|aws-cn|aws-us-gov)/.test(partition);
} | [
"function _validateSegment(part)\r\n\t{\r\n\t\tpart = part.trim();\r\n\t\tvar match = /^(\\d{4})\\s*-\\s*(\\d{4})$/.exec(part);\r\n\t\tif (match) {\r\n\t\t\t// ensure both bits are within 0000-2359 && the 2nd part must be greater than the first\r\n\t\t\tvar start = match[1];\r\n\t\t\tvar end = match[2];\r\n\t\t\tif... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
The BlurXFilter applies a horizontal Gaussian blur to an object. | function BlurXFilter(strength, quality, resolution)
{
var vertSrc = generateBlurVertSource(5, true);
var fragSrc = generateBlurFragSource(5);
core.Filter.call(this,
// vertex shader
vertSrc,
// fragment shader
fragSrc
);
this.resolution = resolution || 1;
this.... | [
"function BlurXFilter()\n\t{\n\t core.AbstractFilter.call(this,\n\t // vertex shader\n\t fs.readFileSync(__dirname + '/blurX.vert', 'utf8'),\n\t // fragment shader\n\t fs.readFileSync(__dirname + '/blur.frag', 'utf8'),\n\t // set the uniforms\n\t {\n\t strengt... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
newline U+000A LINE FEED. Note that U+000D CARRIAGE RETURN and U+000C FORM FEED are not included in this definition, as they are converted to U+000A LINE FEED during preprocessing. TODO: we doesn't do a preprocessing, so check a code point for U+000D CARRIAGE RETURN and U+000C FORM FEED | function isNewline(code) {
return code === 0x000A || code === 0x000D || code === 0x000C;
} | [
"function isNewline$1(code) {\n\t return code === 0x000A || code === 0x000D || code === 0x000C;\n\t}",
"function LF() {\n return '\\n';\n}",
"static get LF () {\r\n\t\treturn '\\n';\r\n\t}",
"function _escaped_new_line() { return \"\\\\n\"; }",
"function isNewline(code) {\n return code === R || code... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Trace consider updating algorithms with info from Given a ray, shoot it until it hits an object and return that object's color, or `WHITE` if no object is found. This is the main function that's called in order to draw the image, and it recurses into itself if rays reflect off of objects and acquire more color. | function trace(ray, scene, depth) {
var distObject = intersectScene(ray, scene);
// If we don't hit anything, fill this pixel with the background color -
// in this case, white.
if (distObject.distance === Infinity) {
return WHITE;
}
// We compute inter... | [
"function recursiveTrace(ray, eye, deltaX, deltaY, delta2X, delta2Y) {\n\tvar delta3X = Vector.scale(Vector.add(deltaX, delta2X), 1 / 2);\n\tvar delta3Y = Vector.scale(Vector.add(deltaY, delta2Y), 1 / 2);\n\tvar returnColor = 0;\n\t\n\tray.direction = Vector.unitVector(Vector.add3(eye.direction, deltaX, deltaY));\n... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Runs the tests, populating the result parameter. | function runWithResult( result/* : TestResult*/ )/* : void*/
{
result.run( this );
} | [
"runTest() {\n this.result.recordResultWhileTesting();\n }",
"function runTestRunner(){\n for (var i=0; i<this.testSuite.length; i++) {\n this.testSuite[i].run();\n }\n this.showResults();\n }",
"function runWithResult( result/* : TestResult*/ )/* : void*/\n {\n this.ru... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Show Picture preview for file upload | function showpreview(input) {
if (input.files && input.files[0]) {
var reader = new FileReader();
reader.onload = function (e) {
$('#priestPreview').attr('src', e.target.result);
}
reader.readAsDataURL(input.files[0]);
}
} | [
"function showPreview(input) {\n if (input.files && input.files[0]) {\n let reader = new FileReader();\n\n reader.onload = function(e) {\n $('#preview-img').attr('src', e.target.result);\n $('#preview-img').show();\n }\n\n reader.readAsDataURL(input.files[0]); // convert to base... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
submit a form with a parameter indicating the operation to be performed. | function submitForm(form,command)
{
form.operation.value=command;
form.submit();
} | [
"function doOperacion(operacion) {\r\n\tvar frm = document.forms[0];\r\n\tfrm.operacion.value = operacion;\t\r\n\tfrm.submit();\r\n}",
"function doOperacion(operacion) {\r\n\tvar frm = document.forms[0];\r\n\tfrm.operacion.value = operacion;\r\n\t//alert('operacion : ' + operacion)\r\n\tfrm.submit();\r\n}",
"fu... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
clears keywords. If param == 0, it clears any 3letter keywords, if == 1, clears 4letter keywords returns true if a keyword is cleared | function clearKeyword(val) {
if (val == 0)
switch (expressionInput.value.substring(expressionInput.value.length - 3, expressionInput.value.length)) {
case 'sin':
case 'cos':
case 'tan':
case 'log':
expressionInput.value = expressionInput.value.... | [
"function clear_keywords2() {\n document.query_form.keywords2.value = '';\n document.query_form.boolean_op.value = 'and';\n // 4 = title in z39.50 speak\n document.query_form.field2.value = '4'; \n}",
"function clearAllKeywords() {\n document.myform.kwName.options.length = 0;\n}",
"function clearKeywor... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
add more songs button at the bottom | function addSongs(music) {
musicProgram.addMoreSongsButton()
.then(function(json) {
console.log("ADD MORE SONGS");
musicProgram.addNewMusic(json, musicProgram.songData);
$moreButton.prop('disabled', true);
addDeleteButtons();
});
} | [
"function addButton(data) {\r\n if (data.next) {\r\n $(\".results\").append(\r\n '<button id=\"moreButton\">See More!</button>'\r\n );\r\n $(\"#moreButton\").on(\"click\", function() {\r\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Modifying Header with number of products added in cart | function modifyingHeader(){
let productsAdded;
if (JSON.parse(localStorage.getItem('cart')) === null) {
productsAdded = 0;
} else {
productsAdded = JSON.parse(localStorage.getItem('cart')).length;
if (document.getElementById('return')) {
document.getElementById('btn-cart'... | [
"displayNumberOfProductsInHeader() {\n const cart = JSON.parse(localStorage.getItem('cart'));\n const targetDiv = document.querySelector(\".header--cart--counter\");\n if (cart) {\n // Si le panier n'est pas vide\n const count = cart.reduce((sum, item) => sum += item.quant... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Call this function passing a callback. The passed callback function will be called with one parameter, which will be the string value of the requested sip header. | function getsipheader(header, callback)
{
if ( !callback || typeof (callback) !== 'function' ) { return; }
if (typeof (webphone_api.plhandler) !== 'undefined' && webphone_api.plhandler !== null)
webphone_api.plhandler.GetSipHeader(header, callback);
else
webphone_api.Log('ERROR, webphone_api... | [
"function setsipheader(header)\n{\n if (typeof (webphone_api.plhandler) !== 'undefined' && webphone_api.plhandler !== null)\n webphone_api.plhandler.SetSipHeader(header);\n else\n webphone_api.Log('ERROR, webphone_api: setsipheader webphone_api.plhandler is not defined');\n}",
"function sipReg... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
set task.status 'success' or 'failed' only task.result will persist to db, even though task failed | async doTask(task) {
task.status = 'success'
task.result = 'done'
} | [
"async doTask(task) {\n task.status = 'success'\n }",
"updateTaskToDone(taskId) {\n this.getTask(taskId).status = \"Done\";\n }",
"function success(task) {\n return {\n type: taskOperationsConstants.UPDATE_SUCCESS,\n task\n };\n }",
"function changeTaskStatus(taskId) {\n\t\tfetch('/tas... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Memoization key serealizer, that prevents unnecessary canvas tests. No need to make test if we know that: browser supports higher canvas size browser doesn't support lower canvas size | function memoKeySerializer(args, cache) {
var _args = _slicedToArray(args, 1),
w = _args[0];
var cachedWidths = Object.keys(cache).map(function (val) {
return parseInt(val, 10);
}).sort(function (a, b) {
return a - b;
});
for (var i = 0; i < cachedWidths.length; i++) {
va... | [
"function memoKeySerializer(args, cache) {\n const [w] = args\n const cachedWidths = Object.keys(cache)\n .map((val) => parseInt(val, 10))\n .sort((a, b) => a - b)\n\n for (let i = 0; i < cachedWidths.length; i++) {\n const cachedWidth = cachedWidths[i]\n const isSupported = !!cache[cachedWidth]\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Create a stereo impulse in a buffer of length sampleFrameLength | function createStereoImpulseBuffer(context, sampleFrameLength) {
var audioBuffer = context.createBuffer(2, sampleFrameLength, context.sampleRate);
var n = audioBuffer.length;
var dataL = audioBuffer.getChannelData(0);
var dataR = audioBuffer.getChannelData(1);
for (var k = 0; k < n; ++k) {
... | [
"function createStereoImpulseBuffer(context, sampleFrameLength) {\n let audioBuffer =\n context.createBuffer(2, sampleFrameLength, context.sampleRate);\n let n = audioBuffer.length;\n let dataL = audioBuffer.getChannelData(0);\n let dataR = audioBuffer.getChannelData(1);\n\n for (let k = 0; k < n; ++k) {\... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Sends data back to the conversion progress sheet | function sendDataToConversionProgress(){
var spreadsheetData = SpreadsheetApp.getActive().getSheetByName("Variables").getRange("W1");
spreadsheetData.setFormulaR1C1('=IMPORTRANGE("1p43wwtkbT0K0QUpDtvqKjdZ8mgdojNP0Xu4z4gX2RYE","pensive!A:A")');
spreadsheetData = SpreadsheetApp.getActive().getSheetByName("Variab... | [
"reportProgress() {\n\t\tif (this._reportProgressHandler) {\n\t\t\tclearTimeout(this._reportProgressHandler);\n\t\t\tthis._reportProgressHandler = false;\n\t\t}\n\t\tImporterWebsocket.progressUpdated(this.progress);\n\t}",
"function progressReport(){\n io.emit('progress', { \n progress : completedPackets.... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Determine whether the given properties match those of a `FirehoseLogDeliveryProperty` | function CfnConnector_FirehoseLogDeliveryPropertyValidator(properties) {
if (!cdk.canInspect(properties)) {
return cdk.VALIDATION_SUCCESS;
}
const errors = new cdk.ValidationResults();
if (typeof properties !== 'object') {
errors.collect(new cdk.ValidationResult('Expected an object, but ... | [
"function CfnConnector_CloudWatchLogsLogDeliveryPropertyValidator(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('Expecte... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
getFillerWords returns array of only filler words | function getFillerWords(data) {
return data.filter(function (d) {return d.filler; });
} | [
"function getFillerWords(data) {\n return data.filter(function (d) { return d.filler; });\n }",
"function getFillerWords(data) {\n return data.filter(function (d) {return d.filler; });\n }",
"function getFillerWords(data) {\n return data.filter(function (d) {return d.filler; });\n }",
"funct... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Add user to the user list | addUser(user) {
/* istanbul ignore else */
if (!this.active_list) {
this.active_list = [];
}
const index = this.active_list.findIndex((a_user) => a_user.email === user.email);
/* istanbul ignore else */
if (index < 0) {
this.active_list = [...this.... | [
"addUser(user){\n this.#userList.set(user.id, user);\n }",
"function addUser(user){\r\n users.push(user);\r\n}",
"function addUser(user) {\n users.push(user);\n\n}",
"function add(){\n\t\t\tsendCommand(\"list\",\"user\",{\"course\":courseId},function (data) {\n\t\t\t\tw2ui['add'+w2uiName].fields... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
The first word of the species taxonym is added to tP for later comparison. | function getGenusStr(genusSpeciesStr, tP) {
var nameAry = genusSpeciesStr.split(" ");
tP.genusParent = nameAry[0];
} | [
"function addUniqueTaxaWithSharedTaxonym(taxonName, tP) { console.log(\"addUniqueTaxaWithSharedTaxonym called for %s. %O\", taxonName, tP)\n var taxonym = appendNumToTaxonym(taxonName, tP); \t\t\t\t//console.log(\"addUniqueTaxaWithSharedTaxonym new taxonym = \", taxonym)\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
end score / function rollAgain | function rollAgain()
{
if (currentDice.length===0)
{
alert("You haven't rolled yet!");
}
else
{
alert("Not yet implemented!");
}
} | [
"function rollAgain() {\n sum = roll();\n\n if (sum == 7) {\n lost(); // the user loses the game if they roll 7 before reach their point\n }\n else if (point == sum) {\n won(); // user wins if they reach their point \n }\n}",
"function lose() {\n\n wrongTotal++;\n\n clea... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
on Create Class click, create the new class, update the left col and schedule, then return to roster | function handleClassCreation() {
const classData = {
class_name: fitClassName,
day: weekday,
start_time: classTime,
trainer_id: props.trainerId,
max_size: maxSize,
};
employeeAddClass(classData).then(() => {
props.fetchScheduleData();
props.fetchTrainerData();
... | [
"function addClasses() {\n\t\tvar classCRN = document.getElementById(\"crnField\").value;\n\t\tvar classTitle = document.getElementById(\"titleField\").value;\n\t\tvar classInstructor = document.getElementById(\"instructorField\").value;\n\t\t\n\t\tvar aClass = {\n\t\t\t_id: classCRN,\n\t\t\ttitle: classTitle,\n\t\... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Generate fake token needed in tests and save it in this.fake_asset_id | async generateFakeToken() {
const tokenParams = {
name: "FakeSmartKey",
quantity: 100000 * Setup.WVS,
decimals: 8,
reissuable: true,
description: "Fake Tokens needed to test BCC dApp"
}
const signedIssueTx = issue(tokenParams, this.dapp_account)
let tx = await broadcast(si... | [
"function genToken() {\n\t\tlet token = uuid.v4();\n\t\tsetStorage({'WTA_TOKEN': token});\n\t\treturn token;\n\t}",
"generateToken() {\n const token = generateToken();\n this.secret = token.secret;\n this.token = token.token;\n\n return token.token;\n }",
"generateAccessToken() {\... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Although not specified in the instructions, countChar finds both UpperCase and LowerCase of the char param | function countChar(word, char){
var count = 0;
for(var i = 0; i < word.length; i++){
if(word.charAt(i) === char.toUpperCase() || word.charAt(i) === char.toLowerCase()){
count += 1;
}
else continue;
}
console.log("Amount of " + char + "\'s found: " + count);
return count;
} | [
"function countChar(string, char) {\n var x = string.split('');\n var count = 0;\n for (var i = 0; i < x.length; i++) {\n if ( x[i] === char) {\n count += 1;\n } \n else if ( x[i] === char.toUpperCase()) {\n count += 1;\n }\n else if ( x[i].toUpperCase() === char) {\n count += 1;\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
this function draws random points in [5,5]x[5,5] and connects a (somewhat) arbitrary subset of them with lines. | function drawRandomPoints() {
$('#pointsShown').show()
$('#pointsHidden').hide()
ggbApplet.reset();
let randomArrayX = [];
let randomArrayY = [];
for (let x of iterator()) {
randomArrayX.push(getRandomInt(-5, 5));
ra... | [
"function drawRandomLines1() {\r\n\t\tctx.beginPath();\r\n\t\tctx.moveTo(x,y);\r\n\t\tctx.lineTo(x + 100, H-y-100);\r\n\t\tctx.stroke();\r\n\t}",
"function drawLines(point) {\n for(var i in point.closest) {\n var lineAlpha = 0.1;\n ctx.beginPath();\n ctx.moveTo(point.x, point.y);\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
returns a string. base path of the fonts folder in the build | function getFontPath() {
return getAssetsPath() + config.build.fontPath;
} | [
"function fontNameToPath(fontName) {\n return \"assets/\"+fontName+\".svg\";\n }",
"function _getFontBaseUrl() {\n var win = index_1.getWindow();\n // tslint:disable-next-line:no-string-literal\n var fabricConfig = win ? win['FabricConfig'] : undefined;\n return (fabricConfig && fabricConfig.fontB... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Convert a JSON of locations into heatmap crimepoints | function convertToCrimepoints(response) {
console.log("Converting to heatmap crimepoints");
// Clear the locations holder
var crimepoints = [];
// Loop through all of the JSON entries provided in the response
for(var i= 0; i < response.length; i++) {
var location = response[i];
... | [
"function getHeatMapData() {\n\tvar heatMapData = [];\n\tfor (var i = 0; i < crimes.length; i++) {\n\t\theatMapData.push(new google.maps.LatLng(crimes[i].lat, crimes[i].lng));\n\t}\n\treturn heatMapData;\n}",
"function createHeatCoords() {\n\n\theatCoords = [];\n\n\tfor (var i=0; i < eventCoords.length; i++) {\n\... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Plot new Temperature point on the Graph | function plotNewTempPt( newTempVal ){
++nextPoint;
if (nextPoint <= numPoints) {
context.lineTo(offSet.x + nextPoint * xScale, graphHeight - newTempVal * yScale);
context.stroke();
} else {
clearInterval(intervalTimer);
}
} | [
"function plotTemperature(timeValue, value){\n console.log(timeValue);\n var x = new Date(timeValue*1000).getTime();\n console.log(x);\n var y = Number(value);\n if(chartT.series[0].data.length > 40) {\n chartT.series[0].addPoint([x, y], true, true, true);\n } else {\n chartT.series[0].addPoint([x, y], ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Widget um eine Liste von Actions zu verwalten. | function WodUiActionList(skills, actions) {
WodUiWidget.call(this, 'div')
this.setStyleProperty('width', '950px')
this.actions = actions
var _this = this
this.modBox = new WodUiWidget('div')
this.modBox.setStyleProperty('width', '300px')
this.modBox.setStyleProperty('paddingBottom', '10... | [
"function showActions(actions){\n log(\"Adding actions..\");\n log(actions);\n}",
"AddActionInList(Titre, Action){\n this._MyCoreXActionButton.AddAction(Titre, Action)\n }",
"function displayActions(sortedList){\n var menuList = sortedList.map(function(obj){\n return {title: obj.displayName, sub... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
function to add checkbox/legend option for a given term | function add_option(term) {
// get form object
var form = document.getElementById("key_options");
// console.log("adding option")
// add input tag
var new_key_input = document.createElement("INPUT");
new_key_input.id = term + "Option"
new_key_input.type = "checkbox";
new_key_input.name ... | [
"function di_setLegendChkbox(uid,chartObj)\n{\n\tvar legendObj = di_getChartLegendObject(chartObj);\n\tif(legendObj.enabled)\n\t{\n\t\tdocument.getElementById('di_vcplegend'+uid).checked = true;\n\t}\n\telse\n\t{\n\t\tdocument.getElementById('di_vcplegend'+uid).checked = false;\n\t}\n}",
"function addTermsToLegen... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Get result of HTTP request and add preview CSS | function get_preview_css_result(res) {
var css = res.responseText;
var status = res.status;
LOG.output("HTTP status:"+status);
if ( status != 200 ) { // failed
window.alert("Can't get CSS file (HTTP status="+status+")");
return;
}
Add_Preview_CSS(css);
} | [
"function Get_Preview_CSS_by_GM_xmlhttpRequest(url) {\r\n\tcall_GM_xmlhttpRequest(url, get_preview_css_result)\r\n}",
"function get_css_result(res) {\r\n\tvar css = res.responseText;\r\n\tvar status = res.status;\r\nLOG.output(\"HTTP status:\"+status);\r\n\tif ( status != 200 ) {\t// failed\r\n\t\tGM_log(\"Can't ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Update the prompt display | function updatePromptDisplay(){
var line = promptText;
var html = '';
if (column > 0 && line == ''){
// When we have an empty line just display a cursor.
html = cursor;
} else if (column == promptText.length){
// We're at th... | [
"function updateInputDisplay() {\n\t// reset to state at start of prompt\n\tbitsy.dialogBuffer.SetBuffer(bufferCopy(cachedBuffer));\n\tvar highlight = promptInput.selectionEnd - promptInput.selectionStart;\n\tvar str = promptInput.value;\n\t// insert caret/replace highlighted text\n\tstr = str.substring(0, promptIn... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Get nodes and return chibi | function chibi(selector) {
var cb, nodes = [], json = false, nodelist, i;
if (selector) {
// Element node, would prefer to use (selector instanceof HTMLElement) but no IE support
if (selector.nodeType && selector.nodeType === 1) {
nodes = [selector]; // return element as node list
} else if (typeof s... | [
"function getNodes() {\n\t\treturn nodes;\n\t}",
"getCenralNodes() {\n let res = [];\n for (let i = 0; i < this.relationsLst.length; i++) {\n const relation = this.relationsLst[i];\n let nodeList1 = relation.getNodeList1();\n for (let j = 0; j < nodeList1.length; j++) {\n const node = ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Register a callback function that is called when the plugin reads data | function registerReadCallback(callback){
serialPort.on('data', function(data){
// TODO Write a new parser for SerialPort that converts directly to ArrayBuffer.
callback( UtilsService.str2ab(data) );
});
} | [
"function registerReadCallback(callback){\n\t\t\t\n\t\t\tserial.registerReadCallback(callback,\n\t\t\t\tfunction error(){\n\t\t\t\t\tnew Error(\"Failed to register read callback\");\n\t\t\t\t});\n\t\t\t\n\t\t}",
"function caml_callback_register(fn) {\n main_callback = fn;\n}",
"function callback(){}",
"fun... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Retrieves the attachment of the selected element. | get selectedAttachment() {
let selectedElement = this._widget.selectedItem;
if (selectedElement) {
return this._itemsByElement.get(selectedElement).attachment;
}
return null;
} | [
"get attachment() { return this.get('attachment'); }",
"get file() {\n return this.isFile ? this.attachments[0].payload : null;\n }",
"get attachmentUrl() { return this.get('attachmentUrl'); }",
"function fetch() {\n\t\n\t if (!filenames.length) {\n\t return null;\n\t }\n\t\n\t ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
query the DOM for presence of cordova.js if it's missing, add it | function cordovaJSCheck() {
var hasCordovaDotJS = (document.querySelector("script[src*='cordova.js']")!=null);
if(!hasCordovaDotJS){
var scr=document.createElement('script');
scr.src='cordova.js';
document.head.appendChild(scr);
}
} | [
"function is_cordova() {\n return (typeof(cordova) !== 'undefined' || typeof(phonegap) !== 'undefined');\n}",
"function _isLikelyCordova() {\r\n return _isAndroidOrIosCordovaScheme() && typeof document !== 'undefined';\r\n}",
"async addDomQueryHelper () {\n // If jQuery is already loaded, make sure it'... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Function: updateDataNode Sync a single data node, bypassing cache. Used by to fetch pending nodes. | function updateDataNode(path, localNode) {
if(localNode) {
return wireClient.set(path, localNode.data, localNode.mimeType).
then(function() {
remoteAdapter.expireKey(path);
}).then(function() {
var parentPath = util.containingDir(path);
remoteAdapter.expireKey(par... | [
"updateStoryNode(data) {\n //Node.update(data.id, data)\n var node = this.graph().getNode(data.id)\n node.updateData(data)\n this.calculateAcception(node)\n this.forceUpdate()\n this.saveStory()\n }",
"function update(data) {\n //first we are flatting the node from a json tree structure ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Clears the search results. | function clearResults()
{
// Stop any existing search.
searchControl.cancelSearch();
// Clear the results.
results = new Array();
resultProgress = new Array();
resultCounter = 0;
writeDiv('results', null, "");
showProgress(0);
// Clear the input box.
setControlValue("searchInput", "");
} | [
"function clearSearchResults() {\n $(\".search-results\").empty();\n }",
"function clear () {\n self.searchTerm = '';\n search();\n }",
"clearSearchResults() {\n this.searchResults = [];\n this.searchSelection = 0;\n }",
"function clearResults() {\n $... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Encrypts and uploads file chunk by chunk | function encryptAndUpload(msg) {
console.log("encryptUpload in worker called");
let file = msg[1];
let fileSize = file.size;
let bufferSize = 128 * 1024;
let offset = 0;
let chunkReaderBlock = (_offset, bufferLength, _file) => {
let reader = new FileReader();
let blob = _file.sl... | [
"function postNextChunk () {\n var isLast = false\n var end = position + opts.chunkSize\n if (end >= blob.size) {\n end = blob.size\n isLast = true\n }\n readBlobSlice(blob, position, end, function (chunk) {\n worker.postMessage({\n name: 'ENCRYPT_CHUNK',\n chunk: chunk,\... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Convenience function to loop through the items and item types of an envelope. (This function was mostly created because working with envelope types is painful at the moment) | function forEachEnvelopeItem(
envelope,
callback,
) {
const envelopeItems = envelope[1];
envelopeItems.forEach((envelopeItem) => {
const envelopeItemType = envelopeItem[0].type;
callback(envelopeItem, envelopeItemType);
});
} | [
"function forEachEnvelopeItem(\n envelope,\n callback,\n ) {\n const envelopeItems = envelope[1];\n envelopeItems.forEach((envelopeItem) => {\n const envelopeItemType = envelopeItem[0].type;\n callback(envelopeItem, envelopeItemType);\n });\n }",
"function forEachEnvelopeItem(\n envelo... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
This function is actually called when a user clicks on the Random Friend Link | function goto_random_friend() {
if (!is_profile_url(myurl)) {
if (mydebug) alert('Sorry you have to be on a normal myspace url like http://www.myspace.com/dj80hd not ' + myurl);return;
}
if (!my_all_friends_node) {
if (mydebug) alert('Could not find all friends node');return;
}
var all_friends_... | [
"function create_random_friend_link() {\r\n //Set our global variable\r\n my_all_friends_node = find_all_friends_node();\r\n if (my_all_friends_node) {\r\n var random_link = my_all_friends_node.cloneNode(false); //mydoc.createElement('a');\r\n var txt = mydoc.createTextNode(' | Random');\r\n random_link... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Map of integrations assigned to a client Remove duplicates from the given array, preferring the last instance of any duplicate. Not guaranteed to preseve the order of integrations in the array. | function filterDuplicates(integrations) {
const integrationsByName = {};
integrations.forEach(currentInstance => {
const { name } = currentInstance;
const existingInstance = integrationsByName[name];
// We want integrations later in the array to overwrite earlier ones of the same type, except th... | [
"function filterDuplicates(integrations) {\n const integrationsByName = {};\n\n integrations.forEach(currentInstance => {\n const { name } = currentInstance;\n\n const existingInstance = integrationsByName[name];\n\n // We want integrations later in the array to overwrite earlier ones of the same type, e... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
=== Bal3A called, this.name=Bal3A, x=1, y=2, z=3 Bal3A/f called, this.name=Bal3A/f, x=4, y=5 z is from outer scope: z=3 Bal3A/f/g called, this.Number.POSITIVE_INFINITY=Infinity, a=6, b=7 the following are from outer scope: x=4, y=5, z=3 Bal3A/f/g return value === / Parenthesis association test with argument values: new... | function Bal3A(x,y,z) {
print("Bal3A called, this.name=" + this.name +
", x=" + x + ", y=" + y + ", z=" + z);
function f(x,y) {
print("Bal3A/f called, this.name=" + this.name +
", x=" + x + ", y=" + y);
print("z is from outer scope: z=" + z);
function g(a,b) {
... | [
"function Bal1A() {\n // printing out this.name indicates whether we're being\n // called as a constructor or as a function\n print(\"Bal1A called, this.name=\" + this.name);\n}",
"function Bal2A() {\n print('Bal2A called, this.name=' + this.name);\n\n function f() {\n print(\"Bal2A/f called... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Represent set of files and it's common settings. Allows to write documentation. Toplevel API class Two common usecases: download github project, process list of files ``` var p = new Project; p.title = 'Makedoc API docs'; p.repo = '1602/makedoc'; p.readFiles(['./lib/project.js'], p.makeDocumentation.bind(p)); | function Project(root) {
this.root = root;
this.title = null;
this.repo = null;
this.files = [];
this.out = './doc/';
this.layout = __dirname + '/../layout.html';
this.layoutHTML = null;
} | [
"function NDoc(files, options) {\n\n // options\n this.options = extend({\n }, options);\n\n // documentation tree consists of sections, which are populated with documents\n var list = {\n '': {\n id: '',\n type: 'section',\n children: [],\n description: '',\n short_description: ''\... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Change proximity mode to "On" or "Off" | function switchProximityMode(mode) {
console.debug(`switching proximity mode to: ${mode}`)
xapi.config.set('Proximity Mode', mode)
.then(() => {
console.info(`turned proximity mode: ${mode}`)
})
.catch((err) => {
console.error(`could not turn proximity mode: ${mo... | [
"function switchProximityMode(mode) {\n console.debug(`switching proximity mode to: ${mode}`)\n\n xapi.config.set('Proximity Mode', mode)\n .then(() => {\n console.info(`turned proximity mode: ${mode}`)\n })\n .catch((err) => {\n console.error(`could not turn proximi... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
addSlider(group, name) Adds a new slider with the given name to the given group and places it in the DOM. If the group doesn't exist, it will be created instead. Parameters: groups............(Object) containing all of the groups group.............(String) name of the group to add to name..............(String) name of ... | function addSlider(groups, group, name, isGroup, weight, locked, flipped, topLevel, theme){
if (isGroup === undefined){
isGroup = false;
};
if (weight === undefined){
weight = 0;
};
if (locked === undefined){
locked = false;
};
if (flipped === undefined){
flipped = false;
};
... | [
"function removeSlider(groups, group, name){\r\n if (!(group in groups)){\r\n throw (\"InvalidGroup\");\r\n };\r\n if (!(name in groups[group])){\r\n throw (\"InvalidSlider\");\r\n };\r\n\r\n // Check if the slider is locked before removing\r\n if (!groups[group][name].lock){\r\n // Set the value of ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
For the given request and response, runs all middleware and their return handlers, if any, and ensures that internal request processing semantics are satisfied. | async _processRequest(req, res) {
const [error, isComplete, returnHandlers,] = await JsonRpcEngine._runAllMiddleware(req, res, this._middleware);
// Throw if "end" was not called, or if the response has neither a result
// nor an error.
JsonRpcEngine._checkForCompletion(req, res, isCompl... | [
"async _processRequest(req, res) {\n const [\n error,\n isComplete,\n returnHandlers,\n ] = await JsonRpcEngine._runAllMiddleware(req, res, this._middleware)\n // Throw if \"end\" was not called, or if the response has neither a result\n // nor an... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Returns those elements of `a` for which `cb(a)` returns truthy | function filter(a, cb) {
var n = [];
each(a, function (v) {
if (cb(v)) {
n.push(v);
}
});
return n;
} | [
"function filter(a, cb) {\n const n = [];\n each(a, function(v) {\n if (cb(v)) {\n n.push(v);\n }\n });\n return n;\n}",
"function filter(a, cb) {\n var n = [];\n each(a, function(v) {\n if (cb(v)) {\n n.push(v);\n }\n });\n return n;\n}",
"function someFn(array, callback) {\n ret... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Check colorspace of files array | function checkColorSpace(files){
let progress = 0
process.on('uncaughtException', function(err){
console.log('CANNOT READ: ' + files[progress])
found(files[progress])
})
function found(file, color){
if(color == colorSpace){
console.log(file.replace(path, ''))
}
progress++
if(progress >= files.len... | [
"function checkColors() {\r\n let colors = {}\r\n\r\n _canvas = document.createElement('canvas')\r\n _canvas.width = canvas.width\r\n _canvas.height = canvas.height\r\n\r\n let ctx = _canvas.getContext('2d')\r\n ctx.fillRect(0, 0, canvas.width, canvas.height)\r\n ctx.drawImage(canvas.elt, 0, 0)\r\n let imgd... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Specific Track Objects /Track for displaying sequence and translated aa sequence | function SequenceTrack(gsvg,trackClass,label,additionalOptions){
var data=new Array();
var that=Track(gsvg,data,trackClass,label);
that.dispCutoff=300;
that.aaDispCutoff=2900;
that.seqRegionSize=4000;
that.strands="both";
that.includeAA=1;
that.labelBase=label;
that.lastUpdate=0;
that.seqRegionMin=0;
that.se... | [
"function RefSeqTrack(gsvg,data,trackClass,label,additionalOptions){\n\tvar that= GeneTrack(gsvg,data,trackClass,label);\n\tthat.counts=[{value:0,names:\"Ensembl\"},{value:0,names:\"RNA-Seq\"}];\n\tthat.drawAs=\"Gene\";\n\tthat.trxCutoff=100000;\n\tthat.density=3;\n\tvar additionalOptStr=new String(additionalOption... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Gets a list of information about existing site designs. | getSiteDesigns() {
return __awaiter(this, void 0, void 0, function* () {
return yield this.clone(SiteDesigns, `GetSiteDesigns`).execute({});
});
} | [
"get siteDesigns() {\r\n return this.create(SiteDesigns, \"\");\r\n }",
"getSiteDesigns() {\n return this.clone(SiteDesignsCloneFactory, \"GetSiteDesigns\").execute({});\n }",
"function getSites() {\n PercSISiteService.getSites(function (status, results) {\n if (status === ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Returns a BrowserStorage object which is just a wrapper around sessionStorage | getStorage() {
if (!this._storage) {
this._storage = new BrowserStorage_1.default();
}
return this._storage;
} | [
"_getSessionStore() {\n try {\n return JSON.parse(localStorage.getItem('session'))\n } catch (e) {\n return {}\n }\n }",
"function getSessionStorageObjects(name){\n if(typeof(Storage) !== \"undefined\") {\n return sessionStorage.getItem(name);\n }\n else{\n console.log('... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Check if ES indexion is OK, capture error otherwise. | function checkESIndex(doc) {
doc.on("es-indexed", (err, _res) => {
if (err) capture(err);
});
} | [
"checkIndex() {\n this.client.indices.exists({\n index: 'events'\n }).then((response) => {\n if (response.body === false) {\n this.initMapping('events', './mapping/events.json');\n }\n });\n }",
"async verifyIndexExists() {\n const ind... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Check firstname with regex & add/remove class | function checkFirstname(firstname) {
if (!firstname.match(nameReg)) {
firstnameError.textContent = 'Le champ ne doit pas contenir de chiffres ou de caractères spéciaux et contenir au moins 2 caractères.';
formSub.firstname.classList.add('invalid');
firstnameValid = false;
} else {
firstnameError.te... | [
"function checkFirstName() {\n\t\t\n\t\tvar pattern = /^[a-zA-Z]*$/;\n\t\tvar fname = idFirstName.val();\n\t\tif (pattern.test(fname) && fname !== '') {\n\t\t\tidFirstNameError.hide();\n\t\t\terrorFirstName = false; \n\t\t\tidFirstName.css(\"color\",\"Dodgerblue\");\n\t\t}\n\t\telse {\n\t\t\tidFirstNameError.html(\... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
////////////////////////////////////////////////////////////////// Encounters // ////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////// Generating encounter as the player gets to it | function generateEncounter()
{
} | [
"function initEncounters() {\n\twolfEncounter = new CombatEncounter(wolfEnemy);\n\twolvesEncounter = new CombatEncounter(wolvesEnemy);\n\tlionEncounter = new CombatEncounter(lionEnemy);\n\tlionsEncounter = new CombatEncounter(lionsEnemy);\n\tcrabEncounter = new CombatEncounter(crabEnemy);\n\tcrabsEncounter = new Co... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
checks if inputs are filled in, posts jokeObj | function addJoke() {
console.log('clicked add ');
if ($('#whoseJokeIn').val() == '' || $('#questionIn').val() == '' || $('#punchLineIn').val() == '') {
alert('Please make sure all inputs are filled in');
return;
}
newJokeSet();
console.log(newJoke);
$('input').val(''); // empt... | [
"function gather() {\n var newJoke = {};\n newJoke.whoseJoke = $('#whoseJokeIn').val();\n newJoke.jokeQuestion = $('#questionIn').val();\n newJoke.punchLine = $('#punchlineIn').val();\n postJokes(newJoke);\n}",
"function remeberTheJoke () {\n var newJokeName = document.getElementById('new-joke-name').value.... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Actualiza el estado de la tarea | function actualizarEstadoTarea(estado) {
bcambios = false;
_estado = estado;
btnGrabar_onClick();
} | [
"function atualizaTela() {\n\n\t\t\t limpaTela();\t\t\t \n\t\t\t desenhaCirculo(x, y, 10);\n\t\t\t }",
"function atualizarrWorkStatusSistema() {\n apiService.post('/api/workflowstatus/atualizar', $scope.novoWorkFlowStatusSistema,\n atualizarWorkflowStatusSucesso,\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
saves the delineated watershed shape file as a CKAN resource | function saveShapeFile()
{
var shapeFileName = $('#field-shapefilename').val();
var watershedDescription = $('#field-shapefiledescription').val();
selectedOrganization = document.getElementById("field-organizations").value;
if(shapeFileName.length == 0 || watershedDescription.le... | [
"function saveSketchFile(e) {\n\n // Save locations in SVG:\n deselectFixt();\n\n let data = new Blob([JSON.stringify(devices)], {type: 'application/json'});\n if (data.size <= 2) \n // There are no devices.\n return;\n\n\n let url = window.URL.createObjectURL(data);\n\n let link = d... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
= Notepad module = | function qll_utility_notepad()
{
object = document.createElement("div");
object.setAttribute('class', 'QLLNotepad');
inner="<div id='QLLNotepad'>" + qll_lang[21] + "</div>";
inner=inner + "<textarea id='QLLNotepadContent'>" + GM_getValue("QLLMenuNotepad:content",qll_lang[24]) + "</textarea>";
inner=inner + "... | [
"function openNotepad() {\n\tvar courseID = getQueryVariable('course_id');\n\topenWin(\"/bin/common/notepad.pl?course_id=\"+courseID);\n}",
"function TextExt() {}",
"_saveNotepad() {\n this._db.saveItem('notepad', this._notes);\n }",
"openInNotepad () {\n return hostService.startProcess(\"notep... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
go to all vendor page. | async gotoAllVendorPage(testController) {
await testController.click('#all-vendor-page');
} | [
"async gotoListVendorsPage(testController) {\n await testController.click('#navbar-list-vendors');\n }",
"async gotoManageVendorPage(testController) {\n await testController.click('#manage-vendor-page');\n }",
"async gotoMyVendorPage(testController) {\n await testController.click('#my-vendor-page');\... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
A hook to retrieve the DragDropManager from Context | function useDragDropManager() {
var _useContext = (0, _react.useContext)(_DndContext.DndContext),
dragDropManager = _useContext.dragDropManager;
(0, _invariant.invariant)(dragDropManager != null, 'Expected drag drop context');
return dragDropManager;
} | [
"function useDragDropManager() {\n var dragDropManager = react_1.useContext(DragDropContext_1.context).dragDropManager;\n invariant(dragDropManager != null, 'Expected drag drop context');\n return dragDropManager;\n}",
"function useDragDropManager() {\n const { dragDropManager } = (0,react__WEBPACK_I... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
set east panel size | function setEastSize(pp) {
if (!pp.length) return;
var ppopts = pp.panel('options');
pp.panel('resize', {
width: ppopts.width,
height: cpos.height,
left: cc.width() - ppopts.width,
top: cpos.top
});
... | [
"function setEastSize(pp){\n\t\t\tif (!pp.length) return;\n\t\t\tvar width = getPanelWidth(pp);\n\t\t\tpp.panel('resize', {\n\t\t\t\twidth: width,\n\t\t\t\theight: cpos.height,\n\t\t\t\tleft: cc.width() - width,\n\t\t\t\ttop: cpos.top\n\t\t\t});\n\t\t\tcpos.width -= width;\n\t\t}",
"function setEastSize(p){\r\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Request JSON from a url, synchronously | function request(url) {
var req = new XMLHttpRequest();
req.responseType = 'json';
req.open('GET', url, false);
req.send();
return req.status == 200 ? req.response : null;
} | [
"function GetJSON(url) {\n\treturn new Promise(function(resolve, reject) {\n\t\trequest(url, function (error, response, body) {\n\t\t\tif(error != \"\" && error != null && error != undefined) {\n\t\t\t\treject('error:', error); // Print the error if one occurred\n\t\t\t}\n\t\t\telse if(response.statusCode == 200) {... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Not all elements are finished loading by the time the 'load' eventListener fires To get around this, the first window is checked after the second window's 'load' event is triggered WHen the last url is opened, it is opened once more in a second window to get the final result Create a linked recursive function to open a... | function EvenWindowScraper() { // Even count, post current results and last results
if( count < urlLength ){
EvenWindow = window.open(url[count]);
EvenWindow.window.addEventListener('load', function(){
//console.log(count + ' Display: ' + !EvenWindow.document.getElementById('sku').style["display"] + ',' + url[c... | [
"function LastCall() {\n\tif (urlLength % 2 == 1){\n\t\tOddWindow = window.open(url[count-1]);\n\t\tOddWindow.window.addEventListener('load', function(){\n\t\t\tconsole.log(count-1 + ' Display: ' + !EvenWindow.document.getElementById('sku').style[\"display\"] + ',' + url[count-1]);\n\t\t\tSafeBox.setItem(url[count-... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Finds a child dialog that was previously added to the container. | findDialog(dialogId) {
return this.dialogs.find(dialogId);
} | [
"onFindDialog(dc) {\n return dc.findDialog(dc.activeDialog.id);\n }",
"function getWrappingDialog(element){\r\n\treturn element.closest('.ui-dialog-content');\r\n}",
"find(dialogId) {\n return this.dialogs.hasOwnProperty(dialogId) ? this.dialogs[dialogId] : undefined;\n }",
"function getCl... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Handles a click on the restore all notification link by hiding the notification and informing Chrome. | function onRestoreAll() {
hideNotification();
apiHandle.undoAllMostVisitedDeletions();
} | [
"function onRestoreAll() {\n hideNotification();\n ntpApiHandle.undoAllMostVisitedDeletions();\n}",
"function hideNotificationAndReset() {\n iSuccess.css('display', 'none');\n iError.css('display', 'none');\n iMessage.html('');\n notification.css('display', 'none');\n }",
"funct... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Sentiment and policital analysis pulled from an API | function getSentiment(articleText, appendScoreHere) {
$.post(
'https://apiv2.indico.io/apis/multiapi?apis=political,emotion',
JSON.stringify({
'api_key': "99883d108820881bbdf367b594a55cf0",
'data': articleText,
})
).then(function... | [
"function analyseSentiment(data){\n\tconst params = {\n\t\ttext : data\n\t};\n\treturn new Promise(function(fulfill, reject){\n\t\ttry{\n\t\t\trequest.get({url:\"http://localhost:4000/aylien/sentiment\", qs: params}, function(error, response, data){\n\t\t\t\t//console.log(\"Error: \", error);\n\t\t\t\t//console.log... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Validate the photo URL of the item. It must at least contain http or https. | function validatePhoto(thePhoto) {
var photoAlert = $(alert);
photoAlert.text("");
if (!(thePhoto.includes("http://") || thePhoto.includes("https://"))) {
photoAlert.text(
"Please enter a valid URL for your photo. It must contain http or https."
);
}
if (photoAlert.text() !== "") {
$("#pho... | [
"function validateImageURL(image_url){\n \n }",
"function validate_url(input) {\n\t\treturn (input.val().startsWith('http://') || input.val().startsWith('https://'));\n\t}",
"validateAssetUrl () {\n\t\t// we don't expect the asset URL \n\t}",
"function URLIsValid(inputField) {\n return (/^(?:http(s... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
returns the result of mapFn applied to the first element of the results | function extractFirstRow (mapFn, defaultResult = {}) {
return neoData => {
const allRows = extractAllRows(mapFn)(neoData);
return allRows.length ? allRows[0] : defaultResult;
};
} | [
"function map(fn) {\n return function(rf) { // <- buildArray for example\n // Hmm, we don't have the information yet to run the functionality of map, lets return a function to provide an interface for this\n return function(result, item) { // look another reducing function\n return rf(result, fn(item))\... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
This function is to nvaugate to differen pages depending on the grades | function navigate(grade) {
localStorage.setItem("grade", grade);
if (grade <= 3) {
window.location.href = ("index.html");
} else if (grade > 3 && grade <= 8) {
window.location.href = ("index1.html");
} else if (grade > 8 && grade <= 12) {
window.location.href = ("index2.html");
... | [
"function gradingStudents(grades) {\n return grades.map((p) => {\n if (p >= 38 && 5 - (p % 5) < 3) return 5 * ((1 + p / 5) | 0);\n return p;\n });\n}",
"function gradingStudents(grades) {\r\n return grades.map(x => {\r\n const next = 5 * (Math.ceil(Math.abs(x / 5)));\r\n retur... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Method that simply clears and animates the password box if wrong password This is js/JQuery/ and animated plugin | function wrongPass() {
// input fields incorrect, assuming its password, we clear it
var aName = "animated shake";
$('.form-button').addClass(aName).one('webkitAnimationEnd mozAnimationEnd MSAnimationEnd oanimationend animationend', function() {
/* Act on the event */
$(this).removeClass(aName);
});;
... | [
"function maskPassword() {\r\n $(\"#passwordDiv\").attr(\"class\", \"masked\");\r\n $(\"#passwordHelp\").show();\r\n $(\"#unmaskPasswordLink\").show();\r\n $(\"#maskPasswordLink\").hide();\r\n return false;\r\n}",
"function clearPassword(){\n finishedPassword = \"\";\n}",
"function unmaskPasswor... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
returns the parent node. | get_parent_node(){
return this.fc.get_fragment_by_id(this.parent_node[0]).get_node_by_id(this.parent_node[1])
} | [
"getParent() {\n // TODO: return null for top-level nodes?\n return this.parent;\n }",
"parent() {\n return this._node(this.el.parent);\n }",
"function parent() {\n return this[0] ? this[0].parent : null;\n}",
"getParent(node) {\n return node.parentNode;\n }",
"get parentNo... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
close the menu when dropdown icon loses focus but what for 100ms so click event can bubble first | onBlur() {
const {
isOpen,
closeDropdownMenu,
} = this.props
if (isOpen) {
//TODO possible memory leak and racing condition
setTimeout(closeDropdownMenu, 200)
}
} | [
"handleDropdownMouseLeave() {\n if (!this._menuHasFocus) {\n this.close();\n }\n }",
"function OCM_simpleDropdownClose() {\r\n\t\t\t\t\t$('#mobile-menu').hide();\r\n\t\t\t\t\t\r\n\t\t\t\t\t$('.slide-out-widget-area-toggle:not(.std-menu) .lines-button').removeClass('close');\r\n\t\t\t\t... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
connect to amqp cloud | function connectToAmqp() {
amqp.connect(CLOUDAMQP_URL + "?heartbeat=60", function(err, conn) {
if(err) {
console.error("[AMQP Connection error]", err.message);
return setTimeout(connectToAmqp, 1000);
}
// if there is an error connecting
conn.on('error', function(err) {
if(err.message.toLowerCase() ==... | [
"connectAmqp() {\n if (this.ampqConnection !== null) {\n return;\n }\n return amqplib_1.default.connect(this.params.amqpUrl).then(async (conn) => {\n conn.on('error', (e) => {\n roarr_1.default.error('[ae-helper] amqp connect get error: ' + e);\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Call index.php?task=task.image_gallery.getmodal to get the HTML code for the modal window. When loaded, the function will call the showImageFromThumbnail() function to display the image in the modal | function loadModal(obj) {
// Retrieve the HTML for the modal form
if (!$('#Modal_ImgGallery').length) {
$.ajax({
type: "POST",
url: marknotes.webroot + "index.php",
data: "task=task.image_gallery.getmodal",
dataType: "json",
success: function (data) {
if (data.hasOwnProperty("form")) {
// T... | [
"function miniGallery(image) {\n galleryModal.style.display = 'block';\n miniModalImg.src = image.src;\n}",
"function showModal() {\n var modalImg = document.getElementById(\"image\");\n var captionText = document.getElementById(\"caption\");\n hideUmbracoNavigation();\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Adds army name to list name string army's name id string army's id returns void | function addArmyNameToList(name, id){
var $list = $("#listArmy");
var element = "<option class='armyElement' value=" + id + ">" + name + "</option>";
$list.append(element);
} | [
"function addName() {\n if (nameExpression.test(nameInput.value)) {\n names.push(nameInput.value);\n nameInput.value = \"\";\n }\n updateNameList();\n}",
"addName() {\n if (this.newName === '')\n return;\n this.names.push(this.newName);\n this.newName = \"\";\n }",
... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Call the login endpoint with the signed message so that the application can authenticate the user The message is the user's email. The server will validate the signed message because it's got the public key corresponding to the private key. | function doLogin(email, key) {
const crypto = new OpenCrypto();
var message = crypto.stringToArrayBuffer(email);
return window.crypto.subtle.sign(
{
name: "RSASSA-PKCS1-v1_5",
hash: { name: "SHA-512" },
},
key,
message,
)
.catch(error => {
... | [
"function login(email, password) {\n client.login(email, password, () => {\n listMessages();\n });\n}",
"login() {\n this.send(\"login\", {publicKeyString: this.crypto.publicKeyString}, true)\n }",
"function signInUser(request, sender, sendResponse) {\t\n\tif(request.msg == \"call signIn\"){\n\t\... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Takes a gateway off of the queue and logs it in. | async processGatewayQueue() {
if (this.gatewayLoginQueue.length) {
if (this.gatewayLoginQueue[0].resumable) {
const gateway = this.gatewayLoginQueue.shift();
await gateway.login();
} else if (
this.startingGateway === null
&& new Date().getTime() > this.safeGatewayIdentif... | [
"gotNewQueue() { this.nowLoggedOn(); }",
"startGatewayLoginInterval() {\n this.processGatewayQueueInterval = setInterval(\n this.processGatewayQueue, SECOND_IN_MILLISECONDS,\n );\n }",
"emitNewQueue(payload) {\n console.log(\"emit new queue to admins and agent\");\n const { queue, agen... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
get modal element from paper reference | function getModal(paperReference) {
return document.querySelector("." + paperReference + " div.modal");
} | [
"getElement()\n {\n \treturn this.modal;\n }",
"function getModalFromChild(object) {\n let paperReference = object.closest(\".paper-entry\").classList[1];\n return getModal(paperReference);\n}",
"function getModalEl() {\n const repoModalEl = document.getElementsByClassName(\"get-repo-modal\")[0];\n c... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
return a new chat page content | function getNewChatPage(jid_id) {
var newChatPage = '<div class="dail-detail" id="chat-page-'+jid_id+'"></div>';
return newChatPage;
} | [
"function loadChat(chat_name) {\n var new_chat_window = document.createElement('div');\n new_chat_window.setAttribute('id', 'chat-window');\n\n var new_chat_log = chat_log[chat_name];\n \n for (var i = 0; i < new_chat_log.length; i++) {\n var message_container = newMessage(new_chat_log[i][0], ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Get two endpoints of this edge on the connected nodes | getConnectionPoints() {
let startBound = this.startNode.getBounds()
let endBound = this.endNode.getBounds()
let startCenterX = (startBound.x + startBound.width) / 2
let startCenterY = (startBound.y + startBound.height) / 2
let endCenterX = (endBound.x + endBound.width) / 2
... | [
"getEndPoint()\n {\n //Get end point for straight edges...\n if (this.quad == null)\n {\n const radius = this.isPlaceholder() ? 1 : Config.NODE_RADIUS;\n const dx = this.from.x - this.to.x;\n const dy = this.from.y - this.to.y;\n const angle = -Math.atan2(dy, dx) - Config.HALF_PI;\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
getTwoWordPhraseCounts(args) Get 2word phrase keywords. | function getTwoWordPhraseCounts(args) {
var inputwords = args['inputwords'];
var inputwordscount = args['inputwordscount'];
var skipwords = args['skipwords'];
var twowordphrases = {};
for(i = 0; i - 1 < inputwordscount; i++) {
var currentword = inputwords[i];
var nextword = inputwords[i + 1];
i... | [
"function getSingleKeywordCounts(args) {\n\t\twords = args['words'];\n\t\twordcount = args['wordcount'];\n\t\tskipwords = args['skipwords'];\n\t\t\n\t\tvar wordcounts = {};\n\t\t\n\t\tfor(i = 0; i < wordcount; i++) {\n\t\t\tvar inputword = words[i];\n\t\t\t\n\t\t\tif(!skipwords[inputword]) {\n\t\t\t\tif(wordcounts[... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Helper function to print a End of line | function printEOL() {
console.log('');
} | [
"function cr() {\n if (this.lastOut !== '\\n') {\n this.lit('\\n');\n }\n }",
"function cr() {\n if (this.lastOut !== '\\n') {\n this.lit('\\n');\n }\n}",
"endOfLine() {\n var tp;\n tp = this.textPosition();\n return this.forwardWhile(function(n) {\n return !differ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Add remaining queries to the queries to do so they can be done first | addRemainingQueriesToTheTop(remainingQueries) {
remainingQueries.reverse();
for(let query of remainingQueries) {
this.queriesToDo.unshift(query);
}
this.remainingQueries = [];
} | [
"updateRemainingQueries(queries) {\n for (let query of queries) {\n this.remainingQueries.push(query);\n }\n }",
"resolveQueries(queries) {\n const promisedQueries = entries(queries).map(([queryName, query]) => {\n\n if (process.env.NODE_ENV !== 'production') {\n const schemaMan... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Removes all icons from within the given element. | function removeIcons(element) {
for (const icon of Array.from(element.querySelectorAll('mat-icon, .material-icons'))) {
icon.remove();
}
} | [
"function removeIcons(element) {\n var e_1, _g;\n var _a;\n try {\n for (var _h = __values(Array.from(element.querySelectorAll('mat-icon, .material-icons'))), _j = _h.next(); !_j.done; _j = _h.next()) {\n var icon = _j.value;\n (_a = icon.parentNode) ===... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Selectable Pone la etiqueta selected a un objeto | function selectObject(item){
//Deselecciono todo
deselectObjects();
//Selecciono el nuevo elemento
item.classList.add("selected");
} | [
"function selecionarItem(event) {\n TrocarSelecionado();\n event.target.classList.add('selected');//adicionar a classe selected\n \n //essa classe é colocada \n}",
"selectObject(){\n $(\"#objects-list option\").prop(\"selected\", false); // Clear objects list selection\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Show bottom border of current tab | function showTab() {
var url = window.location.href;
if(url.indexOf('/get_started/why_mxnet') != -1) return;
for(var i = 0; i < TITLE.length; ++i) {
if(url.indexOf(TITLE[i]) != -1) {
var tab = $($('#main-nav').children().eq(i));
if(!tab.is('a')) tab = tab.find('a').first();
... | [
"activateBottomLine() {}",
"async function borderify() {\n let tabArray = await browser.tabs.query({ currentWindow: true, active: true });\n let tabId = tabArray[0].id;\n await browser.tabs.insertCSS(tabId, { code: borderCSS });\n await browser.sessions.setTabValue(tabId, \"border-css\", borderCSS);\n... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
convert text from textarea to wykop `code` and sub it | function setTextarea(e) {
e.preventDefault();
var textarea = document.querySelector('.arrow_box textarea');
var fullText = textarea.value;
var code = formatSend(fullText);
textarea.value = code;
} | [
"function areaCode(text) {\n var start = text.indexOf(\"(\");\n return text.substring(start + 1, start + 4);\n}",
"function parseEditBox() {\n \tvar code = jQuery(\"#wiki__text\").val();\n \tvar codeStr = code.match(/(<code>(.|\\n)*?<\\/code>)+/g);\n \tif(codeStr != null) {\n \t\tfor(i = 0; i < code... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |