query stringlengths 9 34k | document stringlengths 8 5.39M | negatives listlengths 19 20 | metadata dict |
|---|---|---|---|
COMMON FUNCTIONS Gets the local date | getLocalDate()
{
return new Date(new Date().toLocaleString('nl-NL', { timeZone: this.homey.clock.getTimezone() }));
} | [
"convert_date_to_local(date) {\n if(typeof(date) == 'undefined' || date == null)\n return null;\n \n var local_tz = Intl.DateTimeFormat().resolvedOptions().timeZone; // local timezone\n \n return moment(date).tz(local_tz).format('YYYY-MM... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
handle a channel that has not been successfully subscribed to after a timeout period ... return a timeout error to the caller | _handleSubscribeTimeout (channel) {
if (this.statusPromises[channel]) {
this.statusPromises[channel].reject({ error: 'timeout' });
this._stopListening(channel);
}
} | [
"_stopStatusListening (channel) {\n\t\tdelete this.statusPromises[channel];\n\t\tif (this.statusTimeouts[channel]) {\n\t\t\tclearTimeout(this.statusTimeouts[channel]);\n\t\t}\n\t\tdelete this.statusTimeouts[channel];\n\t}",
"subscribe (channel, listener, options = {}) {\n\t\t// subscribe to the channel, but succe... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Select and navigate to a random bookmark from within the set | function goToRandomURLFromSet(setName) {
folderIds = allSets[setName];
const promises = [];
let allNodes = [];
folderIds.forEach(id => {
const promise = chrome.bookmarks.getChildren(id);
promise
.then((n) => allNodes = allNodes.concat(n))
... | [
"function goToRandomFromAllBookmarks() {\n let bookmarks = [];\n let folderStack = [];\n chrome.bookmarks.getTree(result => {\n let node = result[0];\n\n separateFoldersAndBookmarks(node, bookmarks, folderStack);\n while (folderStack.length > 0) {\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Produce a Location query string from a parameter object. | function locationQuery(params) {
return (
"?" +
Object.keys(params)
.map(function(key) {
return encodeURIComponent(key) + "=" + encodeURIComponent(params[key]);
})
.join("&")
);
} | [
"buildLocation() {\n const search = this.#params.toString();\n return { ...this.#location, search: search ? '?' + search : '' };\n }",
"function useQuery () {\n return new URLSearchParams(useLocation().search)\n}",
"build(params) {\r\n var buildedUrl = new URL(this.location.origin + this.location... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Se encarga de mostrar el spinner de carga | loadSpinner(display){
document.querySelector(".contenido-spinner").style.display = display;
document.querySelector("#resultado").style.display = "none";
} | [
"function colocarLoadingValorVolumen(){\n\t$(\"#loadingVolumen\").show();\n\t$(\"#valorVolumen\").hide();\n}",
"function showSpinner() {\n $(options.selectors.placesContent).addClass('hidden');\n $(options.selectors.spinner).removeClass('hidden');\n }",
"function _fillContentWithLoadingSpinner(... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Returns the replacement string for objects in noam.re.array.specials or | function _replacementStr(obj) {
// This can't be done with a dict because objects are not hashable...
if (obj === specials.ALT || obj === specials.KSTAR ||
obj === specials.LEFT_PAREN || obj === specials.RIGHT_PAREN ||
obj === specials.EPS) {
return obj.toString();
... | [
"function _replacement() {\n if (!arguments[0]) return \"\";\n var i = 1, j = 0, $pattern;\n // loop through the patterns\n while ($pattern = _patterns[j++]) {\n // do we have a result?\n if (arguments[i]) {\n var $replacement = $pattern[$REPLACEMENT]... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Function to cast UInt32 to a UInt8[] | function UInt32toUInt8(value) {
console.log(value);
t = [
value >> 24,
(value << 8) >> 24,
(value << 16) >> 24,
(value << 24) >> 24
];
console.log(t);
return t;
} | [
"function bytesToUint8Array(arr) {\n var l = arr.length;\n var res = new Uint8Array(l);\n for (var i = 0; i < l; i++) {\n res[i] = arr[i];\n }\n return res;\n }",
"function toU8Array(ptr, length) {\n return HEAPU8.subarray(ptr, ptr + length);\n }",
"f... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Function:generateThemeTableHTML (themeSrc, pageObj, ratio) Purpose:generates HTML output with a sample table showing the theme specified in 'themeSrc'. Warning:The wizard design page (pwizwat_3.htm) is only passing in a pageObj with the layoutObjArray all other fields of that object are uninitialized. | function generateThemeTableHTML (themeSrc, pageObj, ratio)
{
var thumb_ratio = 0.0625;
var publish = 0;
if (ratio < 0)
{
publish = 1;
ratio = Math.abs(ratio);
}
// regular expression objects used for parsing info out of style sheets
// do this so multiple tables can appear on a page, each with its own set o... | [
"function generateBaseThemeHeaderHTML (themeSrc, retPage)\n{\n\t// this code would normally go directly into the style pages since its page\n\t// specific, but it's used on 2 seperate pages relating to styles, and I didn't\n\t// want to maintain this in 2 areas\n\tvar myTheme = themeSrc;\n\tif ((myTheme.indexOf(\"T... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
basket remove Iterates throught the list of equipments if any of them is equal to the clicked element it will be removed from the basket. | basketRemove(equipment) {
for (var i = 0; equipmentBasket.length > i; i++) {
if (equipmentBasket[i].id == equipment.id) {
equipmentBasket.splice(i, 1);
}
}
this.specify();
} | [
"function removeBasketItem(event) {\n let buttonClicked = event.target;\n let id = buttonClicked.previousElementSibling.innerText;\n buttonClicked.parentElement.parentElement.remove();\n let itemToRemove = { productId: id }\n basketArrayItemRemove(itemToRemove)\n updateBasketTotal();\n}",
"remov... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
The body check for the request DELETE /categories/:id | function checkRequestDeleteCategory (req, res, next) {
var params = {};
if (!req.params.hasOwnProperty('id')) {
return next(apiErrors.GENERIC_ERROR_REQUEST_FORMAT_ERROR, req, res);
}
params.id = req.params.id;
return {params: params, query: null, body: null};
} | [
"function getDatabaseParameterDeleteCategory (params, query, body){\r\n\tvar parameters = {\r\n\t\twhere: { category_id: params.id },\r\n\t};\r\n\treturn parameters;\r\n}",
"async remove(category, rmSpecs) {\n const rmObj = this.validator.validate(category, 'remove', rmSpecs);\n //@TODO\n let obj = this.... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Smoothly connect the road, so we need to set its rotation correctly Author: LYY | setCorrectRotation (raoad) {
var pointBefore = this._lastRoad.children[0].children
var SlopEndPosition2 = pointBefore[
pointBefore.length - 1
].parent.convertToWorldSpace(pointBefore[pointBefore.length - 1].position)
var SlopEndPosition1 = pointBefore[
pointBefore.length - 2
].p... | [
"roadLineDrawtest()\n {\n this.direction.route({\n origin:{lng:-78,lat:39.137},\n destination:{lat:39.281,lng:-76.60},\n travelMode:google.maps.TravelMode.DRIVING\n },(r,s)=>{\n var pathPoints=r.routes[0].overview_path;\n var path=new google.ma... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Gets a humanreadable representation of the given [[Rule]] to aid debugging. Note that changes to the exact format of the return value are not considered a breaking change; it is intended to aid in debugging, not as a serialisation method that can be reliably parsed. | function ruleAsMarkdown(rule) {
let markdown = `## Rule: ${asUrl(rule)}\n\n`;
let targetEnumeration = "";
if (hasPublic(rule)) {
targetEnumeration += "- Everyone\n";
}
if (hasAuthenticated(rule)) {
targetEnumeration += "- All authenticated agents\n";
}
if (hasCreator(rule)) {... | [
"function getRuleName(rule){\n if(!rule) return '[NULL RULE]';\n return Array.isArray(rule) ? rule[0].name + (rule.length > 1 ? '..' : '') : rule.name;\n}",
"function ruleLine(r) {\n return util.format('%s %s %s', r.uuid,\n r.enabled ? 'true ' : 'false ', r.rule);\n}",
"function getBoquetDesign(r... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Calculate the total height of all the margins of the children that are used between the child elements. | getTotalChildMarginHeights() {
let height = 0;
for (let i = 0; i < this._children.length; i++) {
let child = this._children[i];
if (i < this._children.length - 1) {
height += Math.max(child._marginBottom, this._children[i + 1]._marginTop);
}
}
... | [
"function recalcHeight() {\n // each child element will normally take up 2/3 units\n var y = -1;\n for (var obj of children) {\n // each child lives in its own coordinate system that was scaled by\n // one-third\n y += obj.getHeight() * ONE_THIRD;\n }\n\n... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Invoke opens a new connection. Note; it is the caller's responsibility to close the invocation. | invoke() {
return __awaiter(this, void 0, void 0, function* () {
const inv = new invocation_1.Invocation();
inv.connection = yield this.pool.connect();
return inv;
});
} | [
"function call() {\n if (gOurPeerId == null)\n failTest('calling, but not connected');\n if (gRemotePeerId == null)\n failTest('calling, but missing remote peer');\n if (gPeerConnection != null)\n failTest('calling, but call is up already');\n\n gPeerConnection = createPeerConnection();\n gPeerConnect... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
you can as assume width = height = size use the linePixelColor for the lines and fillPixelColor for the fill of the smiley | function Smiley(size, linePixelColor, fillPixelColor) {
// TODO: Solve your exercise here
} | [
"function hLine(i){\n var x1 = scaleUp(0);\n var x2 = scaleUp(boardSize - 1);\n var y = scaleUp(i); \n drawLine(x1, x2, y, y);\n //alert(\"i:\" + i+ \" x1:\"+x1+ \" x2:\"+x2+\" y1:\"+y+ \" y2:\"+y);\n }",
"function splitPixels(x_cord, y_cord, colorHex, sizeVal) {\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Returns true if the given old identifer has already been assigned a new identifier. | hasId(old) {
return this._existing.has(old);
} | [
"function isNew(candidate, existing) {\n pos = 0;\n while (pos < existing.length) {\n if (existing[pos].equals(candidate)) { return false; }\n pos++;\n }\n return true;\n}",
"function hasChanged(oldCampaign, newCampaign) {\n for (var key in newCampaign) {\n var oldAttr = oldCampaign[key];\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Get the set of currently tracked point refs of the editor. | pointRefs(editor) {
var refs = POINT_REFS.get(editor);
if (!refs) {
refs = new Set();
POINT_REFS.set(editor, refs);
}
return refs;
} | [
"pathRefs(editor) {\n var refs = PATH_REFS.get(editor);\n\n if (!refs) {\n refs = new Set();\n PATH_REFS.set(editor, refs);\n }\n\n return refs;\n }",
"rangeRefs(editor) {\n var refs = RANGE_REFS.get(editor);\n\n if (!refs) {\n refs = new Set();\n RANGE... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Delete One Appointment by AppointmentId | async deleteAppointment(id) {
return Appointment.destroy({where:{id}})
} | [
"function deleteOne(req, res) {\n const id = req.params.applicantId;\n ApplicantModel.findByIdAndDelete(id, (err, applicant) => {\n if (err) throw err;\n if (applicant) {\n res.send({ success: true, message: 'successfully removed' });\n } else {\n res.send({ success: false, message: 'applicant ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Utility class used to spawn command asynchronously Should belong on its own module... | function AsyncProcess(command) {
this._init(command);
} | [
"function make_external_command({command_info,client_id,ws}) { \n\n //dynamically create the command class here \n class external_command extends base_command { \n\t\n\tconstructor(config) {\n \t super({id : command_info['id']})\n\t this.command_info = command_info //store the info within the command... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
value = 'min > sec && sec == 10' return ['min > sec', 'sec == 10'] | function separeteAnd(value) {
if (typeof value == 'boolean') {
return value
}
if (value.indexOf('&&') > 0) {
let res = value.split('&&')
return res
} else if (value.indexOf('&') > 0) {
let res = value.split('&')
return res
} else if (value.indexOf('&&') > 0) {... | [
"function valCheck(input) {\n if (input.length != 5) invTime();\n var hour = Number(input.slice(0, 2));\n if (isNaN(hour) || hour < 0 || hour > 23) invTime();\n var minute = Number(input.slice(3, 5));\n if (isNaN(minute) || minute < 0 || minute > 59) invTime();\n minute*=.01;\n return [hour, mi... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Initializes the home controller functionalities to be useable. This relies on first loading the Google Places API. | function initialize() {
console.log('Initializing Home Controller');
$scope.state.doneInitializing = false;
// Make sure the Google Places API is loaded before continueing.
baLibraryStore.load('googleplaces')
.then(function() {
console.log('Loaded Google Places');
initAutocomplete();... | [
"function init(){\n homeScreen.createHomePage();\n beaverEvents.addModel(beaverApp);\n beaverEvents.addModel(beaverRelations);\n beaverEvents.getViewState(homeScreen);\n beaverEvents.getViewState(profileView);\n beaverEvents.activeView = homeScreen.name;\n beaverEvents.viewState.homeScreen.show... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Override Auto hydrate on save | _update() {
if (this.hydrateOnUpdate()) {
return super._update().then((model) => {
Object.assign(this, model);
return this;
});
}
return super._update();
} | [
"hydrateOnUpdate() {\n return true;\n }",
"async save() {\n // Use replace instead of has been fully updated in any way\n if (this.__fullUpdate) {\n return await this.replace();\n }\n\n // Ensure model is registered before saving model data\n assert.instanceOf(this.constructor.__db, DbApi,... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Enter a parse tree produced by Java9ParserimportDeclaration. | enterImportDeclaration(ctx) {
} | [
"enterSingleTypeImportDeclaration(ctx) {\n\t}",
"function parseImport() {\n if (token.type !== _tokenizer.tokens.string) {\n throw new Error(\"Expected a string, \" + token.type + \" given.\");\n }\n\n var moduleName = token.value;\n eatToken();\n\n if (token.type !== _tokenizer.to... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Function calls 'printQuote' function and 'displayBgColor' function | function displayQuoteAndColor() {
printQuote();
displayBgColor();
} | [
"function changeQuote() {\n setBgColor();\n getQuotes();\n}",
"function printQuote() {\n var randomQuote;\n do { randomQuote = getRandomQuote(); } while (randomQuote === currentQuote);\n currentQuote = randomQuote;\n randomBackgroundColor();\n var htmlString = `<p class=\"quote\">${randomQuote.quote}</... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
use componentWillUnmount to clean the state of any carryover values that otherwise would cause the LL to rerender as a Queue or Stack when switching between components | componentWillUnmount() {
this.props.cleanStateValues();
} | [
"componentWillUnmount() {\n this.props.fnEraseCityStateData();\n }",
"componentWillUnmount(){\n this.props.getProviderErase();\n }",
"componentWillUnmount() {\n\t\tif (this.props.cleanStylesOnUnmount) {\n\t\t\tthis.fontManager.removeCustomStyle();\n\t\t}\n\t}",
"componentWillUnmount() {\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
iterating through the list of moves we check if there is one (Move) greater than our maximum rating, if so than we will add it to our moves values, and store its index if it's the same we'll add to the ties array | function highestRatedMove(moves) {
var maximumRating = -100000000000000;
var maximumMove = -1;
var ties = [];
for (var index = 0; index < moves.length; index++) {
if (moves[index].rating > maximumRating) {
maximumRating = moves[index].rating;
maximumMove = index;
ties = [i... | [
"function maxMove(game){\n return possMoves.reduce(function(maxSoFar, current){\n return evalMove(game, current) > evalMove(game, maxSoFar) ? current : maxSoFar;\n });\n }",
"minimax(newBoard, player) {\n let unvisitedCells = newBoard.unvisitedCells();\n\n if (this.checkWinner(newBoard, this.h... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Wait for the directives in the given modules have been loaded | function loadNgModuleDirectives(ngModules) {
return Promise
.all(ListWrapper.flatten(ngModules.map(function (ngModule) { return ngModule.transitiveModule.directiveLoaders.map(function (loader) { return loader(); }); })))
.then(function () { });
} | [
"function loaded() {\n var m = null,\n pending = [];\n\n for (m in modules) {\n if (modules.hasOwnProperty(m) && modules[m].name === undefined) {\n pending.push(m);\n }\n }\n\n if (pending.length === 0) {\n console.log('core::loa... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Tries to create the drop down list for programs and triggers a reload if the html element 'programList' does not yet exist. | function tryToCreateDropDown(){
var sel = document.getElementById('programList');
if(sel){
createDropDown();
}else{//trigger a reload
location.reload();
}
} | [
"function initAdminProgramDropdown() {\n\tvar dropdown = document.getElementById(\"programDropdown\");\n\t//if the dropdown box exists\n\tif(dropdown) {\n\t\t//clear the dropdown box\n\t\tdropdown.options.length = 0;\n\t\t\n\t\t//add every program to the dropdown box\n\t\tvar i;\n\t\tfor(i in programs) {\n\t\t\tvar... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
assigns the API methods on the options object to the controller methods that implement the functionality. allows for easy resetting if the sitGridOptions object is changed. | function setOptionsAPIMethods() {
vm.sitGridOptions.selectItems = vm.selectItems;
vm.sitGridOptions.selectAll = vm.selectAll;
vm.sitGridOptions.sortBy = vm.sortBy;
vm.sitGridOptions.dataUpdated = vm.dataUpdated;
vm.sitGridOptions.getSelectedItems = vm.getSelec... | [
"options(ctx) {\n ctx.response.headers.set('Allow', this.allowedMethods());\n }",
"setOptions(options) {\n this.options = Object.assign({\n labels: ['Vssue'],\n state: 'Vssue',\n prefix: '[Vssue]',\n admins: [],\n perPage: 10,\n pr... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
New Election Component This component displays a form to create a new election, that is a smart contract instance. You will get the smart contract in SmartContractDetails folder (webvote.sol file) Functions for user validation: checkLogin() : Sends the axios request to server.js file on path "/user" to get the details ... | function ElectionForm() {
//-----------------------Section Start: Variables and States-----------------------------------------------
let history = useHistory();
let web3 = new Web3(process.env.REACT_APP_URL_INFURA);
const privateKey = Buffer.from(process.env.REACT_APP_WEB_VOTE_PRIVATE_KEY, 'hex');
... | [
"async function newContract() {\n\n const beneficiary = document.getElementById(\"beneficiary\").value;\n const arbiter = document.getElementById(\"arbiter\").value;\n // const value = ethers.BigNumber.from(document.getElementById(\"wei\").value);\n const value = ethers.utils.parseEther(document.getElementById(... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
set columnTitle (name to show in the ui) | function setColumnTitle(title){
return '<span class="endPointDiv endPointLeft">•</span>'+ title +'<span class="endPointDiv endPointRight">•</span>';
} | [
"function changeColTitle(obj, col) {\r\n NewGridObj.dimTitles[ColDimId][col] = obj.innerHTML;\r\n}",
"_buildColumnHeaderTitle(){\n\t\tvar def = this.definition;\n\n\t\tvar titleHolderElement = document.createElement(\"div\");\n\t\ttitleHolderElement.classList.add(\"tabulator-col-title\");\n\t\t\n\t\tif(def.hea... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Return a new ``uint88`` type for %%v%%. | static uint88(v) { return n(v, 88); } | [
"static uint112(v) { return n(v, 112); }",
"static uint168(v) { return n(v, 168); }",
"static uint56(v) { return n(v, 56); }",
"static uint(v) { return n(v, 256); }",
"static uint8(v) { return n(v, 8); }",
"static uint192(v) { return n(v, 192); }",
"static uint120(v) { return n(v, 120); }",
"static ui... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Search and return the session id from the notes | function getSession(text) {
return text.substring(text.search('Session ID:')).split('\n', 1)[0];
} | [
"static async find(id) {\n let sessionData = await db.get(`session:${id}`)\n return new Session(sessionData);\n }",
"function findCurrentNote() {\n return $(\"#current-note-display\")[0].getAttribute(\"data-id\");\n}",
"function findUserSessions(userId) {\n let db = mongoStore.db;\n let regexp =... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
setFrontView:method responsible for setting the camera of frontView | setFrontView() {
'use strict';
var ratio = 6;
var camera = new THREE.OrthographicCamera(window.innerWidth / - ratio, window.innerWidth / ratio, window.innerHeight / ratio, window.innerHeight / - ratio);
camera.position.set(window.innerWidth / - 6, 45, 0); //Camera is set on the position x = -200, y = 45
cam... | [
"setTopView() {\n\t\t'use strict';\n\t\tvar ratio = 6;\n\t\tvar camera = new THREE.OrthographicCamera(window.innerWidth / - ratio, window.innerWidth / ratio, window.innerHeight / ratio, window.innerHeight / - ratio);\n\n\t\tcamera.position.set(0, window.innerWidth / 6, 0); //Camera is set on position y = 200\n\t\tc... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
ADD NEW PATIENT PAGE Exporting as a function to router.js | function getAddNewPatientRoute(req, res, next) {
res.render('patient/addNewPatient', {
username : req.session.username,
isAdmin : req.session.isAdmin,
getPatient_fname : "",
getPatient_lname : "",
getPatient_hcard : "",
getPatient_street : "",... | [
"function onNewPugClick() {\n Global.pageHandler.doRedirectToPage( \"new\" );\n }",
"function addPage(page) {\r\n document.querySelector(\"#pages\").innerHTML += `\r\n <section id=\"${page.slug}\" class=\"page\">\r\n <header class=\"topbar\">\r\n <h2>${page.title.rendered}</h2>\r\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Gets projects for an array of tags | async function getProjects(tags) {
return knex('tags')
.whereIn('tag', tags)
.select('project_id')
.then((results) => results.map((row) => row.project_id));
} | [
"function getAllprojects(){\n\n}",
"getV3ProjectsIdRepositoryTags(incomingOptions, cb) {\n const Gitlab = require('./dist');\nlet defaultClient = Gitlab.ApiClient.instance;\n// Configure API key authorization: private_token_header\nlet private_token_header = defaultClient.authentications['private_token... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Check if a string is prefixed by 0x | function isHexPrefixed(str){return str.slice(0,2)==='0x';} | [
"function isValidHexCode(str) {\n\treturn /^#[a-f0-9]{6}$/i.test(str);\n}",
"function isHex(value) {\n if (value.length == 0) return false;\n if (value.startsWith('0x') || value.startsWith('0X')) {\n value = value.substring(2);\n }\n let reg_exp = /^[0-9a-fA-F]+$/;\n if (reg_exp.test(value) ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
SaveMe(): Creates a constant object "content" which saves all nodes and egdges in two arrays. This object is then returned. By calling this function the current state of the graph can be saved. The object "content" posses a unique toString method that ouputs all nodes and edges. Currently for testing purposes. | SaveMe(graphComponent) {
// get cytoscape instance
let cy = graphComponent.getCytoGraph();
const content = {
nodes: cy.elements("node"),
edges: cy.elements("edge"),
minZoom: cy.data("minZoom"),
toString() {
let Output = " ";
for (let i = 0; i < this.nodes.length... | [
"function saveDrawnGraph(){\n topNodes = topData.nodes;\n topEdges = topData.edges;\n\n nodes = addNode(nodes, newNodeID, 'T', 300, 0);\n T = newNodeID;\n N = T + 1;\n E = topEdges.length;\n\n initialiseMatrices();\n\n for(var i = 0; i < topEdges.length; i++){\n var edge = topEdges.ge... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Filters films based on whether they were watched or not | function filterFilms(watched) {
const filteredFilms = films.filter(film => film.watched === watched)
return filteredFilms
} | [
"function filterFilms(films, genre, indie_reel_rating, imdb_rating, start_year, end_year) {\n const genre_match = function (movie) {\n return movie.type === genre;\n };\n const falls_within_year_range = function (movie) {\n const movie_year = parseInt(m... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
task 14: write a function to update a grade in the gradebook | function updateStudentGrade (studnetId,assignmentId,studentScore,gradebookData){
gradebookData[studnetId].grades[assignmentId] = studentScore;
} | [
"gradeSubmission(student){\n //only python files are allowed\n if (this.file.slice(-2) !== 'py'){\n this.grade = 0;\n student.calculateStudentAverage()\n this.comment = \"Only py files are allowed!\"\n return\n }\n //submission is before the deadline\n if (this.submissionTime > th... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Return random initial velocity up to a max magnitude | function randomVelocity(max){
var x = ( Math.random()*2 - 1 ) * max;
var y = ( Math.random()*2 - 1 ) * Math.sqrt( square(max) - square(x)); // Ensures total velocity magnitude is less than max
return new vec(x,y);
} | [
"randomVelocity() {\n return random(50, 200, 10);\n }",
"calcSpeed(min, max) {\n return Math.random() * (max - min) + min;\n }",
"function randomValueFromZeroToMax(max) {\n return Math.floor(Math.random() * max);\n}",
"function randomizeVel() {\n\n for (i = 0; i < verticies.length; i++... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Gets EffectiveBasePermissions for web return type is "_ObjectType_\":\"SP.Web\". | getEffectiveBasePermissions(webObjectIdentity, webUrl, formDigestValue) {
const basePermissionsResult = new base_permissions_1.BasePermissions();
const requestOptions = {
url: `${webUrl}/_vti_bin/client.svc/ProcessQuery`,
headers: {
'X-RequestDigest': formDigestVa... | [
"get effectiveBasePermissions() {\n return SPQueryable(this, \"EffectiveBasePermissions\");\n }",
"get effectiveBasePermissionsForUI() {\n return SPQueryable(this, \"EffectiveBasePermissionsForUI\");\n }",
"async function getCurrentUserEffectivePermissions() {\n return SPQueryable(this, \... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Returns true when filePath is .js or .json. We need this to restart the HTTP server | isScriptFile(filePath) {
return ['.js', '.json'].includes(path_1.extname(filePath));
} | [
"function isScriptFile(filename) {\n var ext = path.extname(filename).toLowerCase();\n return ext === '.js' || ext === '.json';\n}",
"isValidTypeScriptFile(handlerFile) {\n //replaces the last occurance of `.js` with `.ts`, case insensitive\n const typescriptHandlerFile = handlerFile.replace(/\\.js$/g... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Select cipher and show / hide hmtl elements | function caesar_select()
{
document.getElementById("caesar_cipher_text").innerHTML = "";
var x = document.getElementById("welcome");
x.style.display = "none";
var x = document.getElementById("viginere");
x.style.display = "none";
var x = document.getElementById("morse");
... | [
"function mirror_text_type_selection() {\r\n\tif (previous_mirror_text_type != mirror_text_type) {\r\n\t\t//toggle visibility of alphabet key names\r\n\t\tfor (i = 0; i < 28; i++) {\r\n\t\t\tmirrored_font_alphanumeric_punctuation_key_names_arrray[i].classList.toggle(\"hide\");\r\n\t\t\tmirrored_alphanumeric_punctua... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Write a method that accepts two arrays of numbers, and prints the sum of every combination of numbers from first and second array. For example, if the method receives [1, 5, 10] and [100, 500, 1000], the method should print a list: 101, 501, 1001, 105, 505, 1005, 110, 510, 1010]. | function printSums(array1, array2) {
array1.forEach(function(num1) {
array2.forEach(function(num2) {
console.log(num1 + num2);
});
});
} | [
"function sumCombinations(numbers1, numbers2) {\n var result = [];\n numbers1.forEach(function(number1) {\n numbers2.forEach(function(number2) {\n result.push(number1 + number2);\n });\n });\n return result;\n}",
"function Arrays_sum(array1, array2) \r\n{\r\n const result = [];\r\n let ctr = 0;\r... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Set all reachable wall positions. | function setReachableWalls(options, spaces) {
// Helper function to determine whether the space at
// the specified position is a wall or unreachable.
const isReachable = function (x, y) {
const target = spaces.get(x, y);
return target.type !== "WALL" && target.type !== "OOB";
};
// Find any walls whi... | [
"function syncWalls() {\n\tfor (var w_index = 0; w_index < maze.width; w_index++) {\n\t\tfor (var h_index = 0; h_index < maze.height; h_index++) {\n\t\t\tif (w_index > 0 && maze.cells[w_index-1][h_index].right) {\n\t\t\t\tmaze.cells[w_index][h_index].left = generateWall(w_index*maze.cellWidth - maze.wallWidth/2, h_... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Helper function, return the XML tree for config.xml | function getConfigTree(cordovaContext)
{
// Get version from config.xml.
var ET = cordovaContext.requireCordovaModule('elementtree')
var config = exports.readFileUTF8('./config.xml')
var tree = ET.parse(config)
return tree
} | [
"function getConfigXML(){\n\tvar config = $.parseXML( sessionStorage.getItem(\"configXML\") );\n\treturn config;\n}",
"function parseConfiguration( strFileName )\n{\n var gObjFs = new ActiveXObject(\"Scripting.FileSystemObject\");\n if( !gObjFs.FileExists( strFileName) ) \n throw \"File Name '\" + ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
adding grades to array | addGrades(grade) {
this.grades.push(grade);
this.write();
} | [
"function add(grade) {\n\tthis.grades.push(grade);\n}//end add function",
"function getStudentGrade(){\n\t// Input Object\n var studentDetails = [\n {name:'David',marks:80},\n {name:'Vinoth',marks:77},\n {name:'Divya',marks:88},\n {name:'Ishitha',marks:95},\n {name:'Thomas',marks:68}\n ];\n // A... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
This function adds a skill in the div 'skills' | function showSkill(skill) {
var content =
'<p>' + skill.title + '</p>' +
'<div class="w3-light-grey w3-round-xlarge w3-small" style="color:#52B77C;">' +
'<div class="w3-container w3-center w3-round-xlarge w3-teal" style="width:' + skill.skill_level + '%">' + skill.skill_level + '%</div>' +
'</div>'
$('#sk... | [
"function addSkill()\n{\n var count = document.getElementById(\"skill-count\");\n var it = count.getAttribute(\"value\");\n if (it >= 8) {\n alert(\"You have reached maximum number of skills\");\n return;\n }\n count.setAttribute(\"value\", ++it);\n\n mainDiv = document.getElementByI... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Push all events on the current sheet. | function pushAllEventsToCalendar() {
console.log('Pushing all events to calendar');
var dataRange = sheet.getDataRange();
// Process the range.
processRange(dataRange);
console.log('Finished pushing all events');
} | [
"function pushAll() {\n console.log('Menu link clicked: Push all')\n if (validateAction() == true) {\n pushAllEventsToCalendar();\n } else {\n console.log('Sheet is not in the allowed list, skipping.')\n }\n}",
"function deleteAndPushAll() {\n console.log('Menu link clicked: Delete and push all')\n if... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Compares two posts on the basis of id. | compare(otherPost) {
return (this.id === otherPost.id) ? true : false;
} | [
"function _merge_results_in_place(a, b) {\n merge_in_place([a, b],\n function(x, y) { return cmp(x[1], y[1]) },\n function(x, y) { \n if (x[0].id) {\n return (x[0].id == y[0].id);\n } else if (x[0].get_id) {\n return (x[0].get_id() == y[0].get... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Change the Bot Avatar Icon | function changeAvatar() {
let avatarContainer = iframe.contentWindow.document.querySelectorAll('.msg-avatar')
for (let i = 0; i < avatarContainer.length; i++) {
avatarContainer[i].style.width = '42px'
let avatarImage = avatarContainer[i].getElementsByTagName('img')[0]
avatarImage.setAttribute('src', '/... | [
"displayAvatar( message ){\n let allowedImageFileTypes = [ '.png', '.jpeg', '.jpg', '.gif' ];\n let accountWithAvatar;\n\n for( let account of this.accounts ){\n if( account.usernick === message.usernick ){\n accountWithAvatar = account.avatar;\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Get a customer by unique token. | function getCustomer(axios$$1, customerToken) {
return restAuthGet(axios$$1, 'customers/' + customerToken);
} | [
"static async getByCustomer(customerId) {\n try {\n const [subscription] = await db(this.table).where('customerId', customerId);\n // Subscription not found: return null\n if (!subscription) {\n return null;\n }\n return new Subscription(subscription);\n } catch (e) {\n th... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Controller// This is the part which cut the image into pieces. | function cutImageUp() {
for (var y = 0; y < numRowsToCut; ++y) {
for (var x = 0; x < numColsToCut; ++x) {
var canvas = document.createElement('canvas');
canvas.width = widthOfOnePiece;
canvas.height = heightOfOnePiece;
var context = canvas.getContext('2d');
... | [
"function cutImageUp(image) \n{ \n\tfind_dimensions();\n\t\n for(var x = 0; x < numRowsToCut; x++) {\n for(var y = 0; y < numColsToCut; y++) {\n var canvas = document.createElement('canvas');\n canvas.width = widthOfOnePiece;\n canvas.height = heightOfOnePiece;\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Given the start of the header data and it's closing delimiter, parse the JSON contents of the header | function parseHeader(dataString) {
// make sure all lines in the header are comma separated
const commaLines = dataString.split('\n').reduce((a, b) => {
const r = b.trim();
if (r.length !== 0) { // ignore empty lines
a.push(r.slice(-1) === ',' ? r : `${r},`);
}
return a;
}, []);
// remo... | [
"function parseHeaders(multipartBodyBuffer, startingIndex) {\n var lastline = \"\";\n var contentDisposition = \"\";\n var contentType = \"\";\n var i = startingIndex;\n var headerFound = false;\n\n for (; i < multipartBodyBuffer.length; i++) {\n const oneByte = multipartBodyBuffer[i];\n const prevByte ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Build a unique post id from the post so that the post can be retrieved later There may be a nontrivial probability that timestamps from the same group | function createUniquePostIdFromMessage(message, timeStamp) {
var postId = message.title + message.dealership + message.group + timeStamp;
var timeStampArray = [];
for (var i = 0; i < timeStamp.length; i++) {
if (parseInt(timeStamp[i], 10)) {
timeStampArray.push(timeSt... | [
"getNewPostId() {\n const store = model.getLocalStore();\n\n // Get the current highest post id\n let latestPost = _.max(store.posts, post => {\n return post.id;\n });\n // Return new unique id\n return latestPost.id + 1;\n }",
"function createPostID( time, title ){\n var ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Deactivates the click events on the answers | function deactivateClicks() {
console.log( "Deactivating cliker");
Array.from( ptrAnswers ).forEach( function( item ) {
item.removeEventListener( "click", answerSelected );
})
} | [
"function post_notes_unhook_controls()\n{\n\tjQuery(\"a.post_note_duplicate\").unbind('click');\n\tjQuery(\"a.post_note_delete\").unbind('click');\n}",
"function activateClicks() {\n\tconsole.log( \"Activating clicker\")\n\tArray.from( ptrAnswers ).forEach( function( item ) {\n\t\tconsole.log( item );\n\t\titem.a... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Write a function that computes the difference between the square of the sum of the first n positive integers and the sum of the squares of the first n positive integers. Problem In: number n representing the number of positive integers to calculate Out: difference between square of the sum of first n positive integers ... | function sumSquareDifference(n) {
const sum = (total, value) => total += value;
const values = Array.from(new Array(n), (x, i) => x = i + 1);
const squareOfSums = values.reduce(sum) ** 2;
const sumOfSquares = values.map((value) => value ** 2).reduce(sum);
return squareOfSums - sumOfSquares;
} | [
"function squaresSum(n) {\n\tconst a = [];\n\tfor (let i = 1; i <= n; i++) {\n\t\ta.push(Math.pow(i, 2));\n\t}\n\treturn a.reduce((x, i) => x + i);\n}",
"function sumOfSquares(array){\n let squaresArray=array.map(i=>Math.pow(i,2));\n let sum=squaresArray.reduce((a,b)=>{\n return a+b;\n },0)\n r... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
sample Create a [simple random sample]( from a given array of `n` elements. | function sample(array, n, randomSource) {
// shuffle the original array using a fisher-yates shuffle
var shuffled = shuffle(array, randomSource);
// and then return a subset of it - the first `n` elements.
return shuffled.slice(0, n);
} | [
"function randSampleInPlace(collection, numSample) {\n var n = collection.length\n var s = Math.min(n, numSample)\n for (var i = n - 1; i >= n - s; i--) {\n var j = randomIntBetweenInclusive(0, i)\n if (i !== j) {\n // swap\n var temp = collection[j]\n collection[j] = collection[i]\n co... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Exit a parse tree produced by Java9ParserwildcardBounds. | exitWildcardBounds(ctx) {
} | [
"exitWildcard(ctx) {\n\t}",
"visitExit_statement(ctx) {\n\t return this.visitChildren(ctx);\n\t}",
"exitStatementWithoutTrailingSubstatement(ctx) {\n\t}",
"visitBounds_clause(ctx) {\n\t return this.visitChildren(ctx);\n\t}",
"exitParenthesizedType(ctx) {\n\t}",
"exitNormalAnnotation(ctx) {\n\t}",
"exi... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Close the popup "Share collection" | closeShareCollection() {
this.isShowShareCollection = false;
if (this.is_copied) {
this.closeSocialSharing('link');
}
} | [
"function close_popup(popup) {\r\n popup.style.display = \"none\";\r\n}",
"function closePopup()\n{\n win.close();\n return true;\n}",
"function closePopUp() {\n document.getElementById(\"loggerModalWrapper\").style.display = \"none\";\n }",
"close() {\n return spPost(WebPartDefiniti... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Gets all 3D models available on the server/static folder | function getModels(req, res) {
let modelsList = [];
fs.readdirSync(availableModelsFolder).forEach(file => {
if(file.toLowerCase() !== ".ds_store" && file.indexOf(".zip") === -1) {
modelsList.push(file);
}
});
res.json(modelsList);
} | [
"function getModels() {\n return standaloneServices_js_1.StaticServices.modelService.get().getModels();\n }",
"function addModels(){\r\n\t//Note: for each model, an appropriate draw function should be included\r\n\tmodel = modelCollection_EmptyModel();\r\n\tmodelCollection_AddModel(model, modelCollection_Te... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Removes the hotkeys from all items | function DDLightbarMenu_RemoveAllItemHotkeys()
{
for (var i = 0; i < this.items.length; ++i)
this.items[i].hotkeys = "";
} | [
"function DDLightbarMenu_RemoveItemHotkeys(pIdx)\n{\n\tif ((typeof(pIdx) == \"number\") && (pIdx >= 0) && (pIdx < this.items.length))\n\t\tthis.items[pIdx].hotkeys = \"\";\n}",
"removeShortcut(keys) {\n Mousetrap.unbind(keys)\n }",
"function DDLightbarMenu_RemoveItemHotkey(pIdx, pHotkey)\n{\n\tif ((t... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
check the property of media is exist | function video_property_exist(property_name)
{
test( function() {
getmedia();
assert_true(property_name in media, "media." + property_name +" exists");
}, name);
} | [
"onPropertyHas(room, property, identifier) {\n return room.hasOwnProperty(property);\n }",
"load(){\n console.debug(\"Loading\", this.id);\n for (let i = 0; i < this.mediaSourceListeners.length; i++) {\n if(typeof this.mediaSourceListeners[i].load === 'function')this.mediaSourceListen... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Pretty much the same as `findNext`, except for the following differences: 1. Before starting the search, move to the previous search. This way if our cursor is already inside a match, we should return the current match. 2. Rather than only returning the cursor's from, we return the cursor's from and to as a tuple. | function findNextFromAndToInclusive(cm, prev, query, repeat, vim) {
if (repeat === undefined) { repeat = 1; }
return cm.operation(function() {
var pos = cm.getCursor();
var cursor = cm.getSearchCursor(query, pos);
// Go back one result to ensure that if the cursor is currently a mat... | [
"function findNextOccurrence(state, query) {\n let { main, ranges } = state.selection\n let word = state.wordAt(main.head),\n fullWord = word && word.from == main.from && word.to == main.to\n for (\n let cycled = false,\n cursor = new SearchCursor(\n state.doc,\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
When link contains comment_item_nn anchor, highlight that comment Could be extended to higlight other elements, if desired | function highlightCurrent() {
obj = document.location.hash.match(/comment_item_(\d+)/);
if (obj) {
$('comment_item_'+obj[1]).addClassName('js_highlighted');
// The above should be enough to dynamicall define CSS styles, but it's not working, so...
$$('.js_highlighted .comment_header')[0].style.backgroun... | [
"function addMenuItem( updateOnly ) {\n\t\tvar text, tooltip, $oldItem = $( '#ca-highlightcomments' );\n\n\t\tif ( updateOnly && !$oldItem.length ) {\n\t\t\treturn;\n\t\t}\n\n\t\tif ( commentsAreHighlighted ) {\n\t\t\ttext = msg.unhighlightText;\n\t\t\ttooltip = msg.unhighlightTooltip;\n\t\t} else {\n\t\t\ttext = m... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Sets listeners for the given table. | setListeners(table) {
if (!table) return;
var self = this;
if (table.element && KingTableTextBuilder.options.handleLoadingInfo) {
self.listenTo(table, "fetching:data", () => {
self.loadingHandler(table);
});
self.listenTo(table, "fetched:data", () => {
self.unsetLoadingHan... | [
"setListeners() {\n var self = this;\n var table = self.table;\n if (!table || !table.element) return self;\n\n self.listenTo(table, {\n \"fetching:data\": () => {\n self.loadingHandler();\n },\n \"fetched:data\": () => {\n self.unsetLoadingHandler();\n },\n \"fetc... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Functions to render data on the Coin Table appends a new coin row in the table | function createCoinRow(coinData) {
// let value = coin.Data.total_quantity * currentPrice;
let coinPage = coinData.coin;
let coinLink = "<a href=" + coinPage + ".html</a>";
console.log("coinLink is " + coinLink);
let averageCost;
// let currentPrice = ... | [
"renderTableData() {\n window.$(\"#expenses\").find(\"tr:gt(0)\").remove();\n let table = document.getElementById(\"expenses\");\n for (let i = 0; i<exps.length; i++) {\n let row = table.insertRow();\n let cell0 = row.insertCell(0);\n let cell1 = row.insertCell(... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Gets the id of the last visited list if still exists, else returns the first list if no stored list id or 0 if no lists | function getLastVisitedListId()
{
// Get local web storage
if(typeof(Storage) !== "undefined")
{
if (typeof(localStorage.lastViewedListId) !== "undefined")
{
var lastViewdList = app.listsView.collection.get(localStorage.lastViewedListId);
if (typeof(lastViewdList) !== "undefined") ... | [
"function getCurrentListElement() {\n var main_list_id = document.getElementsByClassName('shopping_list')[0].id.substring(8);\n var overview_lists = document.getElementsByClassName('user_list_overview');\n var overview_lists_id;\n for(var i = 0; i < overview_lists.length; i++) {\n\toverview_lists_id = o... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Gets a new Vector2 located at the center of the vectors "value1" and "value2" | static Center(value1, value2) {
const center = Vector2.Add(value1, value2);
center.scaleInPlace(0.5);
return center;
} | [
"static Center(value1, value2) {\n const center = Vector4.Add(value1, value2);\n center.scaleInPlace(0.5);\n return center;\n }",
"static Center(value1, value2) {\n const center = Vector3.Add(value1, value2);\n center.scaleInPlace(0.5);\n return center;\n... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Internal compiletimeonly representation of a `DragRef`. Used to avoid circular import issues between the `DragRef` and the `DropListRef`. | function DragRefInternal() { } | [
"function generateDynamicDataRef(sourceName,bindingName,dropObject)\n{\n var retVal = \"\";\n\n var sbObjs = dwscripts.getServerBehaviorsByTitle(sourceName);\n if (sbObjs && sbObjs.length)\n {\n var paramObj = new Object();\n paramObj.bindingName = bindingName;\n retVal = extPart.getInsertString(\"\", ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Sheet Name /// Generate the name that this weeks sheet will be given | function SheetName(){
var d = new Date();
//return d.getFullYear().toString() + "-" + (d.getMonth() + 1).toString().padStart(2, '0') + "-" + LastSunday();
return d.getFullYear().toString().substr(-2) + WeekOfYear();
} | [
"function excel_define_sheet_name(excel) {\n var excel = excel || $JExcel.new();\n sheet_name = sheet_name || \"Summary\"\n sheet_number = sheet_number || 0\n excel.set(sheet_number, undefined, undefined, sheet_name);\n return excel\n}",
"function LastWeeksSheetName(){\r\n var d = new Date();\r\... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
album description page callback function | function albumDetail(album){
//hide albums page
$('#albums').hide();
//css change to main-content container
$('.main-content').css({
'width': '100%',
'max-width': "3000px"
});
console.log(album);
//variable to store year from release_datel property
var album_year = album.release_date.substri... | [
"function discog(artist) {\n var apiKey = \"523537\";\n var queryURL =\n \"https://theaudiodb.com/api/v1/json/\" +\n apiKey +\n \"/searchalbum.php?s=\" +\n artist;\n $.ajax({\n url: queryURL,\n method: \"GET\",\n }).then(function (discResponse) {\n // this for loop ite... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
This function randomly generates the user board in the same way the tileAssign3x3ment assigns the board. but, the tiles will be randmly gerneated in the assigned array of images; it calls the rotate function in order to reposition the tile. | function generateGameBoard3x3(){
for(var i = 0; i < tile_exit_counter_user.length; i++){
grid_image_positionId[i] = document.getElementById('threeByThree_'+i);
switch(tile_exit_counter_user[i]){
case 1:
grid_image_positionId[i].style.backgroundImage = "url('" + oneSide(i) + "')";
oneSideRotate(i);
... | [
"function generateGameBoard4x4(){\n\tfor(var i = 0; i < tile_exit_counter_user.length; i++){\n\t\tgrid_image_positionId[i] = document.getElementById('fourByFour_'+i);\n\t\tswitch(tile_exit_counter_user[i]){\n\t\t\tcase 1: \n\t\t\t\tgrid_image_positionId[i].style.backgroundImage = \"url('\" + oneSide(i) + \"')\";\n... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Activate or desactive the skull | function activateSkull() {
isClickable = false;
if (!isSkullEnabled) {
$("#darknessFalls").fadeIn(300, function () {
$(".text-effect").textEffect({fps: 10})
$("#skullOn").fadeIn(2000, function () {
$("#darknessFalls").fadeOut(500, function () {
$("body").attr('contenteditable', 'true');
isClicka... | [
"function toggleLaser() {\n if (tool == LASER) selectTool(PEN);\n else selectTool(LASER);\n }",
"function activeSwatch(){\n\tvar $imgs = $('#swatch-carousel').find('img');\n\t$imgs.on('click',function(){\n\t\t$imgs.removeClass('active-swatch');\n\t\t$(this).addClass('active-swatch');\n\t});\n}",
"functio... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Function allowing Manager to add to Inventory | function addToInventory() {
// Querying the Database
connection.query("SELECT * FROM products", function (err, res) {
if (err) throw err;
// Setting up our results in the console.table NPM
consoleTable("\nCurrent Inventory Data", res);
// Inquirer asking Manager to select ID of ... | [
"function addInventory() {\n\n\t//Lets manager identify which item to credit\n\tinquirer\n\t\t.prompt ({\n\t\t\tname: \"restock_product\",\n\t\t\ttype: \"input\",\n\t\t\tmessage: \"Type the Id of the product you want to re-stock:\"\n\t\t})\n\t\t//Initiates database credit process\n\t\t.then(function(answer) {\n\n\t... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Visit a parse tree produced by PlSqlParseron_hash_partitioned_clause. | visitOn_hash_partitioned_clause(ctx) {
return this.visitChildren(ctx);
} | [
"visitOn_hash_partitioned_table(ctx) {\n\t return this.visitChildren(ctx);\n\t}",
"visitSubpartition_by_hash(ctx) {\n\t return this.visitChildren(ctx);\n\t}",
"visitHash_partitions(ctx) {\n\t return this.visitChildren(ctx);\n\t}",
"visitQuery_partition_clause(ctx) {\n\t return this.visitChildren(ctx);\n\t... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Triggered after map loads | function mapLoaded(map) {
console.debug('map has been loaded', map);
} | [
"onMapsReady(){\n\n }",
"function afterMapInit(map) {\n $scope.mapObj.yaMap = map;\n }",
"init() {\n this.worldMap.parseMap();\n }",
"function initMap() {\n $('#widgetRealTimeMapliveMap .loadingPiwik, .RealTimeMap .loadingPiwik').hide();\n map.addLayer(currentMap... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Gets the permissions string for the given user and resource | async function getPermissionsFor (acl, user, req) {
const accesses = MODES.map(mode => acl.can(user, mode))
const allowed = await Promise.all(accesses)
return PERMISSIONS.filter((mode, i) => allowed[i]).join(' ')
} | [
"function getResource() {\n var v = \"custom:(uuid,username,systemId,roles:(uuid,name,privileges))\";\n r = $resource(OpenmrsSettings.getContext() + \"/ws/rest/v1/user/:uuid\",\n {uuid: '@uuid', v: v},\n {query: {method: \"GET\", isArray: false}}\n );\n return new dataMgr.ExtendedR... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Reset the sequence with the same seed. | reset() {
this.seed = this._seed
} | [
"reseed( seed ) {\r\n\t\tthis._noiseSeed = seed;\r\n\t\tthis._recreateNoiseGenerators();\r\n\t\tthis.generateNoiseImage();\r\n\t}",
"resetTimer() {\n this.timer = 0;\n this.spawnDelay = GageLib.math.getRandom(\n this.spawnRate.value[0],\n this.spawnRate.value[1]\n );\n }",
"reset() {\r\n\t\t... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
set the camera Image Url based on the given base url | function setCameraImageUrl(baseurl) {
var url = baseurl + '?time=' + new Date().getTime();
document.getElementById("cameraImage").src = url;
cameraImageUrlBox.value = url;
} | [
"set imageURL(aValue) {\n this._logger.debug(\"imageURL[set]\");\n this._imageURL = aValue;\n }",
"set imageURL(aValue) {\n this._logService.debug(\"gsDiggEvent.imageURL[set]\");\n this._imageURL = aValue;\n }",
"function setImageSrc(image, location) {\n image.src = location + '-640_medium.webp... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
for case "Find a planet by name or search any characters" | function nameFind() {
inquirer.prompt({
type: "input",
name: "planet",
message: "Search for: "
}).then(function (answers) {
// LIKE % * % used for more search flexibility
var planetName = "SELECT * FROM planets WHERE fpl_name LIKE '%" + answers.planet + "%'";
// q... | [
"function searchspecies(manual)\n{\n\t// Array of entries which match the search term\n\tmatches = [];\n\t\n\t// Get the search term we are using\n\tterm = document.getElementById('search').value;\n\t\n\t// Iterate over the pokedex\n\tfor(key of Object.keys(pokedex))\n\t{\n\t\t// Dereference the key\n\t\tlet dex = ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Clears score and localstorage on button click | function clearScore(){
localStorage.setItem('highscore','');
localStorage.setItem('highscoreName','');
reset();
} | [
"function clearScore() {\n localStorage.setItem(\"highscore\", \"\");\n localStorage.setItem(\"highscoreName\", \"\");\n resetGame();\n}",
"function clearScore() {\n currentScore = 0;\n }",
"function clear(){\n localStorage.clear();\n highScores=[];\n highScoreParent.innerHTML=\"\";\n }",... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
updatePassword(userId: string, password: string): Promise; | updatePassword(userId, password) {
return new Promise((resolve, reject) => {
const url = `${this.apiBase}/auth/passwordRecoveryPerform`;
const payload = {userId, password };
const requestOpts = this._makeFetchOpts('POST', payload);
fetch(url, requestOpts).then(re... | [
"function updatePassword(userId, newPassword, callback) {\n var hashedPassword = common.generatePasswordHash(newPassword);\n\n //update password query\n db.query(\"UPDATE LOGIN_CREDENTIALS SET password = $1 WHERE user_id= $2\", {\n bind: [hashedPassword, userId]\n\n }).spread(function () {\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
: (ProseMirror, (attrs: ?Object)) A function that will prompt for the attributes of an [image node](Image) (using `FieldPrompt`), and call a callback with the result. | function promptImageAttrs(pm, callback, nodeType) {
var _pm$selection = pm.selection;
var node = _pm$selection.node;
var from = _pm$selection.from;
var to = _pm$selection.to;var attrs = nodeType && node && node.type == nodeType && node.attrs;
new FieldPrompt(pm, "Insert image", {
src: new TextField({ labe... | [
"function promptImageAttrs(pm, callback, nodeType) {\n\t var _pm$selection = pm.selection;\n\t var node = _pm$selection.node;\n\t var from = _pm$selection.from;\n\t var to = _pm$selection.to;var attrs = nodeType && node && node.type == nodeType && node.attrs;\n\t new FieldPrompt(pm, \"Insert image\", {\n\t ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Callback function for slider menu on event "onmouseover". | sliderMenuOnMouseOver(){
const firstMenuItem = this[sliderMenuElement].querySelector('.slider-menu-list > li:first-child');
const sliderMenuItems = this[sliderMenuElement].querySelectorAll('.slider-menu-list > li:not(:first-child)');
this[sliderMenuElement].classList.add('active');
fir... | [
"function mouseoverHandler() {\n $('.node').mouseover(function(e) { // mouseover event handler\n toggleSidebar();\n var info = this.id.split('|');\n var title = info[0];\n var code = info[1];\n pageTitle.html(title);\n if (code in queryInfo) {\n pageImage.html... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Initialize new Physijs scene | function initScene(){
var scene = new Physijs.Scene();
return scene;
} | [
"function initScene() {\n gScene = new THREE.Scene();\n gScene.background = new THREE.Color(0xcccccc);\n gScene.fog = new THREE.FogExp2(0xcccccc, 0.002);\n}",
"create () {\n this.game.switchScene(this.game.postSetupScene);\n }",
"function SceneNode() {}",
"function Scene_ModManage() {\r\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
return true if new layout is different from current page layout | function layoutChanged(page) {
if (!$layout.length) return false;
if (!lastPage || lastPage.fixlayout || lang(lastPage) !== lang(page)) return true;
var currentlayout = $layout.attr('data-render-layout') || 'main-layout';
var newlayout = generator.layoutTemplate(page);
return (newlayout !== currentl... | [
"function getLayout()\n {\n return ( typeof lastState.layout !== \"undefined\" ) ? lastState.layout : settings.uiLayout;\n }",
"_redrawLayoutMenu() {\n const layoutMenu = this.getLayoutMenu()\n\n if (layoutMenu && layoutMenu.querySelector('.menu')) {\n const inner = layoutMenu.... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
update the workspaces bar | _update_ws() {
// destroy old workspaces bar buttons and signals
this.ws_bar.destroy_all_children();
// get number of workspaces
this.ws_count = WM.get_n_workspaces();
this.active_ws_index = WM.get_active_workspace_index();
// display all current workspaces and tasks buttons
for (let ws_index = 0; ws_in... | [
"function refreshBar() {\n $('owd-menubar procs').html('');\n for (var i in processes) {\n var proc = processes[i];\n var app = processes[i].getApp();\n $('owd-menubar procs').append('<proc proc-id=\"'+processes[i].pid+'\"><img src=\"'+_helper.join(app.getUrl(), app.ge... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Return a valid alpha value [0,1] with all invalid values being set to 1 | function boundAlpha(a) {
a = parseFloat(a);
if (isNaN(a) || a < 0 || a > 1) {
a = 1;
}
return a;
} | [
"function alpha(va, vb, ba, bb) {\n // (1)-(2);\n // (ba-bb)*(1-a) = va - vb\n // 1 - a = (va-vb)/(ba-bb)\n // 1 - (va-vb)/(ba-bb) = a\n if (ba - bb == 0) return 1;\n return 1 - (va - vb) / (ba - bb);\n}",
"function acp_get_alpha_value_from_color( value ) {\n var alphaVal;\n\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Creates a new ACL Rule with the same ACL values as the input ACL Rule, but having a different IRI. Note that nonACL values will not be copied over. | function internal_duplicateAclRule(sourceRule) {
let targetRule = createThing();
targetRule = setIri(targetRule, rdf.type, acl.Authorization);
function copyIris(inputRule, outputRule, predicate) {
return getIriAll(inputRule, predicate).reduce((outputRule, iriTarget) => addIri(outputRule, predicate, ... | [
"function internal_initialiseAclRule(access) {\n let newRule = createThing();\n newRule = setIri(newRule, rdf.type, acl.Authorization);\n if (access.read) {\n newRule = addIri(newRule, acl.mode, internal_accessModeIriStrings.read);\n }\n if (access.append && !access.write) {\n newRule =... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
console.log(clickedItem.innerHTML); update text as user types | function editElement(event){
clickedItem.innerHTML = textBox.value;
} | [
"function handleEditItem() {\n $('.js-shopping-list').on('input', '.js-shopping-item', function(event) {\n let itemIndex = getItemIndexFromElement(event.currentTarget); //assigning the index of the the editted item to itemIndex\n let updatedItem = STORE.items[itemIndex];\n updatedItem.name =... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
This functions shows the gaming page of mathematical operations. It consists of a question and four option as buttons to choose from. / function has two parameters level and selectedGame . level is the current level selected and selectGame is the game type selected. | function showGame1(level,selectedGame) {
if(questionStatement!=undefined){
if(selectedGame=="addition"){
questionStatement.textContent="Add the above numbers";
}
else if(selectedGame=="subtraction"){
questionStatement.textContent="Subtract the above numbers";
}else if(selectedGame=="multi... | [
"function loadGamePage(lvl) {\n\n //Update the level number in global variable\n level = lvl;\n\n //The level is going to start now so initialise the correct items to zero\n itemCorrect = 0;\n\n //Create the game content\n var gameContent = createGamePage();\n\n //If game content is not created the display l... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Redraw wordcloud when the window size changes | function redrawWordCloud() {
WordCloud(document.getElementById('canvas'), OPTIONS);
} | [
"function resizeWordcloud() {\n wordCloudDiv.empty();\n $scope.wordCloud = wordcloud.WordCloud(wordCloudDiv.width(), wordCloudDiv.width() * 0.75,\n 250, $scope.addSearchString, \"#wordCloud\");\n $scope.wordCloud.redraw($scope.wordCount.getWords());\n wordC... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Attempt to replace the link into the respective card. | function replaceLinksToCards(tr, cardAdf, schema, request) {
var inlineCard = schema.nodes.inlineCard;
var url = request.url;
if (!adf_schema_1.isSafeUrl(url)) {
return;
}
// replace all the outstanding links with their cards
var pos = tr.mapping.map(request.pos);
var $pos = tr.doc.r... | [
"function setupNextCardLink(){\n $(\"a:contains('Next Card')\").click(function(event){\n event.preventDefault();\n showCard();\n card = new RandomCard();\n preloadCardImage();\n });\n}",
"function replaceLinkWithEmbed(link) {\n if (link.href !== link.textContent) {\n return;\... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Count the total number of tests that have the specified result. | function countTestsWithResult(tests, result) {
var total = 0;
tests.forEach(function (test) {
if (!test.isDataDriven) {
if (test.result == result) {
total++;
}
} else {
test.subtests.forEach(function (test) {
if (test.result == result) {
total++;
}
});
}
});
return total;
} | [
"setResultCount (count = 0) {\n this.resultCount = count;\n }",
"function countMatches() {\n\tnumberOfMatches += 1;\n\treturn numberOfMatches;\n}",
"onTestResult(result) {\n this.results = this.results.concat(result);\n ResultDbAgent.newTest(this.frameworkid, result.test, (testid) => {\n... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
llena la tabla con los documentos paginados | function fullTable(noPage, groupBy, array){
var startRec = Math.max(noPage - 1, 0) * groupBy;
var recordsToShow = array.splice(startRec, groupBy);
$('#list-source-documents tbody').empty();
$.each(recordsToShow, function( index, value ) {
var actions = $('#action... | [
"function showPageObjects() {\n db.allDocs({ include_docs: true, descending: true }, function(err, doc) {\n redrawPageObjectsUI(doc.rows)\n })\n }",
"function visualizzaTabellaDocumenti() {\n var options = {\n bServerSide: true,\n sAjaxSource: \"risultatiRicercaDocumentoEn... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Assert that a Condition with the given properties exists in the CloudFormation template. By default, performs partial matching on the resource, via the `Match.objectLike()`. To configure different behavior, use other matchers in the `Match` class. | hasCondition(logicalId, props) {
const matchError = (0, conditions_1.hasCondition)(this.template, logicalId, props);
if (matchError) {
throw new Error(matchError);
}
} | [
"hasResourceProperties(type, props) {\n const matchError = (0, resources_1.hasResourceProperties)(this.template, type, props);\n if (matchError) {\n throw new Error(matchError);\n }\n }",
"function CfnBucket_RoutingRuleConditionPropertyValidator(properties) {\n if (!cdk.canIn... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Emulate SPARC assembly (e.g. K computer, fasted Supercomputer 2011, 8th fasted Supercomputer 2018) | function run_SPARC(asmInput, singleStep) {
return run_generic(asmInput, 0x10000, ks.ARCH_SPARC,ks.MODE_SPARC32|ks.MODE_BIG_ENDIAN,uc.ARCH_SPARC,uc.MODE_SPARC32|uc.MODE_BIG_ENDIAN,"SPARC","nop",SPARC_REGISTERS, 'i32', singleStep)
} | [
"function CPU () //the CPU emulation for SID/PRG playback (ToDo: CIA/VIC-IRQ/NMI/RESET vectors, BCD-mode)\n { //'IR' is the instruction-register, naming after the hardware-equivalent\n IR=memory[PC]; cycles=2; storadd=0; //'cycle': ensure smallest 6510 runtime (for implied/register instructions)\n \n if(IR&1) { ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Alias of getQTIAncestor for testPart. | function getQTITestPart(elem) {
return getQTIAncestor(elem, "testPart");
} | [
"function selectAncestor(elem, type) {\n type = type.toLowerCase();\n if (elem.parentNode === null) {\n console.log('No more parents');\n return undefined;\n }\n var tagName = elem.parentNode.tagName;\n\n if (tagName !== undefined && tagName.toLowerCase() === type) {\n return elem.pare... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |