query stringlengths 9 34k | document stringlengths 8 5.39M | negatives listlengths 19 20 | metadata dict |
|---|---|---|---|
This is the function to load a stored student | function loadStoredStudent(userId) {
var loadedStudent = localStorage.getItem(userId);
var parsedStudent = JSON.parse(loadedStudent);
return parsedStudent;
} | [
"function loadStudents() {\r\n StudentModule.getStudents(setupStudentsTable);\r\n}",
"async function loadStudent (req, res, next) {\n req.object = await queries.getStudent(req.params.id);\n if (!req.object) throw new errors.NotFound('Student not found.');\n return next();\n}",
"function loadStudents() {\n... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Get user's profile posts (user's posts and reposts) | async getProfilePosts (req, res, next) {
await Post.getUserPosts(req.params.username, (err, posts) => {
if (err) return next(err)
res.send(posts)
})
} | [
"getProfilePosts (username) {\n return Api().get(`users/${username}/posts`, username)\n }",
"async posts(user) {\n return await user.getPosts();\n }",
"getUserFeedPosts(uid) {\n return this._getPaginatedFeed(`/people/${uid}/posts`,\n FirebaseHelper.USER_PAGE_POSTS_PAGE_SIZE, null, true);\n... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Get all cards available | static all() {
return request.get(`cards/all`);
} | [
"function getAllCards() {\n return mtgMarket.methods.getAllCards().call()\n }",
"function getAllCards() {\n const url = `${process.env.REACT_APP_BACK_ROUTE}/cards/getAllCards`;\n const options = {\n method: \"GET\",\n headers: {\n Authorization: `Bearer ${l... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
I made this function for the change cookies button. It prompts the user and changes the cookies values | function newCookies() {
var name = prompt("Please enter your name:");
var favorite = prompt("Please enter your favorite soccer team");
var age = prompt("Please enter your age");
setCookie("name", name, 7);
setCookie("favorite", favorite, 7);
setCookie("age", age, 7);
checkCookie();
} | [
"function setACookie(){\n var cname = window.document.getElementById('cname').value; //Get the cookie name from the cname input element\n var cvalue = window.document.getElementById('cvalue').value;//Get the cookie value from the cvalue input element\n var exdays = window.document.getElementById('exdays').... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
load a set of texture pages | load(textures) {
textures = new Set(textures);
const loaded = [];
for(let texture of textures) {
if(!this[PAGES][texture]) {
this[PAGES][texture] = new TexturePage(this[SOURCES][texture]);
loaded.push(this[PAGES][texture].loaded);
}
this[REFERENCES].set(
this[PAGES]... | [
"load(textures) {\n textures = new Set(textures);\n const loaded = [];\n for (let texture of textures) {\n if (!this[PAGES][texture]) {\n this[PAGES][texture] = new __WEBPACK_IMPORTED_MODULE_0__texture_page__[\"b\" /* default */](this[SOURCES][texture]);\n loaded.push(this[PAGES][texture... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
parse realm description in JWS, verify signature and store keys. | parseSignedRealm(name, jws, importKey = true) {
return __awaiter(this, void 0, void 0, function* () {
if (typeof (jws) == 'string')
jws = JSON.parse(jws);
// get key out and verify that we have it. assumes full JWS.
let pText = Buffer.... | [
"parseSignedRealm(name, jws) {\n return __awaiter(this, void 0, void 0, function* () {\n if (typeof (jws) == 'string')\n jws = JSON.parse(jws);\n let result = yield this.verify(jws);\n let obj = JSON.parse(result.payload);\n if (name != '*' && obj.na... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Listar todos los datos de la evaluacion generico | function listarTodosEvaluacionGenerico(metodo){
var idCuerpoTabla = $("#cuerpoTablaEvaluacion");
var idLoaderTabla = $("#loaderTablaEvaluacion");
var idAlertaTabla = $("#alertaTablaEvaluacion");
limpiarTabla(idCuerpoTabla,idLoaderTabla,idAlertaTabla);
loaderTabla(idLoaderTabla,true);
consultar("e... | [
"function listarTodosEvaluacion(){\r\n\t\r\n\tlistarTodosEvaluacionGenerico(\"listarTodos\");\r\n}",
"function obtenerMatrizEvaluada() {\n obtenerPorEtapas();\n establecerValoresPorDefecto();\n}",
"function generarListaOrdenadaPorConsultas(){\n\tvar lista = [];\n\tvar fila;\n\tvar filas = doctores.sort(or... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Return parsed upload inputs from request | getUploadInputs(request) {
return Promise.resolve().then(() => {
return {
path: request.files.file.path,
name: request.files.file.originalFilename || request.files.file.name,
customName: request.body.name,
user: {
id: request.session.user.id
}
}
});
} | [
"getImportInputs(request) {\n\t\treturn Promise.resolve().then(() => {\n\t\t\treturn {\n\t\t\t\tscope: request.body.scope,\n\t\t\t\ttheme: request.body.theme,\n\t\t\t\turl: request.body.url,\n\t\t\t\tfile: request.files.file.path,\n\t\t\t\tname: request.files.file.originalFilename || request.files.file.name,\n\t\t\... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
GET issue's upvote total by ID | function findVotesById(issueId) {
return db('upvote')
.count('issue_id').where('issue_id', issueId)
} | [
"function upvote(id) {\n var rbtn = document.getElementById('rank-'+id);\n fetch('/user/upvote/'+id, {method: 'POST'})\n .then(function(response){\n if(response.status == 203) {\n rbtn.innerHTML++;\n } else if(response.status == 201) {\n rbtn.innerHTML--;\n } else... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Deletes the record from the store, also removing any references to the node from any ranges that contain it (along with the containing edges). | function deleteRecord(writer, recordID) {
var store = writer.getRecordStore();
var recordWriter = writer.getRecordWriter();
// skip if already deleted
var status = store.getRecordState(recordID);
if (status === __webpack_require__(235).NONEXISTENT) {
return;
}
// Delete the node from any rang... | [
"function deleteRecord(writer, recordID) {\n\t var store = writer.getRecordStore();\n\t // skip if already deleted\n\t var status = store.getRecordState(recordID);\n\t if (status === RelayRecordState.NONEXISTENT) {\n\t return;\n\t }\n\t\n\t // Delete the node from any ranges it may be a part of\n\t var co... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
top menu click event handler | function topMenuClick(){
var clicked = $(this);
switch (clicked.attr('id')){
case 'login':
window.location.href = UI_PAGE + "login.html";
break;
case 'logout':
logout();
break;
case 'go-to-articles':
window.location.href = UI_PAGE... | [
"function onMenuClick() {\n console.log('clicked on the menu');\n }",
"function doMenuRootClick(){\n}",
"function menuClick() {\n Analytics.trackEvent('Header', 'menuClick');\n }",
"function handleTopBarSubMenu() {\n $(\".topbar-list > li\").on(\"click\", function(e) {\n if (... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Loop over localStorage's schemas | function loadSchemasFromLocalStorage() {
console.group("loadSchemasFromLocalStorage", arguments);
if (typeof(Storage)==="undefined") {
console.warn("The browser is not supporting localStorage, don't try to load models from localStorage");
} else {
// Retrieve the models ... | [
"function readSchema() {\n if(supportsLocalStorage() && localStorage.getItem(\"schema\") != null) {\n schema = localStorage.getItem(\"schema\").split(\",\");\n for(i = 0; i < schema.length; i++) {\n document.getElementById(\"schemaOptions\").innerHTML += \"<option>\"+schema[i]+\"</option... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Calling this function opens howto screen. It adds the body class that controls relevant animations. | function animateHowTo() {
body.classList.add("howto-open");
} | [
"prepareBody() {\n document.body.id = \"EXT_SCREEN_ANIMATE\"\n document.body.className= \"animate__animated\"\n document.body.style.setProperty('--animate-duration', '0.5s')\n }",
"hoistMenuToBody () {\n this.menuSurface_.hoistMenuToBody ();\n }",
"function wowAnimation() {\n new WOW({\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Check spiral metrics vs. simulated noise. | function checkLearnedSpiral(arg,extended=0,linear=0) {
var ctrls=[]; var s=[]; var mindi=[]; var minInds = [];
/*console.log(toKeep);
for (var bg=0; bg<learnedSpirals.length; bg++) {
ctrl=(euclidDistWeight(forControl.map(k => arg[k]),forControl.map(k => learnedSpirals[bg][0][k]),weightVector));
ctrls.p... | [
"function spiral()\n{\n\tg.filter.generate(function() {\n\t\treturn i < (g.surface.dim()[0] * (i % g.surface.dim()[1])) ? 0 : 1;\n\t});\n\tg.draw = true;\n}",
"function testUniformShapeInLoop(sides, angle, length, gradeLog, blockSpec, point) {\n var gLog = gradeLog || new gradingLog(),\n testID = gLog.a... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
function fcnModifyReportFormTCG_Master This function modifies the Match Report Form to add new added players | function fcnModifyReportFormTCG(ss, shtConfig, shtPlayers) {
var MatchFormEN = FormApp.openById(shtConfig.getRange(36, 2).getValue());
var FormItemEN = MatchFormEN.getItems();
var NbFormItem = FormItemEN.length;
var MatchFormFR = FormApp.openById(shtConfig.getRange(37, 2).getValue());
var FormItemFR = Mat... | [
"function fcnCreateReportForm_WG_S() {\n \n var ss = SpreadsheetApp.getActive();\n var shtConfig = ss.getSheetByName('Config');\n var shtPlayers = ss.getSheetByName('Players');\n var shtIDs = shtConfig.getRange(17,7,20,1).getValues();\n var ssID = shtIDs[0][0]; \n var OptGenerateResp = shtConfig.getRange(64,... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Set Checkout total on product add | setCheckoutTotals() {
$(".checkout-actions").find('.total-items').text(this.getTotalItems());
$(".checkout-actions").find('.cost-total').text(this.getTotalCost());
$(".checkout-actions").find('.retail-total').text(this.getProductsTotalRetail());
} | [
"incrementTotalPrice() {\n this.totalPrice += this.product.price;\n }",
"function updateTotalPrice() {\n let totalPrice = 0;\n $(\".checkout__item\").each(function (index) {\n totalPrice += $(this).data(\"price\") * $(this).children().children(\".checkout__item--quantity--text\").text();\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
add contribs to user menu 2/1/11; by Monchoman45 | function UserContribsMenuItem() {
$('ul.AccountNavigation li:first-child ul.subnav li:first-child').after('<li><a href="/wiki/Special:Contributions/'+ encodeURIComponent (wgUserName) +'">Contributions</a></li>');
} | [
"function UserContribsMenuItem() {\n\t$('ul.AccountNavigation li:first-child ul.subnav li:first-child').after('<li><a href=\"/wiki/Special:Contributions/'+ encodeURIComponent (wgUserName) +'\">My contributions</a></li>');\n}",
"function AddNavigationLinks() {\n\t$('<li><a href=\"/wiki/Special:Contributions/'+ enc... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
the highest midi note that would trigger the arg preset | highestNoteForPlonkPreset(preset) {
let maxVoltage = this.minVoltageForPlonkPreset(preset + 1);
return Math.ceil(this.noteForVoltage(maxVoltage) - 1);
} | [
"lowestNoteForPlonkPreset(preset) {\n let minVoltage = this.minVoltageForPlonkPreset(preset);\n return Math.ceil(this.noteForVoltage(minVoltage));\n }",
"minor_third_above(midi_note) {\n return midi_note + 3;\n }",
"function getLowestMidiNote(noteName) {\n return lowestNotes[noteName] ?? -1;\n... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
function create component for chat events | function formEventsContainer() {
var eventsWrapper = $("<div></div>");
var eventsListCont = $("<div></div>");
eventsWrapper.addClass(chatEventsMsgsWrapper.slice(1));
eventsListCont.addClass(chatEventsListCont.slice(1));
eventsWrapper.append(eventsListCont);
return eventsWrapper;
} // end of ... | [
"function createChat (e) {\n unFocus()\n let chat = new Chat(unFocus)\n windows.push(chat)\n console.log(window)\n}",
"render_chat_box() {\n // create container for chat messages\n this.chat_box = this.chat_container.createDiv(\"sc-chat-box\");\n // create container for message\n this.message_cont... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
for appending a `value` to a file | function writeToLog (value, filename) {
var str = JSON.stringify(value) + '\n'
fs.appendFile(filename, str)
} | [
"writePreference(filename, value) {\n const path = this.fm.joinPath(this.fm.libraryDirectory(), filename)\n\n if (typeof value === \"string\") {\n this.fm.writeString(path, value)\n } else {\n this.fm.writeString(path, JSON.stringify(value))\n }\n }",
"function logProp(key, value) {\n fs... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Update main fuel tank data Stage sep: 144 sec. 2nd stage start: 155 sec, shutdown: 600sec | function updateTankData(time) {
var flowRateS1LOX = 857.1429;
var flowRateS1RP1 = 571.429;
var flowRateS2LOX = 60.674;
var flowRateS2RP1 = 35.955;
if (time < 144) {
sampleTanks[0].fuel_volume -= flowRateS1RP1;
vehicleModel.updateTankData(sampleTanks[0], function (err, result) {
if (err) {
... | [
"function refreshDataFast(){\r\n\tupdateFieldBuy2();\r\n\tupdateBuyEstimate();\r\n\tupdateFieldPrince2();\r\n\tupdateSellEstimate();\r\n\tupdateFieldTree2();\r\n\tupdateTreeEstimate();\r\n\tupdateRedHatch2();\r\n\tupdateRedEstimate();\r\n\tfastupdateDowntime();\r\n\t/*\r\n\tfastupdateGodTimer();\r\n\t//fastupdatePl... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Compresses the quadtree by removing duplicate quadrants. It does so by comparing the binary strings of each quadrant with all other quadrants on the same lvl where the quadrant binary string length is greater than 1. If the quadrant's binary strings match, the quadrant (arbitrarily selected) whose path is furthest righ... | function compress(root, nodes) {
if (nodes[0].children.length == 0 || nodes[0].children[0].binStr.length == 1) {
return;
}
var children = [];
for (var i = 0; i < nodes.length; i++) {
children = children.concat(nodes[i].children);
}
for (var i = 0; i < children.length; i++) {
... | [
"function quadtree(img, sRow, sCol, path, lvl, numOfCols, parent) {\n\n var isSame = true;\n var startColor = img[sRow][sCol];\n var binStr = \"\";\n var rows = sRow + numOfCols;\n var cols = sCol + numOfCols;\n for (var i = sRow; i < rows; i++) {\n for (var j = sCol; j < cols; j++) {\n\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Get the Group object and channels from the specified Group Document | function getSingleGroup(db, ObjectID, groupdoc, issuper, curruserid){
var getGroupArray = async () => {
var userdoc = await (global.lookupUserName(db, groupdoc.groupadminid));
var adminname = userdoc.username;
var adminimage = userdoc.imagepath;
var newgroup = new Group.Group_CS(
groupdoc._id,... | [
"function getGroup() { return group; }",
"function Group () {\n return _default({\n '_type': 'Group',\n 'docs': []\n });\n}",
"async function getGroup(groupId) {\n let matchGroupQuery = db\n .ref(\"songs\")\n .orderByChild(\"groupId\")\n .equalTo(groupId);\n let snapshot = await matchGroupQue... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Replaces the overriden properties in the archetype from the entity | function override_properties(archetype, entity) {
const keys = Object.keys(entity);
for (let key of keys) {
if (typeof key === "object") {
override_properties(archetype[key], entity[key]);
} else {
archetype[key] = entity[key];
}
}
} | [
"_initOverrideProps() {\n const definitions = this._settings.schema.definitions;\n const overidesSchema = definitions.cssOverrides.properties;\n Object.keys(overidesSchema).forEach(key => {\n // override validation is against the CSS property in the description\n // field.... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
set status for a particular client session | async setSessionStatus (sessions) {
this.sessionsToUpdate = sessions;
this.currentSessions = this.user.get('sessions') || {};
this.op = {};
await this.updateSessions(); // update the sessions data by adding the presence data for this request
await this.removeStaleSessions(); // remove any stale sessions we f... | [
"function setStatus(session, text) {\n status.text = text;\n\tvar msg = new iot.Message({type: '_status', to: config.devicename, body: {status: status}});\n\tmsg.send(session, function(err,sentMessages) {\n\t});\n}",
"function updateClientStatus(status) {\n if (status != null) {\n clientConne... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Undo last item delete | function undoDelete (){
if (lastDeleted)
{
undoButton.style.display = "none";
undoTextArea.textContent = '';
hideUndo = true;
printListItem(lastDeleted);
appendDbList(lastDeleted);
}
} | [
"undoLastAction(){\n if (this.todoListsBackup.length > 0) {\n this.todoLists = this.todoListsBackup.slice();\n }\n }",
"function undo() {\n if (!actions.length) return;\n var a = actions.pop();\n a.revert();\n}",
"undo() {\n if (this.#position === -1) {\n // ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
closes laser attack modal | function closeLaserAttack(){
document.getElementById("modal-backdrop-laser-attack").classList.add("inactive");
document.getElementById("modal-laser-attack").classList.add("inactive");
openSonar();
} | [
"function openLaserAttacks(){\n\tdocument.getElementById(\"modal-backdrop-laser-attack\").classList.remove(\"inactive\");\n\tdocument.getElementById(\"modal-laser-attack\").classList.remove(\"inactive\");\n}",
"loseGame() {\n this.modal_manager.gameLoseModal('show');\n }",
"function showYouLose() {\n $(\... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Finite State Machine used to change Scenes | function changeScene() {
// Launch various scenes
switch (scene) {
case config.Scene.MENU:
// show the MENU scene
stage.removeAllChildren();
menu = new scenes.Menu();
currentScene = menu;
console.log("Starting MENU Scene");
break;
... | [
"function changeScene() {\n // Launch various scenes\n switch (scene) {\n case config.Scene.MENU:\n // show the MENU scene\n stage.removeAllChildren();\n menu = new scenes.Menu();\n currentScene = menu;\n console.log(\"Starting MENU Scene\");\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
creatCells() / /Create the cells for the rows. / /First determine the date of the starting Sunday. / / | function creatCells() {
startOfWeek();
var thisDate = targetSundayDate;
// var tempArray = [];
for (n=0;n<numRows;n++) {
/** For each row of the table... **/
for (b=0;b<7;b++) {
/** Repeat seven times:
Create the dateCode, which will be used as the cell ID.
Create and write the code... | [
"createWeekCells() {\n const daysInMonth = this.dateAdapter.getNumDaysInMonth(this.activeDate);\n const dateNames = this.dateAdapter.getDateNames();\n this.weeks = [[]];\n for (let i = 0, cell = this.firstWeekOffset; i < daysInMonth; i++, cell++) {\n if (cell === DAYS_PER_WEEK... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Set the maximum stack depth to show | setMaxStackDepth(depth){
maxDepth = depth;
} | [
"maxDepth() {\n let maximum = null;\n\n const _setMaximum = (depth) => {\n if (maximum === null) {\n maximum = depth;\n return;\n }\n\n if (maximum < depth) {\n maximum = depth;\n return;\n }\n }\n\n this._goDeep(this.root, 0, _setMaximum);\n\n return m... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Toggles the select for the number of glasses | function toggleSelect() {
if (glassesOptionElement.checked)
glassesSelectElement.setAttribute('disabled', '');
else
glassesSelectElement.removeAttribute('disabled', '');
} | [
"function toggleCharacterSelect(){\n $('.character-select').toggleClass(\"vanish\");\n }",
"changeGodclass(newGodclass) {\n\t\tvar pantheon = this.state.pantheon;\n\t\tthis.setState({\n\t\t\tgodclass: newGodclass,\n\t\t\tselectedGods: this.state.gods.map((god) => {\n\t\t\t\t(god.godclass === newGodclass... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Closes the ship_div window | function Close() {
var Ship_Div = document.querySelector("#ship_div");
const CloseButton = document.querySelector("#close");
CloseButton.addEventListener("click", function(){
Ship_Div.remove();
//From FACTION_EventListener.js - ensures only 1 Ship_Div can be created
... | [
"function close(){\n\t\tresizePopin();\n\t\toptions.hide(domElement);\n\t}",
"close() {\n if (!this.isOpen()) {\n return;\n }\n this.flyout_.hide();\n // TODO: We can remove the setVisible check when updating from ^10.0.0 to\n // ^11.\n if (this.workspace_.scrollbar &&\n /** @type {*}... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Render Asciidoc to HTML (block) | function asciidocToHTML(content) {
return asciidoctor.convert(content, { safe: "server", attributes: { showtitle: "", icons: "font@" } });
} | [
"function asciidocToHTML(content) {\n var options = opal.hash2(['attributes'], {'attributes': attr});\n\n var html = processor.$convert(content, options);\n return html;\n}",
"function asciidocToHTMLInline(content) {\n var options = Opal.hash({doctype: 'inline', attributes: [attr]});\n\n var html =... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Format the not a moderator response | function formatNotModerator() {
return Q.fcall(function() {
return "You are not a moderator and so you can't run this command";
});
} | [
"function formatRespone(response) {\r\n return response;\r\n }",
"function formatResponse(thisContent) {\n\tvar result = 'You sent me:' +\n \t\t\t'\\n name: ' + thisContent.name +\n \t\t\t'\\n age: ' + thisContent.age + '\\n';\n \treturn result;\n}",
"function formatNoTeamResponse() {\n return Q.f... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Overlap two sound segments, ramp the volume of one down, while ramping the other one from zero up, and add them, storing the result at the output. | function overlapAdd(
numSamples,
numChannels,
out,
outPos,
rampDown,
rampDownPos,
rampUp,
rampUpPos)
{
for(var i = 0; i < numChannels; i++) {
var o = outPos*numChannels + i;
var u = rampUpPos*numChannels + i... | [
"function overlapAddWithSeparation(\r\n numSamples,\r\n numChannels,\r\n separation,\r\n out,\r\n outPos,\r\n rampDown,\r\n rampDownPos,\r\n rampUp,\r\n rampUpPos)\r\n {\r\n for(var i = 0; i < numChannels; i++) {\r\n var o = outPos*... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Create template root object | function _createAstRoot() {
var root = obj();
root.type = 'nj_root';
root.content = [];
return root;
} | [
"function openRootTemplate(tmp) {\n\n // Create an \"empty\" template\n var template = {\n raw: undefined,\n pre: undefined,\n dom: undefined,\n root: undefined,\n parent: undefined,\n view: undefined\n }\n\n // Set the ro... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Loads a react node. Compiling the scene using predefined components. | loadNode(node) {
if (is.string(node)) {
return node;
}
const component = this.components[node.type];
const nodeClone = this.setId(node);
const mergedNode = component
? this.mergeNodes(React.cloneElement(component), nodeClone)
: nodeClone;
... | [
"loadComponentById(e){\n var comp = e.target.id;\n this.setState({\n CompContent: require('./components/'+comp)\n });\n }",
"function onload() { //get called after page load\n\n var src = [\n \"https://unpkg.com/react@16/umd/react.production.min.js\",\n \"https://unpkg.com/react-do... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
According to the predefined model we get the cannon of the tank. The names are visible in the sandbox. The function returns an array of meshes containing the meshes of the tank. | getCannon() {
var scene = this.scene;
if (!this.isClone) {
var cannon = scene.getMeshByName("Box15");
}
else {
//See getSideWheels() for the documentation of the following lines.
var cannon = scene.getMeshByName("clone_".concat(this.id.toString()).co... | [
"function getMeshes(index)\n\t{\n\t\tvar send = [];\t//Copy of meshes to send\n\t\tfor(var i = 0; i < levels[index].meshes.length; i++)\n\t\t{\n\t\t\tsend.push(levels[index].meshes[i].get());\n\t\t}\n\t\treturn send;\n\t}",
"function GetMesh(index)\n{\n return meshes[index];\n}",
"get meshes(): Array<M_Mesh>... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Returns an array of key, value style string pair containing the gradient style supported by the current browser. The format of the colorSteps Object with the following items: Key Description start Default background color in a valid hexadecimal color format, also the start color end Default gradient end color for dumbe... | _standardGradientSteps(_startColor, _stepsIn, _endColor) {
const _steps = [`${_startColor} 0%`];
if (_stepsIn.length !== 0) {
_stepsIn.forEach(_step => {
_steps.push(`${_step[1]} ${_step[0]}%`);
});
}
_steps.push(`${_endColor} 100%`);
return _steps;
} | [
"function createColorGradient(start_color, end_color, steps) {\n var colors = [];\n\n var step_size = 1 / steps;\n\n var regex = /[^\\d,]/g; // Finds any character not a digit or comma\n\n // Array of rgb values as strings\n var start_color_rgb = start_color.replace(regex, '').split(',');\n var en... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
get coord of a cell and return a elCell , dom element of that cell | function getCellAsDomElement(coord) {
var elCell = document.querySelector(`#cell${coord.i}-${coord.j}`);
return elCell;
} | [
"function getCell(elCell) {\n\n}",
"function getElCell(pos) { \n return document.querySelector(`[data-i='${pos.i}'][data-j='${pos.j}']`); \n }",
"function getCell(id, x, y) {\n\treturn document.getElementById(id).children[0].children[x].children[y];\n}",
"function getCellByCoord(i, j) {\n var elCell = ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
"Set is subclassable" from kangax | function test() {
var obj = {};
class S extends Set {}
var set = new S();
set.add(123);
set.add(123);
return set.has(123);
} | [
"function MySet() {\n var collection = [];\n this.has= function(element){\n return (collection.indexOf(element)!==-1);\n //if it doesn't return -1 its true\n }\n this.values = function(){\n return collection;\n }\n this.add = function(element){\n if(!this.has(element)){\n collection.push(elem... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
cut out all but top this.populationSize num members | cull() {
this.members = this.members.slice(0, this.populationSize);
} | [
"function prunePaul(){\n\ti = paul.length;\n\twhile(i>12){\n\t\tpaul.splice(0, 1);\n\t\ti = paul.length;\n\t}\n}",
"function removeFive(members) {\n \n}",
"function cityLimit() {\n if (cities.length > 8) {\n cities.pop();\n }\n}",
"function getTop50(sample) {\n var sortedList;\n //sort d... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Make connection with Rally API | function connectRally() {
restApi = rally({
apiKey: config.rally.apiKey, //preferred, required if no user/pass, defaults to process.env.RALLY_API_KEY
apiVersion: 'v2.0', //this is the default and may be omitted
server: 'https://rally1.rallydev.com', //this is the default and may be omitted
requestOptions: {
... | [
"async callConnectApi() {\n return this.org\n .getConnection()\n .request(await this.fetchRequestInfo())\n .then((result) => this.connectService.handleSuccess(result))\n .catch((err) => this.connectService.handleError(err));\n }",
"function orndApi () {\n var... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Read Kibana settings from ./config/kibana_settings.json By default kibanadashboard is disabled. The landing page after successful login is flights page for now | function defaultHomePage(){
var dfd = $q.defer();
dfd.resolve($http({
method: 'get',
url: './config/kibana_settings.json'
}));
return dfd.promise;
} | [
"readSettings() {\n\n this.hue.bridges = this._settings.get_value(\n Utils.HUELIGHTS_SETTINGS_BRIDGES\n ).deep_unpack();\n\n this._indicatorPosition = this._settings.get_enum(\n Utils.HUELIGHTS_SETTINGS_INDICATOR\n );\n\n this._zonesFirst = this._settings.get... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
inheriting props from AddProjectForm.js/Navigation.js > SetRolesModal.js | function SetRoles({ authHeader, setmodalIsLoading }) {
const {
projects,
fetchUsers,
fetchPermissions,
users,
permissions,
loading,
handleChangeRole,
handleChangePermission,
} = useSetRoles(authHeader, setmodalIsLoading);
useEffect(() => {
setmodalIsLoading(true);
fetchUse... | [
"setRoles(roles) {\n this.roles = roles;\n }",
"function selectRole($event) {\n\t\t\t$event.preventDefault();\n\t\t\tModalSelect.show({\n\t\t\t\titems: RotaRole.$find({orderBy: 'title'}),\n\t\t\t\tselected: vm.rota.role,\n\t\t\t\ttitle: 'Select Role',\n\t\t\t\tnameKey: 'title',\n\t\t\t\tcallback: functi... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Create the node for a save widget. | function createSaveNode(path) {
const input = document.createElement('input');
input.value = path;
return input;
} | [
"async saveNode() {\n await this.t.click(this.nodeSaveButton);\n }",
"function createSaveNode(path) {\n var input = document.createElement('input');\n input.value = path;\n return input;\n }",
"function SaveWidget(path) {\n return _super.call(this, { node: createSaveNode(p... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
In dialog mode, on form render call the queued functions | onFormReady(form) {
this.form = form;
setTimeout(() => {
triggerFn(this.$queue.pop());
});
} | [
"function formSubmitted(){\n getCurrentNumbers();\n setConfirmationMessage();\n}",
"queueAfterRender(f) {\n this.queueRenderUpdate().callbacks.push(f);\n }",
"onOpenForm() {\n// Add a timeout to allow the active window to close...\nthis.runDelayed(() => {\nif (!this._settings.getShowProperties() && ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Check consent button has been loaded. If not, wait 1000 msec and try again, until loading is finished. | function check_consent() {
page.evaluate(function() {
return document.querySelector(".button[value='I agree']")
}).then((res) => {
if (res != null){
... | [
"function wait_for_load() {\n if (loaded_done != loaded_expectation) {\n //if (loaded_done < 36 ) {\n setTimeout(wait_for_load, 250);\n } else {\n loaded = true;\n document.getElementById(\"load_data_button\").style.display = \"none\";\n document.getElementById(\"load_data_status\").style.display = \... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Updates the pending and queued list of all addresses, along with their executable nonces. | async updatePendingAndQueued() {
var _a;
let newPending = this._getPending();
// update pending transactions
for (const [address, txs] of newPending) {
const senderAccount = await this._stateManager.getAccount(ethereumjs_util_1.Address.fromString(address));
const ... | [
"async updatePendingAndQueued() {\n var _a;\n let newPending = this._getPending();\n // update pending transactions\n for (const [address, txs] of newPending) {\n const senderAccount = await this._stateManager.getAccount(ethereumjs_util_1.Address.fromString(address));\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Register a new question to the debate and transmit it to the clients. | sendNewQuestion(question) {
logger.debug(`Sending new question with id ${question.id}`);
this.questions.set(question.id, question);
this.userNamespace.emit('newQuestion', question.format());
} | [
"function addQuestion(req, res) {\n try {\n var uuid = req.params.uuid;\n var allSurveys = new surveys_1.Surveys();\n var surveyToUpdate = new surveys_1.Survey(allSurveys.surveys[allSurveys.findSurveyIndex(uuid)]);\n var newQuestion = new surveys_1.Question(req.body.question);\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Sets the unit of the minwidth attribute. | setMinWidthUnit(valueNew){let t=e.ValueConverter.toDimensionUnit(valueNew);null===t&&(t=this.getAttributeDefaultValueInternal("MinWidthUnit")),t!==this.__minWidthUnit&&(this.__minWidthUnit=t,e.EventProvider.raise(this.__id+".onPropertyChanged",{propertyName:"MinWidthUnit"}),this.__processMinWidthUnit())} | [
"set _minTermLength(value){this.__minTermLength=value;Helper$2.UpdateInputAttribute(this,\"min\",value)}",
"set min(value) {\n Helper.UpdateInputAttribute(this, 'minlength', value);\n }",
"set startWidth(value) {}",
"getMinWidthUnit(){return this.__minWidthUnit}",
"set min(value){Helper.UpdateInputAttri... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Return CSS text of all stylesheets in the page or only a href if the stylesheet is external | function getStyleSheets() {
return [...document.styleSheets].map(styleSheet => {
try {
const href = styleSheet.href;
const rules = styleSheet.rules || styleSheet.cssRules || null;
const cssText = Array.isArray(rules) ? rules.map(r => r.cssText).join(" \n") : null;
return { href... | [
"function getStyleSheets() {\n return [].slice.call(document.styleSheets).map(({ cssRules: cr, href }) => (\n {\n href,\n cssText: (cr && cr.length) ? [].slice.call(cr).map(r => r.cssText).join(\" \\n\") : null,\n }\n )).filter(v => v.href || v.cssText);\n }",
"function getStyleShee... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Event `send` handler: Find transformation to start form or use transformation specified by `transformId` parameter Apply transformation and redirect to start form. | function send(individual, transformId) {
if (transformId !== undefined) {
var startForm = buildStartFormByTransformation(individual, res['v-s:hasTransformation'][0]);
riot.route("#/individual/" + startForm.id + "/#main//edit", true);
} else {
var s = new veda.SearchModel("'rdf:type' == 'v-s:DocumentLink... | [
"function triggerTransition(transitionId, msg) {\n var theForm = document.getElementById('triggerTransitionForm');\n theForm.workflow_action.value = transitionId;\n if (!msg) {\n theForm.submit();\n }\n else { // Ask the user to confirm.\n askConfirm('form', 'triggerTransitionForm', msg, true);\n }\n}",
... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Draws QR code to the given `canvas` and returns it. | function drawOnCanvas(canvas, settings) {
var qr = createMinQRCode(settings.text, settings.ecLevel, settings.minVersion, settings.maxVersion, settings.quiet);
if (!qr) {
return null;
}
var $canvas = jq(canvas).data('qrcode', qr);
var context = $canvas[0].getContext('... | [
"function drawOnCanvas(canvas, settings) {\n var qr = createQRCode(settings.text, settings.ecLevel, settings.minVersion, settings.maxVersion, settings.quiet);\n if (!qr) {\n return null;\n }\n\n var $canvas = $(canvas).data('qrcode', qr);\n var context = $canvas[0].getC... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
APP13 very complicated and doesn't just simply contain IPTC data. It is in fact Photoshop format, which contains it's own chunks, each starting with 8BIM header. IPTC is just one of those chunks and may start several hundreds of bytes into the segment. IPTC chunk in the format starts with 8BIM followed by 4 4 (0x0404) ... | static canHandle(file, offset, length) {
let isApp13 = file.getUint8(offset + 1) === MARKER
&& file.getString(offset + 4, 9) === PHOTOSHOP
if (!isApp13) return false
let i = this.containsIptc8bim(file, offset, length)
return i !== undefined
} | [
"function parseJpegChunks(bytes, chunks) {\n var i = 0;\n var n = bytes.length;\n // Finding first marker, and skipping the data before this marker.\n // (FF 00 - code is escaped FF; FF FF ... (FF xx) - fill bytes before marker).\n while (i < n && (bytes[i] !== 0xff ||\n (i + 1 < n && (bytes[i... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
FUNCTIONS // send message request to content.js to change video speed | function setSpeed(newSpeed) {
console.log(newSpeed);
speedObj.speed[myTabId] = newSpeed;
videoSpeed = parseFloat(newSpeed);
input.value = videoSpeed.toFixed(2);
chrome.tabs.query({ currentWindow: true, active: true },
fu... | [
"function newVideoSpeed(){\n vid.playbackRate = 10;\n}",
"function changeSpeed(value) {\n chrome.runtime.sendMessage({\n name: \"changeSpeed\",\n from: \"content\",\n value: value\n })\n}",
"function orginalVideoSpeed(){\n vid.playbackRate = 1;\n}",
"function increaseSpeed() {\n\t... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Upload the local file to the Storage Service. This changes the state from 'local' to 'remote', if successfull. So, don't forget to persist this new state in the database! | upload() {
let [ssName, storageService] = getStorageService();
if (this.state == local_file) {
console.log('uploading file: ', this.originalFileName);
let oldLocation = this._obj.location;
return storageService.upload(oldLocation, this.originalFileName)
.... | [
"function upload(localFile, originalFileName) {\n\n // Get token from config\n let token = config.get(\"dropbox.oAuthToken\");\n\n if (token === undefined) {\n throw \"There is an error in the config file: Setting dropbox.oAuthToken is required!\";\n }\n\n // Get uploadFolder from config\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Muesra los links despues de 250ms | function showLinks(){
setTimeout(() => {
allLinks.forEach((link) => {
link.classList.toggle('showLink');
})
},250)
} | [
"function animateLinks(){\n\tlet interval = 100; \n\tdocument.querySelectorAll(\"#social-networks a\").forEach((e,index) => {\n\t\tsetTimeout(function () {\n\t\t\te.style.animation = \"display-link-animation 1s forwards\";\n\t\t},index*interval);\n\t\t\n\t});\n\n}",
"async function generateLinks() {\n\tlet html =... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Call this after each document copy | function postCopyCallback(err, newDoc) {
if (err) return; // Nothing else we can do if there's an error
appendJson(newDoc);
nextIndex++;
// See if we've done copying all the source docs
if(nextIndex === listLength) {
appendFeedback(`Done copying ${listLength} of ${listLength} files`);
... | [
"function iterateMain(intr_customer) {\n backupDocument.main.doc.push(intr_customer.doc);\n }",
"onCopy() {\n this.commands.exec(\"copy\", this);\n }",
"function onAllDocumentsLoaded() {\n\n if (nextFormPdf === nextAct.formPdf) {\n // no change to t... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Get Word Get the full word at the memory location. | getWord (addr) {
// make sure that the address is within bounds
addr = Memory.wrap(addr, this.SIZE);
// publish a retrieve event
this.events.retrieve.dispatch(addr, this.data[addr], 16 );
return this.data[addr];
} | [
"popWord() {\n const lowByte = this.popByte();\n const highByte = this.popByte();\n return z80_base_1.word(highByte, lowByte);\n }",
"function _getWord() {\n var index = Math.floor(Math.random() * _words.length);\n return _words[index];\n}",
"readWord() {\r\n let startPosition =... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Radio PLUGIN DEFINITION ========================== | function Plugin(option, value) {
return this.each(function () {
let $this = $(this);
let data = $this.data('bs.radio');
let options = $.extend({}, Radio.DEFAULTS, data, typeof option == 'object' && option);
if (!data && options.init && /select|disable|enable/.test(option)) options.in... | [
"_initializeRadio()\n {\n }",
"isRadio() {\n return true;\n }",
"function setupUIWidgets() {\n $(\"input[type='radio']\").checkboxradio();\n}",
"function Plugin(option) {\n return this.each(function () {\n var $this = $(this);\n var data = $this.data('radiocheck');\n va... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
eslintdisable nounusedvars We represent a [Z.t] as a javascript 32bit integers if it fits or as a bigInt. Provides: ml_z_normalize Requires: bigInt | function ml_z_normalize(x){
var y = x.toJSNumber () | 0;
if(x.equals(bigInt(y))) return y;
return x;
} | [
"function ml_z_of_nativeint(z) {\n return ml_z_of_int(z)\n}",
"function ml_z_of_int32(i32) {\n return bigInt(i32);\n}",
"function ml_z_of_nativeint(z1, z2) {\n\n}",
"function ml_z_of_int32(i32) {\n return ml_z_of_int(i32);\n}",
"function ml_z_fits_nativeint(z1) {\n return ml_z_fits_int(z1);\n}",
"fu... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Funcion que valida el ingreso de los datos en el formulario de contacto | function validarFormulario () {
//Variables
let lfname = document.getElementById("lfname").value;
let lemail = document.getElementById("lemail").value;
let lmessage = document.getElementById("lmessage").value;
console.log("Nombre " + lfname);
console.log("Correo" + lemail);
console.... | [
"function validarDatosyCrearPersona (){\n let nombreEsperandoAceptacion = document.getElementById(\"inputNombre\").value;\n let nombreOk = recibeDatoVerificaNoVacio(nombreEsperandoAceptacion);\n infoErrorNombre(nombreOk);\n\n let apellidoEsperandoAceptacion = document.getElementById(\"inputApellido\").v... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Returns the display format, considering the locale and the prop. | computedDisplayFormat() {
return DateInputUtil.computedDisplayFormat(this.props.displayFormat, this.props.intl.locale);
} | [
"static get Format () {}",
"static getLocaleDateFormat(locale, displayFormat) {\n const formatKeys = Object.keys(_angular_common__WEBPACK_IMPORTED_MODULE_3__[\"FormatWidth\"]);\n const targetKey = formatKeys.find(k => k.toLowerCase() === (displayFormat === null || displayFormat === void 0 ? void 0 :... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Creates an allocator for a temporary variable. A variable declaration is added to the statements the first time the allocator is invoked. | function temporaryAllocator(statements, name) {
var temp = null;
return function () {
if (!temp) {
statements.push(new DeclareVarStmt(TEMPORARY_NAME, undefined, DYNAMIC_TYPE));
temp = variable(name);
}
return temp;
};
} | [
"function temporaryAllocator(statements,name){var temp=null;return function(){if(!temp){statements.push(new DeclareVarStmt(TEMPORARY_NAME,undefined,DYNAMIC_TYPE));temp=variable(name)}return temp}}",
"function temporaryAllocator(statements,name){var temp=null;return function(){if(!temp){statements.push(new Declare... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Module hooker function that will replace Module._load and invoke the _listener with module and timing information | function _hooker(name, parent) {
var timeIn = Date.now(),
exports = _load.apply(Module, arguments),
timeOut = Date.now(),
mod = parent.children[parent.children.length - 1]; // should be the last loaded children
// call the listener
_listener({
name: name,
parent: parent,
module: mod,
filename: mod ?... | [
"_hookModuleLoad() {\n let self = this\n shimmer.wrap(Module, 'Module', '_load', function (load) {\n return function (file) {\n let mod = load.apply(this, arguments)\n\n // require instrument and not instrumented\n if (self._instruments[file] && ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Method used to get list of report types for "Report type" dropdown of Report detail view | getTypes(callback) {
if (!callback)
callback = () => null;
Backend.request("/report/types",{},"GET",{},null, function(err,response) {
if (err) {
callback(err, {});
return;
}
if (!response) {
callback(null,{})... | [
"function getReportType () {\r\n $.ajax({\r\n url:\"../lib/php/admin/getReportType.php\",\r\n type: \"POST\",\r\n dataType: \"json\",\r\n success:function(results){\r\n var size = results.length;\r\n var temp;\r\n for (v... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
translate relative url into absolute url url: relative url base: page url base of the relative url | static resolveUrl(url, base){
if('string'!==typeof url || !url){
return null; // wrong or empty url
}
else if(url.match(/^[a-z]+\:\/\//i)){
return url; // url is absolute already
}
else if(url.match(/^\/\//)){
return 'http:'+url; // url is absolute already
}
else if(url.match(/^[a-z]+\:/i)){ ... | [
"function makeAbsoluteUrl(base_url, relative_url) {\n\tvar PATH_SEPARATOR = \"/\";\n\tvar UPLEVEL_INDICATOR = \"..\";\n\tvar HTTP_PREFIX = \"http://\";\n\tvar used_relative_pieces = new Array();\n\n\t//split on a questionmark to get rid of the querystring, if any\n\tvar url_and_querystring = base_url.split(\"?\");\... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
update the instruction state game background | function instructionState() {
sea.update();
//player.update();
} | [
"function gameOverState() {\n background.update(); //update the background\n }",
"function updateState() {\n gState.push({\n board: copyMat(gBoard),\n shownCount: gGame.shownCount,\n markedCount: gGame.markedCount,\n lives: gGame.lives,\n safeClick: gGame.safeClick,... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
This splits tests by groups. Strategy for group split is taken from a constructor's config.by value: `config.by` can be: `suite` `test` function(numberOfWorkers) This method can be overridden for a better split. | splitTestsByGroups(numberOfWorkers, config) {
if (isFunction(config.by)) {
const createTests = config.by;
const testGroups = createTests(numberOfWorkers);
if (!(testGroups instanceof Array)) {
throw new Error('Test group should be an array');
}
for (const testGroup of testGroup... | [
"group(name, body) {\n const testGroup = this.test(name, body);\n testGroup.isGroup = true;\n return testGroup;\n }",
"function groupingTestCases() {\n return [\n {\n message: 'USER FIELD: A to Z',\n fieldName: 'USER NAME',\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
generate a mesh from atoms | function generateMesh(atoms)
{
var atomlist = []; //which atoms of atoms are selected for surface generation (all for us)
$.each(atoms, function(i, a) { a.serial=i; atomlist[i]=i;}); //yeah, this is messed up
var time = new Date();
var extent = $3Dmol.getExtent(atoms);
var w = extent[1][0] - extent[0][0];
var ... | [
"function mesh() {\n for(var i=0; i< N-1; i++) {\n for(var j=0; j< N-1; j++) {\n\n var a = vec4(2*i/N-1, 2*data[i][j]-1, 2*j/N-1, 1.0);\n var b = vec4(2*(i+1)/N-1, 2*data[(i+1)][j]-1, 2*j/N-1, 1.0);\n var c = vec4(2*(i+1)/N-1, 2*data[(i+1)][j+1]-1, 2*(j+1)/N-1, 1.0);\n var d = ve... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
QUADTABLES Record History Prototype Display | function workflowRecordHistory (row) {
if ( row['DT_INSERTED'] !== null ) {
ins_time = ellapseTime ( row['DT_INSERTED'] );
}
if ( row['DT_UPDATED'] !== null ) {
upd_time = ellapseTime ( row['DT_UPDATED'] );
}
if (row['INSERTED_BY'] ) {
txt = '<span class="timelogValue" tit... | [
"function displayRecord(record) {\n var tip= this; //\"this\" points to a string representing the ID of the BODY's parent table minus the \"table_\" prefix\n var addedRow= addDataRow(tables[tip]);\n setRowValues(addedRow, serverData.furnizori[tip][record.IDFurnizor],\n record.Factura, record.Chitant... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
The list of dependent Observers a subject may have: | function ObserverList(){
this.observerList = [];
} | [
"function registerDependsOnObservers() {\n var descs = this.propertyDescriptors(), desc, k, i, len;\n\n for (k in descs) {\n desc = descs[k];\n for (i = 0, len = desc.dependsOn.length; i < len; i++) {\n this.observe(desc.dependsOn[i], this, dependentPropertyObserver, {\n prior: true,... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
init channels data in revision history | function initReleasesData(revisionsMap, releases) {
// go through releases from older to newest
releases
.slice()
.reverse()
.forEach(release => {
if (release.revision && !release.branch) {
const rev = revisionsMap[release.revision];
if (rev) {
const channel =
... | [
"initChannels() {\n this.initFetchAll();\n this.initGenerate();\n this.initSubmit();\n this.initDelete();\n this.initFetchOne();\n this.initUpdate();\n }",
"createChannel() {\n\t\tfor (let level = 1; level < this.props.appbaseField.length; level += 1) {\n\t\t\tconst re... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
'num' == number of damages from 'data' variable 'severity_type' == JSON object passed according to severity type from 'init.js' (eg. severity_level_fatalities, severity_level_evacuees) Return severity level accordingly | function severityLevel(num, severity_type) {
if (isNaN(num)) return 'NA';
if (num == 0) return 'Level 0';
if (num <= severity_type[1]) return 'Level 1';
if (num <= severity_type[2]) return 'Level 2';
if (num <= severity_type[3]) return 'Level 3';
if (num <= severity_type[4]) return 'Level 4';
... | [
"function renderSeverityCell(data, type) {\n if (type === 'display' || type == 'filter' || type == 'sort') {\n let abbreviatedData = data;\n if (data === '1 - Critical') { abbreviatedData = '1-Crit'; }\n else if (data === '2 - High') { abbrevia... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Do a petition to connect with the web socket server. If the connection was successful subscribe to the queue for get the messages from the server and show the short url. | function connect() {
var socket = new SockJS(URL_SERVER + '/short_url');
stompClient = Stomp.over(socket);
stompClient.connect({}, function (frame) {
console.info('Connected: ' + frame);
stompClient.subscribe('/user/url_shortener/short_url', function (response) {
dealMessageFromS... | [
"function connect() {\n // STOMP JavaScript clients will communicate to a STOMP server using a ws:// URL.\n // To create a STOMP client JavaScript object, you need to call Stomp.client(url) with the URL corresponding to the server's WebSocket endpoint:\n // client = Stomp.client(\"ws://localhost:8080/chat\... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Gets a user element and returns the user's object, null if not found, or false if allUsers array is empty. | function getUserObject(userElement) {
if (!allUsers.length) return false;
for (var i = 0, len = allUsers.length; i < len; i++) {
if (allUsers[i].userElement.html() === userElement.html()) {
return allUsers[i];
}
}
return null;
} | [
"function getUserData(userElement) {\n\t\tif (!allUsers.length) return false;\n\n\t\tfor (var i = 0, len = allUsers.length; i < len; i++) {\n\t\t\tif (allUsers[i].userElement.html() === userElement.html()) {\n\t\t\t\treturn allUsers[i].userData;\n\t\t\t}\n\t\t}\n\n\t\treturn null;\n\t}",
"get_user()\r\n {\r\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
trigger the next element in the queue to be started! | next() {
this.updateTaskRunning();
const next = this.queue.shift();
next === null || next === void 0 ? void 0 : next.start();
} | [
"function startQueue() {\n if(running)\n return;\n running = true;\n setTimeout(doNext,queue[0].delay);\n\n function doNext() {\n queue[0].fn();\n removeItem(queue,0);\n if(queue.length>0) {\n setTimeout(doNext,queue[0].delay);\n } ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
getImage accesses the S3 Bucket asynchronously, and gets a single image by its media_key | async function getImage(media_key) {
const data = s3.getObject({
Bucket: 'twitterimagesoth',
Key: media_key
}
).promise();
return data;
} | [
"async getImage (key) \n { \n \n var s3 = new AWS.S3(); \n var params = \n { \n Bucket: 'limbikbucket', \n Key: key \n }\n try \n {\n var data = await s3.getObject(params).promise();\n return data.Body.toString('base64');\n } catch(e) \n {\n return \"\";\n }... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Loads the Partner Sources | function loadPartner() {
GisMap.Util.MAX_APP_FILES = application.partner_sources.length;
GisMap.Util.LOADED_APP_FILES = 0;
if (application.partner_sources.length == 0) {
GisMap.Core.injectHtml(STARTAPPLICATION);
return;
}
... | [
"_initSources() {\n // finally load every sources already in our plane html element\n // load plane sources\n let loaderSize = 0;\n if(this.autoloadSources) {\n const images = this.htmlElement.getElementsByTagName(\"img\");\n const videos = this.htmlElement.getEleme... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Constructs a new MailServiceBaseResponse. | constructor() {
MailServiceBaseResponse.initialize(this);
} | [
"function EmailResponse(options) {\n //inherit class\n BaseResponse.call(this, options);\n}",
"function BaseResponse(options) {\n //set members\n this.Success = true; //boolean\n this.Messages = []; //string array\n\n //iterate all keys in options\n for (var key in options) {\n if (thi... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Attempt a single spawn point fetch by hitting the fastpokemap API. | function attemptFetch(lat, lng, callback) {
try {
fs.unlinkSync("output.json");
} catch(err) {
console.log("Couldn't delete output.json");
}
var url = secretReversed.generateKeyCheck('https://api.fastpokemap.se/?&lat=' + lat + '&lng=' + lng);
console.log(... | [
"function get_spawn_point() {\n\tif (this.spawn_points.length === 0){\n\t\treturn null;\n\t}\n\t\n\tvar index = randInt(0, this.spawn_points.length - 1);\n\tvar result = {x: this.spawn_points[index].x, y: this.spawn_points[index].y};\n\tthis.spawn_points.splice(index, 1);\n\t\n\treturn result;\n}",
"getSpawnPoint... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
puts the detail gallery carousels caption in the pager bar checks image for alt tag also checks for figcaption tag | function showCaption(element, numCaptions) {
//The image caption is populated with the ALT tag on the image
var $Element = null;
if ($('#detail-cycle img').length > 1) {
$Element = $(element);
// MOHGS-650
//check if a figure element
if ($Element.length > 0 && $Element[0].tag... | [
"function addCaptions(){\r\n\t\tvar images = $('.wc-caption-image, .wc-caption-image-left, .wc-caption-image-right');\r\n\t\t$(window).load(function(){ /*[1]*/\r\n\t\t\tfor (var i = 0; i < images.length; i++) {\r\n\t\t\t\tvar image = $(images[i]);\r\n\t\t\t\timage.wrap('<figure style=\"'+WcFun.emptyIfNull(image.att... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
regBGM :: SoundMaster > (String, String, Bool) > SoundMaster | regBGM(path, keyword, loop) {
let audio = SoundMaster.createAudio(path, loop),
newList = M_List.Cons({
keyword: keyword,
audio: audio
})(this._bgmList);
return new SoundMaster(newList, this._seList);
} | [
"regSE(path, keyword) {\n let audio = SoundMaster.createAudio(path, false),\n newList = M_List.Cons({\n keyword: keyword,\n audio: audio\n })(this._seList);\n return new SoundMaster(this._bgmList, newList);\n }",
"pauseBGM(keyword) {\n return new M_IO((world) => {\n let audi... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Public function `assigned`. Returns true if `data` is not null or undefined, false otherwise. | function assigned (data) {
return data !== undefined && data !== null;
} | [
"function assigned (data) {\n\t return !isUndefined(data) && !isNull(data);\n\t }",
"function assigned (data) {\n return ! isUndefined(data) && ! isNull(data);\n }",
"function assigned(data) {\n return data !== undefined && data !== null;\n }",
"function assigned(data) {\n return data... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
parse test suite name from an HTML string | function parseSuiteName(test_suite) {
var pattern = /<title>(.*)<\/title>/gi;
var suiteName = pattern.exec(test_suite)[1];
return suiteName;
} | [
"onSuiteStart (suite) {\n this.testnameStructure.push(suite.title.replace(/ /g, '-').replace(/-{2,}/g, '-'));\n }",
"function testNameFormatter(result) {\n return `${result.suite.join(' ')} ${result.description}`\n }",
"onSuiteStart (suite) {\n helpers.debugLog(`\\n\\n\\n--- New suite: ${suite.title}... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Boolean NAND (Not AND) Write a function nand that takes two Boolean values. If both values are true, the result should be false. In the other cases the return should be true. I.e.: The call nand(true, true) should return false. The calls nand(true, false), nand(false, true) and nand(false, false) should return true. | function nand(blo1, blo2) {
let and =blo1 && blo2
return !and
} | [
"function nand(value1, value2) {\n return !(value1 && value2);\n}",
"function nand(val1, val2) {\n\tif (val1 && val2) {\n\t\treturn false;\n\t} else {\n\t\treturn true;\n\t}\n}",
"function NAND(x, y) {\n return (!x || !y);\n}",
"function NAND(x, y) {\n return !(x && y) ? 1 : 0;\n}",
"function NAND(x, y... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
wait all txs in mempool to be packed into block | async function waitMempool(rpc) {
while (true) {
sleep.sleep(1)
let mempoolInfo = await rpc.rawCall('getmempoolinfo')
console.log('transaction number left in mempool: ' + mempoolInfo.size)
if (mempoolInfo.size == 0) {
break
}
}
} | [
"async function waitForAll(txs) {\n\t// track cumulative gas usage\n\tlet cumulativeGasUsed = 0;\n\n\tconsole.log(\"\\twaiting for %o transactions to complete\", txs.length);\n\t// wait for all pending transactions and gather results\n\tif(txs.length > 0) {\n\t\t(await Promise.all(txs)).forEach((tx) => {\n\t\t\t// ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Map NightDaystyle > only Day_style Only Select one Style | function mapstyle (){
var date = new Date();
var day_map = [{"featureType":"landscape.natural","elementType":"geometry.fill","stylers":[{"visibility":"on"},{"color":"#e0efef"}]},{"featureType":"poi","elementType":"geometry.fill","stylers":[{"visibility":"on"},{"hue":"#1900ff"},{"color":"#c0e8e8"}]},{"featureType":"... | [
"function setDaysIntoPandemic(days) {\n map.data.setStyle(function(feature) {\n let state = feature.getProperty('NAME');\n var color = getValueBasedOnStateAndDay(state, days, true);\n\n return {\n fillColor: color,\n fillOpacity: 0.8,\n strokeWeight: 1\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Function: millisToDateUN(millis) Handles the universal conversion of milliseconds to date. Parameters: millis A string of milliseconds. Page Actions: See millisToDateHandler(). Called when the client's default date format is set to dd/mm/yyyy. | function millisToDateUN(millis) {
var datetime = new Date(millis);
var theyear=datetime.getFullYear();
var themonth=datetime.getMonth()+1;
var theday=datetime.getDate();
dateString = (theday+"/"+themonth+"/"+theyear);
return dateString;
} | [
"function millisToDateHandler(millis) {\r\n\tvar dateString;\r\n\tif (clientDateFormat == 'dd/mm/yyyy') {\r\n\t\tdateString = millisToDateUN(millis) \r\n\t} else {\r\n\t\tdateString = millisToDateUS(millis);\r\n\t}\r\n\treturn dateString;\r\n}",
"function millisToDateUS(millis) {\r\n\tvar datetime = new Date(mill... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Shots: number of shots per launch Type: what kind of blaster is this(cannon, mutiShot, shotgun) Spread: how spread out should the shouts be from each other Rate: rate of fire Dir: direction to shoot + is down, is up | function Blaster(shots, type, spread, rate, dir){
this.shotNumber = shots;
this.type = type;
this.spread = spread;
this.rate = rate;
this.reload = 0;
this.ready = true;
this.dir = dir;
} | [
"function fireSuperSpecial() {\n if (game.time.now > shotTime)\n {\n \tfireSpecial()\n \tvar count = 2\n music = game.sound.play('laser');\n shot = shots.getFirstExists(false);\n if (shot && count == 2)\n {\n shot.reset(player.x -45 , player.y +10);\n pl... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Cleanup the current instance of the web worker. | function destroyWorker() {
asyncProxy = undefined;
} | [
"function destroyWorker() {\n\t asyncProxy = undefined;\n\t}",
"cleanup() {\n if (this.worker) {\n this.worker.end();\n }\n this.processor = undefined;\n this.worker = undefined;\n }",
"destroy() {\n try {\n this._worker.removeEventListener('message', this._onM... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Adds any needed dependencies to the top of the file TODO Add mocha? | function addDependencies(app) {
let dependents = `const expect = require('chai').expect;${newLine}`;
dependents += `import React from 'react';${newLine}`;
dependents += `import { mount } from 'enzyme';${newLine}`;
dependents += `import 'jsdom-global/register';${newLine}`;
dependents += `import ${app} from 'fi... | [
"setup(require, fix) {\n this.do(() => {\n if (!require()) {\n console.debug(\"[JasmineTestTool] require() returns false, execute fix()\");\n fix();\n }\n })\n this.wait(require);\n }",
"function initdependencies(){\n process.spawnSync('npm',['install', '--save', 'express'], {... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Send sms with free | function sendSmsWithFreeGateway(data, selectedResult, user, pass) {
var messages = getSmsMessages(data, selectedResult);
for (var i = 0; i < messages.length; i++ ) {
var message = messages[i];
freeSendSms(user, pass, message);
}
} | [
"function sendSms() {\n\n // 'msg' and 'numberToDial' are passed in via the HTTP request from the Finesse gadget.\n // Pass these to the Tropo API to send an SMS.\n message(msg, {\n to:\"+\" + numberToDial,\n network:\"SMS\"\n });\n\n log(\"Sent \" + msg + \" to \" + numbertoDial);\n}",... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Setup mouse handlers // //////////////////////// MultiselectJS does not dictate how to recognize mouse events. Below is one example. Handler for mouse down registers handlers for mouse move and mouse up events, mouse up unregisters them. Each handlers invokes the current geometry's m2v function to translate the mouse c... | function setupMouseEvents(parent, canvas, selection) {
function mousedownHandler(evt) {
var mousePos = selection
.geometry()
.m2v(multiselect_utilities.offsetMousePos(parent, evt));
switch (multiselect.modifierKeys(evt)) {
case multiselect.NONE:
selection.click(mousePos);
bre... | [
"function setupMouseEvents (parent, canvas, selection) {\n \n function mousedownHandler(evt) {\n \n var mousePos = selection.geometry().m2v(offsetMousePos(parent, evt));\n switch (multiselect.modifierKeys(evt)) {\n case multiselect.NONE: selection.click(mousePos); break;\n case multiselect.CMD: sel... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Moves the car down | goDown() {
if (this.y > 800) {
this.y = 0 - this.width * 5;
this.carMadeIt = true;
//5% chance of turning right
if (Math.floor((Math.random() * probability)) == 1) {
this.turnRight = true;
}
} else {
this.carMadeIt = false;
}
if (this.carMadeIt) {
thi... | [
"moveDown() {\n this.shiftY = +8;\n this.moving = MoveState.DOWN;\n }",
"function moveDown(){\n undraw();\n currPos += width;\n draw();\n stopTetromino();\n }",
"function turnDown(){\n curDirection = 2;\n floorArray[xPos][yPos].src = d_turtle;\n curDirBtn.class... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Manipulate Sharepoint List By Query method to get single item | function getItemByQuery(options) {
var context = SP.ClientContext.get_current();
var oList = context.get_web().get_lists().getByTitle(options.listName);
var deferred = $q.defer();
var defObject = {
listName: false,
fieldValue: false,
... | [
"function getListItemWithId(itemId, listName, siteurl, success, failure) {\n var url = siteurl + \"/_api/web/lists/getbytitle('\" + listName + \"')/items?$filter=Id eq \" + itemId;\n $.ajax({\n url: url,\n method: \"GET\",\n headers: { \"Accept\": \"application/json; odata=verbose\" },\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Updates suspected malaria cases graph | function updateSuspectedMalariaCases(){
var svgSuspectedMalariaCases = d3.select("#vis-sec-suspected-malaria-cases")
.append("svg")
.attr("width", width + margin.left + margin.right)
.attr("height", ... | [
"function updateMalariaCases(){\n\tvar svgMalariaCases = d3.select(\"#vis-sec-malaria-cases\")\n\t\t\t\t\t\t\t.append(\"svg\")\n\t\t\t\t\t\t\t.attr(\"width\", width + margin.left + margin.right)\n\t\t\t\t\t\t\t.attr(\"height\", height + margin.top + margin.bottom)\n\t\t\t\t\t\t\t.style(\"margin-left\", margin.left ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
This function reads file contents and caches them in a global LRU cache. Returns a Promise filepath => content array for all files that we were able to read. | function readSourceFiles(filenames) {
// we're relying on filenames being de-duped already
if (filenames.length === 0) {
return utils_1.SyncPromise.resolve({});
}
return new utils_1.SyncPromise(function (resolve) {
var sourceFiles = {};
var count = 0;
var _loop_1 = functi... | [
"function cacheContents(reader) {\n // console.log(\"Come in cache Contents\");\n return new Promise(function (fulfill, reject) {\n reader.getEntries(function (entries) {\n // console.log('Installing', entries.length, 'files from zip');\n Promise.all(entries.map(cacheEntry)).then(... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Gets a 2D point | function point2D(x, y) {
return {x: x, y: y};
} | [
"function point2D(x, y) {\n \n return {x: x, y: y};\n\n}",
"function convertIsometricTo2d(point)\n{\n return {\n x: (2* point.y + point.x)/2,\n y: (2* point.y - point.x)/2\n };\n}",
"getPoint2X() {\n\n return this.point2.getX();\n }",
"function CPoint2D(x, y) {\n this.x = x ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |