query stringlengths 9 34k | document stringlengths 8 5.39M | negatives listlengths 19 20 | metadata dict |
|---|---|---|---|
Performs the CSS transformation on the tab list that will cause the list to scroll. | _updateTabScrollPosition() {
if (this.disablePagination) {
return;
}
const scrollDistance = this.scrollDistance;
const translateX = this._getLayoutDirection() === 'ltr' ? -scrollDistance : scrollDistance;
// Don't use `translate3d` here because we don't want to create... | [
"_updatePosition() {\n this.tabListEl.setAttribute('style', transform('translate', this.x + 'px'));\n }",
"updateTabScrollPosition() {\n if (this.disablePagination) {\n return;\n }\n const scrollDistance = this.scrollDistance;\n const translateX = this.getLayoutDirection... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Get the app resource ID for a specific beta group. | function getAppResourceIDForBetaGroup(api, id) {
return api_1.GET(api, `/betaGroups/${id}/relationships/app`)
} | [
"function getAppResourceIDForBetaLicenseAgreement(api, id) {\n return api_1.GET(api, `/betaLicenseAgreements/${id}/relationships/app`)\n}",
"function getAppResourceIDForBetaAppLocalization(api, id) {\n return api_1.GET(api, `/betaAppLocalizations/${id}/relationships/app`)\n}",
"function getAppResourceIDFo... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Given a sentiment value in [1, 1] return an appropriate Icon | function SentimentToIcon(sentiment) {
// neutral
if (Math.abs(sentiment) < 0.2) {
return (
<SvgIcon fontSize="large">
<path d="M9 14h6v1.5H9z" />
<circle cx="15.5" cy="9.5" r="1.5" />
<circle cx="8.5" cy="9.5" r="1.5" />
<path d... | [
"get sentiment_satisfied () {\n return new IconData(0xe813,{fontFamily:'MaterialIcons'})\n }",
"get sentiment_neutral () {\n return new IconData(0xe812,{fontFamily:'MaterialIcons'})\n }",
"get sentiment_very_satisfied () {\n return new IconData(0xe815,{fontFamily:'MaterialIcons'})\n }",
"get senti... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
This functions takes a string containing an ISBN (ISBN10 or ISBN13) and returns true if it's valid or false if it's invalid. | function validateISBN(isbn) {
if(isbn.match(/[^0-9xX\.\-\s]/)) {
return false;
}
isbn = isbn.replace(/[^0-9xX]/g,'');
if(isbn.length != 10 && isbn.length != 13) {
return false;
}
checkDigit = 0;
if(isbn.length == 10) {
checkDigit = 11 - ( (
10 * isbn.charAt(0) +
9 * isbn.charAt(1) +
... | [
"function validate(isbnStr) {\n if (typeof isbnStr !== \"string\") {\n throw new TypeError(\"argument must be a string\");\n }\n\n const normalized = normalize(isbnStr);\n\n switch (normalized.length) {\n case 10:\n return validateNormalizedISBN10(normalized);\n case 13:\n return validateNorm... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
validate examples agains a compiled schema | validateExamples(fullPath, validate) {
const files = getFiles(fullPath + path.sep + 'example*.json');
if (typeof validate !== 'function') {
if (
msg.addError(
fullPath,
'Examples cannot be validated since ' +
'validation function cannot be computed. Probably not all... | [
"function testSchema (data, cb) {\n var generator = machine.obj()\n\n generator.pipe(concat(function (schemaStr) {\n console.log(schemaStr)\n try {\n var schema = vm.runInNewContext(schemaStr, {Joi: Joi})\n schema.validate(data, function (er) {\n if (er) return cb(er)\n cb(null, sche... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
endregion PositionDetail() region PositionData() | function PositionData() {
this.TerritoryType = ExtraTools.eTerritoryType.None;
this.X = 0;
this.Y = 0;
this.Distribution = ExtraTools.eTerritoryDistribution.None;
this.OasisBonus = ExtraTools.eOasisBonus.None;
this.PlayerID = 0;
this.PlayerName = null;
this.AllyID = 0;
this.... | [
"function PositionDetail() {\r\n this.TerritoryType = ExtraTools.eTerritoryType.None;\r\n this.Name = null;\r\n this.X = 0;\r\n this.Y = 0;\r\n this.MainVillage = false;\r\n this.Distribution = ExtraTools.eTerritoryDistribution.None;\r\n this.CanSendTroop = false;\r\n this.Tribe = ExtraTools... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Vote up the update with the given update ID. | function voteOn(updateId) {
// the container of the voting section
var voteContainer = $("#"+updateId).children(".like");
// currently displayed count and new value for count
var curCount = $(voteContainer).children(".votecount");
var newCount = parseInt($(curCount).text());
// check i... | [
"voteUp(answer_id) {\n return this.vote(answer_id, 1)\n }",
"function updateVote(object, upvote) {\n object.increment(\"vote\");\n object.save();\n if (upvote == 1) {\n object.increment(\"upvote\");\n object.save();\n }\n }",
"function sendUpvote() {\n\t\... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
renders the current day and time using moment(), increments every second | function renderDay() {
currentDay.innerHTML = `<h1>${moment().format('MMMM Do YYYY, h:mm:ss a')}</h1>`
setInterval(renderDay, 1000);
} | [
"function timer() {\n let currentTimeAndDate = moment();\n $(\"#currentTime\").text(currentTimeAndDate.format(\"LTS\"));\n $(\"#currentDay\").text(currentTimeAndDate.format(\"dddd, MMMM Do, YYYY\"));\n}",
"function displayCurrentTime() {\n setInterval(function () {\n $(\"#currentDay\").text(mom... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Asynchronously transform `filename` with optional `opts`, calls `callback` when complete. | function transformFile(filename, opts, callback) {
if (_lodashLangIsFunction2["default"](opts)) {
callback = opts;
opts = {};
}
opts.filename = filename;
_fs2["default"].readFile(filename, function (err, code) {
if (err) return callback(err);
var result;
try {
result = _t... | [
"function transformFile(filename, opts, callback) {\n if (_lodashLangIsFunction2[\"default\"](opts)) {\n callback = opts;\n opts = {};\n }\n\n opts.filename = filename;\n\n _fs2[\"default\"].readFile(filename, function (err, code) {\n if (err) return callback(err);\n\n var result;\n\n try {\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
The API will error out if empty facets or filters objects are sent. | function removeEmptyFacetsAndFilters(options) {
var facets = options.facets,
filters = options.filters,
rest = _objectWithoutProperties(options, ["facets", "filters"]);
return _objectSpread(_objectSpread(_objectSpread({}, facets && Object.entries(facets).length > 0 && {
facets: facets
}), filters... | [
"renderFacets() {\n const { recordSetTotal, pageInfo, api, breadcrumb, facets, selectedFacets, cms, labels } = this.props;\n const { pageSize, selectedSortValue, pageNumber } = this.state;\n\n if (facets && facets.length === 0 && selectedFacets.length === 0) {\n return null;\n }\n\n return (\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Remove the ext of a filename, and pascalCase it | function pascalCaseFilename(filename) {
return pascalCase(filename.replace(/\.[^./]*$/, ""));
} | [
"function toFileNameLowerCase(x){return fileNameLowerCaseRegExp.test(x)?x.replace(fileNameLowerCaseRegExp,toLowerCase):x;}",
"function beautifyFilename(filename) {\n\tvar tokens = filename.split('.');\n\tvar tripped = tokens[0];\n\tvar ext = tokens[tokens.length - 1].toLowerCase();\n\ttokens = tripped.split('-');... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Creates a new developer and an accompanying developer group with just one dev. | function createDeveloper(firstName, lastName, email) {
//if the developer does not exist already
if(getDeveloperByEmail(email) === null) {
//create a new developer object
var newDeveloper = {
id: "devId-" + branchId + "_" + autoGeneratedDeveloperId,
firstName: firstName... | [
"function createDeveloperGroup(developerIds) {\n\t\n\t//create a new dev group\n\tvar newDevGroup = {\n\t\tid: \"devGroupId-\" + branchId + \"_\" + autoGeneratedDeveloperGroupId,\n\t\tmemberIds: developerIds\n\t};\n\n\t//create a new unique dev group id\n\tautoGeneratedDeveloperGroupId++;\n\n\t//add the new dev gro... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
takes the current grade returned by calculateCurrentGrade() and the grade desired and does the math to determine what the user needs on the final. | function calculateGradeNeeded(){
var finalExamWeight = document.getElementById("examWeight").value;
var preferredScore = document.getElementById("preferredScore").value;
var gradeNeeded = "";
if(finalExamWeight == "" || preferredScore == ""){
document.getElementById("output1").innerHTML = "Plea... | [
"function calculateGradeNeeded(){\n var currentGrade=calculateCurrentGrade();\n var finalWeight=parseInt(document.getElementById(\"finalWeight\").value);\n checkWeights(finalWeight);\n var gradeDesired=parseInt(document.getElementById(\"gradeDesired\").value);\n var gradeNeeded=((gradeDesired*100)-(c... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Archive the given todo. | function _archive(todo) {
var deferred = $q.defer();
service.archive(todo, function () {
return deferred.resolve();
}, function () {
return deferred.reject();
});
return deferred.promise;
} | [
"function archive() {\n vm.error = undefined;\n var promises = [];\n vm.todos.filter(function (todo) {\n return todo.completed;\n }).forEach(function (todo) {\n promises.push(_archive(todo));\n });\n\n $q.all(promises).t... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Scroll SS Picker To Input | function scrollToInput() {
var pageContent = smartSelect.parents('.page-content');
if (pageContent.length === 0) return;
var paddingTop = parseInt(pageContent.css('padding-top'), 10),
paddingBottom = parseInt(pageContent.css('padding-bottom'), 10),
... | [
"function scrollToInput() {\n\t var pageContent = smartSelect.parents('.page-content');\n\t if (pageContent.length === 0) return;\n\t var paddingTop = parseInt(pageContent.css('padding-top'), 10),\n\t paddingBottom = parseInt(pageContent.css('padding-b... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Determines if a hardcoded path was given in the frontmatter of a page. Then enforces a starting and trailing slash where applicable on the url. | function hardcodedPath() {
if ((0, _isUndefined3.default)(pageData.path)) return void 0;
var pagePath = pageData.path;
// Enforce a starting slash on all paths
var pathStartsWithSlash = (0, _startsWith3.default)(pagePath, '/');
if (!pathStartsWithSlash) {
pagePath = '/' + pagePath;
}
... | [
"function hardcodedPath() {\n if (_.isUndefined(pageData.path)) return undefined;\n\n let pagePath = pageData.path;\n\n // Enforce a starting slash on all paths\n const pathStartsWithSlash = _.startsWith(pagePath, \"/\");\n if (!pathStartsWithSlash) {\n pagePath = `/${pagePath}`;\n }\n\n /... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Return ISO A2 From Country Name ===================================================================== Description: Takes a country name and returns it's iso A2 code, if found, or false if not. | function returnIsoA2FromCountryName(countryName) {
let countriesInfo = countriesInfoFunctions.returnCountriesInfo();
let features = countriesInfo['countryBorders']['features'];
for (let i = 0; i < features.length; i++) {
if (countryName == features[i]['properties']['name']) {
let is... | [
"convertCountryNamesToCode(countryName) {\n\n if (countryName.length === 3) {\n return countryName;\n } else {\n return CountryInfo[CountryInfo.map(x => x.name).indexOf(countryName)]['alpha-3'];\n }\n\n\n }",
"function getCountryCode(country){\r\n var out_count... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
function to validate empty fields in the body | function emptyFields(req, res, next) {
const values = Object.values(req.body);
values.forEach((element) => {
if (element.length == 0) {
res.status(502).send(`Dont leave empty values`);
throw new Error('user sent parameter with empty value');
}
});
console.... | [
"function emptyFields(req, res, next) {\r\n const values = Object.values(req.body);\r\n values.forEach((element) => {\r\n if (element.length == 0) {\r\n res.status(500).send(`Dont leave empty values`);\r\n throw new Error('user sent parameter with empty value');\r\n }\r\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
add: var sloppy = new SloppyCardPosition(); | displayCardDealer(imageUrl, show) {
//necessary if a new card is added
let addPosition = false;
//image path
let imagePath = imageUrl;
//#1a set local variables, they are used to place cards
let positionX;
let positionY;
//#1b set sloppy factor
var sloppy = new SloppyC... | [
"function placeCard() {}",
"addDrawPileCard(scene) {\n // Create an arbitrary card.\n this.drawPileCard = new Card(scene, scene.camera.centerX - 150, scene.camera.centerY, 'spades', 'a', 'a of spades');\n this.drawPileCard.faceDown();\n }",
"createStarship(){\n this.starship = new Starship(40,... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Check findItem is exist on sets or not | function isExist(sets, findItem) {
const found = sets.find(
item =>
item.fromNumber === findItem.fromNumber &&
item.toNumber === findItem.toNumber
);
const hasSupperset = sets.find(item => isSuperset(findItem, item));
return found || hasSupperset;
} | [
"function isValuePresent(mySet, item) {\r\n return mySet.has(item);\r\n}",
"exists(item) {\n return _.find(this.data.collection, {'guid': item.guid});\n }",
"addToSet(set, item) {\n if (!set.includes(item)) {\n set.push(item);\n }\n return set;\n }",
"function con... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
UPDATE SCROLL If the scroll is at the bottom, update the scroll to stay at the bottom when a new message is received | function updateScroll(isScrolledToBottom){
if(isScrolledToBottom){
// Update the scroll
var messageDiv = document.getElementById("messagediv");
messageDiv.scrollTop = messageDiv.scrollHeight - messageDiv.clientHeight;
}
} | [
"function updateScroll() {\n\tmessagesArea.scrollTop = messagesList.clientHeight - messagesArea.clientHeight - diffScroll;\n}",
"updateScroll() {\n var element = document.getElementById(\"messages\");\n element.scrollTop = element.scrollHeight;\n }",
"function updateScroll(){\n $('.msger-ch... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Obtiene la fecha de un determinado Shape referenciado por el ID | function fgetDay(id){
return this.shapes[id].fecha;
} | [
"getDateFromID(id) {\n let itineraries = this.props.itineraries;\n for (let x in itineraries) {\n if (itineraries[x]._id === id) {\n return new Date(itineraries[x].date);\n }\n }\n return \"\";\n }",
"function getDateId() {\n\tvar date = new Date... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Create escaped hex value from number | function createEscapedHex( number ){
return fromCharCode(parseInt( number.toString(16) , 16));
} | [
"function hex($num) {\n var str = \"\";\n for(var j = 7; j >= 0; j--)\n str += _chars.charAt(($num >> (j * 4)) & 0x0F);\n return str;\n }",
"function hex(number) {\n if (number > 255) {\n throw new Error(\"'\" + number + \"'' is greater than 255(0xff);\");\n }\n\n var str = Nu... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Determine whether the given properties match those of a `HANAPrometheusExporterProperty` | function CfnApplication_HANAPrometheusExporterPropertyValidator(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,... | [
"function CfnApplication_JMXPrometheusExporterPropertyValidator(properties) {\n if (!cdk.canInspect(properties)) {\n return cdk.VALIDATION_SUCCESS;\n }\n const errors = new cdk.ValidationResults();\n if (typeof properties !== 'object') {\n errors.collect(new cdk.ValidationResult('Expected ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
to access secret method | accessSecret(){
this.#secret(); // method in class be a property
} | [
"getSecret()\n {\n return this.config.secret;\n }",
"get secret() {\n return this.getStringAttribute('secret');\n }",
"async secret(req, res, next) {\n console.log('Called to secret function');\n }",
"function setSecret(data) {\n secret = data;\n}",
"get secretString() {\n return ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Start the worker (kills a running worker if there already is one) | function startWorker() {
clientWorker = new Worker('/scripts/client_worker.js');
current_task = null;
clientWorker.onmessage = workerOnMessage;
} | [
"function startWorker() {\n var worker = new Worker();\n console.log('worker started');\n}",
"start() {\n const worker = cp.fork(this.workerPath)\n\n worker.on('error', this._onError)\n worker.on('message', this._onMessage)\n worker.on('disconnect', this._onDisconnect)\n\n this.worker = worke... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Query users by given params | queryUsers(params) {
return axios.get('/user/query', {
params: params
}).then(ret => {
return ret.data;
});
} | [
"function getUsersByParams(params, callback) {\n User.find(params)\n .exec(function (err, findUsers) {\n if (err) {\n callback(err, null);\n } else {\n callback(null, findUsers);\n }\n });\n}",
"users(parent, args, { db }, info) {\n\n... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
constructor sets up SGT object and storage of students params: (object) elementConfig all premade dom elements used by the app purpose: stores the appropriate DOM elements inside of an object and uses those element references for later portions of the application Also, stores all created student objects in this.data Fi... | constructor(elementConfig) {
this.elementConfig = elementConfig; /* console.log elementConfig to note what data you have access to */
this.data = {};
this.addEventHandlers = this.addEventHandlers.bind(this);
this.handleAdd = this.handleAdd.bind(this);
this.handleCancel = this.handleCancel.bind(this);
t... | [
"constructor(elementConfig){\n\t\t\t// startTests();\n\t// SGT = new SGT_template({\n\t// \taddButton: $(\"#addButton\"),\n\t// \tcancelButton: $(\"#cancelButton\"),\n\t// \tnameInput: $(\"#studentName\"),\n\t// \tcourseInput: $(\"#studentCourse\"),\n\t// \tgradeInput: $(\"#studentGrade\"),\n\t// \tdisplayArea: $(\... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Click handler organises various actions and effects | clickHandler() {
// Activate if not active
if (this.active === false) {
// Button view press effect
this.changeToActive();
// No click 'action' for input - text is removed in visualEffectOnActivation
}
} | [
"clickHandler() {\n // Activate if not active\n if (this.active === 'safety') {\n // Button view press effect\n this.removeSafety();\n } else if (this.active === false) {\n // Button view press effect\n this.changeToActive();\n // Click act... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Select or deselect all layers | selectDeselectAllLayers() {
me.btnSelectDeseletClicked = !me.btnSelectDeseletClicked;
me.compoData.layers.forEach(layer => layer.checked = me.btnSelectDeseletClicked);
} | [
"selectDeselectAllLayers() {\n me.btnSelectDeseletClicked = !me.btnSelectDeseletClicked;\n me.compoData.layers.forEach(\n (layer) => (layer.checked = me.btnSelectDeseletClicked)\n );\n }",
"function unselectAll(layers) {\n if (!layers) return\n\n log(2, 'Unselect all', layers)\n\n laye... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Flattens the API object structure into an array containing all versions of all APIs. | function flatten (apimap) {
let apiArray = [];
for (let [name, api] of Object.entries(apimap)) {
let latestVersion = api.versions[api.preferred];
apiArray.push({
name,
version: api.preferred,
swaggerYamlUrl: latestVersion.swaggerYamlUrl,
});
}
return apiArray;
} | [
"async listOfAPIs () {\n let response = await fetch(\"https://api.apis.guru/v2/list.json\");\n\n if (!response.ok) {\n throw new Error(\"Unable to downlaod real-world APIs from apis.guru\");\n }\n\n let apiMap = await response.json();\n\n // Flatten the API object structure into an array contain... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
compose :: Semigroupoid c => (c j k, c i j) > c i k . . Function wrapper for [`fantasyland/compose`][]. . . `fantasyland/compose` implementations are provided for the following . builtin types: Function. . . ```javascript . > compose(Math.sqrt, x => x + 1)(99) . 10 . ``` | function compose(x, y) {
return Semigroupoid.methods.compose(y)(x);
} | [
"function compose(x, y) {\n return Semigroupoid.methods.compose (y) (x);\n }",
"function compose(f, g, n) {\n // ...\n}",
"compose(semigroupoid) {\n\t\t// Semigroupoid c => c (i->j) ~> c (j->k) -> c (i->k)\n\t\treturn AJS.of(x => semigroupoid.value(this.value(x)))\n\t}",
"function compose(...fns) {\n co... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Complete the progress bar so the user knows it can do things | function completeProgress() {
var progresswidth = $('.progress').width();
$('.progress-bar').width(progresswidth);
// Wait a little bit before removing the full bar so the user knows it completed
setTimeout(function() {
$(".progress-bar").hide();
}, 500);
} | [
"end() {\n this.progress.done = true;\n }",
"function progress_done(bar, min_width, reset = false) {\n clearInterval(int_id);\n\n if (reset) {\n progress_percent = 0;\n $(bar).text('0%');\n $(bar).css('background-color', '#007bff');\n $(bar).css('width', (min_wi... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
write message to page | function writeToPage(msg) {
results.innerHTML = msg;
} | [
"function printToPage(msg) {\n\t\tdocument.getElementById('serverResponse').innerHTML += `${msg}<br>`;\n\t}",
"function write(message) {\n document.getElementById('message').innerText += message;\n }",
"function write(message) {\r\n var msg = (document.getElementById(\"footer-message\").textContent... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
return max item in lst according to value func val cur = current best Destructive of lst! | function maxWRT( lst, val, cur, curval ){
"use strict";
if ( !cur ){
cur = lst.pop();
curval = val(cur);
}
if ( lst.length === 0 ) {
return {"best":cur,
"bestVal":curval};
}
let hd = lst.pop();
let hdval = val(hd);
let newcur = cur;
let newcurval = curval;
... | [
"function find_max_by(criterion, list) {\n\tlet item1 = list[0];\n\tif (list.length <= 1) return item1;\n\tlet item2 = find_most_valuable(list.slice(1));\n\treturn criterion(item1) > criterion(item2) ? item1 : item2;\n}",
"function find_most_valuable(list) {\n\tlet item1 = list[0];\n\tif (list.length <= 1) return... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Defines a commandline parameter whose value is an integer. | defineIntegerParameter(definition) {
return this._createParameter(definition, {
type: 'int'
}, definition.key);
} | [
"set intParameter(value) {}",
"defineIntegerParameter(definition) {\n const parameter = new CommandLineIntegerParameter_1.CommandLineIntegerParameter(definition);\n this._defineParameter(parameter);\n return parameter;\n }",
"function optionQuantity(argvQuantity) {\n if ( argvQuantity... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Sets up listeners for `ajaxSend` and `ajaxComplete`. | function _setupAJAXHooks() {
requests = [];
if (typeof jQuery === 'undefined') {
return;
}
jQuery(document).on('ajaxSend', incrementAjaxPendingRequests);
jQuery(document).on('ajaxComplete', decrementAjaxPendingRequests);
} | [
"function _setupAJAXHooks() {\n requests = [];\n\n if (!Ember.$) {\n return;\n }\n\n Ember.$(document).on('ajaxSend', incrementAjaxPendingRequests);\n Ember.$(document).on('ajaxComplete', decrementAjaxPendingRequests);\n }",
"function bindClassEvents() {\n var resHandlr = this.responseHandle... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
CAM729 Test to check limit DFR record length feature when FR trigger(Pre+Oplimit+Post fault time) is equal to Maximum record length. CAM730 Test to check limit DFR record length functionality when FR trigger(Pre+Oplimit+Post fault time) is over Maximum record length. CAM731 Test to check limit DFR record length feature... | function CAM_729_730_731_733()
{
try
{
Log.Message("Start:-Test to check limit DFR record length feature when FR trigger(Pre+Oplimit+Post fault time) is within Maximum record length.")
var dataSheetName = Project.ConfigPath +"TestData\\CAM_729_730_731_733.xlsx"
//Step0.Check whether device exists or not... | [
"function CAM_686_687_688()\n{\n try\n {\n Log.Message(\"Started TC:-Test to check limit DFR record length feature when Manual trigger(Pre+Post fault time) is equal to Maximum record length\") \n var DataSheetName = Project.ConfigPath +\"TestData\\\\CAM_686_687_688.xlsx\"\n \n //Step1.: Check if iQ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Adds n new assignments to the bonus bot HIT. | function addBonusBotAssignments(n) {
let bonusHITID = "31J7RYECZL5V0NM6X3YYXPP7U361L0";
returnHIT(bonusHITID, a => {
console.log(`Before: ${a.HIT.NumberOfAssignmentsAvailable}`);
});
mturk.createAdditionalAssignmentsForHIT(
{
HITId: bonusHITID,
NumberOfAdditionalAssignments: n
},
b =... | [
"function addAssignment(evt) {\n evt.preventDefault();\n let newAssignmentID = courseDescriptions.number_assignment_types + 1;\n let blank_assessment = {\n id: newAssignmentID,\n title:\"\",\n description:\"\",\n points_each: 0,\n num_of: 0... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
check whether an alignment exists | function does_alignment_exist(alignmentName) {
var alignmentExists = undefined;
// glue.log("INFO", "Checking for alignment ", alignmentName);
alignmentResult = glue.tableToObjects(glue.command(["list", "alignment", "-w", "name = '"+alignmentName+"'"]));
//glue.log("INFO", "list result was:", alignmentResult);... | [
"_processTableAlignment(definition, alignment)\n {\n let groups = this._splitAndTrimTableRow(definition);\n if (groups.length == 0)\n {\n return false;\n }\n\n const validCol = /^:?-{3,}:?$/;\n for (let i = 0; i < groups.length; ++i)\n {\n le... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
2. throw a detailed mistake, with all the bells and whistles / data catchMistake() mistake2() toss_test.js:172 note about what happened a: apple b: banana c: carrot d: Text in a Data object | function mistake2() {
var a = "apple";
var b = "banana";
var c = "carrot";
var d = Data("Text in a Data object");
toss("data", {note:"note about what happened", watch:{a:a, b:b, c:c, d:d}});
} | [
"function mistake4() {\n\ttry {\n\t\tData(\"hello\").start(6);//throws chop\n\t} catch (e) { toss(\"data\", {caught:e}); }//catch chop, wrap it in a data exception, and throw that\n}",
"function mistakeSay(e) {\n\tvar s = \"\";\n\tif (e.name) s += line(e.name); else s += line(\"exception\"); // Toss name is opti... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Add Weenie image to random hole. | function addWeenie (){
$("#"+ hole).addClass("add_weenie");
} | [
"function drawHole(hole){\n var canvas = document.getElementById(\"space-canvas\");\n var context = canvas.getContext(\"2d\");\n hole.img.onload = function() {\n ctx.drawImage(hole.img, hole.x-25, hole.y-25);\n };\n ctx.drawImage(hole.img, hole.x-25, hole.y-25);\n}",
"function addAnimalImage... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Google map disable zoom on scroll | function simpleDisableMapZoom() {
"use strict";
// Disable scroll zooming and bind back the click event
var onMapMouseleaveHandler = function(event) {
var that = $(this);
that.on('click', onMapClickHandler);
that.off('mouseleave', onMapMouseleaveHandler);
... | [
"function fixGoogleMapMouseWheelZoom() {\n\t$j('.sow-google-map-canvas').addClass('scroll-off'); // set the pointer events to none on doc ready\n\t$j('.widget_sow-google-map').on('click', function () {\n\t\t$j('.sow-google-map-canvas').removeClass('scroll-off'); // set the pointer events true on click\n\t});\n\t// ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Task removes the assets.json file | function removeAssetFile() {
return removeFiles(
path.join(
projectRoot,
output.storeAssetsJsonTo,
ASSETS_JSON_FILE_NAME
),
permissions.allowForceRemove,
permissions.dryRun
);
} | [
"function delJSON() {\n shell.exec(\"rm \" + dest);\n }",
"function clean() {\r\n return del([ 'assets' ]);\r\n}",
"deleteJson() {\n fs.unlinkSync(`./data/tasks/${this.id}.json`);\n }",
"function cleanup_webpack_assets()\n{\n\t// clear require() cache\n\tdelete require.cac... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
console.log(_makeGrid()); Constructs a Board with a starting grid set up. | function Board() {
this.grid = _makeGrid();
} | [
"function Board () {\n this.grid = _makeGrid(8);\n}",
"function Board () {\n this.grid = _makeGrid();\n}",
"function makeBoard() {\n // makeBoard() creates and populates JS board to height and width of the matrix array\n board = [];\n for (let h = 0; h < settings.gridHeight; h++) {\n board.push([]);\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Adjusts the height of the right panel so the bottom remains flush with the bottom of the left panel This function is typically called when the window is resized | function adjustRightDiv() {
// Calculating and settings menu height (height of left panel minus height of navigation buttons)
var numPixels = $('#left-panel-container').height() - $('#nav-btn-row-1').outerHeight() - $('#nav-btn-row-2').outerHeight();
$('#right-div-container').innerHeight(numPixels + 'px');
//... | [
"function sidePanelHeightUpdate()\n \t{\n \t\t_instance.updateHeight();\n \t}",
"function setSizesScrollHeight () {\n\tvar bottomPanelsHeight = $('#bottomLeft').outerHeight();\n\t$('#defContainer').css('padding-bottom', bottomPanelsHeight);\n}",
"function resizeRightPane() {\n // clear all h... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
called if this node became selected is also called by bs.app.output.stageview.window/objectPicker/pickAndSelect if no node is picked and this node was selected last. | function select(_select){
//post("got selected ("+_select+")... (" + myNodeName + ")\n");
if(vpl_linked){
// cpost("... selected is linked... (" + myNodeName + ")\n");
if(appGlobal.selectedNode == null){
appGlobal.selectedNode = "undefined";
}
// cpost("... selected has appGlobal.sele... | [
"OnSelectNode(e) {\n\n e.event.preventDefault();\n this.selected_node = null;\n\n var selected = this.network.getSelectedNodes();\n var nodes = this.data.nodes.get(selected);\n\n if (nodes.length > 0) {\n\n this.selected_node = _.find(this.nodes, { 'id': selected[0] });... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
This function will assign the 'Verified' role to the author of the message Note: this message will be a DM, so there will be no guild attached | function assignVerifiedRole(message) {
// Since this msg has no guild, we need to search for the guild
var guilds = message.client.guilds.cache;
var myGuild;
guilds.map(guild => {
console.log("guild: ",guild);
if (guild.name === "richie's bitchies :)") {
myGuild = guild;
}
});
var cache = myGuild.role... | [
"async function allocatRoleIfVerified(memberid, role, guild){\n\n\tconsole.log(\"Check member: \"+ memberid);\n\tlet verdata = retrieveVerificationInfo(memberid);\n\t\n\tconsole.log(\"Verification data found: \"+verdata);\n\t\n\tif (verdata){\n\t\tif (verdata.status == \"verified\") {\n\t\t\tconsole.log(\"Great - u... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Returns an array of all dropdown values in the correct order until (excluding) the first value that is equal to "". | function getDropDownValues(stage) {
var result = [];
for (var i = 0; i < stage; i++) {
var dropdown = document.getElementById(DROPDOWN_IDS[i]);
if (dropdown == null) {
return result;
}
if (dropdown.value == "") {
if (i == 0) {
result.push[""];
}
return result;
}
result.push... | [
"function getValues(val_only) {\n var values = [];\n for(var i=0, size=model.length; i<size; i++){\n var option = model[i];\n if(model[i].selected === true) {\n if(val_only) values.push(option.value);\n else values.push(option... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Fills in column filter fields with values from the grid store filters. | updateColumnFilterFields() {
const me = this,
grid = me.grid;
let field, filter;
for (let column of grid.columns) {
field = me.getColumnFilterField(column);
if (field) {
filter = grid.store.filters.getBy('property', column.field);
field.value = (filter && me.buildFilterSt... | [
"updateColumnFilterFields() {\n const\n me = this,\n grid = me.grid;\n\n let field, filter;\n\n for (const column of grid.columns) {\n field = me.getColumnFilterField(column);\n if (field) {\n filter = grid.store.filters.getBy('proper... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Subscribes to the event with the specified name. | subscribe(name, fn) {
this.events.get(name).subscribe(fn);
} | [
"subscribe(name, fn) {\n this.events.get(name).subscribe(fn);\n }",
"subscribe(name, event, callback) {\n _stores[name].on(event, callback);\n }",
"static subscribe(channelName, eventName, callback) {\n const channel = this.pusherInstance.subscribe(channelName);\n channel.bind(eventName, dat... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
show remaining filters, from 6 on loads api_topic from localStorage iterates the topics list from 6 hides the link finally | function showFiltersTop1(topicLenght) {
for (var i=6; i<parseInt(topicLenght);i++) {
var li = "liTopic"+(i);
document.getElementById(li).style.display = 'block';
document.getElementById('f_vermas1').style.display = 'none';
}
} | [
"function loadAllTopics() {\r\n hideAll();\r\n var xmlhttp = new XMLHttpRequest();\r\n xmlhttp.open(\"GET\", url + \"/\", true);\r\n xmlhttp.onreadystatechange = function () {\r\n if (xmlhttp.readyState === 4 && xmlhttp.status === 200) {\r\n var topics = JSON.parse(xm... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
This function runs when the Next button is hit at the end of a level, just before a new level is loaded. You can display an ad here and then run the videoAdComplete function below. The videoAdComplete function will load the subsequent level after the ad is finished. Therefore, you should call the videoAdComplete functi... | function newLevelWillStart(scene){
if(logEvents) console.log("Event [newLevelWillStart]", arguments);
scene.levelEnd.loadNextScene();
} | [
"nextLevel(){\n this.levelSpawner.level++;\n\n // if we get to the end set player to the first level and bring up the main menu\n if(this.levelSpawner.level >= this.levelSpawner.levels.length)\n {\n this.scene.switch(\"menuscene\");\n this.scene.stop(\"levelcomplete... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Queries if we're done with the frame capturing yet. | function doneFrameCapturing() {
if (dDoneFrameCapturing) {
returnToTest('done-capturing');
} else {
returnToTest('still-capturing');
}
} | [
"function doneFrameCapturing() {\n return logAndReturn(gCapturingStatus);\n}",
"frameIsEnd() {\n const total = this.getFramesNum();\n if (this.frameCursor == total && this.state !== 'end') {\n this.state = 'end';\n return true;\n }\n\n return false;\n }",
"function endFrame() {\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Validate an "alias" event. | function validateAliasEvent(event){assert(event.userId,'You must pass a "userId".');assert(event.previousId,'You must pass a "previousId".');} | [
"function validateAliasEvent (event) {\n assert(event.userId, 'You must pass a \"userId\".')\n assert(event.previousId, 'You must pass a \"previousId\".')\n}",
"function EmailAliasList_changeHandler(element) {\n var textArea = element.textArea;\n\n var entries = top.code.textArea_getEntries(textArea);\n for(... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
HELPERS disable the minus button if current amount is 1 | function minusButtonEnabling(amount, itemId) {
if (amount == '1') {
$(`#minus-${itemId}-button`).prop('disabled', true);
} else {
$(`#minus-${itemId}-button`).prop('disabled', false);
}
} | [
"function disable() {\n if (qtInput.val() >= 1) {\n addToCartBtn.removeAttr('disabled');\n minusBtn.removeAttr('disabled');\n }\n else{\n addToCartBtn.attr('disabled', true);\n minusBtn.attr('disabled', true);\n }\n }",
"function watchToggle(e) {\n console.log(amount.value)\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Updates UI components for switching between measurement units | function SwitchMeasurementUnits(){
var placeholderMm = '0.0';
var placeholderInches = '0.000';
// Disable print view when switching between units
EnablePrintView(false);
// Flip the toggle
_buttonState = !_buttonState;
// Null out all current values when toggling between units
// We don't wish to conver... | [
"changeUnits(ev) {\n if(ev.target.getAttribute('value') === 'metric') this.unit = 0;\n else if(ev.target.getAttribute('value') === 'imperial') this.unit = 1;\n inputsRequired.forEach((input, i) => {\n input.label.innerHTML = (input.name + placeHolderTexts[i][this.unit === 0 ? 'metric' : 'imperial'])\n... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Returns the underlying data in Array column format. | get getColumnData() {
if (this.config.isLowMemoryMode) {
return utils.transposeArray(this.values);
} else {
return this.$dataIncolumnFormat;
}
} | [
"function getColumnAsArray(col){\n var array = [];//empty array to push it in\n for (var i = 0; i < data.length; i++) {\n array.push(data[i][col]);\n }\n return array; \n}",
"function asArrayColumn(c, array) {\n if (c.__array)\n return c;\n if (!c.isDefined)\n return ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Creates a static wrap of the function | function staticWrap() {
// jshint validthis:true
if (this instanceof staticWrap) {
return create(func, Array.prototype.slice.call(arguments));
} else {
return func.apply(this, arguments);
}
} | [
"function wrapFunction(fn, setargc) {\n var wrap = (...args) => {\n setargc(args.length);\n return fn(...args);\n }\n // adding a function to the table with `newFunction` is limited to actual WebAssembly functions,\n // hence we can't use the wra... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Add native events based on settings | function addEvents() {
if (typeof settings.enable === 'function') {
settings.enable = settings.enable.bind(instance)();
}
if (!settings.enable) {
return; // interaction is disabled
}
Object.keys(settings.events).forEach(function (key) {
var listener = settings.events[key].bind(in... | [
"function addEvents() {\n if (typeof settings.enable === 'function') {\n settings.enable = settings.enable.bind(instance)();\n }\n if (!settings.enable) {\n return; // interaction is disabled\n }\n Object.keys(settings.events).forEach((key) => {\n const listener = settings.events[key].... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Move the dominos according to their directions. | function slideDominos(){
var n = dominos.length;
for(var i = 0; i < n; i++){
domino = dominos[i];
switch(domino.direction){
case DIRECTION_EAST:
domino.x++;
break;
case DIRECTION_WEST:
domino.x--;
break;
case DIRECTION_NORTH:
domino.y++;
break;
case DIRECTION_SOUT... | [
"move() {\n switch (this.direction) {\n case ALL_DIRECTION[0]:\n if (this.chackingMove({\n x: this.coordinates.x - 1,\n y: this.coordinates.y\n }))\n this.coordinates.x += -1;\n break;... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
log a char to the console | logChar(char) {
if (!this.initialized) return;
this.logMap(this.mapChar(char));
} | [
"charPrint (c) {\n if (c === undefined) {\n super.print();\n } else {\n const symbol = c;\n for (let line = 0; line < this.height; line++) {\n console.log(symbol.repeat(this.width));\n }\n }\n }",
"charPrint (c) {\n if (!c) {\n c = 'X';\n }\n let i = this.width;\... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
This method will initialize the express app to accept the authenticated websocket connections. | init(app, server) {
require('express-ws')(app, server);
const utils = require('../components/utils');
app.ws('/api/socket', function (ws, req) {
const jwtToken = utils.getBackendToken(req);
if (!jwtToken) {
ws.close();
} else {
try {
const userToken = jsonwebtoken... | [
"function init(){\n var app = express();\n configureExpress(app);\n\n var User = initPassportUser();\n var Word = require('./Words');\n\n checkForAndCreateRootUser(User);\n checkDefaultWords(Word);\n \n require('./loginRoutes')(app);\n require('./authRoutes')(app);\n\n http.createServer(app).listen(3000... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Override isPageDataChanged, in case isOkToChange page pops up when clicking entity list navigation after checking field auditViewPref. | function isPageDataChanged() {
return false;
} | [
"function isOkToChangePages(id, url) {\r\n if (isChanged) {\r\n if (!confirm(ciDataChangedConfirmation)) {\r\n return false;\r\n }\r\n }\r\n return cisEntityFolderIsOkToChangePages(id, url);\r\n}",
"function isOkToChangePages(id, url) {\r\n if (isPageDataChanged()) {\r\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Turn motor on or off. | setMotorOn(motorOn) {
if (motorOn !== this.motorOn) {
this.motorOn = motorOn;
this.machine.diskMotorOffInterrupt(!motorOn);
this.updateMotorOn();
}
} | [
"setMotorOn () {\n this._parent._send('motorOn', {motorIndex: this._index, power: this._direction * this._power});\n this._isOn = true;\n this._clearTimeout();\n }",
"toggleMotor() {\n this.revoluteJoint.EnableMotor(!this.revoluteJoint.IsMotorEnabled());\n }",
"setMotorOff () {\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Load date and print this | function printDate()
{
var time = getTime();
// Print time
taskline.obj.time_date.innerHTML = time.day + '.' + time.monthNameShort + ' ' + time.year;
} | [
"function LoadDate()\n{\n var dateCurrentDate = new Date();\n var dateMonth = GetMonthString(dateCurrentDate.getMonth());\n var dateDay = dateCurrentDate.getDate();\n var dateString = dateMonth + \" \" + dateDay;\n $greetingDate.text(dateString);\n return;\n}",
"function myDate() \n\t\t{\n\t\t\t... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
[ 4, 5, 6, 7 ] slice() returns a shallow copy of a portion of an array into a new array | function testSlice(arr) {
var newArr = arr.slice(1, 3);
console.log(newArr);
} | [
"function sliceMe(tempArr,start,end){\r\n return tempArr.slice(start,end);\r\n\r\n }",
"function copyWithSlice(array) {\n return array.slice();\n}",
"function slice(arr, start, end){\n //code\n}",
"function applySlice(array, start, end) {\n... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
client script function to enable/disable vendor fields based on export to OpenAir | function setVendorFieldsClient(type, name)
{
var recType = nlapiGetRecordType();
var nlobjContext = nlapiGetContext();
var enableExpenseVBIntegration = nlobjContext.getSetting('SCRIPT', 'custscript_oa_expense_vb_int');
var enablePOIntegration = nlobjContext.getSetting('SCRIPT', 'custscript_oa_po_integration');... | [
"function setVendorFieldsInit()\n{\n\tvar recType = nlapiGetRecordType();\t\n\tvar nlobjContext = nlapiGetContext();\t\n\tvar enableExpenseVBIntegration = nlobjContext.getSetting('SCRIPT', 'custscript_oa_expense_vb_int');\n var enablePOIntegration = nlobjContext.getSetting('SCRIPT', 'custscript_oa_po_integration... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Admininstrative list of media | function mediaList(req,res,template,block,next) {
// Render the item via the template provided above
calipso.theme.renderItem(req,res,template,block,{});
next();
} | [
"function mediaList(req,res,template,block,next) {\n\t// To do \n\tnext(); \n}",
"function ManageMedia() {\n\t}",
"function getContentList() {\n var type = PHOTO_AND_VIDEO_TYPE;\n getMediaList(getPhotoListUICallback, type);\n}",
"async function getMedias() {\n const url = '/api/medias';\n const respo... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
function to accept lunch bill and generate a receipt object | function getReceipt(lunchReceiptList) {
let subTotalNum = 0;
let receiptObj = {
subTotal: "",
taxAmount: "",
totalWithoutTax: "",
tipAmount: "",
totalDue: ""
};
for (let i = 0; i < lunchReceiptList.length; i++) {
subTotalNum = lunchReceiptList[i].price + s... | [
"function printBill(cal,items){\n let message;\n let receiptItem = [];\n items.forEach((el,key) => {\n receiptItem.push({no: key, item: el.name, qty: el.quantity, cost: el.total_price});\n });\n const output = receipt.create([\n { type: 'text', value: [\n Bold()+' DesiChulhaa(Bane... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
hide/show the correct summary | function showSelectedSummary() {
$('.summary-snippet').addClass('hidden');
$('#' + selectedSummary)
.addClass('shown')
.removeClass('hidden');
} | [
"function displaySummary() {\n $('.results').show();\n unanswered = (8-(correctCount + wrongCount));\n $('#correctScore').text(\"Correct Answers:\" + \" \" + correctCount);\n $('#wrongScore').text(\"Wrong Answers:\" + \" \" + wrongCount);\n $('#unanswered').text(\"Unanswered:\" + ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Edit a special offer | function EditSpecialOffer(id)
{
/**
Open the panel EditSpecialOffer
*/
current_id = id;
var name = document.getElementById('special_offer' + current_id + '_name').innerHTML;
var percentage = document.getElementById('special_offer' + current_id + '_percentage').innerHTML;
CreateSpecialOfferPa... | [
"editOffer(name, category, description, location, expiry, id) {\n db.ref('offers/' + this.state.key).update({\n name: name,\n category: category,\n description: description,\n location: location,\n expiry: expiry,\n id: id\n });\n }"... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Opens the edit layer and initializes input states to current redux state | _openEdit() {
const { about } = this.props;
this.setState({layerOn: true, inputName: about.name, inputBio: about.bio,
inputLocation: about.location, inputImage: about.image });
} | [
"editClicked() {\n\t\tthis.state.editOnClick(this.state.buttonState)\n\t\tthis.setNewState()\n\t}",
"function edit() {\n $state.go('^.edit', {'id': vm.lot._id});\n }",
"openEdit(editRecipe) {\n this.setState( { showEdit: true, editRecipe: editRecipe } );\n }",
"function edit() {\n transition(ED... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Registers `is[Type]` and `assert[Type]` generated functions for a given `type`. Pass `skipAliasCheck` to force it to directly compare `node.type` with `type`. | function registerType(type, skipAliasCheck) {
var is = t["is" + type] = function (node, opts) {
return t.is(type, node, opts, skipAliasCheck);
};
t["assert" + type] = function (node, opts) {
opts = opts || {};
if (!is(node, opts)) {
throw new Error("Expected type " + JSON.stringify(type)... | [
"function registerType(type, skipAliasCheck) {\n var is = t[\"is\" + type] = function (node, opts) {\n return t.is(type, node, opts, skipAliasCheck);\n };\n\n t[\"assert\" + type] = function (node, opts) {\n opts = opts || {};\n if (!is(node, opts)) {\n throw new Error(\"Expected type \" + JSON.str... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
returns a function that wraps the supplied func ensuring it is only called once used for callbacks | function getOnceFunction(func){
var executed = false;
return function(){
if(!executed){
func();
executed = true;
}
}
} | [
"function wrapCall(func) {\n if (func !== undefined && func !== null) {\n return func;\n } else {\n return function() {};\n }\n}",
"function _wrap (func, wrapper) {\n return _partial(wrapper, func);\n}",
"function SafeFunction(func){\n\tthis.time = null;\n\treturn function(){\n\t\tif(this.time != null... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Returns the invoke URL for a certain path. | urlForPath(path = '/') {
if (!path.startsWith('/')) {
throw new Error(`Path must begin with "/": ${path}`);
}
return `https://${this.restApi.restApiId}.execute-api.${core_1.Stack.of(this).region}.${core_1.Stack.of(this).urlSuffix}/${this.stageName}${path}`;
} | [
"get invokeUrl() {\n return this.getStringAttribute('invoke_url');\n }",
"async getUrlByInvoke(filepath) {\n let { exclude } = this.options;\n if (exclude && this.stc.resource.match(filepath, exclude)) {\n return Promise.resolve(filepath);\n }\n let data = await this.invokeSelf(filepath... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Triggered in the login modal to close it | function closeLogin() {
vm.modal.hide();
} | [
"function closeLogin() {\n // reset form as we leave\n tidyUp();\n $scope.modal.hide();\n loginFactory.clrErrorMsg();\n \n deregisterBackButtonAction();\n }",
"closeLogin () {\n this.$scope.modal.hide();\n }",
"handleLoginClose(e) {\n\t\te.preventDefault();\n\n\t\tthis.invalidError.classLis... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
update updates the system this does the following things 1. checks for any inputs added with addInput above 2. loops through all entities processing the first action in their queues if the action is a teleport (type spriteX/spriteY/spriteLayer) it's free i.e. the next action is processed too NOTE when using MEngine wit... | update ()
{
let cType = 0;
if (this.useCEngine === true)
{
cType = this.CEngine.cType;
}
const inputSys = this.input;
for (let i = 0, length = this.inputs.length; i < length; ++i)
{
const input = this.inputs[i];
if (input.co... | [
"function applyUpdate(msg) {\n updateDone = false;\n update = msg ;\n if(won ==true){ //if won no need to proceed and apply updates\n\n return;\n }\n\n \n\n if(msg.id != myID) { //not to update oneself\n \n if(msg.exit==true){ //if exit is true ,the... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Translates one of the query initializers into a SearchQuery instance | parseQuery(query) {
let finalQuery;
if (typeof query === "string") {
finalQuery = { Querytext: query };
}
else if (query.toSearchQuery) {
finalQuery = query.toSearchQuery();
}
else {
finalQuery = query;
}
retu... | [
"buildSearchQuery() {\n if (this.get('invalidSearchTerm') || isEmpty(this.get('searchTerm'))) {\n return {};\n }\n const searchTerm = this.get('searchTerm');\n const query = {};\n\n if (this.get('searchType.date')) {\n if (dateHelper.isValidDate(searchTerm, '... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
insertMention() insert the mention and get out | function insertMention() {
var lPad = ' ', rPad = ' ', name = popup.getSelectedName(),
offset = keyCache.getOffset(), mention, prevChar, quote = '';
if (!name) {
if (!popup.spinnerIsVisible()) {
popup.hide();
}
return;
}
// if the user jammed the mention in without whitespace, add it
prevChar... | [
"function insertMention() {\r\n\t\t\tvar mention = prepMention(this.popup);\r\n\r\n\t\t\tif (!mention) {\r\n\t\t\t\tif (!this.popup.spinnerIsVisible()) {\r\n\t\t\t\t\tthis.popup.hide();\r\n\t\t\t\t}\r\n\t\t\t\treturn;\r\n\t\t\t}\r\n\r\n\t\t\tthis.getCaret();\r\n\r\n\t\t\tthis.$textarea.val(this.$textarea.val().slic... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
FUNCTIONS FUNCTION: printMonth(); Questa funzione stampa tutti gioni compresi in un mese. > baseDate: questo argomento deve essere un elemento MOMENT in formato (YYYYMMDD) che rappresenta il primo giono del mes. | function printMonth(baseDate){
$(".month").text(baseDate.format("MMMM YYYY"));
$(".month").attr("data-this-month", baseDate.format("YYYY-MM-DD"))
//Quantita di giorni compresi in un mese.
var daysInMonth = baseDate.daysInMonth();
var source = $("#day-template").html();
var template = Handlebars.compile(source)... | [
"function print_date(date_to_print){\n\tvar months = ['January', 'February', 'March', 'April', 'May', 'June', 'July', 'August', 'September', 'October', 'November', 'December'];\n\tvar days = date_to_print.split('-');\n\tvar d_year = days[0];\n\tvar d_month = days[1];\n\tif (d_month < 10){\n\t\tvar arr_index = d_mon... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
another array needs to be created from the indices that contains only valid choices valid is based on quantizing but should also be calculated from density ... if we remove invalid entries from the valid array, we don't really need to track chosen calculating what is valid should be repeatable and mutable depending on ... | function shuffle(indexArr, outArr, _pitch, _stepLen, _noteLen, _density, _densPol) {
var m = indexArr.length, t, i, valid;
// While there remain elements to shuffle…
while (_stepLen) {
valid=true;
// Pick a remaining element…
i = indexArr[(Math.floor(Math.random() * m))];
//check if there is roo... | [
"computeSecondBeat(first_beat, third_beat, fourth_beat) {\n let newVel = this.chooseRandom(this.#secondVelocity);\n let newOn;\n let newOff;\n let newQueue;\n\n let candidates = [];\n let second_set = [];\n\n if (key.isMajor()) {\n major.forEach((interval, i) => {\n candidates.push(... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Do Something with Data Tree | function doSomethingWithDataTree(root){
var length = root.children.length;
currentSeason = root.children[length-1].name.toLowerCase();
//console.log(currentSeason);
if (currentSeason == "spring") {showSpring();}
if (currentSeason == "fall") {showFall();}
if (currentSeason == "winter") {showWinter();}
} | [
"function setDataToTree() {\n $(treeID).tree({\n data: treeData\n });\n\n}",
"traverse(node){\n if(node){\n this.traverse(node.left)\n console.log(node.data)\n this.traverse(node.right)\n }\n }",
"_forEachTreeNode(data, fn) {\n for (let d of ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Valida a qual o valor nas list boxes | function validaListSeleccionado(id)
{
var listBox = document.getElementById(id);
var return_id;
var optsLength = listBox.options.length;
// encontra o valor seleccionado
for(var i=0;i<optsLength;i++){
if(listBox.options[i].selected) {
return_id = listBox.options[i].value;
}
}
return retu... | [
"function validateSelectMultiple(thisObj) {\n\n\t\tvar fieldValue = thisObj.val();\n\n\t\tif (fieldValue.length > 0) {\n\t\t\t$(thisObj).addClass('is-valid');\n\t\t} else {\n\t\t\t$(thisObj).addClass('is-invalid');\n\t\t}\n\t}",
"function validateSelectMultiple(thisObj) {\r\n var fieldValue = thisObj.val()... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
MOVE THE CAPTIONS // | function addMoveCaption(nextcaption,opt,params,frame,downscale) {
var tl = nextcaption.data('timeline');
var newtl = new TimelineLite();
var animobject = nextcaption;
if (params.typ == "chars") animobject = nextcaption.data('mySplitText').chars;
else
if (params.typ == "words... | [
"function addSceneCaptions() {\n push();\n fill(255);\n textSize(42);\n\n let theSnake;\n let caption;\n\n switch (currentScene) {\n case \"eden1\":\n theSnake = \"(You hear a hiss...) \\\"I imagine you don't get to do much all day,\\nstuck out like that.\\\"\";\n caption = \"(Get to the bottom b... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Apply a tree of deltas to a box. We do this to calculate the effect of all the transforms in a tree upon our box before then calculating how to project it into our desired viewportrelative box This is the final nested loop within updateLayoutDelta for future refactoring | function applyTreeDeltas(box, treeScale, treePath) {
var treeLength = treePath.length;
if (!treeLength)
return;
// Reset the treeScale
treeScale.x = treeScale.y = 1;
var node;
var delta;
for (var i = 0; i < treeLength; i++) {
node = treePath[i];
delta = node.getLayout... | [
"function applyTreeDeltas(box, treeScale, treePath) {\n\t var treeLength = treePath.length;\n\t if (!treeLength)\n\t return;\n\t // Reset the treeScale\n\t treeScale.x = treeScale.y = 1;\n\t var node;\n\t var delta;\n\t for (var i = 0; i < treeLength; i++) {\n\t node = treePath[i]... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Functions below will pack and then unpack a list of names. Each unpacked name is then checked against the names originally passed in. The final number of bytes read is passed back via callback. | function verifyList(test, nameMap, nameList, callback) {
var buf = new Buffer(1024);
var suffix = 0x20;
var bytes = 0;
nameList.forEach(function(name) {
var nbname = new NBName({fqdn: name, suffix: suffix});
var res = nbname.write(buf, bytes, nameMap);
test.equal(res.error, null);
bytes += res... | [
"function readNames(cb, lvl){\t\t\t\t\t\t\t\t\t\t\t\t//lvl is for reading past state blocks, tbd exactly\n\tread('_all', cb, lvl);\n}",
"call(callback, ...names) {\n const {\n stack\n } = this;\n const {\n length\n } = stack;\n let value = getLast(stack);\n\n for (const name of names) ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Calls main() in testmode | function testMain() {
var mode = 'test';
main(mode);
} | [
"function mainTest() {\n var runMode = 'test';\n main(runMode);\n}",
"function doIt() {doMainTest();}",
"function importTest() {\n var runMode = 'importTest';\n main(runMode);\n}",
"function main() {}",
"run_test() { start_tests(); }",
"async function main() {\n const g_tests = async (flag) => {\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
You get an array of numbers, return the sum of all of the positives ones. Example [1,4,7,12] => 1 + 7 + 12 = 20 Note: if there is nothing to sum, the sum is default to 0. Lets star with Foor Loops ! // KATA DAY 2 You get an array of numbers, return the sum of all of the positives ones. Example [1,4,7,12] => 1 + 7 + 12 ... | function positiveSum(arr) {
let sum = 0;
for (let i = 0; i < arr.length; i++) {
if (arr[i] > 0) sum = sum + arr[i]; //this is the operation other way is suma1 += numbers[i]
}
return sum; // and you return the result
} | [
"function positiveSum(array) {\n // Initiate a total sum variable\n // Loop through the array of numbers\n // If the number is positive, add to the running sum\n var total = 0;\n for (var i = 0; i < array.length; i++) {\n if (array[i] > 0) {\n total += array[i];\n }\n }\n return total;\n}",
"fun... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
NOTE: MedicationPrescription is essentially a copy of the code for the proper MedicationPrescription record. This can be refactored to eliminate the redundancy. | function createMedicationPrescription(item, req) {
var mp = new fhirResource.MedicationPrescription_DSTU2(helpers.generateUUID(), item.vaStatus);
mp.contained = [];
// Identifier
if (nullchecker.isNotNullish(item.uid)) {
mp.identifier = [new fhirResource.Identifier(item.uid, constants.medPrescr... | [
"function PrescToFhirPrescMapper(prescription, medication, completePatient) {\n let { id, name, status, form, amount, ingredients, lotNumber, expiration } = medication;\n let R = new getMedicationRequest();\n if (prescription) {\n R.id = prescription.id.toString();\n R.identifier = [\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Once the template is successfully fetched, use its contents to proceed. Context argument is first, since it is bound for partial application reasons. | function done(context, template) {
// Store the rendered template someplace so it can be re-assignable.
var rendered;
// Trigger this once the render method has completed.
manager.callback = function(rendered) {
// Clean up asynchronous manager properties.
delete manager.isAsync... | [
"function templateDone(context, contents) {\n // Ensure the cache is up-to-date\n LayoutManager.cache(url, contents);\n\n // Render the View into the el property.\n view.el.innerHTML = options.render.call(options, contents, context);\n\n // Signal that the fetching is done, wrap i... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
fullName is a required attribute, generate it from the key if necessary | function generateFullName(part, path) {
const partKey = path[path.length - 1];
if (appLib.appModel.metaschema.fullName && !part.fullName) {
// some tests and potentially apps do not have fullName in metaschema
part.fullName = camelCase2CamelText(partKey);
}
} | [
"fullKey(key) {\n return `${this.name}:${key}`;\n }",
"function GenerateFullName(leg){\n passengerName = `${leg.passengerDetails.first} ${leg.passengerDetails.last}`\nreturn passengerName \n}",
"contactFullName(contact) {\n return `${contact.get('firstName') || ''} ${contact.get('middleName') ? co... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Determine whether the given properties match those of a `OriginGroupProperty` | function CfnDistribution_OriginGroupPropertyValidator(properties) {
if (!cdk.canInspect(properties)) {
return cdk.VALIDATION_SUCCESS;
}
const errors = new cdk.ValidationResults();
errors.collect(cdk.propertyValidator('failoverCriteria', cdk.requiredValidator)(properties.failoverCriteria));
e... | [
"function CfnDistribution_OriginGroupMemberPropertyValidator(properties) {\n if (!cdk.canInspect(properties)) {\n return cdk.VALIDATION_SUCCESS;\n }\n const errors = new cdk.ValidationResults();\n errors.collect(cdk.propertyValidator('originId', cdk.requiredValidator)(properties.originId));\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
getPriceLevelAndCurrencyRateForEachDestination Function get price level and currency rate for each destination | function getPriceLevelAndCurrencyRateForEachDestination()
{
var currencyRateFound = false;
try
{
if(shippingDestinationRecords != null)
{
//looping through shipping destinations
for(var index = 0; index < shippingDestinationRecords.length; index++)
{
shippingDestinationIntID = shippingDe... | [
"getCurrencyPairRates() {\n const { currencyPairs, getRates } = this.props;\n const currencyPairIds = Object.keys(currencyPairs);\n getRates({ endpoint, currencyPairIds });\n }",
"function getExchangeRate() {\n const sourceCurrency = document.querySelector('.currency_convert_from').value;\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Fetch a list of messages in this room. This will get all the old messages available, and should giv eyou enough (if available) to fill the screen with messages. Any duplicate messages currently loaded into the store object will not be duplicated, and the room messages will be sorted according to timestamp. This will ma... | fetchRoomMessages(context, roomID) {
let tasks = [];
tasks.push(getRoomMessages(roomID))
if (!context.state.rooms.hasOwnProperty(roomID)) {
tasks.push(context.dispatch('fetchRooms'));
}
Promise.all(tasks).then(data => {
let messages = data[0];
context.commit('addRoo... | [
"function fetchMessages(room_id) {\n\t//Construct REST url\n\tvar currentRoomURI = roomsURI + \"/\" + room_id + \"/messages\";\n\tvar getting = $.get(currentRoomURI, {\n\t\tmessageId : currentRoomLastMessageId\n\t});\n\t\n\t//send get for latest messages in room\n\tgetting.done(function(data) {\n\t\tvar messages = ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Remove truck markers from map | function removeTruckMarkers()
{
for (var i = 0; i < truckMarkers.length; i++) {
truckMarkers[i].setMap(null);
}
} | [
"removeTrackMarkers() {}",
"function removeMarkers () { \n setAllMap(null);\n markers = [];\n }",
"function removeMarkerBubblesFromMap() {\n placeMarkerBubblesOnMap(null);\n}",
"function removeMarkers() {\n for (var k1 = 0, n = markers.length; k1 < n; k1++) {\n markers[k1].setMa... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Generic event handler for a single filter checkbox for downsort option | function DownSortFilterChange()
{
var key = $(this).attr('data-column');
Filters[key].EmptyToBottom= $(this).prop('checked');
console.log(key);
var filter = Filters[key];
// update the filter
filter.EmptyToBottom = $(this).prop('checked');
ToggleChangeHandlersCheck(false);
if (AnyChecked() && !AllC... | [
"function DownSortChange()\n{\n\tToggleChangeHandlersCheck(false);\n\n\tif ($(this).prop('indeterminate')|| $(this).prop('checked'))\n\t{\n\t\t// either some of the filters are checked or all of them are now supposed to be.\n\t\t$(this).prop('indeterminate',false);\n\t\t$(this).prop('checked',true);\n\n\t\tfor (i i... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Gets all the classes currently in the Database | function getAllClasses() {
return readObject('classes');
} | [
"async function getClasses() {\n return db(\"classes\");\n}",
"function getClasses() {\n return db('classes').orderBy('classes.id');\n}",
"function showClasses() {\n\t\tdb.allDocs( { include_docs: true, ascending: true},\n\t\t\t\t\t\tfunction(err, doc) {\n\t\t\t\t\t\t\tshowTableOfClasses(doc.rows);\n\t\t\t\t\... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
main function, reading from date_ranges file, and passing each range to the getRepos function | function main(url){
var instream = fs.createReadStream('date_ranges_100stars.txt');
var outstream = new stream;
var rl = readline.createInterface(instream, outstream);
console.log("start")
rl.on('line', function(line) {
ranges.push(line)
})
rl.on('close', async function() {
... | [
"ranges () {\n const now = new Date()\n const tenYears = new Date(now - (1000 * 60 * 60 * 24 * 365 * 10))\n let items = []\n if (this.props.List) {\n items = this.props.List() || []\n } else {\n console.warn('No List() function was provided for Summary Progress')\n }\n return items.ma... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Clone a random genome in this species | cloneRandomGenome() {
return this.getRandomGenome().clone();
} | [
"copy() {\n\t\tvar newGenome = new Genome();\n\t\tthis.nodeGenes.forEach(function (nodeGene) {\n\t\t\tnewGenome.addNodeGene(nodeGene.copy());\n\t\t});\n\t\tthis.connectionGenes.forEach(function (connGene) {\n\t\t\tnewGenome.addConnectionGene(connGene.copy());\n\t\t});\n\t\treturn newGenome;\n\t}",
"function clone... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |