query
stringlengths
9
34k
document
stringlengths
8
5.39M
negatives
listlengths
19
20
metadata
dict
Abstract the problem of waiting for some condition to occur with a timeout. Loop on checkFunction, calling readyCallback when it succeeds, or calling timeoutCallback after MEDIA_WAIT_DURATION milliseconds.
function checkTimeoutLoop( checkFunction, readyCallback, timeoutCallback ){ var ready = false; // perform one check function doCheck(){ if ( _interruptLoad ) { return; } // run the check function ready = checkFunction(); if ( ready ) { // ...
[ "function waitFor(test, onReady, timeOutMillis, onTimeout) {\n var maxtimeOutMillis = timeOutMillis ? timeOutMillis : 30001, //< Default Max Timeout is 30s\n start = new Date().getTime(),\n condition = false,\n interval = setInterval(\n function() {\n if ( (new Date().getTime() - sta...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Returns a string from the provided time in milliseconds, considering the requested precision to display miliseconds. It always returns a full string in the format: hh:mm:ss.xx Precision can be 1 (during playback) or 2 (when stopped)
function msToStringWithPrecision(ms, precision) { var h = Math.floor(ms / 3600000); ms -= (h * 3600000); var m = Math.floor(ms / 60000); ms -= (m * 60000); var s = Math.floor(ms / 1000); ms -= (s * 1000); var finalTime = ""; finalTime += ((h < 10) ? "0" + h : h) + ":"; finalTime +...
[ "function msToStringWithPrecision(ms, precision)\n{\n var h = Math.floor(ms / 3600000)\n ms -= (h * 3600000)\n\n var m = Math.floor(ms / 60000)\n ms -= (m * 60000)\n\n var s = Math.floor(ms / 1000)\n ms -= (s * 1000)\n\n var finalTime = \"\"\n finalTime += ((h < 10) ? \"0\" + h : h) + \":\"\...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Sets the "result" coordinates with the Vector2 divided by the given one coordinates
divideToRef(otherVector, result) { result.x = this.x / otherVector.x; result.y = this.y / otherVector.y; return this; }
[ "divideToRef(otherVector, result) {\n return result.copyFromFloats(this.x / otherVector.x, this.y / otherVector.y, this.z / otherVector.z);\n }", "divide(otherVector) {\n return new Vector2(this.x / otherVector.x, this.y / otherVector.y);\n }", "divide(otherVector) {\n retur...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Retrieves metaData for multiple studies at once. This function calls retrieveStudyMetadata several times, asynchronously, and waits for all of the results to be returned.
function retrieveStudiesMetadata(server, studyInstanceUids, seriesInstanceUids) { // Create an empty array to store the Promises for each metaData retrieval call var promises = []; // Loop through the array of studyInstanceUids studyInstanceUids.forEach(function (studyInstanceUid) { // Send the call and reso...
[ "function getMetaData(container, callback) {\n var $item,\n model,\n id,\n i,\n chunk,\n chunksize,\n requestIds,\n missingIds = {};\n\n $('[data-id]', container).each(function (i, row) {\n $item = $(row);\n ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Show the profile of other users
function showOtherUser(){ removeFollowList(); removeSearchArea(); var userId = this.dataset.user; // get the user of the clicked name or image showedUser = userId; removeWritenFields(); removeErrorSuccesFields(); document.getElementById("profileSection").style.display = "block"; document...
[ "static displayProfiles() {\r\n const profiles = Store.getProfiles();\r\n profiles.forEach((profile) => {\r\n\r\n // If the profile doesn't exist add it to the list\r\n if (!Store.profileExists(profile)) {\r\n Profile.addProfileToList(profile);\r\n }\r\n...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Creates a new Color4 copied from the current one
clone() { return new Color4(this.r, this.g, this.b, this.a); }
[ "function Color4(/**\n * Defines the red component (between 0 and 1, default is 0)\n */r,/**\n * Defines the green component (between 0 and 1, default is 0)\n */g,/**\n * Defines the blue component (between 0 and 1, default is 0)\n */b,/**\n * Defines the alph...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
A helper function to describe a token as a string for debugging
function getTokenDesc(token) { var value = token.value; return value ? "".concat(token.kind, " \"").concat(value, "\"") : token.kind; }
[ "StringLiteral() {\n const token = this._eat(\"STRING\");\n return factory.StringLiteral(token.value.slice(1, -1));\n }", "function maybeQuoteSymbol(symbol) {\n if (symbol.description === undefined) {\n return symbol.toString();\n }\n\n if (/^[a-zA-Z_][a-zA-Z_.0-9]*$/.test(symbol.description)...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Return the value multiplied by 100 ie: calculateImageSize(1) => 100 calculateImageSize(2) => 200 calculateImageSize(3) => 300 calculateImageSize(4) => 400
function calculateImageSize(value) { }
[ "calculateImageNumber()\n {\n const { cardCount, maxCardCount, numImages } = this;\n\n if (cardCount === 0)\n return false;\n \n return Math.ceil(cardCount/maxCardCount * numImages);\n }", "function change_image(n) {\n full_image(images += n);\n}", "function incre...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
This method intercepts each open preferences event emitted by the native app and opens preferences page.
_handleOpenPreferences(evt) { evt = JSON.parse(evt); this._analyticsLogic.logEvent({ screenName: evt.data.screenName }); this._navigationManager.navigateTo(EventNames.MENUITEMS_OPENPREFERENCES); }
[ "openDictionary() {\n // Prevent creating of new window\n if (this.window && !this.window.isDestroyed() && !this.window.isVisible()) {\n this.showWindow();\n } else if (this.window.isDestroyed()) {\n this.window = this.createWindow();\n this.window.once('ready-t...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Removes keys that are no longer in the map from the _keys array
function _cleanupKeys() { if (this._count == this._keys.length) { return; } var srcIndex = 0; var destIndex = 0; var seen = {}; while (srcIndex < this._keys.length) { var key = this._keys[srcIndex]; if (_hasKey(this._map, key)...
[ "deleteKeys(keys) {\n if (Array.isArray(keys)) {\n for (const key of keys) {\n if (isPlainOldJavaScriptObject(this.data)) {\n delete this.data[key];\n }\n }\n }\n }", "removeKeys () {\n this._eachPackages(function (_pack) {\n _pack.remove()\n })\n }", "remove(...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Invoke this method to explicitly process change detection and its sideeffects. In development mode, `tick()` also performs a second change detection cycle to ensure that no further changes are detected. If additional changes are picked up during this second cycle, bindings in the app have sideeffects that cannot be res...
tick() { if (this._runningTick) { throw new Error('ApplicationRef.tick is called recursively'); } try { this._runningTick = true; for (let view of this._views) { view.detectChanges(); } // Note that we have still left th...
[ "function runObservers () {\n try {\n queuedObservers.forEach(runObserver);\n } finally {\n currentObserver = undefined;\n queuedObservers.clear();\n }\n}", "notify_speed_update() {\n this.speed_update = true;\n }", "function safeApply() {\n $rootScope.$$phase ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
register the app of the user on Manarah API once the app is installed and get an API token to use it for authenticating the app in other api calls
static registerApp(firebaseId, permissionsGranted) { console.log('reg.....'); // call the api passing the fb id and notifications granted flag return axios.post(API_URL + API_ENDPOINTS.registerApp, { fb_id: firebaseId, granted: permissionsGranted ...
[ "function register(){\n\tfunction asyncCallback(status, result){\n \tkony.print(\"\\n------status------>\"+status);\n \tif(status==400){\n \t\tkony.print(\"\\n------result------>\"+JSON.stringify(result));\n \t\tif(result[\"opstatus\"]==8009)\n \t\t{\n \t\t\tif(result[\"message\"]!=undefined)\n ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Send a point to the server.
function postPoint(x, y) { jsonRequest('/point', 'POST', {point: {x: x, y: y} }, null); }
[ "function sendCoords(coords, url, username) {\n var xmlhttp = new XMLHttpRequest();\n xmlhttp.open(\"POST\", url); \n xmlhttp.setRequestHeader(\"Content-Type\", \"application/x-www-form-urlencoded;charset=UTF-8\");\n xmlhttp.setRequestHeader(\"Purpose\", \"sendCoords\");\n xmlhttp.setRequestHeader(\"Username\...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Check the new added catalog name is legal or not. The new added catalog name cannot be zero, cannot longer than 10 characters,too. Also need to check the duplication.
function CheckCatalog( $NewCatalogString ) { if($CatalogInputString.length == 0) { alert("Catalog Name cannot be blank!"); return -1; } else if($CatalogInputString.length > 10) { alert("It is too long! Input it one more time."); return -1; } else if(0) { alert("This catalog name is already exist."); ...
[ "function validName(input) {\n return input.length > 0\n }", "function name_check() {\r\n name_warn();\r\n final_validate();\r\n}", "function groupNameValid(name) {\n return (typeof name === \"string\" && name.length <= 50 && name.length > 2)\n}", "checkName(item) {\n var name = item.nam...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Utility function which iterates across each account given inside an object with email/password pair. And execute the given callback function, with those parameters.
function forEachAccount( accountObject, func ) { // Iterate each email-pass pair for(var email in accountObject) { if(accountObject.hasOwnProperty(email)) { // Get the password, var pass = accountObject[email]; // Login loginAccount( email, pass ); // Callback fu...
[ "function processSignupCallback(request, email, password, done){\n\t\t\n\t}", "getAccountsAsync(callback) {\n this.web3.eth.getAccounts((err, res) => {\n callback(err, res);\n });\n }", "function findUserByEmail(array, value, callback) {\n for (var i = 0; i < array.length; i++) {\n if (arr...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Account Report Add function to show bank customer report
function accountReport(customer) { showAccountInfo(customer.accountHolder, customer.accountNumber, customer.businessName); showAddresses(customer.addresses); showPhoneNums(customer.phoneNumbers); showTransactions(customer.accountTransactions, customer.balance); if (customer.favMelon === 'casaba' || customer.n...
[ "function createVoucherReport(journal, report, docNumber, rowsToProcess) {\n\n //Each voucher on a new page\n report.addPageBreak();\n\n var date = \"\";\n var doc = \"\"; \n var desc = \"\";\n var totDebit = \"\";\n var totCredit = \"\";\n var line = 0;\n var totTransaction = calculateTo...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Borrowed from node source without `normalizedArgsSymbol` symbol setting (net.js) Returns an array [options] or [options, cb]
function normalizeArgs(args) { var arr; if (args.length === 0) { arr = [{}, null]; arr[normalizedArgsSymbol] = true; return arr; } var arg0 = args[0]; var options = {}; if (typeof arg0 === 'object' && arg0 !== null) { // (options[...][, cb]) options = ar...
[ "function normalizeRequestArgs(\n httpModule,\n requestArgs,\n) {\n let callback, requestOptions;\n\n // pop off the callback, if there is one\n if (typeof requestArgs[requestArgs.length - 1] === 'function') {\n callback = requestArgs.pop() ;\n }\n\n // create a RequestOptions object of whatever's at inde...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Requests a new shuffled deck from the API. Returns array of objects.
static async newDeck() { try { console.log("Generating deck...") const response = await Axios.get(`${API}/spreads/shuffled`); let deck = response.data console.log("Deck complete."); for (let card of deck) { this.prepCard(card); } return deck; } catch(error) { ...
[ "static async newMajorDeck() {\n try {\n console.log(\"Generating deck...\")\n const response = await Axios.get(`${API}/cards`);\n let deck = response.data\n console.log(\"Deck complete.\");\n \n //The first 22 cards returned are the major arcana, we drop the rest.\n deck.splic...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Instantiates a new bounding box renderer in a scene.
function BoundingBoxRenderer(scene){/** * The component name helpfull to identify the component in the list of scene components. */this.name=BABYLON.SceneComponentConstants.NAME_BOUNDINGBOXRENDERER;/** * Color of the bounding box lines placed in front of an object */t...
[ "function BoundingBox() {\n this._internalModel = new BoundingBoxFilterModel();\n}", "setBoundingBox() {\n /**\n * Array of `Line` objects defining the boundary of the Drawing<br>\n * - using these in `View.addLine` to determine the end points of {@link Line} in the {@link model}\n * - these lines...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
This function sets the current row in the GridView
function setGridViewCurrentRow(gridView, rowId) { for (var i = 0, len = gridView.rows.length; i < len; i++) { var nextRow = gridView.rows[i]; if (nextRow.bindingContext.id === rowId) { nextRow.makeCurrent(); return; } ...
[ "function highlight_curr_row()\r\n{\r\n\r\n\t// temporarily turn off table rendering\r\n\tdata_view.beginUpdate();\r\n\r\n // get current row\r\n\tvar curr_data_row = convert_row_ids([curr_row_selected])[0];\r\n var item = data_view.getItemById(curr_data_row);\r\n var num_cols = item.length;\r\n\r\n // ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Returns an array of unique values.
function _unique(values) { return Array.from(new Set(values)); }
[ "function unique(arr) {\n return Array.from(new Set(arr));\n }", "function uniqueArr(arr) {\n\treturn [...new Set(arr.filter(x => x > 0))];\n}", "function UNIQUE(array) {\n return array.reduce(function (p, c) {\n if (p.indexOf(c) < 0) p.push(c);\n return p;\n }, []);\n}", "get uniqueValues() {\n ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
get your public key with a callback function
function getPubkey(callback) { sbot.whoami(function(err, msg) { if(err) { console.log('getPubkey(callback) err', err, '\n\n\n\n') return callback(err) } else { console.log('getPubkey(callback) msg', msg, '\n\n\n\n') return callback(null, msg) } ...
[ "function getPublicKey(req, res) {\n var key_path = './server/keystore/key/public_key.pem';\n return g_fs.readFileAsync(key_path, \"ascii\")\n .then(function (content) {\n return res.send(content);\n })\n .catch(function (exception) {\n co...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
function to store list of ports into local storage.
function storePortList() { let string = JSON.stringify(localList); localStorage.setItem("storkey", string); }
[ "function storeDataToLS(port)\r\n{\r\n\tif(typeof (Storage) !== \"undefined\")\r\n\t{\r\n\t\tlocalStorage.setItem(portKey,JSON.stringify(port)) //The port instance with the new data is uploaded into the localStorage\r\n\t}\r\n\telse\r\n\t{\r\n\t\talert(\"The current browser doesn't support local storage\");\r\n\t}\...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Save team as image
function saveTeam(screen) { var modalImage = $("#image-modal-body"); modalImage.html('<img src="/images/loading.gif" id="loading-gif"/>'); if (screen < 1600 && screen > 479) { $('#team-name').css({ 'padding': '0px 0px', 'padding-bottom': '10px' }); } else if (screen > 1600) { $('...
[ "saveToPNG() {\n this.downloadEl.download = 'pattar.png';\n this.downloadEl.href = this.renderCanvas.toDataURL(\"image/png\").replace(\"image/png\", \"image/octet-stream\");\n this.downloadEl.click();\n }", "function save() {\n\n var image = canvas.toDataURL(\"image/png\...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
=== latest Blog Carousel ===
function latestBlogCarousel() { if ($('.latest-blog-carousel').length) { $('.latest-blog-carousel').owlCarousel({ dots: true, loop: true, margin: 30, nav: false, navText: [ '<i class="fa fa-angle-left"></i>', '<i cla...
[ "buildCarousel() {\n // Subclasses may override.\n }", "function fullBodyCarousel(){\n\t$('.full-body-carousel').owlCarousel({\n items:1,\n loop:false,\n center:true,\n margin:0,\n URLhashListener:true,\n autoplayHoverPause:true,\n startPosition: 'URLHash',\n animateOut: 'fadeOut',\n ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Variables are input types A GraphQL operation is only valid if all the variables it defines are of input types (scalar, enum, or input object).
function VariablesAreInputTypes(context) { return { VariableDefinition: function VariableDefinition(node) { var type = Object(_utilities_typeFromAST__WEBPACK_IMPORTED_MODULE_3__["typeFromAST"])(context.getSchema(), node.type); // If the variable type is not an input type, return an error. if (type &&...
[ "enterTypeVariable(ctx) {\n\t}", "function validateTypesToStore(expType, savedType, index, variable) {\n if (expType === savedType) {\n if (savedType === 'i') {\n emit(`istore ${index}`, -1);\n } else if (expType === 's') {\n emit(`astore ${index}`, -1);\n }\n } el...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Initializes the screen models object with screen model of each screen.
static _initScreenModels() { const artistsRepository = new ArtistsRepository(); const albumsRepository = new AlbumsRepository(); const songsRepository = new SongsRepository(); this._screenModels = { artistsListScreenModel: new ArtistsListScreenModel(artistsRepository), artistDetailsScreenMo...
[ "static getScreenModels() {\n if (!this._screenModels) {\n this._initScreenModels();\n }\n\n return this._screenModels;\n }", "initGameObjets(){\n\t\tlet modele = this.controller.modele;\n\t\t//Init les objets\n\t\tthis.scene.add(modele.table.model);\n\t\tthis.scene.add(modele.environment.model)\n\...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
path: path of template return: templateVersion with path is given ex: path = static/js/base/workspaces/list.html return static/js/base/workspaces/templates/v1/list.html?v=23
function templateVersion(path){ //Tweak alway get root if ( path[0] != "/" ){ path = "/" + path; } var seperate_arr = path.split("/"); if (seperate_arr.length > 2){ //Add "templates" before the end item of array seperate_arr.splice(seperate_arr.length - 1,0,"templates",template_version_string); ...
[ "function KgbTemplateUrl(relPath) {\n return 'views/theme-' + KgbEnv.theme + '/' + relPath + '.html';\n}", "function getTemplate() {\n if (!$scope.state || _.indexOf($scope.viewStates, $scope.state) === -1) {\n throw new Error('Missing $scope.state');\n }\n var template;\n switch ($s...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
This represents a compatibility override for an addon.
function AddonCompatibilityOverride(aType, aMinVersion, aMaxVersion, aAppID, aAppMinVersion, aAppMaxVersion) { this.type = aType; this.minVersion = aMinVersion; this.maxVersion = aMaxVersion; this.appID = aAppID; this.appMinVersion = aAppMinVersion; this.appMaxVersion = a...
[ "SetCompatibleWithPlatform() {}", "SetCompatibleWithAnyPlatform() {}", "SetCompatibleWithEditor() {}", "function patchFennecWindow(window) {\n // This function has a structure similar to patchTabBrowserWindow.\n const loadURI = window.BrowserApp && window.BrowserApp.loadURI;\n if (!loadURI) {\n let wind...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
For first challenge to filter data with country USA and write to file
async function filterCountry() { const data = await fs.readFileSync('input/main.csv'); const records = parser(data, { columns: true }); const results = []; const headers = ['SKU', 'DESCRIPTION', 'YEAR', 'CAPACITY', 'URL', 'PRICE', 'SELLER_INFORMATION', ...
[ "function filterCountry(aliens) {\n return aliens.country == $countryInput.value.trim().toLowerCase();\n}", "function data_cleaning_countries_name(suicideData, countriesJson) {\n let all_countries_in_cjson = _.uniqBy(countriesJson.features, 'properties.name');\n for (let c of all_countries_in_cjson) {\n ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
manages all of the different cases for which the fire rate will change based on the bar_control position
function colliding() { var x = bar_control.x; var y = bar_control.y; var rotation = bar_control.rotation; // hack-fix for situations when orientation changed with moving part if (rotation != 180) { firing_rate.base = 11; firing_rate.text = firing_rate.base.toString(); return; } // ...
[ "function updateBars(code) {\n\n\t\t\t// get all the rows in graphic_data concerning current AREACD.\n\t\t\tvar data = graphic_data.filter(function(d) {return d.AREACD == code})\n\t\t\t// \"transpose\" this data into the right format for stacking\n\t\t\ttransposedData = []\n\t\t\tvarnames.forEach( function(d) {\n\t...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Find the last child of this subtree.
get lastChild() { return this.childBefore(this.end + 1); }
[ "function lastElementChild(element) {\n var child = element.lastChild;\n while (child !== null && child.nodeType !== 1) {\n child = child.previousSibling;\n }\n return child;\n}", "function lastAncestor(node,pred){var ancestors=listAncestor(node);return lists.last(ancestors.filter(pred));}", ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Activate every layers in a corpuUid
setAll({ state, dispatch, commit }, { corpuUid }) { // Loop over every layers uids Object.keys(state.actives).forEach(uid => { // Loop over every layers in a corpuUid state.lists[corpuUid].forEach(l => { // Activate the layer dispatch('set', { id: l.id, corpuUid, uid }) }) ...
[ "setup() {\n for (const layer in this.layerRegistry) {\n this.layers.set(`${layerRegistry[layer]}Layer`, this.game.add.group());\n this.game.world.bringToTop(this.layers.get(`${layerRegistry[layer]}Layer`));\n }\n }", "list({ dispatch, commit, rootState, rootGetters }, { corpuId, corpuUid }) {\n ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Called when the user presses the button to choose a different package version. Presents a dialog of available package versions to choose from.
_startChoose(e) { let target = e.target; if (target.nodeName !== 'BUTTON') { target = target.parentElement; } this._chosenServer = target.dataset.server; let choices = this._state.packages[target.dataset.app]; let chosen = choices.findIndex(choice => choice.Name === target.dataset.name); ...
[ "findVersions() {\n this.state.versionData.forEach(yearData => {\n if(yearData.year === this.state.selectedYear) {\n yearData.terms.forEach(termData => {\n if(termData.term === this.state.selectedTerm.toLowerCase()) {\n this.setState({ versi...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
`setBits` is an array of strings, containing the names for each bit that sould be set to 1. `bitIndex` is same as in `readBitField()`. Returns a Buffer, ready to be written out with `BerWriterwriteString()`.
function writeBitField(setBits, bitIndex) { var bitLen = bitIndex.length; var blen = Math.ceil(bitLen / 8); var unused = blen * 8 - bitLen; var bits = Buffer.alloc(1 + blen); // zero-filled bits[0] = unused; for (var i = 0; i < bitLen; ++i) { var byteN = 1 + Math.floor(i / 8); var bit = 7 - (i % 8); var mas...
[ "function setBit(number,i) {\n\treturn number | (1 << i);\n}", "get bitString() {\n return this.extnValueObj.subs[0].toBitString();\n }", "function BitSetFunctor(length) {\r\n var ADDRESS_BITS_PER_WORD = 5;\r\n var BITS_PER_WORD = 1 << ADDRESS_BITS_PER_WORD;\r\n var BIT_INDEX_MASK = BITS_PER_WORD -...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Then we add a new country 2 seconds later
function newCountry(country, callback) { setTimeout(function() { // Add into the array countries.push(country); // Execute the callback callback(); }, 2000 ); }
[ "function handleAdd() {\n if (selectedTimeZone) {\n let newTimeZones = [...myTimeZones, selectedTimeZone]\n setMyTimeZones(newTimeZones)\n localStorage.setItem(TIME_ZONE_KEY, JSON.stringify(newTimeZones))\n }\n }", "function submitCountry()\n{\n let currentUserRef = localStorage.getItem(C...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Initializes an ability dictionary in order to prevent multiple lookups for ability IDs
function createAbilityDict() { let abilDict = {}; return new Promise(function(resolve,reject) { $.getJSON(apiBase + "/IdLists/Ability", function(abilJSON) { abilJSON.forEach((json) => { abilDict[json.Value.toLowerCase()] = json.Key; }); resolve(abilDict); }); }); }
[ "function isValidAbility(id) {\n if (typeof id === 'undefined' || id == null) {\n return false;\n };\n if (typeof ABILITIES[id.toLowerCase()] === 'undefined') {\n return false;\n } else {\n return true;\n };\n}", "constructor() {\n this.game = undefined;\n\n this.mapKey = un...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
get the second last block
getSecondLastBlock (callback) { if (this.chainLength <= 1) { let err = new Error('this.chainLength <= 1, failed to get second last block') return callback(err, null) } this.getBlock(this.chainLength - 2, callback) }
[ "getLatestBlock() {\n return this.chain[this.chain.length - 1];\n }", "function getLastChunk(chunks) {\n return chunks[chunks.length - 1];\n}", "function getNextBlock () {\n\n // ensure something to pull from\n fillBag();\n\n // take block from next pieces queue\n let nextBlock = nextPieces.pop...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Stop visualizing the source node and disconnect it.
disconnect() { if (this.source) { this.source.disconnect(this.analyser); this.source = null; } }
[ "disconnect() {\n\t\t\tthis.connected = false;\n\t\t\t// Emitting event 'disconnect', 'exit' and finally 'close' to make it similar to Node's childproc & cluster\n\t\t\tthis._emitLocally('disconnect');\n\t\t}", "stopTrackingMouse() {\n if (this._pointerWatch)\n this._pointerWatch.remove();\n\n ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Adds a BR at the end of blocks that only contains an IMG or INPUT since these might be floated and then they won't expand the block
function addBrToBlockIfNeeded(block) { var lastChild; // IE will render the blocks correctly other browsers needs a BR if (!isIE) { block.normalize(); // Remove empty text nodes that got left behind by the extract // Check if the block is empty or contains a floated last child lastChild = b...
[ "function _isLineBreakOrBlockElement(element) {\r\n if (_isLineBreak(element)) {\r\n return true;\r\n }\r\n\r\n if (wysihtml5.dom.getStyle(\"display\").from(element) === \"block\") {\r\n return true;\r\n }\r\n\r\n return false;\r\n }", "convertLineBreaksToNonBreaking() {\...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
searches the entire frameset and returns the frame with name frmname
function findFrame(w, frmname) { var res = null; if (frmname != '') { res = w.frames[frmname]; // if it's not in the current window // search the sub-frames if (res == null) { var L = w.frames.length; var i; for (i = 0; i < L; i++) { ...
[ "async getFrame(page, name) {\n return await this.getEvalFrame(page.mainFrame(), { frame: name });\n }", "function frameType(frame) {\n var frameClass = frame.attr(\"class\");\n if (frameClass.indexOf(\"readyFrame\") != -1)\n return \"readyFrame\";\n else if (frameClass.indexOf(\"ackRRFrame\")...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Set the given data into the given destination object
function set_data(dest, key, data, context) { // If there is a transformation function, call the function. if (typeof context.transform == 'function') { dest = dest || {} data = context.transform(data, context.src, dest, context.srckey, context.destkey) } // See if data is null and there is a default ...
[ "set(id, data) {\n let oldData = this.raw();\n oldData[id] = data;\n this._write(oldData);\n }", "setTransactionDataObject (transactionData)\r\n {\r\n this.transactionData=transactionData;\r\n }", "set origData(val) {\n this._origData = val;\n }", "function update_obj(...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Ensures that the experiment branch is set and returns it.
function ensureExperimentBranch() { return new Promise(resolve => { // TESTING CODE try { let forcedBranch = Services.prefs.getCharPref("browser.urlbar.experiment.unified-urlbar.branch"); resolve(forcedBranch); } catch (ex) {} let experiments = Experiments.instance(); // This ...
[ "function getBranch() {\n return new baseService()\n .setPath('ray', '/company/branch/' + vm.currentBranch)\n .execute()\n .then(function (res) {\n vm.branchName = res.name;\n });\n }", "function getBranch(payload) {\...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
This function compares new gift lists and new private gift lists to the old gift lists and old private gift lists.
function checkGiftLists(updatedUserData){ var newGiftList = updatedUserData.giftList; var newPrivateGiftList = updatedUserData.privateList; if(newGiftList == undefined){} else if(newGiftList != undefined) { for (var i = 0; i < userBoughtGiftsArr.length; i++) { var a = findUIDItemInArr(use...
[ "function gotSomethingDifferent(){\n if (prevDetections.length != detections.length){\n return true;\n }\n var prev = getCountedObjects(prevDetections);\n var curr = getCountedObjects(detections);\n for (var k in curr){\n if (curr[k] !== prev[k]){\n return true;\n }\n }\n for (var k in prev){\n...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
ajax_comments_submit() Handles the actual AJAX request
function ajax_comments_submit() { if(ajax_comment_loading) return false; ajax_comments_loading(true); var ol = ajax_comments_find_list(); var f = ajax_comments_find_element(ajax_comments_form, 'form'); new Ajax.Request(f.action, { method: 'post', asynchronous: true, po...
[ "function postSubComment(e) {\n var commentId = e.getAttribute(\"data-id\");\n var subCommentsId = $(\"#sub-comment\" + commentId);\n var content = $(subCommentsId).val();\n if (!content) {\n alert(\"comment can not be empty\");\n return;\n }\n $.ajax({\n type: \"POST\",\n ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Function add type films on search panel in 3 columns for search films by type
function typeOfFilms(data){ var typeslinks = $('.list', data).children('tbody').children('tr').children('td').children('ul').children('li').children('a'); typeslinks.each(function(i){ if (i < 5){ var type = '<a href="http://www.kinopoisk.ru' + $(this).attr('href') + '" targe...
[ "function fnInsertLabelFilters(){\r\n if(FC$.Page==\"Products\"){ \r\n var insertLabelSearchFilter = document.querySelectorAll(\".SearchFil\") \r\n for (i = 0; i < insertLabelSearchFilter.length; i++) {\r\n insertLabelSearchFilter[i].setAttribute(\"aria-label\",\"Search Fil\");\r\n } ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
(2) Write a function where the program takes a random integer between 1 to 10, the user is then prompted to input a guess number.
function guess_number(){ const number = Math.ceil((Math.random() * 10)); function g(){ print("Guess a number from 1-10.") const guess = readline(); if (guess == number){ print("You guessed correctly."); return; } else { g(); } } g(); }
[ "function guess() {\n\n // WRITE YOUR EXERCISE 4 CODE HERE\n let guess = 0;\n let number= 0;\n let attempt = 0;\nnumber = (Math.floor(Math.random()* 1000) + 1);\nguess = prompt (\"Please enter your guess. The range is a random integer between 1 to 1,000.\")\nattempt += 1\nwhile (guess != number){\n if (guess >...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
CODING CHALLENGE 368 A game of table tennis almost always sounds like Ping! followed by Pong! Therefore, you know that Player 2 has won if you hear Pong! as the last sound (since Player 1 didn't return the ball back). Given an array of Ping!, create a function that inserts Pong! in between each element. Also: If win eq...
function pingPong(arr, win) { const a = []; for (let i = 0; i < arr.length; i++) { if (arr[i] === "Ping!" && arr[i+1] === "Ping!") { a.push("Ping!"); a.push("Pong!") } else { a.push("Ping!") } } if (win) a.push("Pong!"); return a; }
[ "checkFinished(row, col, player){\n let winningStreak = [];\n\n //Checking for a streak vertically in the column of the inserted token\n let streak = [];\n let streakReached = false;\n for(let i=0; i<this.rows; i++){\n if(this.field[i][col] == pl...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Add restore default handler
function addRestoreDefaultThemeHandler() { $(document).on("click", "#open-chrome-settings-url", function (e) { e.preventDefault(); chrome.tabs.create({ url: 'chrome://settings/' }); }); $(document).on("click", "#restore-default-theme-dialog-body", function (e) { ...
[ "setFallback(handler) {\n const fallbackGroup = new RouteGroup_1.default(constants_1.ROUTES_FALLBACK);\n fallbackGroup.match(null, handler);\n this.fallback = fallbackGroup;\n }", "function restoreAll() {\n clientMethods.forEach(function (methodName) {\n monitor[methodName].restore();\...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Creates and positions the small glow elements on the screen
static generateSmallGlows(number) { let h = $(window).height(); let w = $(window).width(); let scale = (w > h) ? h/800 : w/1200; h = h/scale; w = w/scale; for(let i = 0; i < number; i++) { let left = Math.floor(Math.random()*w) / 1280 * 100; let ...
[ "function render() {\n background.removeAllChildren();\n\n // TODO: 2 - Part 2\n // this fills the background with a obnoxious yellow\n // you should modify this to suit your game\n var backgroundFill = draw.rect(canvasWidth, groundY, '#5d43a3');\n b...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
class "DFS" (debugging function state) declaration: class contains information for the debugger, which was used during execution of specific function input(s): mode: (DBG_MODE) debugging mode fr: (frame) function's frame pos: (position) executed posiition, when execution was transfered away from thie function fc: (func...
function dfs(mode, fr, pos, fc){ //assign id this._id = dfs.__nextId++; //assign debugging mode this._mode = mode; //assign frame reference this._frame = fr; //assign execution position this._pos = pos; //null function call reference -- it will be assigned by interpreter during invokeCall this._funcCall = fc;...
[ "function dfsAlgorithm() {\r\n const startingPointNode = setDFSAlgorithm(eventStates)\r\n // Set timer to 1s for Animation Frames (in seconds)\r\n runDFSAlgorithm(startingPointNode, eventStates, 1)\r\n visitedNodesAnimation(eventStates, \"DFS\")\r\n // paintVisitedNodes(eventStates, 1) //Timer set to...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Method visitNextpage It visits the next page from url taken from poping the visitable list param : None
function visitNextPage() { var _url = _this.visitableList.pop(); var getPage = request(_url, function(error, response, body){ _this.totalVisit += 1; if(_this.toVisit>0 && _this.totalVisit >= _this.toVisit) { continueVisit = false; } if(error) { //Skip to next page if avaiable if(_this.vis...
[ "nextPage(){\n BusinessActions.nextPage();\n }", "function processNext() {\n const url = urlsToProcess.shift();\n\n PageFetcher.fetch(url, (pageResult) => {\n processResultFn(pageResult);\n\n const { status, url, raw } = pageResult;\n\n proces...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
write a function that takes an input array and returns an array of booleans (>=75) or fail (<75)
function passOrFail(array) { // let pass = false; // if (array >= 75) { // pass = true; // } let pass = array.map((x) => x >= 75); return pass; }
[ "function passOrFail(array) {\n //create new array of boolean values testing x>=75\n const grade = array.map((x) => (x >= 75 ? true : false));\n return grade;\n}", "function arrayLessThan100(arr) {\n\treturn arr.reduce((x, i) => x + i) < 100;\n}", "function smallEnough(a, limit){\n // const isBelowThreshold...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
emoji click event handler
function emojiClickEventHandler(emoji){ writeToClipboard(emoji.char); addToFavorite(emoji); }
[ "function imojieClick(emojie) {\n gMeme.lines.push({\n txt: `${emojie}`,\n size: 20,\n align: 'left',\n color: 'red',\n x: 250,\n y: 300\n }, )\n gMeme.selectedLineIdx = gMeme.lines.length - 1\n drawImgText(elImgText)\n}", "function chooseEmoji(e) {\n if(e....
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
/ This is the method that responds to the MouseLeftButtonUpEvent event. / / / Critical Calls DoUserInitiatedNavigation. We also want to protect against replay attacks / and can't assume the IsHyperlinkPressed DP hasn't been tampered with. / private static void
function OnMouseLeftButtonUp(/*object*/ sender, /*MouseButtonEventArgs*/ e) { /*IInputElement*/var element = sender; /*DependencyObject*/var dp = sender; if (element.IsMouseCaptured) { element.ReleaseMouseCapture(); } // // ISSUE -...
[ "function DispatchNavigation(/*object*/ sender)\r\n { \r\n var hl = sender instanceof Hyperlink ? hl : null;\r\n if (hl != null)\r\n {\r\n // \r\n // Call the virtual OnClick on Hyperlink to keep old behavior.\r\n // \r\n hl.OnClick(); \r\n ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
get rune info by id
function getRuneInfo(id) { if (id in rune) return rune[id] else throw new Error ("No rune with id " + id) }
[ "function find_letter(given_id) {\r\n for(var i = 0; i < 7; i++) {\r\n if(game_tiles[i].id == given_id) {\r\n return game_tiles[i].letter;\r\n }\r\n }\r\n // error\r\n return -1;\r\n}", "function get_letter(passed_id) {\n // loop to iterate through the 7 pieces on the rack\n for(var i = 0; ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Function to get random phrase split into characters in a new array
function getRandomPhraseAsArray(arr) { //index a random phrase and store it in variable const currentPhrase = arr[generateRandomNumber(arr)]; //Split the phrase into individual characters const newArray = currentPhrase.split(''); //return the new array return newArray }
[ "function wordDivide(randomWord) {\n var wordArray = randomWord.split(\"\");\n for (var i = 0; i < wordArray.length; i++) {\n letters.push(wordArray[i]);\n console.log(wordArray[i]);\n }\n}", "function wordToArrayOfLetters(randomWord)\n{\n\tconst wordToGuess = [];\t\t\t\t\t\t\n\tfor(let i=0; i<randomWord...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
accepts element and toggles the index of the option element to deselect. Removes tag
function remove(element) { var index = element.getAttribute('data-index'); select[0].options[index].selected = false; element.parentNode.parentNode.removeChild(element.parentNode); }
[ "deselect(option) {\n this.deselectValue(option.value);\n }", "deselect(option) {\n if (!this.disabled && !option.disabled) {\n option.deselect();\n }\n }", "deselect() {\n if (this.selected != null) {\n this.selected.deselect();\n this.selected = null;\n }\...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Loads a polyfill suite from polyfill.io and then calls the provided callback when it is ready
function polyfill(callback) { callback(); }
[ "function runPolyfill() {\n polyfillCustomElements(document);\n}", "async function polyfill(locale = '') {\n const dataPolyfills = [];\n // Polyfill Intl.getCanonicalLocales if necessary\n if (shouldPolyfillGetCanonicalLocales()) {\n await import(\n /* webpackChunkName: \"intl-getcanonicallocales\" ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
process the grammar and build final data structures and functions
function processGrammar(dict, tokens) { var opts = {}; if (typeof dict === 'string') { dict = lexParser.parse(dict); } dict = dict || {}; opts.options = dict.options || {}; opts.moduleType = opts.options.moduleType; opts.moduleName = opts.options.moduleName; opts.con...
[ "function ProgramParser() {\n \t\t\n \t\t this.parse = function(kind) {\n \t\t \tswitch (kind) { \t\n \t\t \t\tcase \"declaration\": return Declaration();\n \t\t \t\tbreak;\n\t \t\t\tdefault: return Program();\n\t \t\t}\n\t \t}\n \t\t\n \t\t// Import Methods from the expression Parser\n \t\tfunction Assignment() {r...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
USDA search results have a 'marketname' element that is comprised of distanceinmiles and actual market name, in one string
function split_distance_marketname(market) { market.distance = market.marketname.match(/(\d+.\d+)/g)[0]; // /(\d+)/g market.marketname = market.marketname.substr(market.distance.length + 1);// adjusted return market; }
[ "parseName() {\n return ionMarkDown_1.Imd.MarkDownToHTML(this.details.artist) + \" - \" + ionMarkDown_1.Imd.MarkDownToHTML(this.details.title);\n }", "function displayStateSearchData(item) {\n // variable that will contain the string with the results\n const itemStringArray = [];\n\n // Iterate over ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Add a refund address to altcoin order
function add_refund() { var refund_address = document.getElementById("bnomics-refund-input").value; var flypObj = new Object(); flypObj.uuid = flyp_uuid; flypObj.address = refund_address; var flypObjString= JSON.stringify(flypObj); var refund = new XMLHttpRequest(); refund.onreadystatechange = funct...
[ "function refundOrder(order, resolve, reject){\n if(order === undefined) resolve();\n\n let id = order['id'];\n\n let totalAmount = parseFloat(order['total_price']);\n let amountRefunded = 0;\n\n console.log(order['email']);\n\n const refunds = order['refunds'];\n refunds.forEach((refund)=>{\n ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
When the player widget is ready, kickoff a play/pause in order to get the data loading. We'll wait on loadedProgress. It's possible for the loadProgress to take time after play(), so we don't call pause() right away, but wait on loadedProgress to be 1 before we do.
function onPlayerReady( data ) { // Turn down the volume and kick-off a play to force load player.bind( SC.Widget.Events.PLAY_PROGRESS, function( data ) { // Turn down the volume. // Loading has to be kicked off before volume can be changed. player.setVolume( 0 ); // Wait fo...
[ "function onPlayerReady() {\n const roomCode = this.player.roomCode;\n\n // The player is ready to smack down.\n this.player.ready = true;\n\n // Let everyone else know the player is ready.\n this.broadcast.to(roomCode).emit('show player ready', this.player);\n\n // Check to see if all players are ready.\n i...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Creates the viewstack layout.
function _createLayout() { this._renderables = { views: [], transferables: [] }; this._viewStack = []; this.layout = new LayoutController({ layout: ViewStackLayout.bind(this), layoutOptions: this.options, dataSource: th...
[ "createLayout(){\n const container = createComponent('div', {class: 'container'})\n const pageContent = createComponent('div', {id: 'pageContent', class: 'my-5'})\n const welcomeImage = createComponent('img', {src: \"./images/home.png\", style: \"max-width: 100%\"})\n pageContent.append(...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
This function is to extract the first 10 data cells of each subject ID for making the bar chart and to graph that data into a bar chart.
function graph_for_subject_id(){ let top_10_otus_unique_table = [] let top_10_otus_sample_values = [] let top_10_otus_labels = [] let otu_ids_length = database.samples[index]["otu_ids"].length let selected_row = database.samples[index] if (otu_ids_length >= 10){ ...
[ "function barchart(selectedID){\n d3.json(\"data/samples.json\").then((data) => {\n var dropdownMenu = d3.select(\"#selDataset\");\n selectedID = dropdownMenu.node().value;\n var samples = data.samples;\n var selectID = samples.filter(person=>person.id==selectedID);\n var valuearray = selectID[0];...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
create event classes from metadata
function decorateEvents(registry, metadata, metadataEvents) { // decorate the events metadata.asLatest.modules.filter((_ref) => { let { events } = _ref; return events.isSome; }).forEach((section, sectionIndex) => { const sectionName = (0, _util.stringCamelCase)(section.name.toString()); ...
[ "_createEvents(prefix, events) {\n for(let eventName in events) {\n events[eventName] = new Event(prefix + '_' + eventName, this);\n }\n }", "InstallEventClass(string, string, string, string) {\n\n }", "function createEvent(e) {\n\n let ev = {};\n ev.date_start = `${e.start.year}-${e.start.mon...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Removes styling on each search event
function removePreviousSearchStyles() { const allSvgs = document.querySelectorAll('.icon'); const allLinks = document.querySelectorAll('.social a'); // Restores SVG icons to their original styles allSvgs.forEach(svgIcon => { svgIcon.style.opacity = '1'; }); // Deletes the link text and href allLinks...
[ "function clearSearchResult() {\n if (current_mode !== mode.search) {\n console.log(\"Warning: request to clear search result when not in search mode.\");\n return;\n }\n path.classed(\"dimmed\", false);\n highlightSelectedLinks(false);\n selected_links = [];\n //displayConnections(f...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
=> ByteArray stringToByteArray(DOMString string);
function stringToByteArray(string){ var byteArray = new Uint8Array(string.length); for(var i = 0; i < string.length; i++){ byteArray[i] = string[i].charCodeAt(0); } return byteArray; }
[ "function hex_str_to_byte_array(in_str) {\n var i\n var out = []\n var str = in_str.replace(/\\s|0x/g, \"\")\n for (i = 0; i < str.length; i += 2) {\n if (i + 1 > str.length) {\n out.push(get_dec_from_hexchar(str.charAt(i)) * 16)\n } else {\n out.push(\n get_dec_from_hex...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
hide links for any toolspecific sections that are not present
function hideSwitcherLinks (detectedTools) { Array.from(document.querySelectorAll('a.tool-switcher')) .forEach(link => { if (detectedTools.includes(link.dataset.tool)) return link.style.display = 'none' }) }
[ "function hideSectionsBasedOnPermission(){\n currentUserPermission = currentLoggedInUser.privilege;\n $('.permission-link').hide(); //Hide all navigation links by default\n $('.permission-link').each(function(){ //Show proper sections based on the permission\n if($(this).hasClass('perm-'+currentUser...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
builds out the axes labels
function buildAxesLabels() { vis.axes .data(vis.allAxis).enter() .append("svg:text").classed("axis-labels", true) .text(function(d) { return d; }) .attr("text-anchor", "middle") .attr("x", function(d, i) { return config.w / 2 * (1 - 1.3 * Math.sin(i * config.radians / vis.t...
[ "function createXAxisLabels(labels, names)\n{\n let x = 0;\n let y = 20;\n let i = 0;\n\n names.forEach(name => \n {\n xLabels[i] = labels.append(\"text\")\n .attr(\"y\", y)\n .attr(\"text-anchor\", \"middle\")\n .attr(\"value\", name) // value to grab for event listener\n .classed(name === chos...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Read the `ngInjectorDef` type in a way which is immune to accidentally reading inherited value.
function getInjectorDef(type) { return type && type.hasOwnProperty(NG_INJECTOR_DEF) ? type[NG_INJECTOR_DEF] : null; }
[ "getInjectable(name) {\n const node = this.injects[name] || null;\n if (node !== null) {\n return node instanceof Node ? node : this.newNode(node);\n }\n return MISSING_NODE;\n }", "loadIntoExistingLocation(type:Type, location:ElementRef, injector:Injector = null):Promise<ComponentRef> {\n th...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Removes a task from the front. Sets the next task's start time to removed task's and increases it's duration.
removeFront() { this._taskArr.shift(); /* if(this._taskArr.length === 1) { } else if(this._taskArr.length > 1) { let curr = this._taskArr[0]; let next = this._taskArr[1]; next.setStartTime(curr.startTime); this._taskArr.shift()...
[ "removeBack() {\n this._taskArr.pop();\n /*\n if(this._taskArr.length === 1) {\n this._taskArr.pop();\n } else if(this._taskArr.length > 1) {\n let curr = this._taskArr[this._taskArr.length - 1];\n let prev = this._taskArr[this._taskArr.length - 2];\n ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Detach the properties panel from its parent node.
detach() { const parentNode = this._container.parentNode; if (parentNode) { parentNode.removeChild(this._container); this._eventBus.fire('propertiesPanel.detach'); } }
[ "destroy() {\n if (this.panel) {\n this.panel.destroy();\n this.panel = undefined;\n }\n }", "detach() {\n if (this.hasPrimaryIdentifierAttribute()) {\n const identityMap = this.constructor.getIdentityMap();\n identityMap.removeComponent(this);\n...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[FUNCTION] FIND REACHABLE POSITIONS
function findReachablePositions(player, position) { // PARAMETERS : player, position reachs = []; // vider le tableau des cases atteignables var surrounds = findSurroundingPositions(position); // create a variable to define surrounding positions var range = 0; // set distance tested to zero // Define...
[ "function char_position_finder(steps, base){\n\tlet counter = 0,\n\t\t\tposition;\n\t\t// \"arr.some\" is used instead of \"arr.forEach\" so we can break out of the loop as soon as we find the position we're searching for\n\t\tsteps.some( (step, i) => {\n\t\tcounter = step_counter(step, counter);\n\t\tif(counter ==...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
setup mainDsu (emulates an SSApp DSU) and the participantManager.
function createMainDSU(callback) { keyssispace.createSeedSSI(domains[0], function (err, aSeedSSI) { console.log("mainDSU (SSApp) seedSSI identifier: " + aSeedSSI.getIdentifier(true)); //Create a main DSU resolver.createDSU(aSeedSSI, (err, dsuInstance) => { //Reached when DSU crea...
[ "function loadDSU() {\n try {\n resolver.loadDSU(DSU_SSI.getSSI(), (err, dsuInstance) => {\n if (err) {\n console.error(err);\n setModal(\"Error\", \"DSU has NOT been loaded, check console\");\n }\n dsu = dsuInstance;\n console.log(...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Hides the enhanced urlbar when hover with CTRL key pressed
function hideEnhancedURLBar() { if (ctrlMouseHover) return; async(function() { ctrlMouseHover = true; }, 200); setOpacity(1); enhancedURLBar.style.display = "none"; }
[ "removeShortcut(keys) {\n Mousetrap.unbind(keys)\n }", "function hideLinksBar() {\n\tlinksbarDiv.className = 'page transition down';\n}", "function pressedGlobalShortcutKeys () {\n if (!mb.window.isVisible()) {\n mb.window.show()\n } else {\n mb.hideWindow()\n }\n}", "function disablehotKey...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
paintStat( g, sheet, stat, value, region, turns ) Paints text for a character stat in a 'char' region: stat is the name of the stat (Life, Craft, etc.); value is null for stats like Gold, or the amount to print for stats like Life; turns is the number of anticlockwise turns to rotate the text.
function paintStat(g, sheet, stat, value, region, turns) { if (value != null) { stat = sprintf(#tal_stat_format, stat, value); } sheet.drawRotatedTitle(g, stat, R(region), Talisman.titleFont, 7, sheet.ALIGN_CENTER, turns); }
[ "function drawStats(stats) {\r\n textAlign(LEFT);\r\n fill('gray');\r\n blendMode(ADD);\r\n drawStat(0, 'objectsDrawn', stats.objectsDrawn, 800);\r\n drawStat(1, 'highestNote', stats.highestNote, 127);\r\n // drawStat(2, 'highestNoteMax', stats.highestNoteMax, 127);\r\n}", "function drawChar(lin...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
check whether has albumList, if not, insert
function checkAlbumList() { console.log('--checking for db albumList...'); let albumList; try { albumList = db.getData('/albumList'); } catch (err) { albumList = []; db.push('/albumList', albumList); } }
[ "static addAlbum(album) {\n const albums = Storage.getAlbums();\n\n albums.push(album);\n\n localStorage.setItem('albums', JSON.stringify(albums));\n }", "static checkForDuplicate(albumId) {\n const albums = Storage.getAlbums();\n let isDuplicate;\n\n albums.forEach((album) => {\n if(album...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
This function is to make the Scrabble row droppable and let the program know where a piece is dropped.
function load_droppable_pieces() { var img_location = "scrabbleimages/scrabble_transparent.png"; // the image's location var drop = ""; var scrabbleDropID = "#drop" + i; console.log("Load Droppable Function") for(var i = 0; i < 15; i++) { scrabbleDropID = "#drop" + i; // Making...
[ "function dropPiece(evt, availableTiles, startx, starty)\n{\n var correct = 0; //variable that decides if the piece was placed in the correct spot\n for(var i = 0; i < availableTiles.length;i++)\n {\n if(intersect(availableTiles[i]))\n {\n correct = 1;\n evt.currentTarget.x = availableTiles[i].x;...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Update progress bar and notify server about checked and unchecked checkboxes
function showProgress() { let progressBar = document.getElementById('myBar'); let count = 0; for (let x = 0; x < checkboxes.length; x += 1) { if (checkboxes[x].checked) { checkboxes[x].nextElementSibling.nextElementSibling.removeAttribute('hidden'); c...
[ "function updateStatus() {\n\tfor (let i = 0; i < inputs.length; i++) {\n\t\tif (inputs[i].checked === true) {\n\t\t\tlistItems[i].classList.add('completed');\n\t\t\ttasks[i].completed = true;\n\t\t} else {\n\t\t\tlistItems[i].classList.remove('completed');\n\t\t\ttasks[i].completed = false;\n\t\t}\n\t}\n\n\t// d) ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
reads exactly `p.length` bytes into `p`. If successful, `p` is returned. If the end of the underlying stream has been reached, and there are no more bytes available in the buffer, `readFull()` returns `EOF` instead. An error is thrown if some bytes could be read, but not enough to fill `p` entirely before the underlyin...
async readFull(p) { let bytesRead = 0; while (bytesRead < p.length) { try { const rr = await this.read(p.subarray(bytesRead)); if (rr === Deno.EOF) { if (bytesRead === 0) { return Deno.EOF...
[ "async read(p) {\n let rr = p.byteLength;\n if (p.byteLength === 0)\n return rr;\n if (this.r === this.w) {\n if (p.byteLength >= this.buf.byteLength) {\n // Large read, empty buffer.\n // Read directly into p to av...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
load tags to header and hero
function loadTags() { const tags = JSON.parse(sessionStorage.getItem('tags')) tags && tags.headerTags.forEach(tag => { const li = document.createElement('li') li.classList.add('tags__tag') li.innerHTML = `${tag}` headerFields.appendChild(li) }) tags && tags.heroTags.forEach(tag => { const li...
[ "collectHeadTags() {\n let tags = {};\n let currentHandlerInfos = this.router.targetState.routerJsState.routeInfos;\n currentHandlerInfos.forEach((handlerInfo) => {\n Object.assign(tags, this._extractHeadTagsFromRoute(handlerInfo.route));\n });\n let tagArray = Object.keys(tags).map((id) => tags...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Create a recursive function that takes two parameters and repeats the string n number of times. The first parameter txt is the string to be repeated and the second parameter is the number of times the string is to be repeated.
function repetition(txt, n) { return txt.repeat(n); }
[ "function repeat(input, n){\n var output = ''\n for(var i = 0; i < n; i++){\n output = output + input\n }\n return output\n }", "function repeatString(str, count) { \n // TODO: your code here \n if(count === 0){\n return \"\";\n }\n return str + repeatString(str, count - 1);\n}...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Function to activate MutationObserver listener
function addMutationObserver() { const config = { childList: true, attributes: true, subtree: true, }; observer.observe(document, config); }
[ "function addChangesetsObserver() {\n var observer = new MutationObserver(function (mutations) {\n mutations.forEach(function (mutation) {\n if (mutation.type == 'attributes') {\n return;\n }\n searchChangesets();\n });\n });\n\n var config = { ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
The AWS::Cognito::UserPoolUser resource creates an Amazon Cognito user pool user. Documentation:
function UserPoolUser(props) { return __assign({ Type: 'AWS::Cognito::UserPoolUser' }, props); }
[ "function UserPool(props) {\n return __assign({ Type: 'AWS::Cognito::UserPool' }, props);\n }", "function UserPoolGroup(props) {\n return __assign({ Type: 'AWS::Cognito::UserPoolGroup' }, props);\n }", "function UserPoolClient(props) {\n return __assign({ Type: 'AW...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Sets up the click events for the artist view.
function artistEvents (template, artist) { var plyAll = template.querySelector('.play-all'); plyAll.addEventListener('click', emitEvent('artist: play-all', artist)); var addAll = template.querySelector('.add-all'); addAll.addEventListener('click', emitEvent('artist: add-all', artist)); var back = template....
[ "function albumEvents (template, album, artist) {\n\n\t\tvar plyAll = template.querySelector('.play-all');\n\t\tplyAll.addEventListener('click', emitEvent('album: play-all', album));\n\n\t\tvar addAll = template.querySelector('.add-all');\n\t\taddAll.addEventListener('click', emitEvent('album: add-all', album));\n\...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Visit a parse tree produced by PlSqlParserdefault_settings_clause.
visitDefault_settings_clause(ctx) { return this.visitChildren(ctx); }
[ "function kh_parseDefault() {\n var value = this.result[SETTINGS_KEYS.DEFAULT];\n if (value) {\n currentSettings.defaultLayouts = value;\n }\n kh_loadedSetting(SETTINGS_KEYS.DEFAULT);\n}", "function parseDefaultSettings() {\n const {defaultSettings: defaultSettingsInCategories} = require('../data/schema/'...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Finds number of operations
function operationNumber(str) { var operators = ['+', '.', '-', '/', '^', '*']; var count = 0; for (var i = 0; i < str.length-1; i++) { if (operators.includes(str[i])) { count++; } } return count; }
[ "function main() {\n let numerator = [3];\n let denominator = [2];\n let count = 0;\n for (let i = 1; i <= 1000; i += 1) {\n // console.log(numerator, denominator);\n let temp = carryForwardSum(numerator, denominator);\n numerator = carryForwardSum(temp, denominator);\n denominator = temp;\n temp...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Sets add item state as true
addItem() { this.setState({ addItem: 'true' }) }
[ "addNewItem() {\n\t\tconst newItem = {itemName: \"\", tag: \"None\", description:\"\", price:\"\", pic:\"\"};\n\t\tthis.setState((prevState, props) => ({\n\t\t\titems: prevState.items.concat(newItem)\n\t\t}))\n\t}", "function addItemShoppingList(newItem) {\n STORE.items.push({name: newItem, checked: false});\n...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
determine what station the tablet is
function getStation() { switch (parseInt(localStorage.station, 10)) { case 1: case 4: return (1); case 2: case 5: return (2); case 3: case 6: return (3); } }
[ "function closestBusTrainStation(userData){\n\n}", "function getWeatherStationById(stationid) {\n\n // Ieder weerstation aflopen\n for (var weerstation in weerstations) {\n if (weerstations.hasOwnProperty(weerstation)) {\n if(weerstations[weerstation].stationid === stationid) {\n ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
: (dom.Node, [ViewDesc]) Sync the content of the given DOM node with the nodes associated with the given array of view descs, recursing into mark descs because this should sync the subtree for a whole node at a time.
function renderDescs(parentDOM, descs, view) { var dom = parentDOM.firstChild, written = false; for (var i = 0; i < descs.length; i++) { var desc = descs[i], childDOM = desc.dom; if (childDOM.parentNode == parentDOM) { while (childDOM != dom) { dom = rm$2(dom); written = true; } dom ...
[ "function syncTreeNode(content, path, initialLoad) {\n\n if (!$scope.content.isChildOfListView) {\n navigationService.syncTree({ tree: \"media\", path: path.split(\",\"), forceReload: initialLoad !== true }).then(function (syncArgs) {\n $scope.currentNode = syncArgs.node;\n ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Creates an interpolation binding with 7 expressions.
function interpolation7(lView, prefix, v0, i0, v1, i1, v2, i2, v3, i3, v4, i4, v5, i5, v6, suffix) { var bindingIndex = lView[BINDING_INDEX]; var different = bindingUpdated4(lView, bindingIndex, v0, v1, v2, v3); different = bindingUpdated3(lView, bindingIndex + 4, v4, v5, v6) || different; lView[BINDING...
[ "function createInterpolator(data, numTimes, numStations) {\n interpolateProgram = GLProgram.create(gl)\n .loadShader('copyVertices')\n .loadShader('interpolate', '#define SIZE ' + numStations)\n .linkProgram()\n .setUniform('wh', canvas.width, canvas.height)\n .setUniform('stations', nu...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Utility function to test if a keyboard event should be ignored
function shouldIgnore(event) { var mapIgnoredKeys = { 9:true, // Tab 16:true, 17:true, 18:true, // Shift, Alt, Ctrl 37:true, 38:true, 39:true, 40:true, // Arrows 91:true, 92:true, 93:true // Windows keys }; return mapIgnoredKeys[event....
[ "function disableKeyEvents() {\n lumx.isFocus = false;\n $document.off('keydown keypress', _onKeyPress);\n }", "keyDown(key) {\n if(this.keydowns[key]) {\n return true;\n }\n return false;\n }", "function isKeyPressedValid(e) {\n return (e.keyCode == 8 ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Name: Pump_In_Sales Author: Louis Bodnar Purpose: Uses quadratic curves to draw a colorful figure with labeled sections. Each section's height is relative to its weighted value. Arguments: Pump_In_Sale(canvas_name, x_position, y_position, width, height, data); Data format: [[value, label, color], ... ] Example: Pump_In...
function Pump_In_Sale(c, x, y, w, h, d) { var canvas = document.getElementById(c); var context = canvas.getContext("2d"); context.save() var blX = x; // bottom left var blY = y + h; var trX = x + w; // top right var trY = y; var midX = x + (w / 2); var midY = y + (h / 2); var c...
[ "function Used_Vehicle_Sale(c, x, y, w, h, d) {\n var canvas = document.getElementById(c);\n var ctx = canvas.getContext(\"2d\");\n ctx.save();\n ctx.scale(w/150,h/130);\n x = x/(w/150);\n y = y/(h/130);\n\n ctx.fillStyle = \"black\";\n ctx.strokeStyle = \"black\";\n ctx.lineWidth = 1;\n ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Function for removing an online user to the widget (when someone logs out, for example).
function muut_remove_online_user(user) { if(user.path.substr(0,1) == '@') { var username = user.path.substr(1); } var username_for_selector = tidy_muut_username(username); widget_online_users_wrapper.find('.m-user-online_' + username_for_selector).fadeOut(500, function() { $(th...
[ "function removeFriendElement(uid) {\n document.getElementById(\"user\" + uid).remove();\n\n friendCount--;\n if(friendCount == 0){\n deployFriendListEmptyNotification();\n }\n }", "admin_remove_user(user_id) {\n if (Roles.userIsInRole(Meteor.userId(), ['admin'])) {\n Meteor.users.remove...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
creates or updates an animated gif from a set of photos linked to the the photo with id of rootid
function updateAnimation(rootid, path) { // enumerate all input foto's for animation db.query("select id, time, filename from photo where id=$1 or rootid=$1 order by time", [rootid]) .then(function(rows){ if (rows.length > 0) { // at least one photo found, create animation ...
[ "function updateGrid(){\n for(var id = 0; id < numPhotos; id++){\n var selector = $(\"#\"+id);\n selector.attr('src', photoData[i]['src']);\n }\n}", "function setPhotos(p){\n\t\t\tfunction setPic(sp){\n\t\t\t\tvar id=\"\";\n\t\t\t\tfor(i in sp){\n\t\t\t\t\tif(i>3)\n\t\t\t\t\t\tbreak;\n\t\t\t\t\telse\n\t\t...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
getUserBrowser function purpose: returns the common name of the user's browser
function getUserBrowser() { var agent = navigator.userAgent.toLowerCase (); var browser = "Unknown browser"; if (agent.search ("msie") > -1) { browser = "Internet Explorer"; } else { if (agent.search ("firefox") > -1) { browser = "Firefox"; } else { ...
[ "function getBrowser() {\n var browserObj = $.browser;\n if (browserObj.hasOwnProperty(\"chrome\")) {\n return Browsers.CHROME;\n } else if (browserObj.hasOwnProperty(\"mozilla\")) {\n return Browsers.FIREFOX;\n } else if (browserObj.hasOwnProperty(\"msie\")) {\n return Browsers.INTERNET_EXPLORER;\n }...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Returns the URL for a callable with the given name.
_url(name) { const projectId = this.app.options.projectId; if (this.emulatorOrigin !== null) { const origin = this.emulatorOrigin; return `${origin}/${projectId}/${this.region}/${name}`; } if (this.customDomain !== null) { return `${this.customD...
[ "getUrl (name) {\n name = name.name ? name.name : name\n return this.urls[name]\n }", "function computeURL() {\n var url = settings.url;\n if (typeof settings.url == 'function') {\n url = settings.url.call();\n }\n return url;\n }", "https...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
converts BST 'data' values to [array]
cvtBST() { var arr = []; arr.push(this.root.data); // get array - depth-first this.cvtToArray(this.root.left, arr); this.cvtToArray(this.root.right, arr); return arr; }
[ "function flattenTreeData(data) {\n var dataMap = data.reduce(function(map, node) {\n map[node.name] = node;\n return map;\n }, {});\n\n // create the tree array\n var treeData = [];\n data.forEach(function(node) {\n // add to parent\n var parent = dataMap[node.parent];\n if (parent) {\n //...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
norm() is required because of stupid, noninternational sorting in js. Normalizes the icelandic characters to put them in their place
function norm(str){ return str .toLowerCase() .replace(/Á|á/,'azzz').replace(/É|é/,'ezzz').replace(/Í|í/,'izzz') .replace(/Ð|ð/,'dzzz').replace(/Ó|ó/,'ozzz').replace(/Ú|ú/,'uzzz') .replace(/Ý|ý/,'yzzz').replace(/Þ|þ/,'zz').replace(/Æ|æ/,'zzz').replace(/Ö|ö/,'zzzz...
[ "function _normalize(phrase) {\n\n // Lower case it\n phrase = phrase.toLocaleLowerCase();\n\n // Normalize special characters by using the characters in the charMap hash\n phrase = phrase.replace(/[,./!?àáâãāçćčèéêëēėęîïíīįìłñńňôòóōõřśšťûüùúūůÿýžżŻź]/g, function(ch) {\n retur...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }