query stringlengths 9 14.6k | document stringlengths 8 5.39M | metadata dict | negatives listlengths 0 30 | negative_scores listlengths 0 30 | document_score stringlengths 5 10 | document_rank stringclasses 2
values |
|---|---|---|---|---|---|---|
Get alert string if oil pressure is low | function getOilPressAlert(vid){
var returnstr = "";
if (trucks[vid].symptoms.oillevel == true){
returnstr = 'OIL PRESSURE';
}
return returnstr
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function getAirPressAlert(vid){\n var returnstr = \"\";\n if (trucks[vid].symptoms.airpressure == true){\n returnstr = 'AIR PRESSURE';\n }\n return returnstr\n}",
"estimateWhenToWater(){\n let msg = null;\n if(this.state.hardwareID !== \"-\" && this.state.hardwareHumidity > 0){\n ... | [
"0.62943286",
"0.62131715",
"0.6149799",
"0.6024851",
"0.5905751",
"0.58703536",
"0.57881755",
"0.5764214",
"0.569133",
"0.5685931",
"0.5674525",
"0.5661524",
"0.5622725",
"0.5614148",
"0.5564595",
"0.55626875",
"0.55411416",
"0.5525323",
"0.54978853",
"0.54867715",
"0.547147... | 0.7203209 | 0 |
Get alert string if air pressure is low | function getAirPressAlert(vid){
var returnstr = "";
if (trucks[vid].symptoms.airpressure == true){
returnstr = 'AIR PRESSURE';
}
return returnstr
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function getOilPressAlert(vid){\n var returnstr = \"\";\n if (trucks[vid].symptoms.oillevel == true){\n returnstr = 'OIL PRESSURE';\n }\n return returnstr\n}",
"estimateWhenToWater(){\n let msg = null;\n if(this.state.hardwareID !== \"-\" && this.state.hardwareHumidity > 0){\n if(... | [
"0.69997555",
"0.648426",
"0.6340426",
"0.62569845",
"0.6208107",
"0.59735143",
"0.5902884",
"0.5846502",
"0.57949704",
"0.5716304",
"0.56721306",
"0.5664474",
"0.56601113",
"0.56157017",
"0.555999",
"0.5517858",
"0.54923666",
"0.5491237",
"0.5469585",
"0.54485303",
"0.544646... | 0.7493309 | 0 |
Get alert string if brakes are engaged | function getBrakeEngAlert(vid){
var returnstr = "";
if (trucks[vid].symptoms.brakeeng == true){
returnstr = 'P-BRAKE ENGAGED';
}
return returnstr
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function getAirPressAlert(vid){\n var returnstr = \"\";\n if (trucks[vid].symptoms.airpressure == true){\n returnstr = 'AIR PRESSURE';\n }\n return returnstr\n}",
"function getOilPressAlert(vid){\n var returnstr = \"\";\n if (trucks[vid].symptoms.oillevel == true){\n returnstr = 'OIL PRESSURE';\n }\... | [
"0.6569539",
"0.6530682",
"0.5912205",
"0.57139504",
"0.5599354",
"0.5556763",
"0.55391335",
"0.5513387",
"0.5427171",
"0.54226226",
"0.539503",
"0.536524",
"0.5365135",
"0.53576916",
"0.5349783",
"0.5324865",
"0.53159964",
"0.52766687",
"0.5256521",
"0.524377",
"0.5242916",
... | 0.7573694 | 0 |
Send comment (write to dattabase), sender Jesper Englund is hardcoded | function sendComment(comment){
if (comment != ""){
var time = new Date().toLocaleString();
write_comment(comment, "Jesper Englund", time);
}
else {
console.log("Write some text to add a comment");
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function replyaMessage(commentId){\n vm.writeReply=true;\n }",
"function signalrAnnounceComment(postID, op, commentWriterId ) {\n\n let targetbuttonId = 'txtBox_' + postID;\n\n let commentContent = document.getElementById(targetbuttonId).value;\n\n $.connection.linkedInHub.server.annou... | [
"0.6982911",
"0.68064743",
"0.66872597",
"0.6679374",
"0.6599398",
"0.6595924",
"0.65922284",
"0.6587867",
"0.6566752",
"0.65111923",
"0.6480856",
"0.6475917",
"0.6355728",
"0.6349343",
"0.6346062",
"0.6314043",
"0.63024455",
"0.6291315",
"0.6277787",
"0.6264456",
"0.6263884"... | 0.81381404 | 0 |
Translate and display diagnose information about a specific vehicle. Only the diagnoses No fault, Air leakage, Worn bearings & Engaged brakes are considered. | function loadDiagnose(vid){
var diagnosisElem = document.getElementById("diagnosis");
while (diagnosisElem.firstChild) {
diagnosisElem.removeChild(diagnosisElem.lastChild);
}
for (i = 0; i < trucks[vid].diagnoses.length; i++){
var diagnosistext = "unrecognized";
var prognosistext;
if (trucks[vid... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"aboutVehicle() {\n if(this.hasTruckBed) {\n this.hasTruckBed = 'a truck bed'\n }\n console.log(`This vehicle is a ${this.manufacturer} ${type}. It has ${this.numWheels} wheels, ${this.numDoors} doors and ${this.hasTruckBed}.`);\n }",
"aboutVehicle() {\n console.log(`${ty... | [
"0.55500424",
"0.5269369",
"0.5217555",
"0.5187265",
"0.5152287",
"0.51270396",
"0.5006524",
"0.4863111",
"0.48565298",
"0.47534594",
"0.47390506",
"0.4709818",
"0.47082528",
"0.4701173",
"0.46895278",
"0.46633592",
"0.4658804",
"0.4625567",
"0.46195778",
"0.46026248",
"0.459... | 0.62466234 | 0 |
Open specific vehicle page | function openVehicle(vid){
//Open Specific vehicle by clicking More-btn in popup
var sections = document.getElementsByClassName("mySection");
activePage = 'vehicleDetails';
var vDetails;
for (i = 0; i < sections.length; i++) {
if (sections[i].id == 'vehicleDetails'){
vDetails = sections[i];
se... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"openFindInPage() {\n this.controller.openFindInPage();\n }",
"function openTournament(tournamentId) {\n console.log(\"In function, id=: \" + tournamentId);\n window.location.href = '../tournament/tournament.html?id=' + tournamentId;\n}",
"function openWin(obj)\n{\n name=obj.getSelected().text;\n ... | [
"0.5909865",
"0.5883238",
"0.5808898",
"0.575275",
"0.57524633",
"0.571113",
"0.5653373",
"0.56517845",
"0.5644794",
"0.5603332",
"0.5591709",
"0.55770725",
"0.5564786",
"0.5544763",
"0.55226433",
"0.55173624",
"0.55159163",
"0.5510743",
"0.5503741",
"0.5501968",
"0.5478527",... | 0.7175881 | 0 |
display tests modal when a test is clicked | function dispTestsModal(vid, test){
let testsModal = document.getElementById('testsModal');
loadTests(vid, 'testLists');
dispTest(test);
testsModal.style.display='block';
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function startTest() {\n $('#runOptions').modal('show');\n }",
"function openDeleteTestModal(name) {\n confirmModal(\"Delete\", 'testcases', ctrl.deleteTestCase, name);\n }",
"function openModal(coverage) {\n _data.status = true;\n _data.coverage = coverage;\n}",
"startTestHandelClic... | [
"0.7562035",
"0.6999608",
"0.6830898",
"0.66326416",
"0.64993614",
"0.64818025",
"0.6419066",
"0.61740255",
"0.6115798",
"0.6101055",
"0.60960966",
"0.60960966",
"0.6008645",
"0.60008276",
"0.5978808",
"0.5947968",
"0.5947968",
"0.5934801",
"0.5932404",
"0.59205097",
"0.59105... | 0.79316205 | 0 |
Base class for all controls. Parameters: element: The element from which the control was created. bind: The control's bind, or null if it is unbound. label: The control's label, or null if it has none. appearance: The appearance of the control. | function XFormControl(element, bind, innerControls, appearance) {
if (arguments.length == 0) {
return;
}
assert(element != null, "element is null");
XFormObject.call(this, element, true);
this.bind = bind;
this.label = null;
this.innerControls = innerControls;
th... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function XFormControlInstance(control, binding, htmlNode, outerBinding, position) {\r\n if (arguments.length == 0) {\r\n return;\r\n }\r\n \r\n assert(control != null, \"control is null\");\r\n assert(htmlNode != null, \"htmlNode is null\");\r\n \r\n XFormObject.call(this, control.xmlNode, false);\r\n ... | [
"0.5731323",
"0.55997705",
"0.5477807",
"0.52138555",
"0.51878417",
"0.5163968",
"0.5081206",
"0.5060649",
"0.50287205",
"0.49472812",
"0.4932608",
"0.4930171",
"0.4930171",
"0.492454",
"0.492454",
"0.492454",
"0.49171022",
"0.49160054",
"0.49033168",
"0.48738286",
"0.4864550... | 0.7042091 | 0 |
Parameters: control: The control that was rendered. binding: The XFormBinding to which the rendered control is bound, or null if the control is unbound. | function XFormControlInstance(control, binding, htmlNode, outerBinding, position) {
if (arguments.length == 0) {
return;
}
assert(control != null, "control is null");
assert(htmlNode != null, "htmlNode is null");
XFormObject.call(this, control.xmlNode, false);
this.control = c... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"validate(control) {\n return this.required ? requiredValidator(control) : null;\n }",
"validate(control) {\n return this.required ? requiredValidator(control) : null;\n }",
"validate(control) {\n return this.required ? requiredValidator(control) : null;\n }",
"function XFormCont... | [
"0.49389827",
"0.49389827",
"0.49389827",
"0.48804408",
"0.48568743",
"0.48568743",
"0.48568743",
"0.48568743",
"0.48010126",
"0.48010126",
"0.48010126",
"0.48010126",
"0.47295198",
"0.47295198",
"0.47295198",
"0.4685283",
"0.4685283",
"0.4685283",
"0.46787387",
"0.46403608",
... | 0.51758945 | 0 |
Pulls saved searches from localstorage | function getSavedSearches() {
var searchList = JSON.parse(localStorage.getItem(savedSearchesName));
lastSearchIndex = localStorage.getItem(lastSearchName);
if (searchList) {
savedSearches = searchList;
displaySavedSearches();
displayWeatherData();
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function getSearches() {\n storedSearches = JSON.parse(localStorage.getItem(\"Search Term\"));\n if (!storedSearches) {\n savedST = [];\n } else {\n savedST = storedSearches;\n STSavedSearches();\n }\n}",
"function loadSearch() {\n let storedHistory = JSON.parse(localStorage.g... | [
"0.8354337",
"0.7663376",
"0.7653147",
"0.75355",
"0.74397796",
"0.7403794",
"0.7357767",
"0.7321882",
"0.72947377",
"0.72492063",
"0.72419935",
"0.7189147",
"0.7179163",
"0.71386695",
"0.71284735",
"0.7125502",
"0.711153",
"0.7067113",
"0.69900286",
"0.693761",
"0.6937013",
... | 0.84986186 | 0 |
Saves searches to localstorage | function setSavedSearches() {
if (savedSearches.length > 0) {
localStorage.setItem(lastSearchName, lastSearchIndex);
localStorage.setItem(savedSearchesName, JSON.stringify(savedSearches));
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function savedSearches() {\n localStorage.setItem(\"savedCities\", JSON.stringify(searchedCities));\n}",
"function saveSearch() {\n \n \n localStorage.setItem(\"search-value\", teamSearch);\n console.log(saveSearch);\n }",
"function saveSearch() {\n localStorage.setItem('currentCity', JSON... | [
"0.8207676",
"0.8044303",
"0.79935646",
"0.7982559",
"0.79625547",
"0.77459896",
"0.7690127",
"0.76343447",
"0.74353945",
"0.73501956",
"0.7284459",
"0.72714543",
"0.72172505",
"0.72017276",
"0.7151018",
"0.71344966",
"0.7115111",
"0.7111072",
"0.70885026",
"0.70156395",
"0.6... | 0.80448335 | 1 |
Define la clase de articulo que tiene los atributos Codigo, Nombre, Precio. | function ArticuloClass(codigo, nombre, precio) {
this.codigo = codigo;
this.nombre = nombre;
this.precio = precio;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"constructor(nombreObjeto, apellido,altura){\n //Atributos\n this.nombre = nombreObjeto\n this.apellido = apellido\n this.altura = altura\n }",
"function Pelicula (id, titulo) {\n\n\tthis.id = id;\n\tthis.titulo = titulo;\n\n}",
"function diagnostico(id,codigo,descripcion,complica... | [
"0.7011615",
"0.6655746",
"0.6575284",
"0.6525625",
"0.65080166",
"0.6287895",
"0.62820095",
"0.6281796",
"0.62738013",
"0.6263551",
"0.62437856",
"0.62369716",
"0.62163407",
"0.62159216",
"0.62149346",
"0.61998194",
"0.6191395",
"0.61753714",
"0.6139017",
"0.6100652",
"0.607... | 0.71686864 | 0 |
Function to get the primes up to max in an array | function getPrimes(max) {
var sieve = [];
var i;
var j;
var primes = [];
for (i = 2; i <= max; ++i) {
if (!sieve[i]) {
// i has not been marked -- it is prime
primes.push(i);
for (j = i << 1; j <= max; j += i) {
sieve[j] = true;
}
}
}
re... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function getPrimes(max) {\n if (max > 0) {\n const sieve = [];\n let iCount = 0;\n let jCount = 0;\n const primes = [];\n for (iCount = 2; iCount <= max; ++iCount) {\n if (!sieve[iCount]) {\n primes.push(iCount);\n for (jCount = iCount << 1; jCount <= max; jCount += iCount) {\n ... | [
"0.74857277",
"0.72674155",
"0.7195848",
"0.7186184",
"0.7089224",
"0.7053368",
"0.7028537",
"0.6919434",
"0.6843279",
"0.6816287",
"0.67820877",
"0.67307323",
"0.66366166",
"0.65998083",
"0.6588133",
"0.65747195",
"0.65111274",
"0.6507537",
"0.6421472",
"0.6381921",
"0.63802... | 0.7287748 | 1 |
listen Starts the server with the config given by the environment variables | function listen() {
app.listen(config.port, () => {
console.log('Express server listening on %d, in %s mode', // eslint-disable-line
config.port, app.get('env'));
});
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function listen () {\n\t\n\tif (app.get('env') === 'test') return;\n \tapp.listen(port);\n \tconsole.log('Express app started on port ' + port);\n}",
"function listener() {\r\n if (logged == 1) return;\r\n logged = 1;\r\n cfg.port = app.address().port;\r\n csl.log('Server running on... | [
"0.7678177",
"0.75051886",
"0.7437582",
"0.7411284",
"0.7390748",
"0.73569834",
"0.7344949",
"0.7344949",
"0.7344949",
"0.7332535",
"0.7316486",
"0.7316174",
"0.7316174",
"0.7316174",
"0.7316174",
"0.7316174",
"0.7305463",
"0.7304851",
"0.7261475",
"0.72287714",
"0.7218982",
... | 0.77536947 | 0 |
Inserts 100 chunks of 1000 records each, timing each chunk Results: | function timeChunkedInsertionBatches(N, doc = A.from({ list: [] })) {
const batch = 1000
for (let i = 0; i < N; i++) {
let start = new Date()
const time = new Date() - start
doc = A.change(doc, s => {
const newIds = Array(batch)
.fill(0)
.map((d, j) => i * batch + j)
for (id ... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function insertChunk(chunk,i) {\n console.log(`${config.color.yellow} chunk ${++i} ${config.color.white}[ resolved ]`);\n return new Promise(function(resolve, reject) {\n records.insertMany(chunk, function(err) {\n if(err) reject(err);\n else resolve();\n });\n });\n }",
"functi... | [
"0.72786963",
"0.7235104",
"0.6993607",
"0.6833861",
"0.6781851",
"0.6472026",
"0.6457172",
"0.64279693",
"0.6308611",
"0.61122954",
"0.60051155",
"0.59514195",
"0.5859299",
"0.5848014",
"0.580559",
"0.57811624",
"0.57723904",
"0.57539964",
"0.57451624",
"0.5723052",
"0.56345... | 0.7488058 | 0 |
Gets back to previous line and continue with horizontal layout offset_from_start_x == 0 : follow right after previous item offset_from_start_x != 0 : align to specified x position (relative to window/group left) spacing_w = 0 : enforce spacing amount | SameLine(offset_from_start_x=0, spacing_w=-1)
{
let win = this.getCurrentWindow();
if (win.SkipItems)
return;
let g = this.guictx;
if (offset_from_start_x != 0)
{
if (spacing_w < 0.) spacing_w = 0.;
win.DC.CursorPos.x = win.Pos.x - win.Scr... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"moveToNextLine(line) {\n let paragraph = line.paragraph;\n let paraFormat = paragraph.paragraphFormat;\n let isParagraphStart = line.isFirstLine();\n let isParagraphEnd = line.isLastLine();\n let height = 0;\n let maxDescent = 0;\n let afterSpacing = 0;\n let... | [
"0.5995686",
"0.59710056",
"0.5943788",
"0.5943012",
"0.59368473",
"0.59190303",
"0.59076494",
"0.5885204",
"0.5869043",
"0.5834896",
"0.5807872",
"0.57587796",
"0.5720378",
"0.56659853",
"0.5655866",
"0.56139827",
"0.5566939",
"0.5503192",
"0.54893535",
"0.54770976",
"0.5468... | 0.7792164 | 0 |
text alignment notes: CursorPos is the overall arbiter text_pos = new Vec2(win.DC.CursorPos.x, win.DC.CursorPos.y + win.DC.CurrentLineTextBaseOffset); Font drawing applies it's fontmetrics to "find a baseline". CurrentLineTextBaseOffset is from the top, ie: 0 is the default. CurrentLineHeight is managed by this file (t... | AlignTextToFramePadding()
{
let win = this.getCurrentWindow();
if (win.SkipItems)
return;
let g = this.guictx;
let next = Math.max(win.DC.CurrentLineHeight,
g.FontLineHeight + g.Style.FramePadding.y * 2);
win.DC.CurrentLineHeight = next;
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function updateTextPadding() {\n var styles = wrapper.styles,\n textAlign = styles && styles.textAlign,\n x = paddingLeft + padding * (1 - alignFactor),\n y;\n \n // determin y based on the baseline\n y = basel... | [
"0.6944046",
"0.6820348",
"0.6815244",
"0.6809512",
"0.6809512",
"0.6743754",
"0.67345893",
"0.66859245",
"0.6656276",
"0.6656276",
"0.6656276",
"0.6549671",
"0.65185106",
"0.6516377",
"0.6499813",
"0.6499754",
"0.64988875",
"0.6456682",
"0.6455559",
"0.63861585",
"0.6312045"... | 0.6923834 | 1 |
AlignTextToFrameCenter may be useful in lines with a variety of font sizes. The goal is to cause Big and small fonts to share a midline (defined as Baseline / 2). The knob that governs this is "CurrentLineTextBaseOffset", and the method above only increases this value (always takes the max encountered). This method all... | AlignTextToFrameCenter(maxFontHeight)
{
let win = this.getCurrentWindow();
if (win.SkipItems)
return;
let g = this.guictx;
let ypad = g.Style.FramePadding.y;
let next = g.FontLineHeight + ypad * 2;
win.DC.CurrentLineHeight = next;
win.DC.CurrentLi... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"AlignTextToFramePadding()\n {\n let win = this.getCurrentWindow();\n if (win.SkipItems)\n return;\n\n let g = this.guictx;\n let next = Math.max(win.DC.CurrentLineHeight,\n g.FontLineHeight + g.Style.FramePadding.y * 2);\n win.DC.CurrentLineHe... | [
"0.71292675",
"0.5761216",
"0.5761216",
"0.5744945",
"0.5659162",
"0.551908",
"0.55015147",
"0.54748905",
"0.5465491",
"0.54631174",
"0.54631174",
"0.5444273",
"0.5360748",
"0.5311748",
"0.52391124",
"0.52090704",
"0.518708",
"0.5146147",
"0.51112187",
"0.49858284",
"0.496912... | 0.83737147 | 0 |
unlock horizontal starting position + capture the whole group bounding box into one "item" (so you can use IsItemHovered() or layout primitives such as SameLine() on whole group, etc.) | EndGroup()
{
let g = this.guictx;
let win = this.getCurrentWindow();
console.assert(!win.DC.GroupStack.empty(),
"Mismatched BeginGroup()/EndGroup() calls");
let group_data = win.DC.GroupStack.back();
let group_bb = new Rect(group_data.BackupCursorPos, win... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"createVisualBoundaries() {\n this.groups.forEach(item => {\n if (item.id != ID_GROUP_TOTAL) {\n this.items.add({\n group: item.id,\n start: item.end,\n end: item.end,\n type: \"background\"\n });\n }\n });\n }",
"function highlightGroupUngroup() ... | [
"0.63299644",
"0.5794855",
"0.5792012",
"0.5665804",
"0.55788773",
"0.55683756",
"0.55576015",
"0.5555248",
"0.5527756",
"0.55130684",
"0.5506973",
"0.5475851",
"0.5434794",
"0.5409243",
"0.53906107",
"0.53877056",
"0.53670174",
"0.5320927",
"0.5309686",
"0.52876097",
"0.5283... | 0.5973964 | 1 |
cursor position in window coordinates (relative to window position) User generally sees positions in window coordinates. Internally we store CursorPos in absolute screen coordinates because it is more convenient. Conversion happens as we pass the value to user, but it makes our naming convention confusing because GetCu... | GetCursorPos()
{
let win = this.getCurrentWindowRead();
return new Vec2(win.DC.CursorPos.x - win.Pos.x + win.Scroll.x,
win.DC.CursorPos.y - win.Pos.y + win.Scroll.y);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"GetCursorScreenPos()\n {\n let win = this.getCurrentWindowRead();\n return win.DC.CursorPos.Clone();\n }",
"GetCursorStartPos()\n {\n let win = this.getCurrentWindowRead();\n return Vec2.Subtract(win.DC.CursorStartPos, win.Pos);\n }",
"function appxGetCursorPos() {\r\n ... | [
"0.789616",
"0.74344146",
"0.72989404",
"0.7283284",
"0.7033037",
"0.69625276",
"0.6885021",
"0.6762407",
"0.6574666",
"0.64839184",
"0.63763434",
"0.63558584",
"0.63484704",
"0.63356316",
"0.6291299",
"0.6259569",
"0.620041",
"0.6196116",
"0.61859334",
"0.6158024",
"0.614349... | 0.81596786 | 0 |
cursor position in absolute screen coordinates [0..io.DisplaySize] (useful to work with ImDrawList API) | GetCursorScreenPos()
{
let win = this.getCurrentWindowRead();
return win.DC.CursorPos.Clone();
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"GetCursorPos()\n {\n let win = this.getCurrentWindowRead();\n return new Vec2(win.DC.CursorPos.x - win.Pos.x + win.Scroll.x,\n win.DC.CursorPos.y - win.Pos.y + win.Scroll.y);\n }",
"function appxGetCursorPos() {\r\n var c = appxFixCursorCol(ab2int32(appx_session.curr... | [
"0.73710054",
"0.7329141",
"0.72156125",
"0.7107464",
"0.70110023",
"0.69518626",
"0.68676597",
"0.68581706",
"0.6609226",
"0.6579347",
"0.65762764",
"0.65762764",
"0.65677893",
"0.65640867",
"0.6552636",
"0.64766675",
"0.64735",
"0.64614725",
"0.6404628",
"0.6392598",
"0.637... | 0.75111437 | 0 |
Advance cursor given item size for layout. | itemSize(size, text_offset_y=0)
{
let g = this.guictx;
let win = g.CurrentWindow;
if (win.SkipItems)
return;
if(size.Max != undefined)
{
// we infer that size is a Rect
size = size.GetSize();
}
// Always align ourselves on... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"nextItem() {\n\t\tif (this.cursor < this.menuData.length - 1) {\n\t\t\tthis.cursor++;\n\t\t}\n\n\t\tthis.menuData[this.cursor].focus();\n\t}",
"function increaseSize() {\n\tif (selectedShape) {\n\t\tselectedShape.resize(5);\n\t\tdrawShapes();\n\t}\n}",
"addToCursor(state, n){\n state.cursor += n\n }",
... | [
"0.57922924",
"0.5743986",
"0.55942047",
"0.5547835",
"0.5417704",
"0.5342686",
"0.5280779",
"0.5280779",
"0.5246451",
"0.5240494",
"0.5233714",
"0.51702857",
"0.5115362",
"0.51015264",
"0.51010406",
"0.50999856",
"0.5081861",
"0.50784916",
"0.50784916",
"0.50784916",
"0.5072... | 0.624247 | 0 |
On submit reset the text, close the keybord and pass the text back to the parent. | onSubmit() {
const text = this.state.text;
if (text) {
this.props.onSubmit(this.state.text);
this.updateText('');
Keyboard.dismiss();
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function clearText(e){\n\t$.originalText.value= \"\";\n\t$.originalText.focus();\n\t$.encryptedText.text = \"\";\n\t$.label2.enabled = false;\n\t$.encryptedText.enabled = false;\n}",
"finishEditingText() {\n if (!this.editingText) return;\n this.editingText.finishEditing();\n\n if (this.editingText.cont... | [
"0.63926834",
"0.6208676",
"0.6155781",
"0.6115445",
"0.6069944",
"0.60497266",
"0.6041323",
"0.602982",
"0.59964126",
"0.59448385",
"0.5894443",
"0.5887979",
"0.5860635",
"0.5841724",
"0.5838053",
"0.58346045",
"0.5828881",
"0.5795838",
"0.57778275",
"0.57768583",
"0.5770287... | 0.6736388 | 0 |
this function will be passed down to SingleStyleDetail component for rendering there make a request to back end api to delete style based on id, then return to /styles route (StyleListContainer) | handleStyleDelete(id){
const request = new Request();
request.delete('/api/styles/'+id).then(()=>{
window.location = '/styles'
})
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function destroy(req, res) {\n console.log(\"Entering style destroy(): style id = ${req.params.styleId\");\n\n db.Style.findById(req.params.styleId, function(err, style) {\n if (err) {\n console.log(`failed to find style ${req.params.styleId} from db`);\n res.sendstatus(404);\n }\n\n console.l... | [
"0.65698093",
"0.5549067",
"0.54170316",
"0.5369261",
"0.5368453",
"0.5304802",
"0.52721137",
"0.5221482",
"0.5216674",
"0.51887435",
"0.51087755",
"0.51025015",
"0.50569636",
"0.50405973",
"0.50167423",
"0.50094324",
"0.5008626",
"0.5003606",
"0.49861816",
"0.49749008",
"0.4... | 0.75861454 | 0 |
Gets the new messages and call the notify function to actually notify user | async function notifyNewMessages(auth){
try{
// Get all the new filtered messages
const newMessages=await getNewFilteredMessages(auth);
// Notify the user, desktop & console
notify(newMessages);
}
catch(err){
console.log("Error in notifyNewMessages")
throw er... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function notify(messsages){\n const totalMessages=messsages.length;\n if(totalMessages!=0){\n const notifyString=`You have ${totalMessages} new ${totalMessages==1?\"message\":\"messages\"}`;\n notifier.notify({\n title:\"GmailFilteredNotify\",\n message:notifyString\n ... | [
"0.7449229",
"0.66590154",
"0.6585424",
"0.65042645",
"0.6491128",
"0.6489955",
"0.64790887",
"0.6476097",
"0.6451661",
"0.64185137",
"0.6409372",
"0.64034164",
"0.6383262",
"0.6363759",
"0.6333853",
"0.63043153",
"0.6298602",
"0.6298602",
"0.6298602",
"0.62762415",
"0.626812... | 0.76738816 | 0 |
Given a base token tree and a target token tree, transforms the specified index from the base to the target tree. | function _getIndexChange(tokenTree, targetTokenTree, index) {
if (tokenTree.tag === 'token') {
if (targetTokenTree.tag === 'token') {
let content = tokenTree.content
let targetContent = targetTokenTree.content
return getTokenIndexChange(content, targetContent, index)
}
return targetToken... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"_rewriteAstToEmulateBaseTag(ast, docUrl) {\n const baseTag = dom5.query(ast, matchers.base);\n const p = dom5.predicates;\n // If there's no base tag, there's nothing to do.\n if (!baseTag) {\n return;\n }\n for (const baseTag of dom5.queryAll(ast, matchers.base... | [
"0.488927",
"0.4787918",
"0.46580303",
"0.4642522",
"0.45845604",
"0.45599928",
"0.4556909",
"0.45395064",
"0.45051333",
"0.44808906",
"0.44550157",
"0.44464284",
"0.44413817",
"0.44200343",
"0.43857944",
"0.43857586",
"0.43825516",
"0.43722868",
"0.43608594",
"0.43608594",
"... | 0.60326445 | 0 |
when a request comes in We look up user id in session, and assign it to the object from our database We also assign it to `locals` variable, making it available in the template directly, no need for template_vars all middleware runs FIRST. This middleware runs with each request. By having this function it helps program... | function userMiddleware(req, res, next) {
const user_id = req.session.user_id;
if (user_id) {
req.user = users[user_id];
res.locals.user = req.user; //locals makes the variable available in templates
}
//if there was a corresponding user object make it true if there wasn't anything or undefined make it ... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"initUser() {\n this.app.use(function (req, res, next) {\n res.locals.user = req.user || null;\n next();\n });\n }",
"function currentUser(request, response, next) {\n if (request.session.currentUser != null) {\n response.locals.userEmail = request.session.currentUser;\n response... | [
"0.70671964",
"0.6695087",
"0.6676071",
"0.6500606",
"0.64239913",
"0.63472885",
"0.6301011",
"0.6296741",
"0.61895",
"0.6148069",
"0.60670453",
"0.6037729",
"0.60341585",
"0.60335153",
"0.602854",
"0.60234696",
"0.6006831",
"0.59982705",
"0.59757274",
"0.5966475",
"0.5960977... | 0.7445232 | 0 |
Updates the font size of the textarea and fullcontent divs such that the text fits within these elements without overflowing. | updateScale(){
var autoscalingContentElement = $(this.refs.autoscalingContent);
var fullContentElement = $(this.refs.fullContent);
if(_.isEmpty(autoscalingContentElement) || _.isEmpty(fullContentElement)){
return;
}
var minFontSize = this.props.minFontSize || 1;
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"_updateTextSize(size) {\n this['textSize'] = parseInt(size, 10);\n this._targetEl.style.fontSize = this['textSize'] + 'px';\n this._layoutWords();\n }",
"function changeTextSize() {\n\tvar getTextBox = document.getElementById('text-area');\n\tvar getFontBox = document.getElementById('fontsize');\n\tif(... | [
"0.66078335",
"0.6540397",
"0.64105606",
"0.6380884",
"0.62700474",
"0.62649554",
"0.623665",
"0.61595315",
"0.6158095",
"0.6155164",
"0.6124171",
"0.60800564",
"0.6058501",
"0.60386336",
"0.6001323",
"0.59922945",
"0.5978887",
"0.59720427",
"0.59608203",
"0.5953683",
"0.5924... | 0.7023256 | 0 |
Loads the state boundary polygons from a GeoJSON source. | function loadMapShapes() {
// load US state outline polygons from a GeoJson file
map.data.loadGeoJson('https://storage.googleapis.com/mapsdevsite/json/states.js', { idPropertyName: 'STATE' });
// wait for the request to complete by listening for the first feature to be added
google.maps.event.addListenerOnce(m... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function loadFeatures(data) {\n var features = new OpenLayers.Format.GeoJSON().read(data);\n states.addFeatures(features);\n}",
"function loadGeoJSON() {\n const geojsonMap = JSON.parse(fs.readFileSync('/Users/hm20160509/codes/1.working/updis/UpdisWeb/tests/data.json'))\n\n const geojson = {\n 'type':... | [
"0.5747603",
"0.5682778",
"0.5418761",
"0.5402059",
"0.53691506",
"0.5272588",
"0.52721596",
"0.5267848",
"0.52275854",
"0.517313",
"0.50994456",
"0.50189775",
"0.5015727",
"0.49818814",
"0.4973852",
"0.49589548",
"0.49543393",
"0.49385867",
"0.4913078",
"0.49032664",
"0.4884... | 0.61713505 | 0 |
Build data for individual glyph | function buildGlyph(curGlyph) {
var glyphContents = "STARTCHAR " + curGlyph.slice(-1) + "\n"
+ "ENCODING " + curGlyph.slice(-1).charCodeAt(0) + "\n"
+ "SWIDTH 1000 0\n"
+ "DWIDTH 16 0\n"
+ "BBX 16 16 0 -2\n"
+ "BITMAP\n";
var bitmap = drawnGlyphs[curGlyph];
var q... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"setFromCharData(value) {\n this.fg = value[CHAR_DATA_ATTR_INDEX];\n this.bg = 0;\n let combined = false;\n // surrogates and combined strings need special treatment\n if (value[CHAR_DATA_CHAR_INDEX].length > 2) {\n combined = true;\n }\n else if (value[CH... | [
"0.607436",
"0.60741895",
"0.5900024",
"0.5810736",
"0.5769007",
"0.5720463",
"0.5720463",
"0.56907135",
"0.56497353",
"0.5588977",
"0.5573818",
"0.5573818",
"0.5573818",
"0.55603564",
"0.555174",
"0.54725385",
"0.54420495",
"0.54372156",
"0.54372156",
"0.54372156",
"0.542705... | 0.6179837 | 0 |
Check if font loaded correctly | function checkFont() {
for (glyph in drawnGlyphs) {
if (drawnGlyphs[glyph].length === 16) {
var t;
for (t=0; t<16; t++) {
if (drawnGlyphs[glyph][t].length === 16) {
continue;
}
else {
alert("Font ... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function checkIsLoaded(fontName) {\n\n if (loadedFonts.indexOf(fontName) === -1) {\n loadedFonts.push(fontName);\n loadFont(fontName);\n }\n}",
"function is_safe_font(a) {\n\n if (isUndefined(a)) {\n return false;\n }\n\n if (a.t... | [
"0.78129417",
"0.6927086",
"0.69236976",
"0.6824896",
"0.67838025",
"0.65934366",
"0.6473368",
"0.64274704",
"0.6401545",
"0.63877547",
"0.6346773",
"0.6306768",
"0.62991524",
"0.6289081",
"0.6275447",
"0.6243393",
"0.62092614",
"0.61931646",
"0.6169699",
"0.612944",
"0.61154... | 0.78046566 | 1 |
Copy text of font file | function copyFont() {
navigator.clipboard.writeText(fontArea.value);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function copyFont() {\n return gulp.src('./src/fonts/**').pipe(gulp.dest(`${distFolder}/fonts`))\n}",
"function copyFonts() {\n return src(files.fonts.src)\n .pipe(dest(files.fonts.dest))\n}",
"function copyIconFont() {\n return gulp\n .src(src + settings.copyFontFiles)\n .pipe(\n ... | [
"0.6767804",
"0.67509806",
"0.66505384",
"0.6149899",
"0.59868085",
"0.5972003",
"0.59700745",
"0.59615475",
"0.5857775",
"0.5844982",
"0.58268255",
"0.58048",
"0.5790372",
"0.577922",
"0.5771371",
"0.5756568",
"0.5748197",
"0.5746192",
"0.5720723",
"0.57061064",
"0.56962645"... | 0.7281066 | 0 |
Clear font from text field | function clearFont() {
fontArea.innerHTML = "";
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function clearText(e){\n\t$.originalText.value= \"\";\n\t$.originalText.focus();\n\t$.encryptedText.text = \"\";\n\t$.label2.enabled = false;\n\t$.encryptedText.enabled = false;\n}",
"function clearText() {\n var inputText = document.getElementById(\"inputText\");\n inputText.value = null;\... | [
"0.71949285",
"0.69420373",
"0.6892236",
"0.68183637",
"0.67909765",
"0.67240196",
"0.6650064",
"0.6638387",
"0.6610023",
"0.6544776",
"0.6468924",
"0.6457998",
"0.6449335",
"0.6444226",
"0.6402996",
"0.6402619",
"0.6371962",
"0.63663447",
"0.6354539",
"0.6341293",
"0.6341293... | 0.7699363 | 0 |
Get all regions in an array | function getAllRegions() {
var allRegions = ['All regions'];
currentCountries.map(country =>
country.region && allRegions.push(country.region));
return [...new Set(allRegions)];
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"static get regions() {\n\t\treturn [];\n\t}",
"static get regions() {\n\t\treturn [RegionGF, RegionGP, RegionMQ, RegionYT, RegionRE, RegionBL, RegionMF, RegionPM];\n\t}",
"getAllRegions() {\n return document.getElementsByClassName(A11yClassNames.REGION);\n }",
"async getCockpitRegions() {\n cons... | [
"0.76568353",
"0.731273",
"0.7190173",
"0.70221496",
"0.6777631",
"0.67586255",
"0.6621256",
"0.66108286",
"0.6562821",
"0.65441126",
"0.6501974",
"0.6332847",
"0.6272596",
"0.6190981",
"0.6084863",
"0.60241437",
"0.5996777",
"0.5953953",
"0.5939538",
"0.592616",
"0.5919645",... | 0.7569196 | 1 |
Get all unique activities in an array | function getAllActivities() {
var allActivities = [];
var allActivitiesNames = ['All activities'];
currentCountries.map(country =>
country.activities && allActivities.push(country.activities));
allActivities.map(currentActivities =>
currentActivities.length && c... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"distinct() {\n return this.reduce(\n (seen, element) => {\n if (!seen.includes(element)) {\n seen.push(element);\n }\n return seen;\n },\n []\n );\n }",
"function uniq (arr) {\n return arr.reduce((acc, current) => {\n\n if (!acc.includes(current)) {\n ... | [
"0.6965757",
"0.67529786",
"0.6676789",
"0.6675847",
"0.6666873",
"0.66520864",
"0.6639959",
"0.66111934",
"0.6599833",
"0.65887475",
"0.6570303",
"0.65590125",
"0.65540516",
"0.6542303",
"0.6539641",
"0.6538104",
"0.65369266",
"0.6533309",
"0.6532281",
"0.65073997",
"0.64870... | 0.7108231 | 0 |
image process streamized class | function image_process_streamization() {
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function image_result_streamization() {\r\n \r\n}",
"function ImageProcessor(s3Object) {\n this.s3Object = s3Object;\n}",
"function Image(obj) {\n this.obj = obj;\n this.trackFile();\n}",
"function createImageFilterStream() {\n\treturn es.map(function(image, callback) {\n\t\tisValidImage(image, f... | [
"0.7050068",
"0.6181471",
"0.60767055",
"0.5960764",
"0.58869594",
"0.5761361",
"0.57414556",
"0.5683273",
"0.5634716",
"0.56085974",
"0.5579262",
"0.5577209",
"0.5525739",
"0.54986453",
"0.5465046",
"0.54489917",
"0.54471225",
"0.5406353",
"0.5379607",
"0.53752685",
"0.53673... | 0.79348654 | 0 |
image result streamized class | function image_result_streamization() {
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function image_process_streamization() { \r\n\r\n}",
"function createImageStream(document) {\n\treturn es.readArray(getDocumentImageElements(document));\n}",
"function createImageFilterStream() {\n\treturn es.map(function(image, callback) {\n\t\tisValidImage(image, function(err, isValid) {\n\t\t\t// Ignore ... | [
"0.696485",
"0.65692765",
"0.60989",
"0.6006038",
"0.6004081",
"0.59380573",
"0.5937013",
"0.59308225",
"0.5776351",
"0.57741874",
"0.5767402",
"0.57566714",
"0.574192",
"0.57299024",
"0.5721184",
"0.5700134",
"0.56867516",
"0.56867516",
"0.56867516",
"0.5636889",
"0.5635861"... | 0.79051304 | 0 |
find how many pairs add up to sum given one array, this is an O(n) solution unlike above... | function getPairsCount(arr, sum) {
let hashMap = {};
for(let i=0; i < arr.length; i++) {
hashMap[arr[i]] = (hashMap[arr[i]] || 0) + 1;
}
let twice_count = 0;
for(let i=0; i< arr.length; i++) {
twice_count += hashMap[sum-arr[i]] || 0;
if(sum-arr[i] === arr[i]) twice_count--;
}
return twice_count/2;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function hasPairSum2(array, sum) { // time: O(n), space: O(n)\n // loop over\n const complements = new Set()\n for(let i=0; i<array.length; i++) {\n // if set has current, return true\n if (complements.has(array[i])){\n return true;\n }\n // add sum - current\n complements.... | [
"0.74237466",
"0.7380823",
"0.73647124",
"0.7334625",
"0.73048145",
"0.72925246",
"0.7287178",
"0.7257091",
"0.7237896",
"0.7228852",
"0.72185546",
"0.71850103",
"0.7183263",
"0.717628",
"0.71652174",
"0.7124714",
"0.7122003",
"0.71194905",
"0.7114997",
"0.70882845",
"0.70866... | 0.8139776 | 0 |
this function will return all pairs including dupes and can also return the amount of duped and nonduped pairs | function getPairsIncludingDupes(arr, sum) {
let hashMap = {};
let pairs = [];
for(let i=0; i < arr.length; i++) {
hashMap[arr[i]] = (hashMap[arr[i]] || 0) + 1;
}
let twice_count = 0;
for(let elem of arr) {
if(hashMap[sum - elem]) {
twice_count++;
pairs.push([elem, sum - elem])
}
if(sum-elem === elem... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function pairs(k, arr) {\n // Write a new function that doesn't use nested for loops\n const sortedArr = arr.sort((a, b) => a - b)\n\n // track each number in an object\n // unnecessary if-else logic if we know the numbers in sortedArr are all unique?\n const numElems = sortedArr.reduce((obj, item) => {\n ... | [
"0.6825647",
"0.67909026",
"0.6685492",
"0.6685241",
"0.6540089",
"0.6496515",
"0.64147407",
"0.6405153",
"0.63304585",
"0.6321936",
"0.6315258",
"0.62813824",
"0.6194185",
"0.6187612",
"0.61774784",
"0.61668456",
"0.61366254",
"0.612592",
"0.60921586",
"0.60893744",
"0.60590... | 0.7489246 | 0 |
replacing/storing the course history id | function historyReplaceID(id=null){
var state_var = {};
state_var['tab'] = 'course';
if (id != null)
state_var['id'] = id;
else if (history.state.id != undefined)
state_var['id'] = history.state.id;
if (history.state.page != undefined)
state_var['page'] = history.state.page;
history.replaceState... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"updateCourseClicked(id) {\n this.props.history.push(`/update/courses/${id}`)\n }",
"function updateHistory(cid = '', site = '', articleType = '') {\n\n}",
"addCourse(courseObj, newPosition){\n this.setState((prevState) => {\n\n // generate a unique key for the course\n co... | [
"0.61136687",
"0.60942966",
"0.57641727",
"0.57329345",
"0.5664887",
"0.5651257",
"0.55532974",
"0.5521013",
"0.54831904",
"0.54794025",
"0.5474303",
"0.5459377",
"0.5444025",
"0.54274106",
"0.5380007",
"0.5361023",
"0.53599",
"0.5342619",
"0.5342443",
"0.5328954",
"0.5328156... | 0.7479697 | 0 |
replacing/storing the course history page | function historyReplacePage(page=null){
var state_var = {};
state_var['tab'] = 'course';
if (history.state.id != undefined)
state_var['id'] = history.state.id;
if (page != null)
state_var['page'] = page;
else if (history.state.page != undefined)
state_var['page'] = history.state.page;
history.re... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function historyReplaceID(id=null){\n\t\tvar state_var = {};\n\t\tstate_var['tab'] = 'course';\n\n\t\tif (id != null)\n\t\t\tstate_var['id'] = id;\n\t\telse if (history.state.id != undefined)\n\t\t\tstate_var['id'] = history.state.id;\n\n\t\tif (history.state.page != undefined)\n\t\t\tstate_var['page'] = history.s... | [
"0.6422051",
"0.63859177",
"0.6292276",
"0.619745",
"0.61266637",
"0.608888",
"0.60769325",
"0.6009189",
"0.6006622",
"0.5991785",
"0.5991617",
"0.5988302",
"0.59827554",
"0.59611684",
"0.5910327",
"0.59077245",
"0.5893677",
"0.5887741",
"0.5871506",
"0.58644307",
"0.58344525... | 0.7296672 | 0 |
Viewing the info of the selected course | function courseInfo(course_id){
$("#info_course").load("../Tab_Course/course_info.php", {"ID":course_id},function(){
courseDeleteConfirmation();
loadEditingCourseForm();
clickPrereqSearch();
historyReplaceID(id=course_id);
$("#info_course").collapse('show');
});
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function clickedCourse(){\n\t $(\"#course_table #rows\").click(function(e){\n\t \tvar course_id = $(this).find('td:eq(0)').text();\n\t \tcourseInfo(course_id);\n\t });\t\n\t}",
"function _generateCourseInfo() {\n\t\t_getCourseInfoLayout(_renderCourseInfoMain);\n\t}",
"function showCourses() {\n\tif... | [
"0.70134777",
"0.6840767",
"0.67868596",
"0.67076445",
"0.6700189",
"0.6625337",
"0.64780015",
"0.6431698",
"0.64149684",
"0.6367072",
"0.6332085",
"0.63182545",
"0.63053656",
"0.6266093",
"0.62651885",
"0.62538",
"0.6240747",
"0.62322414",
"0.6142971",
"0.61095244",
"0.60968... | 0.7181865 | 0 |
Opening the Course Editing form | function loadEditingCourseForm(){
$(".edit_course_open_modal").click(function(){
$("#course_creating_modal").empty();
var id = $("#info_course_id").text().trim();
$("#course_editing_modal").load("../Tab_Course/course_edit.php",{
id: id
}, function(){
add_prereq();
removeAddedPrereq();
edit... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function displayEditForm() {\n\t\tlet courseId = $(this).attr('data-id');\n\t\tlet editForm = $('#editCourseForm');\n\n\t\tcoursesService.loadCourseById(courseId)\n\t\t\t.then((courseInfo) => {\n\t\t\t\teditForm.find('input[name=\"imageUrl\"]').val(courseInfo['imageUrl']);\n\t\t\t\teditForm.find('input[name=\"pric... | [
"0.7357367",
"0.71497726",
"0.6937585",
"0.6743047",
"0.66832566",
"0.66723615",
"0.66586185",
"0.66586185",
"0.6639127",
"0.6602743",
"0.6532356",
"0.6406008",
"0.6337781",
"0.6337781",
"0.63314754",
"0.62912303",
"0.6280926",
"0.6250057",
"0.6201304",
"0.619188",
"0.6134846... | 0.73854834 | 0 |
Search Possible Pre reqs on add click | function add_prereq(){
$(".add_prereq").click(function(){
searchPrereq();
$(".success_add_prereq").remove();
});
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function searchPrereq(page = 1){\n\t\tvar search = $(\"#prereq_search_input\").val().trim();\n\t\tvar course_prereps = getAddedPrereqs();\n\t\tvar id = $(\"#e_course_id\").text().trim();\n\t\t$(\"#modal_table_prereq\").load(\"../Tab_Course/prereq_search.php\", {\n\t\t\tsearch: search,\n\t\t\tpage: page,\n\t\t\tid:... | [
"0.6171265",
"0.59755075",
"0.5856828",
"0.5813045",
"0.5802339",
"0.5778371",
"0.5745299",
"0.56572604",
"0.5585141",
"0.5568614",
"0.5546521",
"0.55374885",
"0.5490877",
"0.54406804",
"0.5413406",
"0.53870857",
"0.5374445",
"0.53607106",
"0.5350512",
"0.5350288",
"0.5324527... | 0.66705287 | 0 |
Saving the Course that has been edited | function editingCourse(){
var id = $("#e_course_id").text().trim();
var code = $("#e_course_code").val().trim();
var title = $("#e_course_title").val().trim();
var unit = $("#e_units").val().trim();
var lec = $("#e_lecture").val().trim();
var lab = $("#e_laboratory").val().trim();
var req_st... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"save() {\n store.put(`schedules.saved.${this.name}`, (this.courses));\n }",
"function onModifyCourse() {\n 'use strict';\n if (lastCheckedCourse === -1) {\n\n window.alert(\"Warning: No course selected !\");\n return;\n }\n\n var course = FirebaseCourse... | [
"0.7525344",
"0.6994201",
"0.6881455",
"0.68668646",
"0.6743365",
"0.6615891",
"0.65209085",
"0.64957035",
"0.64923036",
"0.6456123",
"0.63931286",
"0.63511413",
"0.63388014",
"0.63242215",
"0.6299388",
"0.6297222",
"0.625567",
"0.62310886",
"0.61967725",
"0.6184634",
"0.6169... | 0.72185415 | 1 |
Confirmation before Saving the Edited Course | function editingConfirmation(){
$( "#formCourseEditing" ).submit(function( e ) {
e.preventDefault();
swal({
title: 'Save Changes?',
text: "Saving Course Info Changes",
icon: 'warning',
buttons:{
confirm: {
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function onModifyCourse() {\n 'use strict';\n if (lastCheckedCourse === -1) {\n\n window.alert(\"Warning: No course selected !\");\n return;\n }\n\n var course = FirebaseCoursesModule.getCourse(lastCheckedCourse);\n txtCourseNameModified.value = course.name;... | [
"0.71750027",
"0.68872714",
"0.6859344",
"0.6304277",
"0.62807024",
"0.6229332",
"0.61896735",
"0.6181207",
"0.6168263",
"0.60868007",
"0.6073582",
"0.60607594",
"0.60350674",
"0.602269",
"0.6010811",
"0.59865254",
"0.5920681",
"0.59164596",
"0.5910137",
"0.5906238",
"0.58917... | 0.72935706 | 0 |
Searching the unadded prereqs on editing | function searchPrereq(page = 1){
var search = $("#prereq_search_input").val().trim();
var course_prereps = getAddedPrereqs();
var id = $("#e_course_id").text().trim();
$("#modal_table_prereq").load("../Tab_Course/prereq_search.php", {
search: search,
page: page,
id: id,
course_prereps: course_prerep... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function add_prereq(){\n\t\t$(\".add_prereq\").click(function(){\n\t\t\tsearchPrereq();\n\t\t\t$(\".success_add_prereq\").remove();\n\t\t});\n\t}",
"function removeAddedPrereq(){\n\t\t$(\".delete-prereq\").click(function(){\n\t\t\tvar id = $(this).attr(\"id\").trim();\n\t\t\t$(\".item-prereq-\"+id).remove();\n\t... | [
"0.649645",
"0.5992304",
"0.5822394",
"0.55968815",
"0.5536623",
"0.5505642",
"0.54240364",
"0.54067004",
"0.5400377",
"0.52914727",
"0.52846915",
"0.52571446",
"0.51924026",
"0.51924026",
"0.51897085",
"0.51791465",
"0.51455635",
"0.51399034",
"0.5133233",
"0.51321656",
"0.5... | 0.6078356 | 1 |
Getting the Prereqs that are already added (for sql purposes) | function getAddedPrereqs(){
var added_prereqs = [];
$("#added_prereqs tr").each((index, elem) => {
added_prereqs.push(elem.id);
});
if(added_prereqs=="")
return ["0"];
return added_prereqs;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"_makePrereqs() {\n const prereqCells =\n Object.values(this._cells).filter(cell => !cell.isEmpty());\n const prereqs = Object.fromEntries(prereqCells.map(c => [c.id, []]));\n for (const cell of prereqCells) {\n for (const d of cell.dependents) {\n\tif (prereqs[d]) prereqs[d].push(cell.id);\n ... | [
"0.61919695",
"0.5746494",
"0.54353124",
"0.53835016",
"0.52722055",
"0.5185069",
"0.5122736",
"0.51185316",
"0.5011757",
"0.5010487",
"0.49023545",
"0.4890499",
"0.4890499",
"0.48884094",
"0.48817918",
"0.4857087",
"0.48528755",
"0.48110086",
"0.48026764",
"0.4801773",
"0.47... | 0.6806436 | 0 |
Opening the Course Creating form | function loadCreatingCourseForm(){
$(".create_course_open_modal").click(function(){
$("#course_editing_modal").empty();
$("#course_creating_modal").load("../Tab_Course/course_create.php", function(){
add_prereq();
removeAddedPrereq();
clickPrereqSearch();
creationConfirmation();
});
});
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function onCreateCourse() {\n dialogCreateCourse.showModal();\n }",
"function createCourse(ev) {\n\t\tev.preventDefault();\n\t\tlet imgInput = $(this).find('input[name=\"imageUrl\"]');\n\t\tlet priceInput = $(this).find('input[name=\"price\"]');\n\t\tlet durationInput = $(this).find('input[name=\"durat... | [
"0.81580603",
"0.6891906",
"0.6831677",
"0.6549099",
"0.6528313",
"0.64983916",
"0.6377277",
"0.635788",
"0.63521236",
"0.6232156",
"0.6215187",
"0.6205577",
"0.6149874",
"0.6087909",
"0.60779274",
"0.6009535",
"0.6009373",
"0.5981011",
"0.59444916",
"0.58965623",
"0.58527523... | 0.7224927 | 1 |
returns the direction of the ship (10, 10, 1, 1, 0) returns 0 if the direction can not be calculated (when there is only one connected hit) | function getDirectionOfShip() {
return connectedHits.length > 1 ?
connectedHits[1] - connectedHits[0] : 0;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function getDirection(x1, y1, x2, y2) {\n var dx = x2 - x1;\n var dy = y2 - y1;\n if (dx < 0) {\n if (dy < 0) return 7;\n else if (dy == 0) return 6;\n else return 5;\n }\n else if (dx == 0) {\n if (dy < 0) return 0;\n else if (dy == 0) return -1;\n else ret... | [
"0.69021195",
"0.6873615",
"0.68438625",
"0.6633054",
"0.65115035",
"0.63769233",
"0.6314277",
"0.63009506",
"0.6291244",
"0.6200707",
"0.6149006",
"0.61318445",
"0.6100284",
"0.6042285",
"0.5947621",
"0.5923145",
"0.58972055",
"0.5891917",
"0.58693546",
"0.58648735",
"0.5836... | 0.86544055 | 0 |
Method to set conversation reference. | addConversationReference(context) {
var _a;
return __awaiter(this, void 0, void 0, function* () {
const conversationReference = botbuilder_1.TurnContext.getConversationReference(context.activity);
if (((_a = conversationReference.conversation) === null || _a === void 0 ? void 0 :... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"set referenceObject(obj) {\n this._referenceObject = obj;\n }",
"set referencedClips(value) {}",
"link() {\n this._participant = this._sbolDocument.lookupURI(this._participant);\n }",
"setWrapperRef( node ) {\n\t\tthis.wrapperRef = node;\n\t}",
"setWrapperRef( node ) {\n\t\tthis... | [
"0.6132831",
"0.54228866",
"0.534178",
"0.5313806",
"0.5313806",
"0.5282623",
"0.5189099",
"0.51813793",
"0.51747745",
"0.5150963",
"0.5150963",
"0.5150963",
"0.5146431",
"0.5118624",
"0.5098928",
"0.50763893",
"0.50763893",
"0.50759786",
"0.5068286",
"0.50393844",
"0.5039384... | 0.58846396 | 1 |
Middleware to validate new user creation | function validateNewUser(req, res, next)
{
// prepare error object
const err = new Error();
err.name = "Bad Request";
err.status = 400;
if(has(req.body, 'email') == false)
{
err.message = "Missing email";
next(err);
}
if(has(req.body, 'password') == false)
{
e... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"async users_post(req, res, next) {\n try {\n let body = _.pick(req.body, ...newUserFields);\n let user = await User.create(body);\n res.send('created successfully');\n return next();\n } catch (e) {\n console.error(e);\n res.send(500, e);\n return next(false);\n }\n }",... | [
"0.6874598",
"0.68287045",
"0.6807949",
"0.68001574",
"0.6765868",
"0.67644036",
"0.67321396",
"0.67095035",
"0.6658198",
"0.66481614",
"0.66110533",
"0.6607158",
"0.65988517",
"0.6592788",
"0.6588212",
"0.6573544",
"0.6569949",
"0.6560662",
"0.6538877",
"0.6501317",
"0.64949... | 0.7278506 | 0 |
checks any changes in user authentication | function checkAuthChanges(){
ref.onAuth(function(){
if(ref.getAuth() == null){
if(window.location.href.includes("dashboard")) {
window.location.href = "login";
}
}else{
if(window.location.href.includes("login") || window.location.href.includes("sig... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"checkAuth() { }",
"function auth(user){\r\n\tif(getUserObjectByIDObject(user).password === user.password){\r\n\t\treturn true;\r\n\t}\r\n\treturn false;\r\n}",
"function checkLoginStatus() {\n firebase.auth().onAuthStateChanged(function (user) {\n if (!user) {\n // Take the use... | [
"0.7039821",
"0.67310214",
"0.6623517",
"0.65542847",
"0.65361136",
"0.6458006",
"0.64484936",
"0.64484936",
"0.64461",
"0.6439755",
"0.6425377",
"0.64227694",
"0.63856256",
"0.63716614",
"0.6360357",
"0.63542444",
"0.6351387",
"0.6348229",
"0.6291334",
"0.6275153",
"0.627447... | 0.6845331 | 1 |
HELPER FUNCTIONS / Looks at all tables and drops all temporary tables | function cleanupTables(connection, cb) {
const showTables = 'SHOW TABLES;'
connection.query(showTables, (err, result, fields) => {
if (err) {
console.log('Error showing tables.')
cb(err)
} else {
let key = 'Tables_in_LBLR_data'
console.log('key:', key)
let i
for (i = 0; ... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function dropExistingTables(tables) {\n let sql = ``\n for (var i = 0; i < tables.length;) {\n sql = `DROP TABLE IF EXISTS ${tables[i++]}; `\n queryReturn(sql, `Cleared Table: ${sql.split(' ')[4].split(';')[0]}`)\n }\n}",
"function dropTables(db) {\n db.run('DROP TABLE IF EXISTS movies'... | [
"0.66600466",
"0.65784967",
"0.65610605",
"0.6540875",
"0.64046",
"0.6395595",
"0.62466145",
"0.6137408",
"0.6097338",
"0.5990568",
"0.5906694",
"0.5894177",
"0.5853765",
"0.5826894",
"0.5792764",
"0.57846516",
"0.5778279",
"0.5723895",
"0.5622302",
"0.5622068",
"0.55980074",... | 0.69551414 | 0 |
Takes in milliseconds MS and returns it as a string formatted into minutes, seconds and milliseconds. | function time_string(ms) {
let secs = Math.floor(ms / 1000)
ms = ms - (secs * 1000)
let mins = Math.floor(secs / 60)
secs = secs - (mins * 60)
return mins.toString() + ' m ' + secs.toString() + ' s ' + ms.toString() + ' ms'
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"static formatTime(milliseconds) {\n const seconds = milliseconds / 1000;\n let s = seconds % 60;\n const m = (seconds - s) / 60;\n\n if (s < 10) {\n s = `0${s}`;\n }\n\n return `${m}:${s}`;\n }",
"function millisToMinutesAndSeconds(ms){\n var minutes = Math.floor(ms / 60000);\n ... | [
"0.8017194",
"0.7959089",
"0.78883046",
"0.7831207",
"0.7828462",
"0.77295536",
"0.76514024",
"0.75507855",
"0.7533043",
"0.75114626",
"0.74951994",
"0.7396251",
"0.733333",
"0.7301571",
"0.72880435",
"0.72829586",
"0.72800547",
"0.72749317",
"0.7249498",
"0.72263604",
"0.722... | 0.81412804 | 0 |
Takes in HEADERS and VALUES and returns a json object with headers as keys mapping to values. Assumes that values is at least as long as headers and that values are ordered as needed for the mapping. | function make_obj(headers, values) {
let objects = []
for (v of values) {
let obj = []
for (let i = 0; i < headers.length; i ++) {
obj[headers[i]] = v[i]
}
objects.push(obj)
}
return objects
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function headersToObject(headers) {\n var headersObject = {};\n headers.forEach(function (value, name) {\n var isMultiValue = !singleValueHeaders.includes(name.toLowerCase()) && value.includes(',');\n headersObject[name] = isMultiValue\n ? value.split(',').map(function (s) { return s... | [
"0.6313172",
"0.6313172",
"0.5951062",
"0.5951062",
"0.5951062",
"0.5951062",
"0.5951062",
"0.5951062",
"0.5951062",
"0.5951062",
"0.5951062",
"0.5951062",
"0.5951062",
"0.5951062",
"0.5951062",
"0.5951062",
"0.5951062",
"0.5951062",
"0.5951062",
"0.5951062",
"0.5951062",
"... | 0.69292 | 0 |
Creates a table with NAME and columns given by EXAMPLE_DATA using CONNECTION. Accepts a CALLBACK to pass on errors, otherwise returns nothing. | function create_table(name, example_data, unique_keys = [], connection, callback) {
let create_query = 'CREATE TABLE ' + name + ' '
const keys = Object.keys(example_data)
let cols = []
for (k of keys) {
let col_string = k
if (typeof example_data[k] === 'number') {
if (example_data[k] > 0) {
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function createTable() {\n\n db.transaction(function (tx) { tx.executeSql(createStatement, [], showRecords, onError); });\n\n}",
"function createTable() {\n const sql = `CREATE TABLE ${table} (c1 int, c2 int)`;\n const request = new Request(sql, (err, rowCount) => {\n if (err) {\n throw err;\n }\... | [
"0.67070943",
"0.669812",
"0.6540037",
"0.6530531",
"0.6515779",
"0.6402902",
"0.6381249",
"0.63518834",
"0.633107",
"0.63252556",
"0.63252556",
"0.63252556",
"0.63252556",
"0.63252556",
"0.63252556",
"0.6324503",
"0.62768394",
"0.6266759",
"0.62369674",
"0.61908615",
"0.6180... | 0.7514492 | 0 |
Drops table with NAME using CONNECTION. Accepts a CALLBACK to pass on errors, otherwise returns nothing. | function drop_table(name, connection, callback) {
const drop_query = 'DROP TABLE ' + name
connection.query(drop_query, (err, result) => {
if (err) {
callback(err)
} else {
callback(null)
}
})
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function dropTable(tableName) {\n conn.query(\"Drop Table \" + tableName, function(err, result, fields) {\n if (err) throw err;\n console.log('Dropped Table ' + tableName);\n });\n}",
"drop_table(table_name){\n\t\tvar drop_table_query = \"DROP TABLE \" + table_name + \";\";\n\t\tthis.sqlite3_... | [
"0.72460765",
"0.709959",
"0.70358115",
"0.6758778",
"0.66365343",
"0.6629075",
"0.6526731",
"0.6396209",
"0.63531595",
"0.6315976",
"0.6196974",
"0.6139282",
"0.61243254",
"0.6034092",
"0.5947362",
"0.5934142",
"0.5835764",
"0.58215433",
"0.5758096",
"0.5746076",
"0.5732434"... | 0.80147314 | 0 |
Read in a csv file at FILEPATH. Requires a CALLBACK to pass on the data. Returns the file data through the callback as OUTPUT. File data is formatted as an array of lines of file data. | function read_csvfile(filepath, callback) {
const output = []
try {
fs.createReadStream(filepath)
.pipe(csv_parser({delimiter: ':'}))
.on('data', function(row) {
output.push(row[0].split(','))
})
.on('end',function() {
callback(null, output)
})
} catch (err) {
callback(e... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function getFileData(file, callback) {\n var data = [];\n var reader = new FileReader();\n\n reader.onload = function(event) {\n var csv = Papa.parse(event.target.result);\n csvData = csv.data;\n var headerRow = csvData[0];\n for (var i = 1; i < csvData.length; i++) {\n ... | [
"0.68613577",
"0.6731145",
"0.66839236",
"0.6436169",
"0.6315002",
"0.6300055",
"0.62833136",
"0.6247814",
"0.61906457",
"0.6076713",
"0.60177904",
"0.59373945",
"0.5929138",
"0.59113705",
"0.5874373",
"0.5817952",
"0.57445717",
"0.57437694",
"0.5629387",
"0.55982554",
"0.558... | 0.7313201 | 0 |
Read in multiple csv files containing data split across files (assumes that the data is formatted the same across files). Files are given by an array of strings FILEPATHS. Requires a CALLBACK to pass on the data. Returns the file data through the callback as OUTPUT. Returns null if no filepaths passed in. | function read_csvfiles(filepaths, callback) {
async.map(filepaths,
(fp, map_callback) => {
read_csvfile(fp, (err, output) => {
if (err) {
map_callback(err)
} else {
map_callback(null, output)
}
})
},
(err, result) => {
if (err) {
callback(err)
} else {
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function handleReadMoreFiles(files, errArr, dataArr, callback) {\n\t// shift file 0\n\tconst FILE0 = files.shift();\n\n\t// base case: if file 0 defined\n\tif (!FILE0) {\n\t\t// if no file 0, then callback\n\t\treturn callback(errArr, ...dataArr);\n\t} // if (!file0)\n\n\t// inductive step: read the file\n\thandle... | [
"0.6284994",
"0.6212025",
"0.5950061",
"0.5928147",
"0.5698308",
"0.5659935",
"0.56348497",
"0.55809784",
"0.5468445",
"0.5452885",
"0.53877944",
"0.5307409",
"0.5240332",
"0.52392846",
"0.5215326",
"0.5207624",
"0.5168896",
"0.51672566",
"0.49275094",
"0.48905876",
"0.487163... | 0.7868744 | 0 |
Read in a json file at FILEPATH. Requires a CALLBACK to pass on the data. Returns the file data through the callback as OUTPUT. File data is formatted as an array of lines of file data. | function read_jsonfile(filepath, callback) {
fs.readFile(filepath, (err, file_data) => {
if (err) {
callback(err)
} else {
let output
try {
output = JSON.parse(file_data)
console.log('Read in json file: ' + filepath)
} catch (err) {
callback(err)
}
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function readJSON(filename, callback){\n // If a callback is provided, call it with error as the\n // first argument and result as the second argument,\n // then return `undefined`. If no callback is provided,\n // just return the promise.\n return readFile(filename, 'utf8')\n .then(JSON.p... | [
"0.7282354",
"0.7277981",
"0.72656417",
"0.7164961",
"0.70985967",
"0.70617086",
"0.695508",
"0.68007773",
"0.67511857",
"0.67507607",
"0.6735059",
"0.6699673",
"0.6664366",
"0.6561419",
"0.65554315",
"0.65547574",
"0.65478784",
"0.6546312",
"0.6482972",
"0.64222753",
"0.6404... | 0.7454321 | 0 |
Insert an array of OBJECTS into TABLE using CONNECTION. Assumes objects are correctly formatted for insert. Accepts a CALLBACK to pass on errors, otherwise returns nothing. | function insert_table(objects, table, connection, ignore = false, duplicate = '', callback) {
if (objects && objects.length) {
const keys = Object.keys(objects[0])
const cols = bracket(keys)
let insert_query
if (ignore) {
insert_query = 'INSERT IGNORE INTO ' + table + ' ' + cols + ' VALUES ?'
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function insertMultiple2_withCB(MONGO_URI, dbName, collectionName, objToInsert, cbFunction) {\r\n\r\n MONGO_CLIENT.connect(MONGO_URI, { useUnifiedTopology: true }, function (err, db) {\r\n if (err) throw err;\r\n var dbo = db.db(dbName);\r\n dbo.collection(collectionName).insertMany(objToInsert, function... | [
"0.63955486",
"0.6030737",
"0.58866173",
"0.57965916",
"0.5733702",
"0.5695256",
"0.5689663",
"0.56576157",
"0.5593997",
"0.5539297",
"0.5528081",
"0.54950756",
"0.5494837",
"0.54745233",
"0.5463512",
"0.5400251",
"0.53966063",
"0.5360456",
"0.53399825",
"0.5331126",
"0.53078... | 0.6578627 | 0 |
Read in multiple error json files containing data split across files (assumes that the data is formatted the same across files). Files are given by an array of strings FILEPATHS. Inserts all of the entries into TABLE using CONNECTION. Requires a CALLBACK to pass on the number of errors inserted. | function insert_errorfiles(filepaths, table, connection, callback) {
if (filepaths && filepaths.length) {
async.waterfall([
// Read in files
function read_json(wcb) {
async.map(filepaths,
(fp, map_callback) => {
read_jsonfile(fp, (err, filepath, output) => {
if (... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function batch(filepaths, userid_table, id, connection, callback) {\n const json_table = 'errors_json' + '_' + id.toString()\n console.log('PROCESSING BATCH ' + id)\n \n async.waterfall([\n // Create tables\n function create_json(cb) {\n create_table(json_table, error_example, undefined, connectio... | [
"0.6930879",
"0.5843888",
"0.5802189",
"0.5762271",
"0.5615641",
"0.54906416",
"0.5482289",
"0.5422328",
"0.5395647",
"0.53811675",
"0.5365641",
"0.5326786",
"0.53021574",
"0.5249825",
"0.5231845",
"0.5220623",
"0.5210858",
"0.5185664",
"0.5178002",
"0.5119815",
"0.50817513",... | 0.819017 | 0 |
Takes in a code STR and replaces the colons with underscores, removes quotation marks | function clean_code(str) {
let ret = JSON.stringify(str).replace(/:/gi, '_')
ret = JSON.stringify(ret).replace(/"/gi, '')
if (ret.slice(0, 1) === ' ') {
ret = ret.slice(1)
}
if (ret.slice(-1) === ' ') {
ret = ret.slice(0, -1)
}
return ret
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function translate(str){\r\n\treturn str.replace(\"_\",\" \");\r\n}",
"function formatstring(str){\n\treturn str.replace(/ /g,\"_\");\n}",
"function cssUnescapeString(str) {\n\treturn str.replace(\"_\", \"'\");\n}",
"function codeStrings(_str) {\r\n\r\n var strTemp = _str;\r\n strTemp= strTemp.replace(... | [
"0.66647464",
"0.63641036",
"0.63377523",
"0.6279828",
"0.6279828",
"0.61889464",
"0.61804724",
"0.6114114",
"0.6079731",
"0.6065354",
"0.5959654",
"0.59452003",
"0.5939841",
"0.5909958",
"0.5884032",
"0.5879344",
"0.5862247",
"0.5769386",
"0.57690644",
"0.57668215",
"0.57647... | 0.7257864 | 0 |
Takes in a list of ERRORS and returns an array of clusters formed by essence matching. | function t1_clustering(errors) {
const clusters = []
for (error of errors) {
if (clusters.length == 0) {
const first = []
first.push(error)
clusters.push(first)
} else {
let in_cluster = false
for (cluster of clusters) {
const prototype = cluster[0]
if (prototyp... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function t2_convert(errors, callback) {\n const t2_clusters = []\n for (e of errors) {\n let cluster = []\n cluster.push(e)\n t2_clusters.push(cluster)\n }\n callback(null, t2_clusters)\n}",
"function resolveClusters() {\n //Encontra os Matchs\n findClusters();\n //Enquanto houv... | [
"0.5947615",
"0.5687337",
"0.55828357",
"0.5505576",
"0.53527063",
"0.53527063",
"0.526906",
"0.526906",
"0.52220315",
"0.51121515",
"0.50923866",
"0.49900806",
"0.49564102",
"0.48813507",
"0.48377192",
"0.4828953",
"0.48147485",
"0.48125622",
"0.48056382",
"0.47948763",
"0.4... | 0.7679493 | 0 |
Processes a batch of json error files given by JSON_FPATHS containing ~250,000 errors. Inserts the errors into UUID TABLE with processing ID using CONNECTION. Hardcoded examples of error and io data. Accepts a CALLBACK to pass on errors, otherwise returns nothing. | function batch(filepaths, userid_table, id, connection, callback) {
const json_table = 'errors_json' + '_' + id.toString()
console.log('PROCESSING BATCH ' + id)
async.waterfall([
// Create tables
function create_json(cb) {
create_table(json_table, error_example, undefined, connection, (err, res... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function insert_errorfiles(filepaths, table, connection, callback) {\n if (filepaths && filepaths.length) {\n async.waterfall([\n // Read in files\n function read_json(wcb) {\n async.map(filepaths, \n (fp, map_callback) => {\n read_jsonfile(fp, (err, filepath, output) => {\n ... | [
"0.76308346",
"0.61278945",
"0.61046946",
"0.56206805",
"0.55919564",
"0.54896015",
"0.53407335",
"0.53282607",
"0.53249127",
"0.5193624",
"0.508863",
"0.5022854",
"0.5003693",
"0.4984646",
"0.49761868",
"0.4949158",
"0.4888846",
"0.4887379",
"0.48782313",
"0.48754588",
"0.48... | 0.75663495 | 1 |
Processes BATCHES to insert errors into UUID_TABLE with COUNT as a batch processing ID using CONNECTION. Aggregates the errors in UUID_TABLE. Requires a callback to pass on errors. | function batch_sync(batches, userid_table, connection, callback) {
async.waterfall([
// Process the files and insert into userid_table
function process(cb) {
batch_rec(batches, userid_table, 0, connection, (err) => {
if (err) {
callback(err)
} else {
callback(null)
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function batch(filepaths, userid_table, id, connection, callback) {\n const json_table = 'errors_json' + '_' + id.toString()\n console.log('PROCESSING BATCH ' + id)\n \n async.waterfall([\n // Create tables\n function create_json(cb) {\n create_table(json_table, error_example, undefined, connectio... | [
"0.70659596",
"0.5856587",
"0.58406514",
"0.5800926",
"0.57141745",
"0.5444951",
"0.53819215",
"0.53128",
"0.5284399",
"0.527636",
"0.5226061",
"0.52257",
"0.52200484",
"0.52200043",
"0.51041144",
"0.5066396",
"0.5062628",
"0.50184095",
"0.50129336",
"0.50028515",
"0.49953803... | 0.6773723 | 1 |
Makes a dictionary mapping hashes to their associated cluster value using T2 CLUSTERS. Requires a CALLBACK to pass on the dictionary. | function mk_hash_dict(t2_clusters, connection, callback) {
const essence_dict = {}
let count = 0
for (cluster of t2_clusters) {
for (error of cluster) {
essence_dict[error['essence']] = count
}
count ++
}
const select_map = 'SELECT * FROM ' + run_map
connection.query(select_map, (err, res... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"map(callback) {\n const keys = this.keys.concat([]);\n const values = this.keys.map((key, i) => callback(key, this.values[i]));\n return new this.constructor(keys, values);\n }",
"function get_prototypes(t2_clusters, connection, callback) {\n mk_hash_dict(t2_clusters, connection, (err, h... | [
"0.5288491",
"0.51086533",
"0.50131726",
"0.4950822",
"0.4950822",
"0.4950822",
"0.48281932",
"0.47136378",
"0.47136378",
"0.46835724",
"0.46805435",
"0.46626568",
"0.46272984",
"0.46217147",
"0.46174362",
"0.45967257",
"0.4580405",
"0.4576644",
"0.45744064",
"0.45607108",
"0... | 0.6483969 | 0 |
Returns a list of prototypes corresponding to each cluster in T2 CLUSTERS. Passes on CONNECTION to get_prototypes. Requires a CALLBACK to pass on PROTOTYPES. | function get_prototypes(t2_clusters, connection, callback) {
mk_hash_dict(t2_clusters, connection, (err, hash_dict) => {
if (err) {
callback(err)
} else {
const select_query = 'SELECT * FROM ' + userid_table;
connection.query(select_query, (err, result, fields) => {
if (err) {
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function module4(t2_clusters, connection, callback) {\n async.waterfall([\n function setup(cb) {\n if (t2_clusters) {\n console.log('Passed on T2 Clusters.')\n cb(null, t2_clusters)\n } else {\n recover_clusters(__dirname + '/t2_clusters.json', (err, clusters) => {\n if ... | [
"0.509535",
"0.47897848",
"0.46276724",
"0.45989278",
"0.45491913",
"0.45441398",
"0.4543338",
"0.45057398",
"0.4495753",
"0.44906512",
"0.44826102",
"0.4473964",
"0.44669175",
"0.44449854",
"0.4430542",
"0.4403685",
"0.4399669",
"0.43963572",
"0.43718964",
"0.43608537",
"0.4... | 0.7224312 | 0 |
Recovers Tier 2 clusters in Module 4 setup at FILEPATH. Requires a callback to return the clusters. | function recover_clusters(filepath, callback) {
read_jsonfile(filepath, (err, fp, output) => {
if (err) {
callback(err)
} else {
callback(null, output)
}
})
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"async function load_clusters() {\n\n}",
"function module4(t2_clusters, connection, callback) {\n async.waterfall([\n function setup(cb) {\n if (t2_clusters) {\n console.log('Passed on T2 Clusters.')\n cb(null, t2_clusters)\n } else {\n recover_clusters(__dirname + '/t2_clusters... | [
"0.6215993",
"0.6127128",
"0.54886574",
"0.5397027",
"0.53664076",
"0.53664076",
"0.52264553",
"0.49705535",
"0.48756692",
"0.48563528",
"0.4626811",
"0.46174133",
"0.45806825",
"0.4573808",
"0.45417702",
"0.45030478",
"0.44963253",
"0.44583675",
"0.4453785",
"0.44484374",
"0... | 0.64145166 | 0 |
Select training data batch from TABLE using CONNECTION with ID giving offset (id join_size) in the master table. Write the data into FOLDER. Accepts a CALLBACK to pass on errors, otherwise returns nothing. | function select_and_write_training(table, id, folderpath, connection, callback) {
const to_write = folderpath + '/training_data_' + id.toString() + '.csv'
const select_training1 = 'WITH temp AS (SELECT * FROM ' + table + ' WHERE ' + table + '.classification IS NOT NULL LIMIT ' + join_size + ' OFFSET ' + (id * join_... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function batch_sync(batches, userid_table, connection, callback) {\n async.waterfall([\n // Process the files and insert into userid_table\n function process(cb) {\n batch_rec(batches, userid_table, 0, connection, (err) => {\n if (err) {\n callback(err)\n } else {\n call... | [
"0.5854235",
"0.56437314",
"0.56227756",
"0.5430232",
"0.5298103",
"0.5208975",
"0.51787126",
"0.5117262",
"0.50454175",
"0.49615866",
"0.49143964",
"0.48981363",
"0.47695827",
"0.47382167",
"0.46817598",
"0.46627146",
"0.46180573",
"0.461518",
"0.45725322",
"0.45643845",
"0.... | 0.7285499 | 0 |
Appends TO_WRITE to FILENAME. Accepts a CALLBACK to pass on errors, otherwise returns nothing. | function append_file(filename, to_write, callback) {
fs.appendFile(filename, to_write, (err) => {
if (err) {
callback(err)
} else {
callback(null)
}
})
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function onWritten(writeErr) {\n var flags = fo.getFlags({\n overwrite: optResolver.resolve('overwrite', file),\n append: optResolver.resolve('append', file),\n });\n if (fo.isFatalOverwriteError(writeErr, flags)) {\n return callback(writeErr);\n }\n\n callback(null, f... | [
"0.6565381",
"0.62418324",
"0.6045085",
"0.58066195",
"0.57959265",
"0.5741196",
"0.5629052",
"0.5609742",
"0.55644065",
"0.55474365",
"0.5499254",
"0.5454946",
"0.54548794",
"0.54548794",
"0.54548794",
"0.54548794",
"0.54548794",
"0.54548794",
"0.54548794",
"0.54548794",
"0.... | 0.6816116 | 0 |
Creates the create table statement to be written using TABLE_NAME and RESULTS. Store TABLE_NAME's field information in FIELD_NAMES. | function create_table_statement(table_name, results, field_names) {
statement = 'CREATE TABLE ' + table_name + ' (\n'
field_names[table_name] = []
for (let i = 0; i < results.length; i++) {
field_names[table_name].push(results[i].Field)
statement += ' ' + results[i].Field + ' ' + results[i].Type.toUpper... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function write_create_tables(filename, connection, table_names, field_names, callback) {\n if (table_names && table_names.length) {\n let name = table_names.shift()\n write_create_table(filename, connection, name, field_names, (err, ret_fnames) => {\n if (err) {\n console.log('Error making ' + n... | [
"0.71921813",
"0.7059665",
"0.68582046",
"0.6792824",
"0.6627168",
"0.6617882",
"0.64316726",
"0.63944304",
"0.63706225",
"0.6348709",
"0.63199806",
"0.6296379",
"0.61755836",
"0.6115767",
"0.60198605",
"0.5989204",
"0.5986084",
"0.59818274",
"0.59607506",
"0.59514666",
"0.59... | 0.845523 | 0 |
Write a single create table statement for TABLE_NAME to FILENAME with FIELD_NAMES. Uses CONNECTION to query database for TABLE_NAME's field information and FIELD_NAMES to store the data. Requires a CALLBACK to pass on errors and field_names. | function write_create_table(filename, connection, table_name, field_names, callback) {
let query = 'DESCRIBE ' + table_name
connection.query(query, (err, results, fields) => {
if (err) {
callback(err)
} else {
let ret = create_table_statement(table_name, results, field_names)
let to_write ... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function write_create_tables(filename, connection, table_names, field_names, callback) {\n if (table_names && table_names.length) {\n let name = table_names.shift()\n write_create_table(filename, connection, name, field_names, (err, ret_fnames) => {\n if (err) {\n console.log('Error making ' + n... | [
"0.8167967",
"0.7013665",
"0.6795856",
"0.6537759",
"0.64417064",
"0.6392481",
"0.63858",
"0.63707",
"0.63295144",
"0.6320171",
"0.61852777",
"0.61365193",
"0.6121679",
"0.60999155",
"0.60999155",
"0.60999155",
"0.60999155",
"0.60999155",
"0.60999155",
"0.6052367",
"0.6038855... | 0.80605805 | 1 |
Write create table statements for TABLE_NAMES into FILENAME. Uses CONNECTION to query database for field information and FIELD_NAMES to store the data. Requires a CALLBACK to pass on errors and field_names. | function write_create_tables(filename, connection, table_names, field_names, callback) {
if (table_names && table_names.length) {
let name = table_names.shift()
write_create_table(filename, connection, name, field_names, (err, ret_fnames) => {
if (err) {
console.log('Error making ' + name + ' cr... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function write_create_table(filename, connection, table_name, field_names, callback) {\n let query = 'DESCRIBE ' + table_name\n connection.query(query, (err, results, fields) => {\n if (err) {\n callback(err)\n } else {\n let ret = create_table_statement(table_name, results, field_names)\n l... | [
"0.78139627",
"0.6861071",
"0.6806612",
"0.6618433",
"0.651323",
"0.64563143",
"0.64109606",
"0.63431495",
"0.6285459",
"0.6280931",
"0.625625",
"0.6227131",
"0.61780393",
"0.6173759",
"0.607957",
"0.6049348",
"0.6030646",
"0.60011417",
"0.59844244",
"0.5981967",
"0.5950291",... | 0.8352472 | 0 |
Creates the insert into statement to be written using TABLE_NAME and RESULTS and FIELD_NAMES | function insert_into_statement(table_name, result, field_names) {
let statement = 'INSERT INTO ' + table_name + ' ('
let cols = field_names[table_name]
for (let i = 0; i < cols.length; i++) {
statement += cols[i]
if (i < cols.length - 1) {
statement += ', '
}
else {
statement += ')\n'... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function write_insert_into(filename, connection, table_name, field_names, callback) {\n let select_query = 'SELECT * FROM ' + table_name\n connection.query(select_query, (err, result, _fields) => {\n if (err) {\n callback(err)\n } else {\n let statement = insert_into_statement(table_name, result,... | [
"0.67792344",
"0.66440046",
"0.6588859",
"0.65231025",
"0.6498335",
"0.64781404",
"0.63771564",
"0.63408804",
"0.6253245",
"0.62179536",
"0.60067034",
"0.5919716",
"0.5802665",
"0.5704486",
"0.57018363",
"0.5694892",
"0.569044",
"0.56792164",
"0.5672553",
"0.56713665",
"0.563... | 0.78446496 | 0 |
Write insert into statements for TABLE_NAME into FILENAME. Uses CONNECTION to query database for rows and FIELD_NAMES to store TABLE_NAMES' field data. Accepts a CALLBACK to pass on errors, otherwise returns nothing. | function write_insert_into(filename, connection, table_name, field_names, callback) {
let select_query = 'SELECT * FROM ' + table_name
connection.query(select_query, (err, result, _fields) => {
if (err) {
callback(err)
} else {
let statement = insert_into_statement(table_name, result, field_name... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function write_insert_intos(filename, connection, table_names, field_names, callback) {\n if (table_names && table_names.length) {\n let name = table_names.shift()\n write_insert_into(filename, connection, name, field_names, (err) => {\n if (err) {\n console.log('Error making ' + name + ' insert... | [
"0.7768939",
"0.6581975",
"0.627187",
"0.6221827",
"0.58771354",
"0.52747613",
"0.527432",
"0.5210583",
"0.52004904",
"0.5175454",
"0.51438",
"0.5096025",
"0.508812",
"0.5042416",
"0.49761444",
"0.49633437",
"0.4886376",
"0.48690125",
"0.4847448",
"0.48394978",
"0.48290703",
... | 0.788929 | 0 |
Write insert into statements for TABLE_NAMES into FILENAME. Uses CONNECTION to query database for rows and FIELD_NAMES to store TABLE_NAMES' field data. Accepts a CALLBACK to pass on errors, otherwise returns nothing. | function write_insert_intos(filename, connection, table_names, field_names, callback) {
if (table_names && table_names.length) {
let name = table_names.shift()
write_insert_into(filename, connection, name, field_names, (err) => {
if (err) {
console.log('Error making ' + name + ' insert into stat... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function write_insert_into(filename, connection, table_name, field_names, callback) {\n let select_query = 'SELECT * FROM ' + table_name\n connection.query(select_query, (err, result, _fields) => {\n if (err) {\n callback(err)\n } else {\n let statement = insert_into_statement(table_name, result,... | [
"0.76098084",
"0.69130796",
"0.62752265",
"0.61599034",
"0.5737396",
"0.534259",
"0.5275142",
"0.5267813",
"0.52164745",
"0.5188933",
"0.5187515",
"0.50548136",
"0.50529236",
"0.5023213",
"0.49024385",
"0.4829837",
"0.47888333",
"0.47838098",
"0.4781814",
"0.4768811",
"0.4748... | 0.7765145 | 0 |
Helper function for read flags validation. Returns 0 if REPLY has valid flags. Returns 1 if REPLY had too many arguments. Returns 2 if the flags are not formatted correctly. | function read_flags(reply) {
const module_flags = ['--modules=all', '--modules=1', '--modules=2', '--modules=3', '--modules=4']
if (reply.length > 2) {
return 1
} else if (reply.length == 2) {
if (module_flags.includes(reply[1])) {
return 0
} else {
return 2
}
} else {
return 0
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"validateFlags (flags) {\n // console.log(`flags: ${JSON.stringify(flags, null, 2)}`)\n\n // Exit if wallet not specified.\n const name = flags.name\n if (!name || name === '') {\n throw new Error('You must specify a wallet with the -n flag.')\n }\n\n const qty = flags.qty\n if (isNaN(Numb... | [
"0.5874517",
"0.5670869",
"0.5452085",
"0.5355052",
"0.5311761",
"0.5195768",
"0.513155",
"0.51183623",
"0.5046294",
"0.49711433",
"0.49549833",
"0.49327224",
"0.4920053",
"0.48934427",
"0.48867673",
"0.48769346",
"0.48399508",
"0.48102772",
"0.48102772",
"0.48102772",
"0.481... | 0.6267788 | 0 |
Helper function for the read option in select_loop. Takes in LISTENER to grab user input if IO_FNAME is not well formed. Requires a CALLBACK to return IO_FNAME if valid file and exists, otherwise returns null after too many ATTEMPTS. | function select_loop_read_io(listener, folderpath, io_fname, attempts, callback) {
if (attempts > 4) {
callback(null)
} else {
let valid = is_alphanum(io_fname)
let dne = false
let usable = false
if (valid) {
let filepath = folderpath + '/' + io_fname
exists = fs.existsSync(filepath)... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function select_loop_read_fol(listener, folder_name, attempts, callback) {\n if (attempts > 4) {\n callback(null, null)\n } else {\n let valid = is_path(folder_name)\n let dne = false\n let usable = false\n if (valid) {\n let folderpath = __dirname + '/' + folder_name\n exists = fs.exist... | [
"0.6000377",
"0.57488525",
"0.5229137",
"0.5024565",
"0.5012649",
"0.49493724",
"0.491409",
"0.48696765",
"0.4847828",
"0.4817603",
"0.48077044",
"0.47520182",
"0.47511232",
"0.47505262",
"0.47432515",
"0.47044826",
"0.46969947",
"0.46887958",
"0.46663192",
"0.46510202",
"0.4... | 0.66196024 | 0 |
Helper function for the read option in select_loop. Takes in LISTENER to grab user input if FOLDER_NAME is not well formed. Returns FOLDER, IO_FNAME if both usable, otherwise returns null after too many ATTEMPTS. | function select_loop_read_fol(listener, folder_name, attempts, callback) {
if (attempts > 4) {
callback(null, null)
} else {
let valid = is_path(folder_name)
let dne = false
let usable = false
if (valid) {
let folderpath = __dirname + '/' + folder_name
exists = fs.existsSync(folderpa... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function select_loop_read_io(listener, folderpath, io_fname, attempts, callback) {\n if (attempts > 4) {\n callback(null)\n } else {\n let valid = is_alphanum(io_fname)\n let dne = false\n let usable = false\n if (valid) {\n let filepath = folderpath + '/' + io_fname\n exists = fs.exists... | [
"0.61885065",
"0.5644804",
"0.51664174",
"0.49849522",
"0.4981474",
"0.48553967",
"0.482324",
"0.48179433",
"0.47423154",
"0.47158605",
"0.4675818",
"0.46638703",
"0.46378672",
"0.46155408",
"0.45779386",
"0.4542802",
"0.4513742",
"0.450754",
"0.45045254",
"0.44627422",
"0.44... | 0.6518143 | 0 |
Helper function for the label option in select_loop. Takes in LISTENER to grab user input if REPLY is not well formed. Requires a CALLBACK to return path when user PATH links to a valid file, otherwise returns null after too many ATTEMPTS. | function select_loop_label(listener, path, attempts, callback) {
if (attempts > 4) {
callback(null)
} else {
if (fs.existsSync(path)) {
callback(path)
} else {
console.log()
console.log('dp: No such file found. Please try again.\n')
listener.question('', (path_1) => {
pat... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function select_loop_get_tr(listener, fname, attempts, callback) {\n if (attempts > 4) {\n callback(null)\n } else {\n let valid = is_alphanum(fname)\n let dne = false\n let usable = false\n if (valid) {\n const folderpath = '/var/lib/docker/volumes/CABINET/_data/DataPipeline'\n let file... | [
"0.59026647",
"0.5719186",
"0.55038744",
"0.5155272",
"0.5115532",
"0.5089036",
"0.48698577",
"0.48668092",
"0.48622647",
"0.48308718",
"0.47978967",
"0.4780726",
"0.47542113",
"0.47465375",
"0.47350767",
"0.47079968",
"0.4700909",
"0.47005844",
"0.46817577",
"0.46633285",
"0... | 0.6856737 | 0 |
Helper function for the get training option in select loop. Takes in LISTENER to grab user input if FNAME is not well formed. Requires a CALLBACK to pass on fname when FNAME is a valid filename and does not already exist, otherwise returns null after too many ATTEMPTS | function select_loop_get_tr(listener, fname, attempts, callback) {
if (attempts > 4) {
callback(null)
} else {
let valid = is_alphanum(fname)
let dne = false
let usable = false
if (valid) {
const folderpath = '/var/lib/docker/volumes/CABINET/_data/DataPipeline'
let filepath = folderp... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function detectFilename() \n{\n\t$('.upload-wrap input[type=\"file\"]').on('change', function() \n\t{\n\t\tvar filename = $(this).val();\n\t\tvar lastIndex = filename.lastIndexOf(\"\\\\\");\n\t\tif (lastIndex >= 0) \n\t\t{\n\t\t\tfilename = filename.substring(lastIndex + 1);\n\t\t}\n\t\t$(this).prev().find('.unedi... | [
"0.5315385",
"0.52298784",
"0.519525",
"0.5106261",
"0.5040232",
"0.50075525",
"0.49772763",
"0.49671808",
"0.49092576",
"0.48865956",
"0.48609912",
"0.48161906",
"0.47972944",
"0.47805682",
"0.47528327",
"0.47159",
"0.46868187",
"0.4674638",
"0.46504545",
"0.46250895",
"0.46... | 0.6328487 | 0 |
Helper function for the get table option in select loop. Takes in LISTENER to grab user input if TABLE is not well formed. Requires a CALLBACK to return table when TABLE is a valid table name, otheriwse returns null after too many ATTEMPTS. Performs no checks to see if table actually exists in the database. | function select_loop_get_tab(listener, table, attempts, callback) {
if (attempts > 4) {
callback(null)
} else {
let valid = is_alphanum(table)
if (valid) {
callback(table)
} else {
console.log()
console.log('dp: Invalid table name. Please try again.\n')
listener.question('', ... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"tablename(context) {\n switch (context) {\n case \"select\":\n case \"selectOne\":\n return \"(select * from tablename1 join tablename2 on tablename1.id = tablename2.id)\";\n case \"insert\":\n case \"update\":\n case \"delete\":\n return \"tablename1\";\n ... | [
"0.57635003",
"0.5612994",
"0.55222034",
"0.5489865",
"0.54446805",
"0.54249245",
"0.53118354",
"0.52039844",
"0.51939946",
"0.5184008",
"0.5165041",
"0.5159092",
"0.51296353",
"0.5116405",
"0.51118577",
"0.51000476",
"0.50995165",
"0.50985307",
"0.5070591",
"0.50354236",
"0.... | 0.6164884 | 0 |
READ MODULE FUNCTIONS The read functions is split into modules which serve as checkpoints for various steps in the pipeline. / MODULE 1: find files, connect, create userid, create io, insert io, process batches, drop io FOLDERPATH is the path to the error dump, IO_PATH the path to the IO connections file, CONNECTION is... | function module1(folderpath, io_path, connection, callback) {
async.waterfall([
// SETUP: find files, connect, create userid, create io, insert io (result = [batches, null, null], returns batches)
function setup(cb) {
async.parallel([
// Find the json files to be processed (returns batches)
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function read(folderpath, io_name, start_module=1, callback) {\n async.waterfall([\n // Connect to database\n function connect(cb) {\n connect_db((err, connection) => {\n if (err) {\n console.log('Error connection to database.')\n cb(err)\n } else {\n console.lo... | [
"0.67460805",
"0.5787217",
"0.5688287",
"0.54610205",
"0.54457766",
"0.5162471",
"0.516179",
"0.51143795",
"0.5090059",
"0.4933284",
"0.49221486",
"0.487925",
"0.4875173",
"0.48584834",
"0.48407054",
"0.4827656",
"0.48187327",
"0.47759736",
"0.47633868",
"0.4737155",
"0.47324... | 0.6528899 | 1 |
Module 2: select userid, sort precluster, insert precluster, flask convert, write flask USERID DATA is the data from userid table. CONNECTION is a connnection to the database. On completion module 2 serves as a checkpoint for the flask processing of messages into essences. If an error occurs afterwards read() may conti... | function module2(userid_data, connection, callback) {
async.waterfall([
// Select from userid table (returns result)
function select_userid(wcb) {
if (userid_data) {
console.log('Passed userid table data')
wcb(null, userid_data)
} else {
const cols = comma(relevant_fields)
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function module4(t2_clusters, connection, callback) {\n async.waterfall([\n function setup(cb) {\n if (t2_clusters) {\n console.log('Passed on T2 Clusters.')\n cb(null, t2_clusters)\n } else {\n recover_clusters(__dirname + '/t2_clusters.json', (err, clusters) => {\n if ... | [
"0.6740742",
"0.63118124",
"0.58714336",
"0.57636994",
"0.5727347",
"0.5597069",
"0.5517316",
"0.5485693",
"0.54750764",
"0.54537004",
"0.5423681",
"0.53651494",
"0.5343726",
"0.51768094",
"0.5171742",
"0.51531965",
"0.5152756",
"0.51431924",
"0.51331383",
"0.51064736",
"0.50... | 0.71168584 | 0 |
MODULE 3: t1 cluster, sort master, insert master, insert cluster, update cluster, t2 cluster, write t2 FLASKED is the errors combined with the essences returned from the flask server. CONNECTION is a connection to the database. On completion module 3 serves as a checkpoint for the clustering of errors. If an error occu... | function module3(flasked, connection, callback) {
async.waterfall([
// Gets postflask.csv data if not passed along.
function setup(cb) {
if (flasked) {
cb(null, flasked)
} else {
read_csvfile(__dirname + '/postflask.csv', (err, flasked_data) => {
if (err) {
cb... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function module4(t2_clusters, connection, callback) {\n async.waterfall([\n function setup(cb) {\n if (t2_clusters) {\n console.log('Passed on T2 Clusters.')\n cb(null, t2_clusters)\n } else {\n recover_clusters(__dirname + '/t2_clusters.json', (err, clusters) => {\n if ... | [
"0.6864038",
"0.58851814",
"0.5424073",
"0.531144",
"0.50838196",
"0.5032781",
"0.49738088",
"0.48772186",
"0.47937554",
"0.4782271",
"0.46852195",
"0.4676314",
"0.463525",
"0.4560314",
"0.45562145",
"0.4544981",
"0.45120937",
"0.44614345",
"0.44527248",
"0.4438982",
"0.44289... | 0.71391934 | 0 |
MODULE 4: count userid, write csv, drop userid T2 CLUSTERS are the Tier 2 Clusters. CONNECTION is a connection to the database. Module 4 is the final module. Accepts a callback to pass on errors, otheriwse returns nothing. | function module4(t2_clusters, connection, callback) {
async.waterfall([
function setup(cb) {
if (t2_clusters) {
console.log('Passed on T2 Clusters.')
cb(null, t2_clusters)
} else {
recover_clusters(__dirname + '/t2_clusters.json', (err, clusters) => {
if (err) {
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function module2(userid_data, connection, callback) {\n async.waterfall([\n // Select from userid table (returns result)\n function select_userid(wcb) {\n if (userid_data) {\n console.log('Passed userid table data')\n wcb(null, userid_data)\n } else {\n const cols = comma(rele... | [
"0.5773037",
"0.51863456",
"0.50222623",
"0.4966284",
"0.4920549",
"0.49050954",
"0.4874343",
"0.48582044",
"0.47754598",
"0.475507",
"0.47059196",
"0.4660936",
"0.46499363",
"0.46414134",
"0.4619048",
"0.46113548",
"0.45995066",
"0.45981616",
"0.45620233",
"0.44962287",
"0.4... | 0.71694446 | 0 |
MAIN FUNCTIONS / Reads in the json error files inside FOLDERPATH and adds the relevant application using IO_NAME. Starts with START_MODULE. If RBDMS = true, uses the rbdms file to add in relevant RBDMS information to application. Accepts a callback to pass on errors, otherwise returns nothing. | function read(folderpath, io_name, start_module=1, callback) {
async.waterfall([
// Connect to database
function connect(cb) {
connect_db((err, connection) => {
if (err) {
console.log('Error connection to database.')
cb(err)
} else {
console.log('Connected t... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function er_populateResources(callback) {\n\t// Ensure that callback is a function\n\tcallback = callback ? callback : () => {};\n\n\ttry {\n\t\tconst resourcesDir = flatReadDirectory(RESOURCES_DIR);\n\t\tconst numFiles = resourcesDir.length;\n\n\t\tsynchronize(numFiles, syncArr => {\n\t\t\tfor (let i = 0; i < num... | [
"0.5056106",
"0.49325258",
"0.49257392",
"0.4872696",
"0.48421812",
"0.48403683",
"0.47854066",
"0.4769658",
"0.47348526",
"0.47304523",
"0.47184685",
"0.46677893",
"0.4626023",
"0.4621945",
"0.46198422",
"0.45636222",
"0.4560246",
"0.4542711",
"0.4484975",
"0.44652343",
"0.4... | 0.54305565 | 0 |
Updates the master table using the labels from CLASSIFIED_FILEPATH. If GET == TRUE then write new training data using the updated labels. Accepts a CALLBACK to pass on errors, otherwise returns nothing. | function label(classified_filepath, get=true, callback) {
async.waterfall([
// Read classified.csv
function read(cb) {
read_csvfile(classified_filepath, (err, file_data) => {
if (err) {
console.log('Error reading: ' + classified_filepath)
cb(err)
} else {
co... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function getCallback(err,data) {\n\t\tconsole.log(\"getting labels from \"+imageFile);\n\t\tif (err) {\n\t\t console.log(\"error: \",err,\"\\n\");\n\t\t} else {\n\t\t // good response...so let's update labels\n\t\t db.run(\n\t\t\t'UPDATE photoLabels SET labels = ? WHERE fileName = ?',\n\t\t\t[data.labels+... | [
"0.57381344",
"0.5516541",
"0.5114112",
"0.43737465",
"0.43419683",
"0.42759883",
"0.4246477",
"0.4192745",
"0.4176503",
"0.41762778",
"0.4165583",
"0.41633654",
"0.414645",
"0.41352597",
"0.41270268",
"0.41109836",
"0.41086784",
"0.4101841",
"0.4089688",
"0.40771148",
"0.407... | 0.571616 | 1 |
Gets all of the training data and writes it to FILENAME inside CABINET/DataPipeline. Accepts a CALLBACK to pass on errors, otherwise returns nothing. | function get_training(essences, filename, callback) {
console.log('GETTING TRAINING DATA.')
async.waterfall([
// Connect to database
function connect(cb) {
connect_db((err, connection) => {
if (err) {
console.log('Error connection to MySQL database.')
cb(err)
} else... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function load(callback){\r\n\tutil.log(\"Data: Saving All...\");\r\n\t//Save Each\r\n\tutil.log(\"Data: Saving Done...\");\r\n}",
"function processData() {\n const promises = []\n console.log('\\nLoading training data...')\n\n dirs.forEach(dir => {\n const dirPath = path.join(dataPaths.test, dir)\n cons... | [
"0.57793486",
"0.5705712",
"0.5377268",
"0.5253523",
"0.52035487",
"0.5166614",
"0.5038968",
"0.5031673",
"0.50151426",
"0.49581534",
"0.4828103",
"0.47886878",
"0.47829255",
"0.47759894",
"0.47725415",
"0.47621313",
"0.47551876",
"0.47466013",
"0.47416812",
"0.4741272",
"0.4... | 0.5880152 | 0 |
Write TABLE_NAME in the databse into a csv file. Accepts a CALLBACK to pass on errors, otherwise returns nothing. | function get_table(table_name, callback) {
console.log()
console.log('dp: BEGIN GET TABLE')
async.waterfall([
function connect(cb) {
connect_db((err, connection) => {
if (err) {
console.log('Error connecting to database')
cb(err)
} else {
console.log('Connec... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function write_create_tables(filename, connection, table_names, field_names, callback) {\n if (table_names && table_names.length) {\n let name = table_names.shift()\n write_create_table(filename, connection, name, field_names, (err, ret_fnames) => {\n if (err) {\n console.log('Error making ' + n... | [
"0.6544546",
"0.64619815",
"0.6358006",
"0.6103715",
"0.60344666",
"0.5972805",
"0.5877628",
"0.58768123",
"0.58122885",
"0.56848454",
"0.56385994",
"0.55779636",
"0.545913",
"0.544002",
"0.5435169",
"0.5400732",
"0.5371889",
"0.5343041",
"0.5331084",
"0.5318136",
"0.5282445"... | 0.6631383 | 0 |
Selects which function to run from user input using LISTENER. Returns nothing. | function select(listener) {
console.log()
listener.question('dp: What would you like to do?\n\n', (reply)=> {
console.log()
select_loop(listener, reply.split(' '), 0)
})
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function UserInputs (userOption, inputParameter){\r\nswitch(userOption){\r\n\r\n case \"this-song\": \r\n findSong();\r\n break;\r\n case \"this-concert\": \r\n findConcert();\r\n break;\r\n case \"this-do-what-it-says\": \r\n find-do-what-it-says();\... | [
"0.5668922",
"0.56614393",
"0.5642004",
"0.5625508",
"0.5593197",
"0.5587952",
"0.55783725",
"0.5564189",
"0.5556017",
"0.5556017",
"0.55514145",
"0.55209327",
"0.5506861",
"0.55039614",
"0.5497262",
"0.5477789",
"0.5467023",
"0.546174",
"0.5428416",
"0.54064333",
"0.5378352"... | 0.6122543 | 0 |
Get the weather x yield data reduced to just the variables we are interested and cleaned of missing data. | async function getData(url) {
const weatherDataResponse = await fetch(url);
const weatherData = await weatherDataResponse.json();
const cleaned = weatherData.map(weather => ({
yield: weather.Yield,
precipitation: weather.pr_rcp45
})).filter(d => (d.yield != null));
console.log(cleane... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function getdata() {\n\n var url = `/data`;\n\n d3.json(url).then(function(xx) {\n\n data = []\n // xx.slice(s, e)\n globaldata = xx;\n unfiltered = xx;\n actual = [], minute = []\n \n makedata();\n})\n}",
"function getWeather(){\n\treturn fetch(API_URL)\n\t.then(res => res.json())\n\t.then(... | [
"0.56633914",
"0.55927527",
"0.5402143",
"0.5266795",
"0.51981986",
"0.5160582",
"0.51459825",
"0.51397973",
"0.51207644",
"0.51104915",
"0.51057124",
"0.5087265",
"0.50798255",
"0.505358",
"0.50469196",
"0.50331336",
"0.5028265",
"0.49874163",
"0.49814236",
"0.49674404",
"0.... | 0.6271131 | 0 |
Convert the input data to tensors that we can use | function convertToTensor(data) {
// Wrapping these calculations in a tidy will dispose any
// intermediate tensors.
return tf.tidy(() => {
// Step 1. Shuffle the data
//tf.util.shuffle(data);
// Step 2. Convert data to Tensor
const inputs = data.map(d => d.precipitation)
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function convertToTensor(data) {\n return tf.tidy(() => {\n //step 1: shuffle data\n //Always shuffle the data. It's important to the final result\n tf.util.shuffle(data);\n\n //2 Convert data to Tensor\n // Converting to a 2d tensor. Tensor shape: [num_examples, num_features_per_example].\n // ... | [
"0.75865775",
"0.75478894",
"0.7388033",
"0.7346605",
"0.7212181",
"0.67223924",
"0.6657573",
"0.6604205",
"0.6389736",
"0.61748695",
"0.6080165",
"0.6054989",
"0.6025763",
"0.6025763",
"0.5935457",
"0.5882282",
"0.58322436",
"0.5747046",
"0.56331795",
"0.561828",
"0.5602934"... | 0.75726056 | 1 |
This method logs an incoming call to an API path | apiIn(correlationId, method, path, msgId) {
let ts = moment().tz('Europe/Rome').format('YYYY-MM-DD HH:mm:ss.SSS');
console.info('[' + ts + '] - [' + correlationId + '] - [' + this.apiName + '] - [api-in] - [info] - Received HTTP call ' + method + ' ' + path);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"trace(method, requestUrl, body, responseBody, responseStatus) {\n this.log.trace(`${method} ${requestUrl.path} ${responseStatus}`);\n }",
"function log() {\n logger.hit(`${this.req.url} ${this.statusCode} ${this.req.method} ${this.req.body.From} ${this.req.body.Body} ${this[action_symbol]}`, this)\n}",
... | [
"0.6590161",
"0.65117604",
"0.6281234",
"0.6222674",
"0.6158214",
"0.61464447",
"0.61272466",
"0.6111434",
"0.5998583",
"0.5995896",
"0.59885556",
"0.59885556",
"0.5979014",
"0.59177685",
"0.5908627",
"0.59058475",
"0.59025204",
"0.5881552",
"0.5876808",
"0.58658195",
"0.5822... | 0.68286127 | 0 |
This method logs an outgoing call to an API | apiOut(correlationId, microservice, method, path, msgId) {
let ts = moment().tz('Europe/Rome').format('YYYY-MM-DD HH:mm:ss.SSS');
console.info('[' + ts + '] - [' + correlationId + '] - [' + this.apiName + '] - [api-out:' + microservice + '] - [info] - Performing HTTP call ' + method + ' ' + path);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"trace(method, requestUrl, body, responseBody, responseStatus) {\n this.log.trace(`${method} ${requestUrl.path} ${responseStatus}`);\n }",
"apiIn(correlationId, method, path, msgId) {\n\n let ts = moment().tz('Europe/Rome').format('YYYY-MM-DD HH:mm:ss.SSS');\n\n console.info('[' + ts + '] - [' + correla... | [
"0.6655113",
"0.62716675",
"0.6179344",
"0.61485523",
"0.61355776",
"0.61355776",
"0.6119009",
"0.6103812",
"0.6066898",
"0.5968096",
"0.5944604",
"0.5885278",
"0.5795297",
"0.55828655",
"0.5534111",
"0.54839873",
"0.5464275",
"0.54542804",
"0.5450532",
"0.54476285",
"0.54431... | 0.6852318 | 0 |
This method logs an outgoing message sent to a Kafka topic | eventOut(correlationId, topic, msgId) {
let ts = moment().tz('Europe/Rome').format('YYYY-MM-DD HH:mm:ss.SSS');
console.info('[' + ts + '] - [' + correlationId + '] - [' + this.apiName + '] - [event-out] - Sending event to topic ' + topic);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"sendMessage(topic) {\n this.mqttClient.publish(topic)\n }",
"sendMessage(topic, message) {\n\t\tthis.mqttClient.publish(topic, message)\n\t\t//console.log('SENDING MESSAGE TO ' + this.host)\n\t\t//console.log(topic)\n\t\t//console.log(message)\n\t}",
"sendMessage(topic,message,err) {\n\n t... | [
"0.62122697",
"0.62073797",
"0.6149605",
"0.6040973",
"0.59659195",
"0.57990736",
"0.57934856",
"0.5760486",
"0.55911976",
"0.5558308",
"0.5509461",
"0.548443",
"0.5481805",
"0.5436749",
"0.54281074",
"0.542729",
"0.542729",
"0.54210824",
"0.5331873",
"0.53060955",
"0.5298039... | 0.6524807 | 0 |
Run the rollup build with an plugin configuration. | function build(config) {
return rollup({
input: './fixtures/index.js',
plugins: [copy(config)],
}).then((bundle) =>
bundle.write({
file: 'output/bundle.js',
format: 'iife',
name: 'test',
})
);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"async init(context) {\n if (!rollup) {\n throw new Error('Rollup not found! This plugin requires Rollup to be installed');\n }\n let rollupMajorVersion = (rollup.VERSION) ? rollup.VERSION.split('.')[0] : '';\n if (rollupMajorVersion.length) {\n rollupMajorVersion =... | [
"0.5815141",
"0.5794617",
"0.569451",
"0.5663384",
"0.55926174",
"0.53928834",
"0.5365771",
"0.5363078",
"0.5314978",
"0.5301755",
"0.52817625",
"0.52654165",
"0.51635385",
"0.51026416",
"0.50787383",
"0.5068189",
"0.50421107",
"0.50300777",
"0.5008421",
"0.5001206",
"0.49915... | 0.6754024 | 0 |
Run the rollup build with an plugin configuration compatible with multiple inputs. | function buildWithMultipleInput(config) {
return rollup({
input: ['./fixtures/index.js', './fixtures/index2.js'],
plugins: [copy(config)],
experimentalCodeSplitting: true,
}).then((bundle) =>
bundle.write({ dir: 'output/', format: 'es', name: 'test' })
);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function build(config) {\n return rollup({\n input: './fixtures/index.js',\n plugins: [copy(config)],\n }).then((bundle) =>\n bundle.write({\n file: 'output/bundle.js',\n format: 'iife',\n name: 'test',\n })\n );\n}",
"rollup(config) {\n const outputDir = process.cwd() + '/dist/'... | [
"0.59357345",
"0.57080775",
"0.5691743",
"0.5660022",
"0.5572233",
"0.55673975",
"0.5566736",
"0.54491913",
"0.54491913",
"0.54491913",
"0.54277545",
"0.53744805",
"0.53668696",
"0.53024536",
"0.5190006",
"0.51116353",
"0.49816313",
"0.49730578",
"0.49228334",
"0.48705363",
"... | 0.70365626 | 0 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.