query stringlengths 9 34k | document stringlengths 8 5.39M | negatives listlengths 19 20 | metadata dict |
|---|---|---|---|
Sorts the selected values in the selected based on their order in the panel. | _sortValues() {
if (this.multiple) {
const options = this.options.toArray();
this._selectionModel.sort((a, b) => {
return this.sortComparator ? this.sortComparator(a, b, options) :
options.indexOf(a) - options.indexOf(b);
});
th... | [
"function sortPanes()\n {\n if(_SortGeneration !== _Generation) {\n _OptionPanes.sort(function(lhs, rhs) { return lhs.getDisplayOrder() - rhs.getDisplayOrder(); });\n _SortGeneration = _Generation;\n }\n }",
"function selectionSort()\n{\n\tfor (var... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Returns the amount of slack for the given edge. The slack is defined as the difference between the length of the edge and its minimum length. | function slack(g, e) {
return g.node(e.w).rank - g.node(e.v).rank - g.edge(e).minlen;
} | [
"findMaxEdgeValue(){\n let heaviestEdgeWeight = 0;\n for (let edge of this.props.edges) {\n if (edge.weight > heaviestEdgeWeight) {\n heaviestEdgeWeight = edge.weight;\n }\n }\n return heaviestEdgeWeight;\n }",
"getTileSize(tileEdge) {\n return {\n width: 2.0 * tileEdge,\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
This function takes the array of styles and separates them into styles that are handled by Aphrodite and inline styles. | function separateStyles(stylesArray) {
var aphroditeStyles = [];
// Since determining if an Object is empty requires collecting all of its
// keys, and we want the best performance in this code because we are in the
// render path, we are going to do a little bookkeeping ourselves.
var hasInlineStyles = fals... | [
"function setCSS(styles, elements) {\n if (elements.length > 1) {\n for (var i = 0; i < elements.length; i++) {\n Object.assign(elements[i].style, styles);\n }\n } else {\n Object.assign(elements.style, styles);\n }\n} // Set CSS before elements appear",
"function removeStylesToElement(tag, style... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Retrieves Algolia facet hits from multiple indices. | function getAlgoliaFacets(requestParams) {
var requester = (0, _createAlgoliaRequester.createAlgoliaRequester)({
transformResponse: function transformResponse(response) {
return response.facetHits;
}
});
var queries = requestParams.queries.map(function (query) {
return _objectSpread(_objectSprea... | [
"facetItems(aItems) {\n if (this.attrDef.objectNounDef.isPrimitive) {\n return this.facetPrimitiveItems(aItems);\n }\n return this.facetComplexItems(aItems);\n }",
"function getAllSelectedData() {\n const out_vertex_arr = [];\n const out_edge_indexes = [];\n const out_face_inde... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Given some expression, such as a binding or interpolation expression, and a context expression to look values up on, visit each facet of the given expression resolving values from the context expression such that a list of arguments can be derived from the found values that can be used as arguments to an external updat... | function convertUpdateArguments(localResolver, contextVariableExpression, expressionWithArgumentsToExtract, bindingId) {
var visitor = new _AstToIrVisitor(localResolver, contextVariableExpression, bindingId, undefined);
var outputExpr = expressionWithArgumentsToExtract.visit(visitor, _Mode.Expression);
if (... | [
"visitExprlist(ctx) {\r\n console.log(\"visitExprlist\");\r\n let exprlist = [];\r\n for (var i = 0; i < ctx.star_expr().length; i++) {\r\n exprlist.push(this.visit(ctx.star_expr(i)));\r\n }\r\n return exprlist;\r\n }",
"function bindNames(args, values, env) {\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Remove a span from an array, returning undefined if no spans are left (we don't store arrays for lines without spans). | function removeMarkedSpan(spans, span) {
for (var r, i = 0; i < spans.length; ++i)
if (spans[i] != span) (r || (r = [])).push(spans[i]);
return r;
} | [
"function getOldSpans(doc, change) {\n var found = change[\"spans_\" + doc.id];\n if (!found) { return null }\n var nw = [];\n for (var i = 0; i < change.text.length; ++i)\n { nw.push(removeClearedSpans(found[i])); }\n return nw\n }",
"function arrayRemove(arr, val... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
======================================\ || ADD FILE DEPENDENCIES TO PAGE HEAD || \====================================== | function appendToHead(callback) {
var headLayout = '';
var scripts = ['jquery.printarea.min.js','jquery.fancybox.min.js','flash-detection.min.js','swfobject.min.js','jquery.mCustomScrollbar.min.js','jquery.touchSwipe.min.js','jquery.jcarousel.min.js','jquery.tooltip.min.js','tour.min.js'];
for (var i = script... | [
"function GistEditDependencies() {\n var gist = gisty.getCurrentGist();\n if (gist === null) {\n Logger.error(\"Please select a Script to edit Dependencies.\");\n return;\n }\n // extract the dependencies from the bootstrap code and format them nicely\n var code = gist.files[\"internalS... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
general handler for all unknown passives | function unknown_passive_handler(effect, other_data) {
let msg = "";
if (effect['unknown passive params']) msg += `Unknown passive effects {${effect['unknown passive params']}}`;
if (msg.length === 0) throw no_buff_data_msg;
if (needTarget(effect, other_data)) {
msg += get_ta... | [
"function new_pass() {\n // we have to nuke if it has already happened...\n if (passResults.length) {\n MimeTypeNoun._mimeTypes = {};\n MimeTypeNoun._mimeTypesByID = {};\n MimeTypeNoun._mimeTypeHighID = {};\n MimeTypeNoun._highID = 0;\n MimeTypeNoun._init();\n }\n curPassResults = [];\n passResu... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
This is now to add new scores to the database. create a async function which sends a fetch request and that will be to /scoreboard. send extra data within the fetch request to tell it we want to post the data send the input values in the req.body await the response.json create another function which gets the data from ... | async function addNewScore(e) {
e.preventDefault();
const response = await fetch("/scoreboard", {
method: "POST",
headers: { "content-type": "application/json" },
body: JSON.stringify(gatherInputData()),
});
const data = await response.json();
console.log(data);
getAllScores();
clearInputField... | [
"function xhr_save_score() {\n var saveable_scores = [];\n var game_id = scorecard.data(\"game_id\");\n\n scorecard.find(\"tbody td\").each(function(i, el) {\n var el = $(el);\n\n // Grab values for this cell\n var player_id = el.data(\"player_id\");\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Creates koalas at random places | function createBaseKoala() {
koalas[koalas.length] = {
x: Math.random() * (gameCanvas.width - koalaImg.width),
y: -koalaImg.height,
dy: Math.random() * 3 + 1, //randomizing speed
version: Math.random() //randomizing the texture
};
} | [
"function generateJoke() {\n\t\t\t\trand = Math.floor(Math.random() * qty) + 1;\n\t\t\t\t$slip.find('.q').html( data[rand].q);\n\t\t\t\t$slip.find('.a').html( data[rand].a);\n\t\t\t}",
"function create_random_map() {\n var easy = planet_types.none;\n for(var j = 0; j < map.rows - map.downgrade; j++)... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
add table to body of iframe | function addTable(r, c) {
var b = idoc.body || idoc.find('body')[0];
$(b).html(table.html(r,c))
} | [
"function addtable(target, tableData) {\n\n // Add table header\n $(target).append($('<thead>'));\n $(target + ' thead').append($('<tr>'));\n for (i = 0, l = tableData.header.length; i < l; i++) {\n $('thead tr').append($('<th>', { text: tableData.header[i] }));\n }\n\n // Add table content... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Set parent message if we use Field in Field. | newMessage(value) {
if (this.parent && this.parent.hasInnerField) {
this.parent.newMessage = value;
}
} | [
"get parent() {\n return ContentType(this, \"parent\");\n }",
"get parent() {\n return tag.configure(ContentType(this, \"parent\"), \"ct.parent\");\n }",
"function writeMessagesForChildGroups(parentId) {\n jQuery(\"[data-parent='\" + parentId + \"']\").each(function () {\n\n var cu... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Finalizes and returns the multisig address in trytes. | finalize(digests) {
if (!objectHelper_1.ObjectHelper.isEmpty(digests)) {
this.absorb(digests);
}
const addressTrits = new Int8Array(this._hashLength);
this._kerl.squeeze(addressTrits, 0, addressTrits.length);
return address_1.Address.fromTrytes(trits_1.Trits.fro... | [
"async function genP2SH() { \n\n\tvar privKeys = [bitcoin.ECKey.makeRandom(), bitcoin.ECKey.makeRandom(), bitcoin.ECKey.makeRandom()]\n\tvar pubKeys = privKeys.map(function(x) { return x.pub })\n\tvar redeemScript = bitcoin.scripts.multisigOutput(2, pubKeys) // 2 of 3\n\tvar scriptPubKey = bitcoin.scripts.scriptHas... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Get default action by key and append the callback | _getCommonAction(key, callback, visibleWhen) {
let action = COMMON_ACTIONS[key];
action = angular.extend({callback: callback}, action);
if (visibleWhen) {
action = angular.extend({visibleWhen: visibleWhen}, action);
}
return action;
} | [
"function actionCreator(action){\n return action\n}",
"function getAction() {\r\n\r\n return( action );\r\n\r\n }",
"function initOptAction(optAction, item = undefined, optSet = undefined) {\n let fun;\n\n if (optAction !== undefined) {\n const __CONFIG = getOptConfig(get... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Output the SensorTag Configuration file | function viewSensorTagConfigFile() {
readSensorTagConfigFile(showSensorTagConfigFile);
} | [
"function showSensorTagConfigFile(fileData) {\n\t\n\tvar sensorData = fileData.sensortagMapping;\n\tvar fileOutput = document.getElementById('sensortagConfigFileData');\n\tfileOutput.innerHTML = \"<h2>Current SensorTag Configuration Information:</h2>\"; \n\tfileOutput.innerHTML += \"<b>Institution: </b>\" + sensorD... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
DISPLAYS FOLIO ACQ REPORTS SIDEBAR | function acqReports() {
var html = HtmlService.createHtmlOutputFromFile('acqReports')
.setTitle('FOLIO Acquisition Reports');
SpreadsheetApp.getUi() // Or DocumentApp or SlidesApp or FormApp.
.showSidebar(html);
} | [
"function circReports() {\n var html = HtmlService.createHtmlOutputFromFile('circReports')\n .setTitle('FOLIO Circulation Reports');\n SpreadsheetApp.getUi() // Or DocumentApp or SlidesApp or FormApp.\n .showSidebar(html); \n}",
"function toggleLeftSideBarDisplay() {\n\tif(left_sidebar_display == L... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
MOVE THUMB SLIDER TO POSITION // | function moveThumbSliderToPosition($this,pos,speed) {
//$this.stop();
//$this.find('.tp-thumbcontainer').animate({'left':pos+'px'},{duration:speed,queue:false});
TweenLite.to($this.find('.tp-thumbcontainer'),0.2,{left:pos,ease:Power3.easeOut,overwrite:"auto"});
} | [
"function positionThumbs(){\n\t\t\n\t\tif(g_isVertical == false)\n\t\t\tpositionThumbs_horizontal();\n\t\telse\n\t\t\tpositionThumbs_vertical();\t\n\t\t\t\t \t\t\n\t}",
"function moveSlider(dotIndex) {\n if (dotIndex === 3) {\n $productThumbnail.get(0).src = `img/pg-2.jpg`;\n $productThumbnail.get(1).src =... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
set the tabs scrollers to show or not, dependent on the tabs count and width | function setScrollers(container) {
var header = $('>div.tabs-header', container);
var tabsWidth = 0;
$('ul.tabs li', header).each(function(){
tabsWidth += $(this).outerWidth(true);
});
if (tabsWidth > header.width()) {
$('.tabs-scroller-left', header).css('display', 'block');
$('.tabs-scr... | [
"function setScrollers(container) {\n\t\tvar header = $('>div.tabs-header', container);\n\n\t\tvar tabsWidth = 0;\n\t\t$('ul.tabs li', header).each(function () {\n\t\t\ttabsWidth += $(this).outerWidth(true);\n\t\t});\n\t\tif (tabsWidth > header.width()) {\n\t\t\t$('.tabs-scroller-left', header).css('display', 'bloc... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Gets the method name. | getMethodName()
{
return this._methodName
} | [
"getGetterName () {\n\t\tconst definition = this.definition;\n\t\tlet getterName;\n\n\t\tgetterName = definition.getter;\n\n\t\tif (!getterName) {\n\t\t\tconst name = definition.name;\n\t\t\tconst Name = (name.substr(0, 1).toUpperCase() + name.substr(1));\n\n\t\t\tgetterName = ('get' + Name);\n\t\t}\n\n\t\treturn g... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
given a single expr, convert to Pyret and wrap it inside a stmt | function makeStmtFromExpr(expr){
return {name:"stmt"
, kids: [expr.toPyret()]
, pos: expr.location};
} | [
"visitExpr_stmt(ctx) {\r\n console.log(\"visitExpr_stmt\");\r\n if (ctx.augassign() !== null) {\r\n return {\r\n type: \"AugAssign\",\r\n left: this.visit(ctx.testlist_star_expr(0)),\r\n right: this.visit(ctx.getChild(2)),\r\n };\r\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Load function name suggestion code (for search box) | function loadSuggestCode()
{
searchEnabled = true;
// Force default turnoff for buggy Mac browsers
if (navigator.userAgent.toLowerCase().indexOf('mac') > 0) {
searchEnabled = false;
}
myphpnet = getCookie('MYPHPNET');
if (typeof(myphpnet) == "string") {
myphpnet_parts = myphpnet.s... | [
"function TagSuggest() {}",
"function changeSuggest() {\r\n var suggest = \"\";\r\n if(listIndex == -1) {\r\n suggest = curPattern;\r\n } else {\r\n var acList = document.getElementById(\"ac-list\");\r\n if(acList && acList.childNodes.length > listIndex) suggest = acList.childNodes[listInd... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
! Create tacktick proprietary messages to display ! custom values. ! version : .1 ! homegrownmarine.com CURRENTLY DISABLED :: untested, provided as example | function formatTacktickMessage(data) {
var key = data.subtype === 'heading'?'FFP':'FFD';
key += data.index;
var parts = ["PTAK",key].concat(data.values);
return parts.join(',');
} | [
"function massage() {\n console.log(\"****************************************************************\")\n console.log(\"Sorry honey, that service isn't digital\")\n console.log(\"But I'd recommend going to a really nice hotel spa & resort\")\n console.log(\"and request their relaxing massage package\")\n con... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
GET hero by id. Will 404 if id not found | getHero(id) {
const url = `${this.heroesUrl}/${id}`;
return this.http.get(url).pipe(Object(rxjs_operators__WEBPACK_IMPORTED_MODULE_3__["tap"])(_ => this.log(`fetched hero id=${id}`)), Object(rxjs_operators__WEBPACK_IMPORTED_MODULE_3__["catchError"])(this.handleError(`getHero id=${id}`)));
} | [
"static getHero(id) {\n return new Promise((resolve, reject) => {\n const hero = heroes.find(({ id: id_hero }) => id_hero === id);\n setTimeout(() => {\n if (hero) {\n this.log(`fetched hero id=${id}`);\n resolve(hero);\n } else {\n this.handleError(reject, `get... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Pass it an option dictionary with any of the bootstrap or base/js/dialog modal options, plus the following optional properties: description: html for the form group preceding the editor group, useful as a description | function KSE_modal (modal_options) {
var editor = editor_build();
editor.data({'kse_sequence': [], 'kse_undefined_key': false});
editor.data('kse_input', modal_options['input']);
editor_update_input_group(editor);
var modal = modal_build(editor, modal_options);
editor.on... | [
"function optionsModal () {\n if (document.getElementById('options')) {\n document.getElementById('options').outerHTML = ''\n } else {\n document.getElementById('modals').appendChild(html`\n <div class=\"modal is-active\" id=\"options\">\n <div class=\"modal-background\" onclick=\"${optionsModal... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
remove an address from the map | function removeAddress(){
if(activeCounter >0){
activeCounter--;
if(markers[counter] != null){
markers[counter].setMap(null);
markers[counter] = null;
if(activeCounter ==0){
//if no active markers anymore, reinitialize the map
initialize();
}else{
//otherwise, reset the ... | [
"function eraseMap() {\n document.body.removeChild(map);\n }",
"remove(key) {\n var item = this.map[key];\n if (!item) return;\n this._removeItem(item);\n }",
"function clearAddress() {\n address = [];\n}",
"function removePostcode(postcode){\n\tvar element = document.getElementById(postcode);\... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
migrateDelegationV3toV6 operations [PRODUCTION] [See on api.ovh.com]( | CreateDelegationOfDomainWithSameNicThanV3(domain) {
let url = `/email/domain/${domain}/migrateDelegationV3toV6`;
return this.client.request('POST', url);
} | [
"migrateCreditCards() {}",
"enterDelegationSpecifiers(ctx) {\n\t}",
"function runMigration2(tx) {\n\n tx.executeSql(DOC_STORE_WINNINGSEQ_INDEX_SQL); // index used for the join in the allDocs query\n\n tx.executeSql('ALTER TABLE ' + BY_SEQ_STORE + ' ADD COLUMN deleted TINYINT(1) DEFAULT 0', [], function ()... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
shows what items are in the backpack | function backpackDisplay(){
for (var i in inventory){
var currentElement = inventory[i];
updateText(i+" : " + currentElement);
}
} | [
"function showItems() {\n\t\tvar itemlist = [];\n\t\n\t\tfor (var i = 0; i < room.items.length; i++) {\n\t\t\tif (room.items[i].specialdesc) {\n\t\t\t\toutput.before(room.items[i].specialdesc + \"<br />\");\n\t\t\t}\n\t\t\telse {\n\t\t\t\titemlist.push(room.items[i].desc);\n\t\t\t}\n\t\t}\n\t\n\t\tif (itemlist.leng... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
xhr to get add tab | function get_add_tab() {
axios.get(`/inventory/tab/add`)
.then(response => {
document.getElementById('grid_area').innerHTML = response.data;
init_add_tab();
document.getElementById('spinner').style.display = 'none';
})
.catch(error => {
consol... | [
"function doOpenTool_newTab(url)\n{\n var br = getBrowser();\n br.selectedTab = br.addTab(url);\n}",
"addTab() {\n this._insertItem(FdEditformTab.create({\n caption: `${this.get('i18n').t('forms.fd-editform-constructor.new-tab-caption').toString()} #${this.incrementProperty('_newTabIndex')}`,\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Returns FIO Addresses and FIO Domains owned by this public key. | getFioNames(fioPublicKey) {
const getNames = new queries.GetNames(fioPublicKey);
return getNames.execute(this.publicKey);
} | [
"getFioAddresses(fioPublicKey, limit, offset) {\n const getNames = new queries.GetAddresses(fioPublicKey, limit, offset);\n return getNames.execute(this.publicKey);\n }",
"getFioDomains(fioPublicKey, limit, offset) {\n const getNames = new queries.GetDomains(fioPublicKey, limit, offset);\n... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
load the jslint options and globals | function loadOptionsAndGlobals() {
"use strict";
var parentFolder,
optionsText,
globalsText,
textStream,
skipFilesText;
//get the parent folder path
parentFolder = new File(module.filename).parent.path;
//yank in the options
textStream = new TextStream(parentFolder + "jslint_options.json");
options... | [
"function scriptsLint() {\n\treturn gulp\n\t .src(js_in)\n\t .pipe(plumber())\n\t .pipe(eslint())\n\t .pipe(eslint.format())\n\t .pipe(eslint.failAfterError());\n}",
"function jsu_loaded(){\n // [Optional] Init jslog with JSLOG_LEV \n // jslog_init(JSLOG_LEV);\n\tinitSampleCmn(); // manage optional PAR sho... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
polyvecReduce applies Barrett reduction to each coefficient of each element of a vector of polynomials. | function polyvecReduce(r, paramsK) {
for (var i = 0; i < paramsK; i++) {
r[i] = polyReduce(r[i]);
}
return r;
} | [
"function polyEval(evalPoint, constTerm, ...coeffs) {\n return add(constTerm, ...coeffs.map((c, j) => c.mul(scalar(evalPoint).toThe(scalar(j+1)))))\n}",
"function polyCSubQ(r) {\r\n for (var i = 0; i < paramsN; i++) {\r\n r[i] = byteopsCSubQ(r[i]);\r\n }\r\n return r;\r\n}",
"function polyAdd(a... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
what text appears in the dialog, in order of importance (leastmost) ready enemy almost dead refreshed ultimate ready tired almost dead | dialogContent() {
// if tutorial is no longer active, give dialog based on most important thing player needs to know
if (tutorial === false) {
// if chars are ready to act (nothing special happening)
let allCharsNames = "";
for (var i = 0; i < playersList.length; i++) {
if (a... | [
"function showImpactAssessmentWarningDialogue() {\n showDialog({\n title: 'WARNING: Inconsistent data',\n text: 'Elements on this page need correcting: \\nRows of risk weights should NOT EXCEED 100 for each area\\nProblem groups highlighted in red'.split('\\n').join('<br>'),\n negative: {\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Abfrage der VolcanoDaten vom lokalen volcanoArray und Darstellung auf der Karte inkl. Cluster | function getVolcanos(){
volcanoMarkerCluster = L.markerClusterGroup({
iconCreateFunction: function(cluster) {
var zahl = cluster.getChildCount()
var stringzahl = zahl.toString();
var ziffern = stringzahl.length;
if (ziffern == 1){
var html = "<div class='cluster_text' style='margin-left: 21px;'>"+cl... | [
"getClusterFeatures(data) {\n let features = [];\n for (const song of data) {\n let songFeatures = [];\n for (const featureName of this.clusterFeatures) {\n songFeatures.push(song[featureName]);\n }\n features.push(songFeatures);\n }\n return features;\n }",
"function debug... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
clicking the unlike button triggers the unlike function that unlikes a post based on the specific id | onUnlikeClick(id){
this.props.unlike(id)
} | [
"unlike() {\n return spPost(Comment(this, \"Unlike\"));\n }",
"function deleteFavori(id, type, element) {\r\r\n jQuery(element).prev().hide();\r\r\n jQuery(element).hide();\r\r\n jQuery.post(\r\r\n swapchic_ajax.ajax_url,\r\r\n {\r\r\n 'action': 'ajaxLike',\r\r\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Verifies product details, name, description and price | verifyProductDetails(productsDetails) {
for (let i = 0; i < productsDetails.length; i++) {
expectChai(productsDetails[i][0]).to.equal(this.productNames[i].getText());
expectChai(productsDetails[i][1]).to.equal(this.productDescriptions[i].getText());
expectChai(productsDetails... | [
"function verifyExtraFieldsFromProduct() {\n if ($scope.device.product.extraFields) {\n\n }\n }",
"verifyItemTotalPrice(productsDetails) {\n let itemTotalPrice = 0.0;\n for (let i = 0; i < productsDetails.length; i++) {\n itemTotalPrice... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Public: Define a test case. label Label for this test case. This is combined with the label from `describe` when Cavy outputs to the console. f The test case. testTag (Optional) A string tag used to determine whether the individual test should run. 'Inherits' a tag from its surrounding describe block (if present) or de... | it(label, f, testTag = null) {
const tag = this.tag || testTag;
this.testCases.push({ describeLabel: this.describeLabel, label, f, tag });
} | [
"describe() {\n return `${super.describe()} : ${this.title}`;\n }",
"function TLabel(){}",
"function runExample(eg) {\n eg.result = (eg.expected === eg.actual);\n eg.message = \"Expected \" + eg.expected + \", got \" + eg.actual;\n}",
"function addFunctionToPage(f, label) {\n let $script = docume... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Converts a point from latitude/longitude WGS84 coordinates (in degrees) into pixel XY coordinates at a specified level of detail. Latitude of the point, in degrees. Longitude of the point, in degrees. Level of detail, from 1 (lowest detail) to 23 (highest detail). Output parameter receiving the X coordinate in pixels. ... | function LatLongToPixelXY(latitude, longitude, levelOfDetail)
{
latitude = Clip(latitude, MinLatitude, MaxLatitude);
longitude = Clip(longitude, MinLongitude, MaxLongitude);
var x = (longitude + 180) / 360;
var sinLatitude = Math.sin(latitude * Math.PI / 180);
var y = 0.5 - Math.log((1 + sinLatitude) / (1 ... | [
"function PixelXYToLatLong( pixelX, pixelY, levelOfDetail)\n\t{\n\t\tvar mapSize = MapSize(levelOfDetail);\n\t\tvar x = (Clip(pixelX, 0, mapSize - 1) / mapSize) - 0.5;\n\t\tvar y = 0.5 - (Clip(pixelY, 0, mapSize - 1) / mapSize);\n\n\t\tvar latitude = 90 - 360 * Math.atan(Math.exp(-y * 2 * Math.PI)) / Math.PI;\n\t\t... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
var letra="F"; PRUEBA alert(Morse(letra)); | function Morse(letra)
{
var codificacion;
/* SOLUCION BRUTA
switch(letra)
{
case "A":
codificacion="·-";
break;
case "B":
codificacion="-···";
.....
}*/
//USANDO ARRAY A B C D E F
var tabla=["·-","-···","-·-·","-··","·","··-·"];
var ... | [
"function getThueMorse(i) {\n const binStr = (i).toString(2);\n const re = /[1]/g;\n const oneCount = ((binStr || '').match(re) || []).length;\n return oneCount % 2;\n}",
"function halo(){\n return \"Halo Sanbers!\";\n}",
"function betHorses(){ \r\n if(bet == 1) bet = 'horse1'; \r\n if(bet == 2) bet =... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
This method set the current severity based on the current NODE_ENV: show all the log levels if the server was run in development mode; otherwise, if it was run in production, show only warn and error messages. | level() {
const env = process.env.NODE_ENV || 'development';
const isDevelopment = env === 'development';
return isDevelopment ? 'debug' : 'warn';
} | [
"setDefaultLogger() {\n const defaultLevel = Meteor.isProduction ? 'error' : 'trace';\n const defaultLogger = loglevel.createLogger('', defaultLevel);\n\n this.setLogger(defaultLogger);\n }",
"setLogLevel() {\n this.chefWorkers.forEach(cw => {\n cw.worker.postMessage({\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
PROGRAM Takes am Elm Native UI program implementation and turns into a React component that will begin rendering the virtual tree as soon as the Elm program starts running | function makeComponent(impl, onAppReady, flags) {
return React.createClass({
getInitialState: function getInitialState() {
return {};
},
onAppReady: onAppReady,
componentDidMount: function componentDidMount() {
this.eventNode = { tagger: function() {}, parent: undefined };
... | [
"function App() {\n return (\n <div className=\"app-container\">\n {/* \n This is the main UI stateful component for our app. \n It renders the Display and Keypad components and houses all app functions as well as the app's state. \n */}\n <Calculator />\n </div>\n );\n}",
... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
TODO: this method should return the channels per token no the token by address, or if the intention was to get TODO: the token by address then we should change the method name | getChannelsForToken (tokenAddress) {
return new Promise((resolve, reject) => {
this.getTokens()
.then(response => {
return response.json();
})
.then(dashBoardInfo => {
dashBoardInfo.tokens.map((token, index) => {
if (token.address === tokenAddress) {
... | [
"getChannelByName(name){\n for (var i = 0; i < this.channelList.length; i++) {\n if(this.channelList[i].name == name){\n return this.channelList[i];\n }\n }\n }",
"function get_channel_key(){\n return this.channel;\n }",
"function getMostRecentNick(scope, token) {\n if (!scope... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Update the AxisDelta with a transform that projects source into target. The transform `origin` is optional. If not provided, it'll be automatically calculated based on the relative positions of the two bounding boxes. | function updateAxisDelta(delta, source, target, origin) {
if (origin === void 0) { origin = 0.5; }
delta.origin = origin;
delta.originPoint = (0,popmotion__WEBPACK_IMPORTED_MODULE_3__.mix)(source.min, source.max, delta.origin);
delta.scale = calcLength(target) / calcLength(source);
if (isNear(delta.... | [
"set originY(value) {\n this._originY = value;\n this.setViewBox(-this._originX, -this._originY, this._width, this._height);\n }",
"function setAxisTranslation() {\n var axisProto = this.constructor.prototype;\n // Call uber method\n axisProto.setAxisTranslation.call(this);\n... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Hides the "Netflix originals" section | function hideOriginals() {
var $originals = getContainers().$lolomo.find('.originals-panels-row');
$originals.hide();
} | [
"function hideViz() {\n viz.hide();\n}",
"function hidePlayer() {\r\n setBlockVis(\"annotations\", \"none\");\r\n setBlockVis(\"btnAnnotate\", \"none\");\r\n if (hideSegmentControls == true) { setBlockVis(\"segmentation\", \"none\"); }\r\n setBlockVis(\"player\", \"none\");\r\n}",
"function div_hide_learn(... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Get singleton database instance, initialize a new connection only when the database does not exist. | static getInstance() {
if (this.status === DatabaseStatus.DISCONNECTED) {
this.status = DatabaseStatus.CONNECTING;
this.uniqueInstance = new Database(false);
}
while (this.uniqueInstance === null) ;
return this.uniqueInstance;
} | [
"function getDatabase() {\n return new Database(config.database.uri);\n}",
"function databaseSingletonTest(){\n var oracle = DatabaseSingleton.getInstance();\n var postgres = DatabaseSingleton.getInstance();\n console.log(\"\\nSame database instance? %s\", (oracle === postgres));\n}",
"async getInstan... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
init all values for a worker | initWorker(worker) {
worker.setRetryTime(FATUS_EQ_RETRY_TIME);
worker.setMaxAttempts(FATUS_WRK_RETRY_ATTEMP);
worker.setStackProtection(FATUS_WRK_STACK_TRSHLD);
worker.setReservationTime(FATUS_JOB_RESERV_TIME);
worker.setMaxFails(FATUS_MAX_FAIL);
} | [
"createWorkers() {\n let me = this,\n config = Neo.clone(NeoConfig, true),\n hash = location.hash,\n key, value;\n\n // remove configs which are not relevant for the workers scope\n delete config.cesiumJsToken;\n\n // pass the initial hash value as ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
This fetch call gets one object from tableName. | get(tableName, id) {
return fetch(`${remoteURL}/${tableName}/${id}`).then(result => result.json())
} | [
"getTable(name) {\n return this.tables.get(name);\n }",
"function getName (tableName, id) {\n\n\t\tvar table = db.getSchema().table(tableName);\n\n\t\treturn db.select(table.name).from(table).where(table.id.eq(id)).exec()\n\t\t\t.then(function (name) {\n\t\t\t\treturn name[0].name;\n\t\t\t});\n\n\t}",
... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Indirectly access the global BigInt constructor, it allows browsers that doesn't support BigInt to run the library without breaking due to "undefined BigInt" errors. | function getBigIntConstructor(){if(typeof window!=='undefined'){return window['BigInt']||null;}if(typeof __webpack_require__.g!=='undefined'){return __webpack_require__.g['BigInt']||null;}if(typeof self!=='undefined'){return self['BigInt']||null;}throw new Error('Can\'t search globals for BigInt!');} | [
"function createBigInt(num){if(typeof BigInteger==='undefined'){BigInteger=getBigIntConstructor();}if(BigInteger===null){throw new Error('BigInt is not supported!');}return BigInteger(num);}",
"function nbi() { return new BigInteger(null); }",
"function array2bigint(bytes)\n{\n\tlet hex;\n\n\tif (typeof(bytes) ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Sets all chart containers in a statsrow to the same height. | function resizeStatsRow() {
if ($(window).width() > 991) {
let m2 = 0;
$(".stats-row").children().children().height("");
$(".stats-row").children().children().each(function(i, el) {
m2 = Math.max(m2, $(el).height());
});
$(".stats-row").children().children().height(m2);
}
} | [
"function ResizeScreenAfterContainerResize() {\r\n\r\n $(\"div [id$=InsertGridSubstance]\").css(\"height\", \"50%\");\r\n $(\"div [id$=InsertGridHealthHistory]\").css(\"height\", \"100\");\r\n}",
"function SetRowHeight() {\n var grid = this.GetGrid();\n var rowHeight = GetR... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Standalone version of jQuery.extend, from | function extend() {
var options, name, src, copy, copyIsArray, clone,
target = arguments[0] || {},
i = 1,
length = arguments.length,
deep = false,
// helper which replicates the jquery internal functions
objectHelper = {
hasOwn: Object.prototype.hasOwnProp... | [
"function copyObjectJQuery (obj) {\n return jQuery.extend(true, {}, obj);\n}",
"function extend () {\n\n // Variables\n var extended = {};\n var deep = false;\n var i = 0;\n var length = arguments.length;\n\n // Check if a deep merge\n if ( Object.prototype.toString.call( arguments[0] ) === '[object Bool... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Performs ajax request to update all relevant chat messages to SEEN status. Takes other user's id of the current conversation. | function setSeenMessagesByUserAndReceiverId(otherUserId)
{
$.ajax({
url: path_to_set_seen_messages,
type: "POST",
dataType: "json",
data: {
"otherUserId": otherUserId
},
async: true,
success: function (data)
{
refreshMessages();... | [
"function ajaxConversation(arg1, arg2, arg3) {\n const iddisc = arg1;\n const idowner = arg2;\n const idexp = arg3;\n $.ajax({\n type: \"POST\",\n url: `/messagedisc/${idowner}/${iddisc}`,\n }).done(function (resp) {\n $(\".conversation\").html(resp);\n if ($(window).width() < 576... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Enter a parse tree produced by KotlinParsercallableReference. | enterCallableReference(ctx) {
} | [
"function pushlex(type, info) {\n var result = function(){\n lexical = new CSharpLexical(indented, column, type, null, lexical, info)\n };\n result.lex = true;\n return result;\n }",
"enterOrdinaryCompilation(ctx) {\n\t}",
"enterKotlinFile(ctx) {\n\t}",
"enterTypeReference(ctx) {... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Drop fields for line and area marks. Lines and areas are defined by a series of datum. We overlay point marks on top of lines and areas to allow tooltip to show all data in the series. For the line marks and area marks underneath, we only show nominal fields in tooltip. This is because line / area marks only give us th... | function dropFieldsForLineArea(marktype, itemData) {
if (marktype === 'line' || marktype === 'area') {
var quanKeys = [];
for (var key in itemData) {
if (itemData.hasOwnProperty(key)) {
var value = itemData[key];
if (value instanceof Date) {
... | [
"function removeMissingFromLineChart(dataClone, line, height, svg, tooltip, formatTime, x, y) {\t\r\n\tvar nonMissingSlices = []; //nonMissingSlices = holds slices of non-missing data\r\n\tvar start = 0; //start = used to signal beginning of slices for missing data\r\n\r\n\t//CREATE ARRAY OF ARRAYS\r\n\tfor(var i =... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
deal with clicking on one of the edit comment buttons | function comment_edit_click(e) {
var comment_id = e.target.getAttribute('data-comment-id');
console.log('editing comment ID #'+comment_id);
var comment = document.getElementById('comment-' + comment_id);
var edit_comment_form = document.getElementById('edit-comment-'+comment_id);
//console.log(comment);
//comment... | [
"function commentEdit(id) {\n var comment = jQuery('#comment-' + id);\n var content = comment.find('.comment-text');\n\n comment.find('.comment-edit').hide();\n\n var form = jQuery(template('template-comment-edit', {\n id: id,\n content: content.text()\n }))\n .find('.comment-edit-abort')\n .clic... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
randomly picks from all the args | function pick(){
return arguments[randomInt(arguments.length)]
} | [
"function randomPoint() { return pick(points); }",
"function pickRandomFrom(list) {\n return list[Math.floor(Math.random() * list.length)];\n }",
"function randomAnimal(){\n\tvar animals = ['pig', 'cow', 'sheep', 'chicken'];\n\tvar num = Math.floor(Math.random() * animals.length);\n\tvar pick = animals[num]... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Defining passport local strategy for Authenticating user at the time of login Whenever passport.authenticate('local') will be invoked this strategy will be executed | function passportLocalStrategy () {
passport.use(new LocalStrategy({
usernameField: 'Username',
passwordField: 'Password',
passReqToCallback: true
}, (req, username, password, done) => {
// Database
const domain = username.split('@')[1]; // 'Test3012';
// Server
... | [
"function signin (req, res, next) {\n\n passport.authenticate('local', function(err, user, info) {\n if (err || !user) {\n res.status(400).send(info);\n } else {\n // Remove sensitive data before login\n user.scrub();\n L.debug(\"\"+JSON.stringify(user));... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
pressShortcut will use ctrl on Linux or meta on Mac, depending on which platform the tests are running. | async function pressShortcut(t, shortcutUsingCtrl) {
if (shortcutUsingCtrl === undefined) {
throw (
"pressShortcut expecting a shortcut string like 'ctrl-a' but got undefined. " +
"Did you forget to pass t?"
);
}
var shortcut;
if (t.browser.os.name == "macOS") {
shortcut = shortcutUsingC... | [
"addShortcut(keys, callback) {\n Mousetrap.bind(keys, callback)\n }",
"function fixShortcut( name ) {\n\tif ( isMac ) {\n\t\tname = name.replace('Ctrl', 'Cmd');\n\t} else {\n\t\tname = name.replace('Cmd', 'Ctrl');\n\t}\n\treturn name;\n}",
"static async ctrlClick(selector) {\n return JQueryActi... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
========================================================================// ParameterSonTrajanje ========================================================================// trajanje soncnega obsevanja v 1 uri sonce | function ParameterSonTrajanje(parent, name, id, mval, bval) {
Parameter.apply(this, [parent, name, id, mval, bval]);
this.min = new Number(0);
this.max = setMaxSonTrajanje;
} | [
"function ParameterKliSmerVetra(parent, name, id, mval, bval) {\n Parameter.apply(this, [parent, name, id, mval, bval]);\n this.values = [0, 2, 4, 6, 8, 10, 12, 14, 16, 18, 20, 22, 24, 26, 28, 30, 32];\n}",
"function ParameterKliStanjeTal(parent, name, id, mval, bval) {\n Parameter.apply(this, [parent, name, i... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
This is a ES6 workaround to fix dependency injection in Angular directives, since they are expected to return factory and not constructor. For more information: | static directiveFactory (dataService) {
return new ChartDirective(dataService)
} | [
"enhanceNgApp(moduleNode){\n // Add a reference to the dom node\n this.ngApp.$element = moduleNode;\n\n // Add a method to obtain services from this.ngApp\n this.ngApp.getService = (service)=>{\n return this.injector.get(service);\n }\n }",
"injectDependencies() {\n this.injectHtmlTemp... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
This object class is used to keep track of the hidden elements on the page | function HiddenElements() {
this.list = [];
this.count = 0;
this.hideDisplay = 0;
this.hideVisibility = 0;
this.hidePosition = 0;
this.hideOpacity = 0;
this.hideOverflow = 0;
this.hideFontSize = 0;
this.hideTextIndent = 0;
this.hideHTML5 = ... | [
"invisible()\n {\n for (let container of this.containers)\n {\n container.children.forEach(object => object[this.visible] = false)\n }\n }",
"function testDeveloperElementsAreHidden(item) {\n testElementsVisibility(item, devElements, false);\n }",
"function testNormalEl... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Creates an operation with the given name and arguments | function operation(operatorName, args) {
return { type: 'operation', operator: operatorName, args: args || [] };
} | [
"function op(type, name, side = undefined) {\n return new Op(type, name, side);\n}",
"constructor() { \n \n Operation.initialize(this);\n }",
"function defineOperator(Prim, n, opjname, opname) {\n opname = opname || opjname;\n define(Prim, opjname, function (env, expr) {\n var arg... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Parse Hex remove and convert 3 to 6 if needed | function HexParse(i) {
i = i.replace(/#/g, "");
if (3 === i.length) {
i = [i[0] + i[0], i[1] + i[1], i[2] + i[2]].join("")
}
return i
} | [
"function _hexDecode(data) {\n var j\n , hexes = data.match(/.{1,4}/g) || []\n , back = \"\"\n ;\n\n for (j = 0; j < hexes.length; j++) {\n back += String.fromCharCode(parseInt(hexes[j], 16));\n }\n\n return back;\n }",
"function removeHex(val) {\n\tconst regExpToR... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
this function highlight all metal types also create dynamic cells for color convention and also call some function which highlight specific metals on hover event | function highlightMetalstypes()
{
defaultcolor(); // this function is used for making each cell color as it was in default
deleteTableRows(); // this function is used for deleting all those rows which were created for color convetion
document.getElementById('colorcaption').style.visibility = "... | [
"hover(state, index) {\n //If table object already has hover css toggle back to normal highlight\n\t\t\tif (state.table[index].css == state.colorTheme.hover && state.table[index].interactive) {\n state.table[index].css = state.colorTheme.hightlight\n } \n\t\t\t//If the object is... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Gather and total all current unspents for address | function totalUnspents(addressToGet, network, callback) {
getUnspents(addressToGet.toString(), network, function(err, address, unspents) {
totalReturn = 0.0;
unspents.forEach(function(unspent) {
totalReturn += parseFloat(unspent.value);
});
callback(null, addressToGet, to... | [
"function getUnspents(address, network, callback) {\n var api = new API(network)\n api.addresses.unspents(address, function(err, results) {\n if(err) return callback(err)\n\n var unspents = results.map(function(r) {\n return {\n txId: r.txId,\n vout: r.vout,\n value: r.value\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Merge properties from one object onto another recursively. Properties from the src object will overwrite existing target property. | function recursiveMerge(target, src) {
for (var prop in src) {
if (src.hasOwnProperty(prop)) {
if (typeof target.prototype !== 'undefined' && target.prototype.constructor === target) {
// If the target object is a constructor override off prototype.
target.prototy... | [
"function recursiveMerge(target, src) {\n for (var prop in src) {\n if (src.hasOwnProperty(prop)) {\n if (target.prototype && target.prototype.constructor === target) {\n // If the target object is a constructor override off prototype.\n clobber... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Returns 'true' if we have a current server | haveCurrentServer() {
return isEmpty(this.getCurrentServer()) === false;
} | [
"isOnServer() {\n return !(typeof window !== 'undefined' && window.document);\n }",
"isOnline() {\n return this.worldManager && this.worldManager.isOnline();\n }",
"function isLocalhost(){\n return window.location.origin.includes(\"localhost:8088\");\n}",
"function checkServer(callback){\n\tp... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Decrypt message with key, then decompress. | function zeroDecipher(key, data) {
return decompress(sjcl.decrypt(key, data));
} | [
"function des (key, message, encrypt, mode, iv, padding) {\n //declaring this locally speeds things up a bit\n var spfunction1 = [0x1010400,0,0x10000,0x1010404,0x1010004,0x10404,0x4,0x10000,0x400,0x1010400,0x1010404,0x400,0x1000404,0x1010004,0x1000000,0x4,0x404,0x1000400,0x1000400,0x10400,0x10400,0x10... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Function activateFinalSubmitOverlay() //fDateNums[0] = weekday name (eg. Mon, Tue) fDateNums[1] = current month (three chars String) fDateNums[2] = first day of this month (always '01') fDateNums[3] = current year | function activateFinalSubmitOverlay() {
document.getElementById("overlay").style.display = "block";
document.getElementById("submitFormName").innerText = "Ryan Morris";
document.getElementById("submitFormType").innerText = counselingType;
document.getElementById("VerifyDate").innerText = "On: " + fDateN... | [
"_updateDatePane() {\n var DateChooser = qx.ui.control.DateChooser;\n\n var today = new Date();\n var todayYear = today.getFullYear();\n var todayMonth = today.getMonth();\n var todayDayOfMonth = today.getDate();\n\n var selDate = this.getValue();\n var selYear = selDate == null ?... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Add a dust dependency to the dependency array, returning the normalized path/name | function addDustDependency( require_path, source_path, options, deps ) {
var name = determinePartialName( require_path, source_path, options );
deps.push( "var partial" + deps.length + " = require('" + name + "');" );
return name;
} | [
"function record_dependency(dependent, property, dependee)\n{\n if (!pending[dependee])\n \tpending[dependee] = [];\n \t\n pending[dependee].push({property: property, dependent: dependent});\n}",
"function GistEditDependencies() {\n var gist = gisty.getCurrentGist();\n if (gist === null) {\n Logg... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Create a new random filled map | function create_random_map() {
var easy = planet_types.none;
for(var j = 0; j < map.rows - map.downgrade; j++) {
for(var i = 0; i < map.columns; i++) {
var planet = map.planets[i][j];
if(gamer.level <= 2) {
if(i % 2 == 0) {
... | [
"function seedMap() {\n let i = CONSTANTS.SEED.NUM\n while( i-- > 0 ) {\n createNode({\n float: true\n })\n }\n}",
"function buildMap() {\n var map = [];\n for(var i=0; i<=20; i++) {\n var row = [];\n for(var j=0; j<=20; j++) {\n row.push(new Tile(i,... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Enter a parse tree produced by Java9ParserinterfaceMethodDeclaration. | enterInterfaceMethodDeclaration(ctx) {
} | [
"enterNormalInterfaceDeclaration(ctx) {\n\t}",
"enterInterfaceModifier(ctx) {\n\t}",
"exitNormalInterfaceDeclaration(ctx) {\n\t}",
"enterMethodDeclarator(ctx) {\n\t}",
"extractInterface(name) {\r\n const { constructors, properties, methods, accessors } = getExtractedClassDetails(this, false);\r\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Set bottom margin to content | function setContentBottomMargin() {
var scrollContainerHeight = $scrollContainer.height();
var lastContentItem = $contentItems.last();
var contentBottomMargin = scrollContainerHeight - lastContentItem.height() - topOffset + 20;
if (contentBottomMargin <= 0) { return; }
$content.css({ 'margin-bottom'... | [
"function setFooterMargin() {\n var stickyFooterHeight = $('.combination-bet__footer').height()\n $('.combination-bet .footer').css('margin-bottom', stickyFooterHeight + 'px')\n\n }",
"function bottomMargin(obj)\n\t{\n\t\treturn parseFloat(obj.css('margin-bottom'));\n\t}",
"function positionElementBottom... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
get string key for network, channel combination | function key(network, channel) {
return network + "|||" + channel;
} | [
"function get_channel_key(){\n return this.channel;\n }",
"ComputeKeyIdentifier() {\n\n }",
"function getClientKey() {\n\n }",
"get keyName() {\n const prefix = this.guildIDs ? this.guildIDs.join(',') : 'global';\n return `${prefix}:${this.commandName}`;\n }",
"encodeKey(key) {\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
downloadReport downloads a CSV of the cumulative allocation data | function downloadReport() {
// Build CSV
const head = columns.map(c => c.head).join(',')
const body = reverse(sortBy(cumulativeData, 'totalCost')).map(toCSVLine).join('\r\n')
const csv = `${head}\r\n${body}`
// Create download link
const a = document.createElement("a")
a.href = URL.createOb... | [
"function downloadCSVFile()\n {\n window.open('/ReportController/downloadCSVFile', '_blank');\n }",
"createDownloadLinkForCsvFile () {\n // put metrics as download link value\n Csv.filename = 'busrideMetrics_' + Utils.getCurrentDateAndTime(new Date()) + '.csv'\n csvDownloadLink.setAttribute(\n 'hr... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
adds the value of the stat names to the data variable in the order of the array given in statNames it is in the order you ask for the stats in | parseStats(){
var userData = this.user.getStats();
var count = 0;
var index = 0;
while(count < userData.playerstats.stats.length){
while(index < this.statNames.length){
if(userData.playerstats.stats[count].name == this.statNames[index]){
th... | [
"add(stats) {\n let sum = new BirdStats({});\n this.forEachStat((name, value) => {\n sum[name] = value + stats[name];\n });\n return sum;\n }",
"function playerStats(stats, name, position, teamId, image) {\n\n\t//changing image depending on the team id\n\tdocument.getElementById('player').classN... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Setter of the friends attribute. | set friends(aValue) {
this._logService.debug("gsDiggEvent.friends[set]");
this._friends = aValue;
} | [
"function updateFriendsLocations() {\n\n /* TODO: pull from the database to grab friends' locations */\n getFriendsLocation().then(response => {\n setFriends(response);\n })\n \n }",
"function setFriendRequests() {\n\n LOG(\"Setting friend requests...\")\n var ref = database.ref('friends')... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
runs the renderStickyNavBar to make sure either navbars are sticky | function renderIndexHTMLNav() {
renderStickyNavBar(navbar2, navbar1);
} | [
"function stick() {\n if (window.pageYOffset >= offset) {\n navbar.classList.add(\"sticky\")\n } else {\n navbar.classList.remove(\"sticky\");\n }\n }",
"function onScroll() {\n var isNavBarVisible = window.pageYOffset >= showNavBarMinimum;\n if ( isNavBarVisible != wasNavBarVisible ) {\... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
check if file has changed by comparing last modified date If yes, send back new lines | function readFileForChanges() {
const newlyReadLastModifiedDateInMillies = new Date(fs.statSync(filePath)['mtime']).getTime();
//proceed only if file has been modified
if(lastModifiedDateInMillis < newlyReadLastModifiedDateInMillies){
let linesToSendBack = [];
let linesInFile = fs.readFileSync(filePath).t... | [
"function fileChanged() {\n \"use strict\";\n if (bTrackChanges) {\n if (!bFileChanged) {\n bFileChanged = true;\n highlightChanged();\n }\n }\n}",
"watch (fileChanged) {\n setTimeout(() => {\n fileChanged({\n change: \"modified\",\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
This retrieves the employee information from the input. It returns a string equal to the value in the input. | function retrieveEmployeeInformation() {
return document.querySelector("input").value;
} | [
"function promptEmployee() {\n return inquirer.prompt([\n {name: \"name\" , type: \"input\", message: \"TeamInfo: Employee Name? (<first> <last>)\"},\n {name: \"id\" , type: \"input\", message: \"TeamInfo: Badge Number?\"},\n {name: \"email\", type: \"input\", message: \"TeamInfo: E-mail? (<userName>@<m... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Sum all the values in a set. e.g. sumSet([1,2,3]) > 6 | function sumSet(set) {
var i, n = 0;
for (i = 0; i < set.length; i++) {
n += +set[i];
}
return n;
} | [
"function findSums(courseArray, targetSum) {\n\t\tvar sumSets = [];\n\t\tvar temp = [];\n var optimalSets = [];\n\t\tvar courseSets = powerset(courseArray);\n var workLoad;\n\t\tfor (var i = 0; i < courseSets.length; i++) {\n\t\t\tvar courseSet = courseSets[i]; \n\t\t\tif (sumCredits(courseSet) == tar... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
This function checks if condition is as followes: 'column=value' flag is TRUE if we want to check that there are no digits | function onlyBy(req,column,flag)
{
var squery = JSON.stringify(req.params.query)
if(squery.length<=column.length+4)
return false
return squery.substring(1,column.length+1)===column && (!flag || !(/\d/.test(squery))) && squery.charAt(column.length+1)==='='
} | [
"function isColumnEqualToNumber(req,column)\n{\n var squery = JSON.stringify(req.params.values)\n squery = squery.substring(1,squery.length-1)\n if(squery.length< column.length+1)\n if(!(column===squery.substring(0,column.length)))\n return false\n if(!(squery.charAt(column.length)==='='))\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
SlideVerticallyTransition class changes slides by sliding them vertically. This class can be removed if this effect is not used. If offset (difference between index of currently displayed slide and index of next slide) is greater than 0, slides are sliding from up to down. Otherwise (offset is lower than 0), slides are... | function SlideVerticallyTransition() {} | [
"moveVertically(start, forward, distance) {\n return moveVertically(this, start, forward, distance);\n }",
"moveVertically(start, forward, distance) {\n return moveVertically(this, start, forward, distance);\n }",
"function SlideHorizontallyTransition() {}",
"function navVertical(forwa... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Updates the content of the div with server info | updateDivContent() {
var server = getServer(this.serverKey);
if(this.type == 'status') {
this.#updateStatusContent(server);
}
if(this.type == 'queue') {
this.#updateQueueContent(server);
}
if(this.type == 'controls') {
this.#updateCo... | [
"function updateUiData(info){\n const {date , temp , feelings} = info;\n // update the date div \n dateEntry.innerHTML = \"Date: \" + date;\n\n // update the temp div \n tempEntry.innerHTML = \"Temp: \" + temp;\n\n // update the content entry \n content.innerHTML = \"Feelings: \" + feelings ;\n\n}",
"#upda... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Step 1: GET Request to fetch createaccount token | function getCreateAccountToken() {
var params_0 = {
action: "query",
meta: "tokens",
type: "createaccount",
format: "json"
};
request.get({ url: endPoint, qs: params_0 }, function (error, res, body) {
if (error) {
return;
}
var data = JSON... | [
"function createaccount(createaccount_token) {\n var params_1 = {\n action: \"createaccount\",\n username: \"your_username\",\n password: \"your_password\",\n retype: \"retype_your_password\",\n createreturnurl: wikiUrl,\n createtoken: createaccount_token,\n forma... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
fore each item role dice for price based on rarity | function get_item_prices(rarity_counts, price_dice) {
// !!!
} | [
"function get_rarity_counts (rarity_dice) {\n// !!!\n}",
"rollDamage({\n event = null,\n stuntDie = null,\n addFocus = false,\n atkDmgTradeOff = 0,\n resistedDmg = false}={}) {\n\n if (!this.data.data.hasDamage && !this.data.data.hasHealing) {return false};\n const... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
chunk Split an array into chunks of a specified size. This function has the same behavior as [PHP's array_chunk]( function, and thus will insert smallersized chunks at the end if the input size is not divisible by the chunk size. `sample` is expected to be an array, and `chunkSize` a number. The `sample` array can cont... | function chunk(sample, chunkSize) {
// a list of result chunks, as arrays in an array
var output = [];
// `chunkSize` must be zero or higher - otherwise the loop below,
// in which we call `start += chunkSize`, will loop infinitely.
// So, we'll detect and return null in that c... | [
"function chunk(array, chunkSize, processChunk) {\n for (let i = 0; i < array.length; i += chunkSize) {\n const chunk = array.slice(i, i + chunkSize);\n processChunk(chunk);\n }\n}",
"function chunk(array, size) {\n\n // #1 solution\n // let i = 0\n // let total = 0\n // let temp = []\n // let result... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Performs 10 tests and checks if at least 6 was successful. | function trials (test, minSuccess = 10) {
let success = 0
for (let t = 0; t < 10; t++) {
success += test() ? 1 : 0
}
assert(success >= minSuccess)
} | [
"function testEverywhere() {\n const { parameters } = tests.exercises.find((exercise) => {\n return exercise.name === \"everywhere\";\n });\n\n let tc = 0;\n let pass = 0;\n for (const values of parameters[0].values) {\n for (const x of parameters[1].values) {\n const functionCall = `everywhere(${fo... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Step 1: Create the Leaflet map | function createMap(){
// Add place searchbar to map
L.Control.openCageSearch(options).addTo(map);
// Add zoom control (but in top right)
L.control.zoom({
position: 'topleft'
}).addTo(map);
// build easy bar from array of easy buttons
L.easyBar(buttons).addTo(map);
// Add easy... | [
"function createMap(myLatitude, myLongitude) {\n\n\n// Leaflet Map on index page\n L.tileLayer('https://api.tiles.mapbox.com/v4/{id}/{z}/{x}/{y}.png?access_token=pk.eyJ1IjoiZW5qb3ltcmJhbiIsImEiOiJjam5hY3EwcDQwZ2hiM3BwYWQ2dWt4a2x1In0.nlX1GeaPE2DQn3aZH0IJaA', {\n maxZoom: 18,\n minZoom: 4,\n a... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Updates the map with new data | function updateMap(data, canvas) {
//TODO
} | [
"reload(newData) {\n this.mapData = newData;\n console.log('New Dataset: ', this.mapData);\n console.log('Reloading the map using a new dataset');\n this.render();\n }",
"refreshMap() {\n this.removeAllMarkers();\n this.addNewData(scenarioRepo.getAllEvents(currentScenario));\n th... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Draw a chunk in the red timeline of length 'elementLength' with x position 'elementStart' | function createRedChunk(elementLength,elementStart){
var redChunk = document.createElement('div');
redChunk.id = 'redChunk';
redChunk.style.width = elementLength+'px';
redChunk.style.height = '16px';
redChunk.style.left = elementStart+'px';
redChunk.style.top = redTimelin... | [
"function createBlueChunk(elementLength,elementStart){\n var blueChunk = document.createElement('div');\n blueChunk.id = 'blueChunk';\n blueChunk.style.width = elementLength+'px';\n blueChunk.style.height = '16px';\n blueChunk.style.left = elementStart+'px';\n blueChunk.sty... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Given a timestamp, either return the record of the exact time or interpolate a result from the real data. | function get_record_by_timestamp(timestamp) {
var records = app_state.data.records;
var min_t = records[0].timestamp;
var max_t = records[records.length - 1].timestamp;
if (timestamp < min_t || timestamp > max_t) {
console.warn('Timestamp out of range');
return null;
}
// If we have real record fo... | [
"function getSampleIndex(timestamp, samples){\n\n // TODO: get the actual index of the sample closest to the given timestamp\n\n return timestamp;\n }",
"function findNearest(time, callback){\n for(i = 0; i < timestamps.length; i++)\n if (timestamps[i] > time){\n callback(measurments[i])... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
STRETCH PROBLEMS (NOT REQUIRED) getHeaderTag takes in header text and a header size and returns the opening and closing H tag with the text inside Example: getHeaderTag('Welcome', 2) would return 'Welcome' | function getHeaderTag(text, size) {
// return '\'<'${size}'>'${text}'</'${size}'>\'';
} | [
"function fnH5oGetSectionHeadingText(eltHeading) {\n var sEmpty = '', sTxt;\n if (fnH5oIsElmHeading(eltHeading)) {\n if (fnH5oGetTagName(eltHeading) === 'HGROUP') {\n eltHeading = eltHeading.getElementsByTagName('h' + (-fnH5oGetHeadingElmRank(eltHeading)))[0];\n }\n /* @todo: try to reso... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Poll the heartbeat file and update the status image to show if the system is running or not | function poll()
{
setTimeout( function() {
$.ajax("/alarmHeartbeat.html").success( function(data) {
console.log('HB:'+data);
var milliseconds = Math.floor( Date.now() / 1000 );
console.log('MS:'+milliseconds);
var diff = milliseconds - data;
console.log('DIFF:'+diff);
if(diff < 20)
... | [
"function heartbeat() {\n for (var key in this._nodes) {\n var node = this._nodes[key];\n\n // ensure more` than a second has elapsed since the last send. this works\n // because this use of hrtime returns a tuple of [seconds, nanoseconds] and\n // if the seconds field is non-zero it will evaluate to t... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Check if ESLint has run the fix | function isFixed(file) {
return file.eslint !== null && file.eslint.fixed;
} | [
"lint() {\n // get a linting report that contains information about\n // errors, warnings, and detailed messages including line numbers and columns.\n const report = this.engine.executeOnFiles([this.engine.options.cwd]);\n // get the default eslint report formatter\n const formatter = this.engine.ge... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Updates tags of the specified region. | updateTagsById(id, tagsDescriptor) {
const region = this.lookupRegionByID(id);
if (region != null) {
region.updateTags(tagsDescriptor, this.tagsUpdateOptions);
}
} | [
"updateTagsForSelectedRegions(tagsDescriptor) {\r\n const regions = this.lookupSelectedRegions();\r\n regions.forEach((region) => {\r\n region.updateTags(tagsDescriptor, this.tagsUpdateOptions);\r\n });\r\n }",
"function changeRegion(array, index, region) {\n array[index].reg... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
TODO: refactor this using Pointer basically the signature should be Context(instancePointer,schemaPointer) | function Context(instance,schema,ipath,spath,parent){
if (!(this instanceof Context)) return new Context(instance,schema,ipath,spath,parent);
this.instance = instance;
this.schema = schema;
this.instancePath = (ipath === undefined ? [] : ipath);
this.schemaPath = (spath === undefined ? [] : spath);
this._as... | [
"schema(schema) {\n if (arguments.length) {\n this._schema = schema;\n return this;\n }\n if (!this._schema) {\n this._schema = this.constructor.definition();\n }\n return this._schema;\n }",
"getChildContext() {\n return {\n store: this.store,\n };\n }",
"bind(context... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Entity(idName, idAliases, deText, uses, reacts, routine): An object constructor function to construct a "entity", an object type representing a living person. Entities will act every time a command that passes time is successfully activated (MOVE, GET, or USE). Entities have: An ident, identifying this entity. The enti... | function Entity(idName, idAliases, deText, plText, reacts, speech, routine, ownLoc)
{
this.ident = idName;
this.alias = idAliases;
this.descText = deText;
this.placeText = plText;
this.itemReaction = reacts;
this.dialogue = speech;
this.brain = routine;
this.myLocation = ownLoc;
} | [
"function Item(idName, idAliases, deText, plText, itemGet, itemAct, uses, reacts)\n{\n\tthis.ident = idName;\n\tthis.alias = idAliases;\n\tthis.descText = deText;\n\tthis.placeText = plText;\n\tthis.canGet = itemGet;\n\tthis.canUse = itemAct;\n\tthis.itemUse = uses;\n\tthis.itemReaction = reacts;\n}",
"renderEnti... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
nextPhase() advances the game upon returning all babies: mama takes a nap. if it's the third nap, load the next level. else, load this level's next phase (same layout, more baddies). | function nextPhase(){
napping = true;
babiesReturned = true;
player.sleeping = true;
trace =0;
naps++; // increment naps taken
if(naps===3){
// IF ALL NAPS COMPLETE, LEVEL IS OVER
// display continue level text
currentText = [
"the day is over. level complete!",
"click to continu... | [
"checkNextGame (){\n\n }",
"function completeContinuePhase () {\n\t/* show the player removing an article of clothing */\n\tprepareToStripPlayer(recentLoser);\n updateAllGameVisuals();\n\t\n\t$mainButton.html(\"Strip\");\n if (players[HUMAN_PLAYER].out && AUTO_FORFEIT) {\n setTimeout(advanceGame,F... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
utility function to remove street suffixes returned from Alexa output to make matching returns given string with street suffix removed | function removeStreetSuffix(string) {
var streetSuffixes = [
"street",
" st ",
" st",
"boulevard",
" blvd ",
" blvd",
"place",
" pl ",
" pl",
"court",
" ct ",
" ct",
"terrace",
" ter ",
" ter",
"road",
" rd ",
" rd",
"parkway",
" pkwy ",
" pkwy",
"lane",
" ln ",
" ln",
... | [
"function cleanStationName(name) {\n name = name.replace(\"asema\", \"\")\n name = name.replace(\"_(Finljandski)\", \"\")\n name = name.replace(\"Lento\", \"Lentokenttä\")\n return name;\n}",
"function reformatAddressForRequest(address) {\n return address.split(\" \").join(\"+\").replace(/,/gi, \"\... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Creates a new Installation Entry if one does not exist. Also clears timed out pending requests. | function updateOrCreateInstallationEntry(oldEntry) {
var entry = oldEntry || {
fid: generateFid(),
registrationStatus: 0 /* NOT_STARTED */
};
return clearTimedOutRequest(entry);
} | [
"async function createEntry({ model, entry, files }) {\n try {\n if (_.has(entry, 'files') || _.has(entry, 'featured_image') || _.has(entry, 'logo')) {\n delete entry.files;\n delete entry.featured_image;\n delete entry.logo;\n }\n\n if (model === 'article' || model === 'destination' || mod... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
=== FUNCTIONS === Default onExit function for gulp | function onExit(done) {
done();
} | [
"exitKotlinFile(ctx) {\n\t}",
"function on_exit(hndler, action) /* forall<a,e> (hndler : () -> e (), action : () -> e a) -> e a */ {\n return _bind_on_exit(hndler, action);\n}",
"exitPreprocessorNot(ctx) {\n\t}",
"exitFileAnnotation(ctx) {\n\t}",
"exitPreprocessorImport(ctx) {\n\t}",
"exitPreprocessorCo... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |