query
stringlengths
9
34k
document
stringlengths
8
5.39M
negatives
listlengths
19
20
metadata
dict
Return a new ``bytes6`` type for %%v%%.
static bytes6(v) { return b(v, 6); }
[ "static bytes7(v) { return b(v, 7); }", "static bytes5(v) { return b(v, 5); }", "static bytes9(v) { return b(v, 9); }", "static bytes25(v) { return b(v, 25); }", "static bytes23(v) { return b(v, 23); }", "static bytes8(v) { return b(v, 8); }", "static bytes11(v) { return b(v, 11); }", "static bytes15(...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
carga el select del directorio para editar carpeta
function carga_editar_directorio_noges(ruta) { dir = "../static/directorio_noges" + ruta; $.ajax({ type: "POST", url: "web/select.php", data: "ruta=" + dir + "&seleccion=editar_directorio_noges", success: function(r) { $('#select-editar-directorio-noges').html(r); ...
[ "function carga_archivo_directorio_noges(ruta) {\n dir = \"../static/directorio_noges\" + ruta;\n $.ajax({\n type: \"POST\",\n url: \"web/select.php\",\n data: \"ruta=\" + dir + \"&seleccion=archivo-directorio_noges\",\n success: function(r) {\n $('#select-archivo-direct...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
generates Rock in linear interval
linearRockGenerator(collisionGroup, lvlArray, orbNumber, orbStartPosition, orbPositionY, interval) { var orbSpawnPosition = orbStartPosition; var loopLimit = lvlArray.length+orbNumber; for (var i = lvlArray.length; i < loopLimit; i++) { lvlArray.push(new Rock(this.game, orbSpawnPosition, orbPositionY, 1, coll...
[ "generateRocks() {\n for (let i = 1; i < m.bombMap.length-1; i++) {\n for(let j = 1; j < m.bombMap.length-1; j++) {\n if (m.bombMap[i][j] === 'wall') {\n continue;\n }else if ((j < 3 || j > 13) && (i === 1 || i === 15)) {\n contin...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Generates an SVG from an NC file containing the GCode. title is the file name without the extension ".nc"
function testFile(title, colors, width, height) { fs.readFile(title + ".nc", 'utf8', function (err, code) { if (err) { return console.log(err); } var svg = cnctosvg.createSVG(code, colors, title, width, height, 2, true); fs.writeFile(title + ".svg", svg, "utf8", function(...
[ "function downloadSVG(index) {\r\n var templateName = $(\"#page-template-\" + index).val();\r\n var color = $(\"input[name='page-color-\" + index + \"']:checked\").val();\r\n var fileName = getFileName(index);\r\n \r\n // Output to blob.\r\n var stream = blobStream();\r\n \r\n // Eventually ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
get the 'registration from the service worker and create a new 'subscription' register the subscription with the push message server by sending a POST request to the server
function subscribe() { navigator.serviceWorker.ready .then(registration => { return registration.pushManager.subscribe({userVisibleOnly: true}) }) .then(subscription => { console.log('Subscribed ', subscription.endpoint) return fetch('http://localhost:4040/register', { ...
[ "async function send() {\n console.log('Registering service worker...')\n const register = await navigator.serviceWorker.register('/serviceWorker.js', {\n // this worker is applied to the home page/index\n scope: '/'\n })\n console.log('Service worker registered')\n\n console.log('Registering push...')\n...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Gets the registered items in the list, sorted by their position in the DOM.
getSortedItems() { return Array.from(this._unsortedItems).sort((a, b) => { const documentPosition = a._dragRef.getVisibleElement().compareDocumentPosition(b._dragRef.getVisibleElement()); // `compareDocumentPosition` returns a bitmask so we have to use a bitwise operator. // ...
[ "visitOrder_by_elements(ctx) {\n\t return this.visitChildren(ctx);\n\t}", "get index() {\n return fromCache(this, CACHE_KEY_INDEX, () => {\n const { el, items } = this;\n const { length } = items;\n const { clientWidth } = el;\n const outerLeft = el.getBoundingC...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
hbase shell: create 'hbasetest', 'cf1', 'cf2'
function createHb (options = {}) { hbase.define('Test', Object.assign({ tableName: 'hbasetest', columns: [{ name: 'cf1:string', type: 'string' }, { name: 'cf2:date', type: 'date' }, { name: 'cf2:number', type: 'number' }, { name: 'cf2:buffer', type: ...
[ "async createTable(params) {\n try {\n const query = `CREATE TABLE IF NOT EXISTS core_tickData_${params.feed} (\n id UUID,\n ca timestamp, \n date timestamp, \n symbol text, \n price double, \n volume...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
handleRemoveAddressResponseSuccess Handle the success response from the server
static handleRemoveAddressResponseSuccess(response, contextIdentifier){ ContextualErrorActions.clearErrors(contextIdentifier); ApplicationDispatcher.dispatch({ actionType: ServerStateActionTypes.RECEIVE_CHECKOUT_DELIVER_AND_COLLECT_SERVER_STATE, action: { serverState: response.state } ...
[ "static handleRemoveAddressResponseFailure(response, contextIdentifier){\n ContextualErrorActions.receiveErrors(contextIdentifier, response.errors);\n }", "static handleSetSelectedAddressResponseSuccess(response, contextIdentifier){\n ContextualErrorActions.clearErrors(contextIdentifier);\n ApplicationD...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
utility function to compose 2 functions Notice that the params are ordered fn2, fn2. The functions compose from right to left Most typical FP libraries define their compose to work righttoleft Why? We are listing them to match the order they are written if done manually, the order we envounter them when reading from le...
function compose2(fn2, fn1) { return function composed(origValue) { return fn2(fn1(origValue)) } }
[ "function composeu (firstUnary, secondUnary){\n\treturn function (arg){\n\t\treturn secondUnary(firstUnary(arg));\n\t};\n}", "function compose(...fns) {\n return fns.reduce(function(pre, curr) {\n return function(...args) {\n return pre(curr(...args))\n }\n })\n}", "function compose(...funcs) {\n ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
pull out the needed row of data for that color
function extractRow(fftData,M,row, color){ var line = new Array(M); var kR = row * M; // copy out line of data... for (var col = kR; col < kR + M; col++){ var kc = col-kR; // convenience column number switch(color){ case "r":{ line[kc]={ r: fftData[col].r, i: fftData[col].ri } ...
[ "function chooseAvailableColor() {\n // Count how many times each color is used\n var colorUsage = {};\n colorNames.forEach(function(color) {colorUsage[color] = 0; })\n dataLayers.forEach(function(layer) {\n var color = layer.color;\n if (color in colorUsage)\n colorUsage[color]...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Retry appending entries for a single replica.
retryAppendEntries(replicaId) { var prevLogIndex = this.nextIndex[replicaId] - 1; var prevLogTerm = prevLogIndex < 0 ? null : this.log[prevLogIndex][1]; var entries = []; for (var i = prevLogIndex + 1; i < this.log.length; i++) { entries.push(this.log[i]); } ...
[ "addreplica(params) {\n this.options.qs = Object.assign({\n action: 'ADDREPLICA',\n }, params);\n\n return this.request(this.options);\n }", "retry()\n {\n if ((this.attempts + 1) === this.config.attempts) {\n window.clearInterval(this.timer);\n r...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Finds a control within this page's control tree using the supplied predicate
findControl(predicate) { // check all sections for (let i = 0; i < this.sections.length; i++) { // check all columns for (let j = 0; j < this.sections[i].columns.length; j++) { // check all controls for (let k = 0; k < this.sections[i].columns[j].c...
[ "function findBy(container, property, value, all){\r\n\r\n var me = container;\r\n var panels = me.panels;\r\n var pp = [];\r\n for(var i=0; i<panels.length; i++){\r\n var p = panels[i];\r\n if (property){\r\n if (p[property] == value){\r\n ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
helper functions load a CSV File via XMLHttpRequest object and save it to the global "dataset" object
function teLoadCSVFile (filePath) { console.log("start loading file - "+filePath); var rawFile = new XMLHttpRequest(); rawFile.overrideMimeType('text/plain'); // override default XML reader (syntax error) rawFile.open("GET", filePath, true); // .onreadystatechange fires after rawFile.sen...
[ "function import_data_from_csv() {\n fetch(\"input.csv\")\n .then(v => v.text())\n .then(data => init_table_from_data(data))\n}", "function loadCSVfile() {\n return axios.get(EXTERNAL_CSV_FILE)\n .then((res) => {\n // In my case, the columns are located on the second line of ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Compile the query to determine if a table exists.
hasTable(tableName) { const sql = `select * from sqlite_master ` + `where type = 'table' and name = ${this.client.parameter( this.formatter.wrap(tableName).replace(/`/g, ''), this.builder, this.bindingsHolder )}`; this.pushQuery({ sql, output: (resp) => resp.length > 0 ...
[ "getTableSchema(tableName, cb) {\n let params = {\n TableName: tableName\n };\n dynamodb.describeTable(params, function (err, data) {\n if (err) {\n //table not found\n cb('');\n }\n if (data) {\n //table e...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
If there are some attrs on node that don't exist in nextAttrs, then we need to remove them
function remove () { for (let key in currAttrs) { if (!nextAttrs[key]) { dom.removeAttribute(key); delete dom.__attrs[key] } } }
[ "function cleanup(a) {\n return _.filter(a, function (a) {\n var field = a[0];\n return attr[field];\n });\n }", "onAttrRemove (attrName, entName) {\n if (this.entityAttrsUse.length <= 0) return // microdata list already empty\n if (!attrName || !entName) {\n console.wa...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
void startStream ( response ) accepts response: response send signal to child process to start live feed
function startStream (response) { child.send('start'); response.writeHead(200, {"Content-Type": "text/json"}); response.end('{"status":"ok"}'); }
[ "function stopStream (response) {\n\n\tchild.send('stop');\n\t\n\tresponse.writeHead(200, {\"Content-Type\": \"text/json\"});\n\tresponse.end('{\"status\":\"ok\"}');\n}", "register(stream) {\n const streamState = new StreamInfo(stream);\n stream.on('end', this._streamEnd(streamState));\n stre...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Function which handles a user liking or disliking a object
function haveLikedOrDislikedObject(res, contentNumber, user){ if(user != undefined){ if(res == 0){ $("#haveLikedDiv_" + contentNumber).text("Processing..."); $.post("/likeContent", { content: contentNumber, user: user.UserID, isLike: 1 }) .done(function(data) { var numLikes = data.numberOfLikes;...
[ "async onLikeClicked() {\n let currPlayer = await (await fetch(\"/players\")).json();\n let nodeOwner = getStatusValue(this.props.node.status, \"user\");\n // parse current player click\n if (currPlayer.username == nodeOwner) {\n alert(\"Nice try, but you can't like your own a...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Initialize the segment information.
onCodePathSegmentStart(segment) { segmentInfo.initialize(segment); }
[ "constructor() { \n \n OrgApacheJackrabbitOakSegmentSegmentNodeStoreFactoryProperties.initialize(this);\n }", "function segmenterInit (elem, optParm) {\n function segments(opt) {\n var conf = {\n home: {\n pieces: 4,\n \t\tanimation: {\n \t\t\tduration: 1500,\n ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Flush the buffer and insert it
function flushBuffer(cb) { crate.Insert(table_name).data(buf).run(function(err, res) { if(cb) { cb() } if (err) { console.log("Failed to insert :(", err) return } console.log("Inserted sucessfuly.") }); console.log("Inserting ", buf.length, " documents...
[ "async flush() {\n if (this.err !== null)\n throw this.err;\n if (this.n === 0)\n return;\n let n = 0;\n try {\n n = await this.wr.write(this.buf.subarray(0, this.n));\n }\n catch (e) {\n th...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
create SVG circle overlay and append it to the preview element
function createCircleOverlay(previewEl) { var dummy = document.createElementNS('http://www.w3.org/2000/svg', 'svg'); dummy.setAttributeNS(null, 'version', '1.1'); dummy.setAttributeNS(null, 'width', '100%'); dummy.setAttributeNS(null, 'height', '100%'); dummy.setAttributeNS(null, 'class', 'overlay')...
[ "renderCircle() {\r\n\t\tconst x = this.ranges.x(this.data[this.data.length - 1].date);\r\n\t\tconst y = this.ranges.y(this.data[this.data.length - 1].value);\r\n\r\n\t\tthis.point = this.svg.select('.circle')\r\n\t\t\t.interrupt()\r\n\t\t\t.transition()\r\n\t\t\t\t.duration(this.numberGeneratorOptions.interval * 2...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
resets properties and methods for resizing the element
resetResize() { const { isResizing } = resizeState; if (isResizing) { assign(resizeState, resizeDefaults); removeClass(this.container, RESIZE_CLASS); removeListener(document, 'mousemove', resizeState.listener); } }
[ "_resetPosition() {\n this._monitor = this._getMonitor();\n\n this._updateSize();\n\n this._updateAppearancePreferences();\n this._updateBarrier();\n }", "function resizedw(){\n loadSlider(slider);\n }", "function resize () {\n width = slider.offsetWidth\n\n ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Request the current location and build the second page
function build_page2(button) { navigator.geolocation.getCurrentPosition(function(position) { direction = set_direction(position); build_page2_1(direction, button); },handleError); }
[ "function _page2_page() {\n}", "function newPage1() {\n window.location.assign(\"../Question5/Question5.html\")\n}", "function callNextPage()\n{\n\tvar pageHref;\n\t\t\n\t// If there is a href\n\tif (arguments.length > 0)\n\t{\n\t\t// Get the href from the arguments\n\t\tpageHref = arguments[0];\n\t\t\n\t\t/...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
reminderEmail will send email for the next 2 weeks
async function reminderEmail() { const currentEmailHTML = await getCurrentEmailHTML(); const fromMoment = moment(getDateString(new Date())); const fromDate = fromMoment.endOf('isoWeek').format('DD/MM'); const toMoment = fromMoment.add('weeks', 1); const toDate = toMoment.format('DD/MM'); return sendEmail({...
[ "function postReminder() {\n cron.schedule('13***', () => {\n communityCallReminder();\n }, {\n scheduled: true,\n timezone: \"America/New_York\"\n });\n}", "function notifyMember(site,personalMail,firstname,lastname,date){\n var body = \"Documents and information required for emp...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
takes macro chain and returns its decoded value at the given index.
function decodeMacroChain(featureMacro, dataMatrix, index){ var macroList = featureMacro.match(/%x\[[-]?\d+,\d+\]/g); var featurePrefix = featureMacro.substring(0,featureMacro.indexOf(':')+1); var decodedMacroSequence = ''; for(var j=0; j<macroList.length;j++){ var columnStartIndex = macroList[j].indexOf(',')+1;...
[ "getMacro(name) {\n const len = this.stack.length - 1;\n for (let i = len; i >= 0; i--) {\n const inst = this.stack[i]._getMacro(name);\n if (inst !== null) {\n return inst;\n }\n }\n return null;\n }", "get(index) {\n let foundNode = this._find(index);\n return foundNode ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Function that uses linear interpolation between a max and min color/value pair to get the color associated with an input value. Colors are interpolated in the RGB space, each channel separately Opacity (A) can be toggled if no colors are supplied, the default is from blue to red
function color_interp(value, max, min, color_max, color_min, incl_a) { incl_a = typeof incl_a !== 'undefined' ? incl_a : false; color_max = typeof color_max !== 'undefined' ? color_max : { a: 255, r: 255, g: 0, b: 0 }; color_min = typeof color_min !== 'undefined' ? color_min : { a: 255, r: 0, g: 0, b: 255 }...
[ "getColor(value) {\n if (undefined == value) { return 'lightgrey'; }\n if (value < 0) {\n return this.negativeColorScale(value);\n } else {\n return this.selectedPosColorScale(value);\n }\n }", "function createColorScale() {\n return d3scale.scaleSequential(d3...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Returns the last node of the linked list.
getLast () { let lastNode = this.head; if (lastNode) { while (lastNode.next) { lastNode = lastNode.next; } } return lastNode; }
[ "getLast() {\n if (!this.head) {\n return null;\n }\n let node = this.head;\n while (node) {\n // If next is null, then we are at the last node\n if (!node.next) {\n return node;\n }\n node = node.next;\n }\n }", "function last() {\n return _navigationStack...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Flips the flipper (if necessary). `flipped` Set to true to display the backside or false for front side.
function flip (flipped) { const projection = getProjection() target = getTargetAngle(projection, flipped) updateAnimation() }
[ "function flip() {\r\n if (stopFlip) return;\r\n //add the flip style to a clicked card\r\n this.classList.add(\"flip\");\r\n moveCount();\r\n pickedCards.push(this);\r\n // card 1 selected\r\n if (cardSelected === false) {\r\n cardSelected = true;\r\n cardOne = this;\r\n return;\r\n //card 2 sel...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
toggleQ from all questypes to electedQuesTypes and viceversa
toggleQ(x){ if(this.questypes.indexOf(x)!==-1){ this.selectedQuesTypes.push(x);//add to selectedQuesTypes this.questypes.splice(this.questypes.indexOf(x),1);//pop from total questypes } else{ this.questypes.push(x);//add to all questypes this.selectedQuesTypes.splice(this.selectedQue...
[ "RemoveSelectedQfromAll(sel){\n while(sel.length>0){\n var x=sel.pop();\n if(this.questypes.indexOf(x)!==-1)\n this.questypes.splice(this.questypes.indexOf(x),1);\n }\n }", "function Quest(Type, Name, Level, Experience, Item) {\n function mainQuest() {\n var main = (Type == true) ?...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
~ Course object constructor ~ A course contains 1+ lectures sections and 0+ recitation, workshop, and lab sections
function Course(id, title) { this.id = id; this.title = title; this.lectures = []; this.recitations = []; this.workshops = []; this.labs = []; this.addSection = function (sectionObj) { if (lecPattern.test(secti...
[ "function Course(_title, _durationInDays, _desc) {\n this._title = _title;\n this._durationInDays = _durationInDays;\n this._desc = _desc;\n /*this.title = title;\n this.desc = desc;\n this.durationInDays = durationInDays;*/\n }", "constructor(_courseName) {\r\n th...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Reformats data to be in Vendor, Price, Link object property form
function reformatData(data, vendor){ let price = data.price.toString(); let link = data.link.toString(); return {"Vendor":vendor, "Price":price, "Link":link}; }
[ "getrenDetFormattedData(renewalsData) {\n\n var renewalTransformedDetails = {\n client: {\n type: renewalsData.market,\n renewalLetter: {\n label: \"Renewal Letter\",\n endpoint: \"\"\n },\n aggregatedPremiums: [\n {\n ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Get the current months short name. For example if it was December, then it would return Dec.
function getCurrentMonthShortname() { var d = new Date(); var months = new Array(12); months[0] = "Jan"; months[1] = "Feb"; months[2] = "Mar"; months[3] = "Apr"; months[4] = "May"; months[5] = "Jun"; months[6] = "Jul"; months[7] = "Aug"; months[8] = "Sep"; months[9] = "Oc...
[ "nameMonths() {\n var d = new Date()\n var mount = d.getMonth()\n var months = [\n 'January', 'February', 'March', 'April', 'May', 'June',\n 'July', 'August', 'September', 'October', 'November', 'December'\n ]\n\n return [\n {label: months[(mount != 0) ? (mount - 1) : 11], value: 'last...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
drop neighboring bubbles of same color
dropNeighbors() { if (!this.neighbors) { return; } this.neighbors.forEach((neighbor, idx) => { if (neighbor !== null && neighbor.isOfColor(this.color)) { this.neighbors[idx] = null; neighbor.delete(); neighbor.dropNeighbors(); } }); }
[ "removeEdge() {\n this.graph[fromNode] = true;\n this.graph[toNode] = true;\n }", "function removeFlareon() {\n cells.forEach((currentValue, index) => {\n if (index !== 1 && index !== 3 && index !== 5 && index !== 7) { //* if it's not one of the end indexes then continue\n return ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Deactivate all tabs and tab panels
function deactivateTabs () { for (t = 0; t < tabs.length; t++) { tabs[t].setAttribute('aria-selected', 'false'); tabs[t].classList.remove('active'); }; for (p = 0; p < panels.length; p++) { panels[p].classList.remove('show'); panels[p].classList.r...
[ "_deactivateUnselectedTabs () {\n this.panels.forEach((panel, index) => {\n if (!this._panelShouldBeActivated(panel)) {\n this._deactivateTab(panel, index)\n }\n })\n }", "deselectAllTabs() {\n this.createViewTab.className = \"WallEditor_CreateViewTab\";\n ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
return the url path for the current record path (or a modified one) by preserving or overriding the alt
getUrlRecordPathWithAlt (newPath, newAlt) { if (newPath === undefined || newPath === null) { newPath = this.getRecordPath() } if (newAlt === undefined || newAlt === null) { newAlt = this.getRecordAlt() } let rv = fsToUrlPath(newPath) if (newAlt !== '_primary') { rv += '+' + new...
[ "urlAlias(record) {\n return {\n alias: '/slide/' + record.id,\n target: '/slide/' + record.id,\n };\n }", "getSrc(){\n\t\tif( this.props.activeTrack ) {\n\t\t\treturn this.props.activeTrack.url;\n\t\t}\n\t}", "_getLinkURL() {\n let href = this.context.link.href...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Sends a signup API call and handles the results.
static sign_up(callback = null) { // Hide the inputs window.UI.hide("authenticate-inputs"); // Change the output message this.output("Hold on - Signing you up..."); // Send the API call window.API.send("authenticate", "signup", { name: window.UI.find("authenti...
[ "function signUp(form) {\r\n\r\n var user =\r\n {\"email\" : form.email.value,\r\n \"password\" : form.password[1].value,\r\n \"firstname\" : form.firstname.value,\r\n \"familyname\" : form.familyname.value,\r\n \"gender\" : form.gender.value,\r\n \"city\" : form.city.value,\r\n \"country\" : form.country.v...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
get image for weather
function getWeatherIcon(day){ let src = './images/' switch(day.weather[0].main){ case 'Thunderstorm': if (/rain|drizzle/.test(day.weather[0].description)){ src += 'rain-thunder' } break; case 'Drizzle': case 'Rain': src += 'rain' break; case 'Snow': src...
[ "function getIllustration(weatherIcon) {\n let temp = (props.iconCode.temperature);\n let illustrationImg = \"\";\n switch (weatherIcon) {\n case \"01d\":\n if (temp < -1) {\n illustrationImg = ImgCold;\n } else {\n ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
add a hobby has input in it to output
function addHobby(input) { if (!input) { return; } var hobby = createHobby(input); hobbyOutput.appendChild(hobby); }
[ "function newHobbies() {\n showHobbies();\n const q = chalk.blue(`Type in your girl friend's hobby (or enter to quit): `);\n prompt(q).then(hobby => {\n if (hobby) {\n db.get('hobbies')\n .push(hobby)\n .write();\n }\n console.log(chalk.green('Ok!'));\n });\n}", "function removeHob...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
miniLOL.Document.check(xml, path) > String xml (Document): The DOMDocument to check. path (String): The path where the XML was retrieved from. Check if the Document has some parsing errors, and return the error message if present.
function check (xml, path) { var error = false; if (!xml) { error = 'There is a syntax error.'; } if (xml.documentElement.nodeName == 'parsererror') { error = xml.documentElement.textContent; } if (path && error) { miniLOL.error('Err...
[ "function loadXML(url)\n {\n\n if (window.XMLHttpRequest) {// code for IE7+, Firefox, Chrome, Opera, Safari\n xmlhttp = new XMLHttpRequest();\n }\n else {// code for IE6, IE5\n xmlhttp = new ActiveXObject(\"Microsoft.XMLHTTP\");\n }\n try\n {\n ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Create copy of current palette
function handleNewPalette() { // Set new source and name, add option const key = getCurrentPaletteKey(); const newKey = Date.now(); palettes[newKey] = JSON.parse(JSON.stringify(palettes[key])); // This a hack but it works palettes[newKey].name = palettes[key].name + ' (Copy)'; $('select[data-id="palette"]')...
[ "get options$palette()\r\n\t{\r\n\t\treturn _.cloneDeep( this._options.palette );\r\n\t}", "function updateCurrentPalette() {\n updatePaletteColorBar();\n const key = getCurrentPaletteKey();\n $.getJSON('/setpalette', {\n key: key, value: JSON.stringify(palettes[key])\n }, () => { });\n}", "function Pale...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
merge all layer properties into one background properties CSS object
makeCSS () { var mergedLayers = {}; if (this.layers.length > 0) { mergedLayers = this.layers.reverse().reduce(function (merged, layerProps) { merged.backgroundImage += (', ' + layerProps.backgroundImage); merged.backgroundSize += (', ' + layerProps.backgroundSize); merged.backgro...
[ "getBackgroundStyle(childs) {\n\n if (!isArray(childs) || childs.length === 0) {\n return 'transparent';\n }\n\n let colors = A(A(childs).getEach('color'));\n colors = colors.uniq(); // every color only once!\n colors = colors.sort(); // assure color-order always the same\n colors = colors.fi...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Show the actual simulation and hide the parameter menu
function showSimulation() { document.getElementById("simulationView").style.display = "block"; document.getElementById("propertiesInput").style.display = "none"; updateRestart(); if (simulationParameters["interleaver"]) { document.getElementById("interleaverSection").style.display = "block"...
[ "function showProperties() {\r\n document.getElementById(\"simulationView\").style.display = \"none\";\r\n document.getElementById(\"propertiesInput\").style.display = \"block\";\r\n}", "function showHideOptions() {\r\n\r\n // Toggle show options status in CurStepObj and draw code window\r\n // TODO: ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Determines whether the provided styling value is truthy or falsy.
function isStylingValueDefined(value) { // the reason why null is compared against is because // a CSS class value that is set to `false` must be // respected (otherwise it would be treated as falsy). // Empty string values are because developers usually // set a value to an empty string to remove i...
[ "function falsy_QMRK_(a) {\n return ((a === null) || (a === false));\n}", "function disabledCssCheck() {\n // check color style of 'cssCheck' div tag (should be set to red)\n if(window.getComputedStyle(document.getElementById(\"cssCheck\"), null)[\"color\"] == \"rgb(255, 39, 39)\" || \n window.getComput...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
B) Word Play Create a form where users may enter a sentence. Turn that sentence into an array using the split method. Then, loop through this array to build a new array out of every word in the sentence that is 3 or more characters in length. Finally, reverse the order of the new array, join it back together into a str...
function wordPlay(){ let sentence = document.querySelector("#input").value let newArr = [] sentence.split(" ").forEach((element, index, arr) => element.length >= 3? newArr.push(element.split("").reverse().join("")): newArr) let toAdd = document.querySelector("#addHere"); toAdd.innerText = "sentence: "+sentence+"\...
[ "function reverseEachWord(sentence) {\n words = sentence.split(\" \");\n for (let i = 0; i < words.length; i++) {\n let newWord = words[i].split(\"\");\n words[i] = newWord.reverse().join(\"\");\n }\n return words;\n}", "function enterWords() {\n\tvar wordListInput = prompt(\"Enter your list of words he...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
start method that checks the ball's speed
start() { // if the ball does not move, we can give it speed if (this.ball.vel.x === 0 && this.ball.vel.y === 0) { // Math.random() will set different directions for the ball to take when game starts this.ball.vel.x = 300 * (Math.random() > .5 ? 1 : -1); // ball's velocity at x...
[ "speedCheck () {\r\n if (this.nextVertex.roadWorks) {\r\n this.speed = 1\r\n } else (this.speed = this.masterSpeed)\r\n if(this.nextVertex.speed && this.nextVertex.speed < this.speed) {\r\n this.speed = this.nextVertex.speed\r\n } \r\n \r\n }", "increaseBallSpeed() {\n this.ballSpeed ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Check whether item is already in project, show add / remove button as needed
function _check_project_item() { var pid = $('.project select[name=pid]').val() var ty = $('.project').attr('ty') var id = $('.project').attr('pid') $.ajax({ url: '/projects/ajax/check/ty/'+ty+'/pid/'+pid+'/iid/'+id, type: 'GET', dataType: 'json...
[ "buttonCheck(){\n this.visibility(document.getElementById(\"add-list-button\"), this.currentList == null);\n this.visibility(document.getElementById(\"undo-button\"), this.tps.hasTransactionToUndo());\n this.visibility(document.getElementById(\"redo-button\"), this.tps.hasTransactionToRedo());\...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
channel up /down switches
setChannelUp(state) { if (this.isTvOn()) { this.lgTvCtrl.channelUp(); } this.resetChannelControlButtons(); }
[ "function flowingLeds() {\r\n leds.forEach(function(currentValue) {\r\n currentValue.writeSync(0);\r\n });\r\n if (indexCount == 0) dir = \"up\";\r\n if (indexCount >= leds.length) dir = \"down\";\r\n if (dir == \"down\") indexCount--;\r\n leds[indexCount].writeSync(1);\r\n if (dir == \"up\") indexCount++...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
this should be called by a periodic process to constantly update drone's location, speed, etc.
update_drone_stats(){ this.update_location(new_location); this.update_sensor(); this.update_battery(); // send drone info to remote maybe }
[ "notify_speed_update() {\n this.speed_update = true;\n }", "async function periodicRefresh(){\n try {\n tsLogger('Refreshing monitor data, monitor data, and missed events...');\n\n //Get daily usage data\n let today = new Date();\n let todayMidnight = new Date(today.getFul...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
By default a timeline references the same observer collection as a parent timeline, if any changes are made to the observers this method first clones them ensuring we maintain a local copy and deref the parent
cloneObserversOnChange() { if (this._inheritingObservers) { this._inheritingObservers = false; this.observers = cloneObserverCollection(this.observers); } }
[ "async addClonesToParent() {\n let parentComposition = this.openmct.composition.get(this.parent);\n await parentComposition.load();\n parentComposition.add(this.firstClone);\n\n return;\n }", "trimTimeline(timeline, trim) {\n // The new resolved objects.\n let newObjects = {};\n ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
resetSuccessFountain() this sets the variable runSuccess back to false resets the fountain info to its original parameters and empties the coordinates array
function resetSuccessFountain(){ runSuccess = false; successFountain.reset(successParticle); coordinates = []; }
[ "function resetFailFountain(){\n runFail = false;\n failFountain.reset(failParticle);\n coordinates = [];\n}", "function quizgame_reset_points(){\n//Set the points at the beginning of the game to zero\nquizgame_tigerpoints = 0;\nquizgame_tupoints = 0;\n}", "function resetFailedMoves() {\n failedMoves = 0;\n...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Returns a signal that emits events of `type` from the `EventListener`compatible `target` object (e.g. a DOM element).
static fromEvent (type, target, useCapture = true) { return new Signal(emit => { if (target.addListener) { target.addListener(type, emit.next) } else if (target.addEventListener) { target.addEventListener(type, emit.next, useCapture) } return () => { if (target.addLi...
[ "function factory(target, type) {\n var htmlElement = document.querySelector('html');\n var bodyElement = document.querySelector('body');\n\n var path = [target, document, window];\n\n switch (type) {\n case 'abort':\n case 'error':\n if (target instanceof natives.refs.Element.r...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
=== DATA DISPLAY === clears data canvas
function clear_data_canvas(){ data_ctx.clearRect(0,0,110,80) }
[ "function clearCanvas() {\n elements.gridCanvas.innerHTML = '';\n }", "function clearCanvas() {\n context.clearRect(0, 0, canvas.width, canvas.height);\n pointCount = 0;\n drawImage();\n }", "function clearGrid() {\n const mainDiv = document.getElementById('canvas');\n ma...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Configure a basic analyzer instance for the workspace.
function configureAnalyzer(options) { const workspaceDir = options.workspaceDir; const urlResolver = new polymer_analyzer_1.PackageUrlResolver({ packageDir: workspaceDir }); const urlLoader = new polymer_analyzer_1.InMemoryOverlayUrlLoader(new polymer_analyzer_1.FsUrlLoader(workspaceDir)); for (const [u...
[ "function initAnalyser() {\n//Creates an AnalyserNode\n\tanalyser = audioContext.createAnalyser();\n\t/*A value from 0 - 1 where 0 represents no time averaging with the last analysis frame. The default value is 0.8 */\n\tanalyser.smoothingTimeConstant = SMOOTHING;\n\t//The size of the FFT used for frequency-domain ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Global function that adds a plugin to the global plugin array \param aPlugin An object describing the plugin to install
function registerPlugin (aPlugin) //-------------------------------------------------------------------- { checkParam (aPlugin, "object"); checkParam (aPlugin.id, "string"); if (aPlugin.type === "view") { boc.ait.registerView (aPlugin); } else { checkParam (aPlugin.load, "fu...
[ "function init() {\n var _this = this;\n\n this._get('options').plugins.forEach(function (plugin) {\n // check if plugin definition is string or object\n var Plugin = undefined;\n var pluginName = undefined;\n var pluginOptions = {};\n if (typeof plugin === 'string') {\n plugin...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Process the first response.
function processFirstResponse(response) { var result; result = {}; result.scriptPaths = getScriptPaths(response); result.contextPath = getContextPath(response); return result; }
[ "_runResponseCycle () {\n const everyStep = (step, next) => {\n if (!step) {\n return next()\n }\n\n return step.call(this, this, next)\n }\n\n const finalStep = (error) => {\n if (error) {\n console.log(error)\n }\n }\n\n const _onPreResponse = this._getMergedE...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Handle changing the settings via front end `config.index` reducer Writes to file and then sends payload to front end via ipc event.
function updateSettings(event, payload) { fs.writeFile(configPath, JSON.stringify(payload, null, 2), function (err) { if (err) return console.log(err); event.sender.send('config', payload) }); }
[ "function updateSettings(settings){\n ipc.send('updateSettings', {\n settings: settings\n })\n}", "function save() {\n\twriteFile(config, CONFIG_NAME);\n\tglobal.store.dispatch({\n\t\ttype: StateActions.UPDATE_CONFIGURATION,\n\t\tpayload: {\n\t\t\t...config\n\t\t}\n\t})\n}", "handleMainPropertyChan...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
get the color corresponding to a target value
getColor(value) { if (undefined == value) { return 'lightgrey'; } if (value < 0) { return this.negativeColorScale(value); } else { return this.selectedPosColorScale(value); } }
[ "function colorTarget() {\n let colorPicked = Math.floor(Math.random() * colors.length);\n return colors[colorPicked];\n}", "function get_color_value(selector, i) {\n return self.get_css_color($root.find(selector + \" .color_sample\")[i]);\n }", "getColor() {\n if (this.temperature <= 15)...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
console.log(cityName("LosAngeles")); console.log(cityName("NewYork")); console.log(cityName("Chicago")); / 8) Create a function to calculate the sum of three elements of a given array of integers of length 3.
function sumOfThree(x) { return x[0] + x[1] + x[2]; }
[ "function sumAges(arr) {\n}", "function sumOfNumbers(arr) {\n function sum(total, num) {\n return total + num;\n }\n return arr.reduce(sum);\n}", "function cityFacts(city) {\n let output = city.name + \" has a population of \" + city.population + \" and is situated in \" + city.continent;\n co...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Chapter 101 RopeGroup Cassi may continue for multiple orgasms
function C101_KinbakuClub_RopeGroup_CassiContinue() { ActorAddOrgasm(); C101_KinbakuClub_RopeGroup_PlayerArousal = C101_KinbakuClub_RopeGroup_PlayerArousal - 200; C101_KinbakuClub_RopeGroup_ForcingCassi = false; C101_KinbakuClub_RopeGroup_PressingCassi = false; C101_KinbakuClub_RopeGroup_CanPressCassi = true; if ...
[ "function C101_KinbakuClub_RopeGroup_Run() {\n\tBuildInteraction(C101_KinbakuClub_RopeGroup_CurrentStage);\n\t\n\t// changing images\n\t// Group view\n\tif (C101_KinbakuClub_RopeGroup_CurrentStage == 100) {\n\t\tDrawImage(CurrentChapter + \"/\" + CurrentScreen + \"/RopeGroupAmelia.png\", 600, 20);\n\t\tDrawImage(Cu...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
FUNCTION: detectCodecIDForStreaming() DESCRIPTION: detect the size for .flv (rtmp) and initialize the width and height ARGUMENTS: the url (rtmp) RETURNS: nothing.
function detectCodecIDForStreaming() { var dom = dw.getDocumentDOM(); videoObj = dom.getSelectedNode(); var sourceURL = VIDEO_SERVER_URI.value; if(/\s*rtmp:\/\/([^\/]+)\/([^\/]+\/[^\/]+)/i.test(sourceURL) && !((sourceURL.indexOf("*") != -1) || (sourceURL.indexOf("?") != -1) || (sourceURL.indexOf("<") != -1) ...
[ "function detectSizeForStreaming()\n{\n\tvar sourceURL = VIDEO_SERVER_URI.value; \n\tif(/\\s*rtmp:\\/\\/([^\\/]+)\\/([^\\/]+\\/[^\\/]+)/i.test(sourceURL) && !((sourceURL.indexOf(\"*\") != -1) || (sourceURL.indexOf(\"?\") != -1) || (sourceURL.indexOf(\"<\") != -1) || (sourceURL.indexOf(\">\") != -1) || (sourceU...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
a function to create copy buttons on all code blocks
function codeButtons () { // get all <code> elements. var allCodeBlocksElements = $('div[class^="language-"]'); allCodeBlocksElements.each(function(i) { // add a sequentially increasing id to each code block. var currentId = "codeblock" + (i + 1); $(this).attr('id', currentId); //define and then add a clip...
[ "function addCopyToClipboardButton() {\n var idPrefix = \"codeId_\";\n var idNumerator = 0;\n\n var codeElementList = document.getElementsByTagName(\"CODE\");\n\n for (var i = 0; i < codeElementList.length; i++) {\n var CODE = codeElementList[i];\n if (typeof CODE.innerText !== 'undefined'...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
modified: encode \0 > 192 128 packed: encode \cz\cz > 26 \cz\0 > 192 128
function h$encodeUtf8Internal(str, modified, packed) { var i, j, c, low, b64bytes, b64chars; function base64val(cc) { if(cc >= 65 && cc <= 90) return cc - 65; // A-Z if(cc >= 97 && cc <= 122) return cc - 71; // a-z if(cc >= 48 && cc <= 57) return cc + 4; // 0-9 if(cc === 43) return 62; // + if(c...
[ "static bytes27(v) { return b(v, 27); }", "static bytes26(v) { return b(v, 26); }", "static bytes28(v) { return b(v, 28); }", "function compress(s)\n\t\t{\n\t\t\treturn encode64(Graph.arrayBufferToString(pako.deflateRaw(s)));\n\t\t}", "function XujWkuOtln(){return 23;/* B3UWQ1mbO0eo K6YGIfgn0p 862fhnhxy6o U...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Tests that dev elements are hidden.
function testDeveloperElementsAreHidden(item) { testElementsVisibility(item, devElements, false); }
[ "function testNormalElementsAreHidden(item) {\n testElementsVisibility(item, normalElements, false);\n }", "function testDeveloperElementsAreVisible(item) {\n testElementsVisibility(item, devElements, true);\n }", "function isHidden ( elem ) {\n // @see http://stackoverflow.com/questions/19669786...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
a simple function to click next link a timer will call this function, and the rotation will begin
function rotate() { $('#next').click(); }
[ "function rotate() {\n\t$('#next').click();\n}", "function timerNav() {\n\n if (timerStart == false) {\n setInterval(nextStudent, 5000);\n timerStart = true;\n };\n\n }", "function goToNextImage() {\n clearInterval(automaticSlideInstance);\n var oldIndex = currentIndex;\...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
funcion que sube imagenes por tipo (usuario, medico etc ) le pasamos res para darle la respuesta json al cliente id es el id a quien le pertenece el file que estamos guargdando en el folder uploads
function subirFilePorTipo(tipo, id, nombreArchivo, res) { // validamos if (tipo === 'usuarios') { Usuario.findById(id, (err, usuarioDB) => { if (!usuarioDB) { return res.status(400).json({ ok: false, mensaje: ' usuario no existe' ...
[ "function subirImagen(form_, name) // Funcion para subir al servidor la imagen seleccionada\n{\n console.log(\"form_: \" + form_ + \"\\nname:\" + name);\n var form = document.forms.namedItem(form_);\n var logodependencia = document.getElementsByName(name).value;\n\n var\n //oOutput = docume...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Funcion que crea las listas
function creaList(list, posicion){//crea la lista de datos de la posicion solicitada var listHTML = ''; listHTML += '<ul>'; listHTML += '<li><h2>nombrePelicula: ' + list[posicion].nombrePelicula + '</h2></li>'; //nos entrega el dato del atributo segun la posicion que tenga en el objeto listHTML += '<li>actor: ...
[ "function creaList(list, posicion){//crea la lista de datos de la posicion solicitada\n\tvar listHTML = '';\n\t\n\t\tlistHTML += '<ul>';\n\t\tlistHTML += '<li><h2>Ciudad: ' + list[posicion].ciudad + '</h2></li>'; //nos entrega el dato del atributo segun la posicion que tenga en el objeto\n\t\tlistHTML += '<li>Numer...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Convert a xpath expression representing the path from root to a node
function simpleXPathToNode(xpath) { // error was thrown, attempt to just walk down the dom tree var currentNode = document.documentElement; var paths = xpath.split('/'); // assume first path is "HTML" paths: for (var i = 1, ii = paths.length; i < ii; ++i) { var children = currentNode.children; var pat...
[ "function xpathVisitor() {\n\tantlr4.tree.ParseTreeVisitor.call(this);\n\treturn this;\n}", "function xPathEval(xpath){\r\n rtn = document.evaluate(xpath, document, null, XPathResult.ORDERED_NODE_SNAPSHOT_TYPE, null);\r\n if (!rtn) debug(d_hi, \"Evaluation of xpath '\" + xpath + \"' failed!\");\r\n retur...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Creates an Object from a query string, providing values for names which are present more than once as an Array.
function parse(query) { var obj = {} if (query.length < 2) { return obj } var params = query.substring(1).split('&') for (var i = 0, l = params.length; i < l; i++) { var parts = params[i].split('=') , name = parts[0] , value = decodeURIComponent(parts[1]) if (obj.hasOwnProperty(name)) ...
[ "function transformQuery(query) {\n const params = new URLSearchParams();\n for (const [name, value] of Object.entries(query)){\n if (Array.isArray(value)) {\n for (const val of value){\n params.append(name, val);\n }\n } else if (typeof value !== 'undefined'...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Encode a signed number in the encode format.
function encodeSignedNumber_(num) { var sgn_num = num << 1; if (num < 0) { sgn_num = ~(sgn_num); } var encodeString = ""; while (sgn_num >= 0x20) { encodeString += ALPHABET_.charAt(0x20 | (sgn_num & 0x1f)); sgn_num >>= 5; } encodeString += ALPHABET_.charAt(sgn_num); ...
[ "function encode_int(v) {\n if (!(v instanceof BigInteger) ||\n v.compareTo(BigInteger.ZERO) < 0 ||\n v.compareTo(LARGEST_NUM_PLUS_ONE) >= 0) {\n throw new Error(\"BigInteger invalid or out of range\");\n }\n return intToBigEndian(v);\n }", "functio...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Composes a React component class, returning a new class that intercepts props, resolving them with the provided fragments and subscribing for updates.
function createContainerWithFragments(Component, fragments) { var ComponentClass = getReactComponent(Component); var componentName = getComponentName(Component); var containerName = 'Relay(' + componentName + ')'; var Container = function (_React$Component) { (0, _inherits3['default'])(Container, _React$Co...
[ "function renderComponent(ComponentClass, props = {}, state = {}) {\n //ComponentClass refers to component class build (ex. CommentBox extends Component)\n //make instance of said class (below)\n //renderIntoDocument requires DOM, need react-dom library.\n const componentInstance = TestUtils.renderIntoDocument...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
draws a fire on the ship after system damage
drawDamageFire(ctx, fire, loc){ const offsetOfFire = fire.getWidth()/2; const xcoord = this.center()[0] + Math.cos(this.rotationOffset + loc.angle) * loc.distance - offsetOfFire; const ycoord = this.center()[1] + Math.sin(this.rotationOffset + loc.angle) * loc.distance - offsetOfFire; fire.draw(ctx, { ...
[ "function fire(){\n if (readyFire){\n //Fire\n app.main.bullets.spawnBullet(posX, posY - height);\n fireTimer = 0;\n readyFire = false;\n\t\t\tcreatejs.Sound.play(\"fireSound\");\n }\n\n }", "function shoot() {\n\t\tbullet = {x:gun.x, y:gun.y, radius:4,...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Remove parameters that do not have values.
function removeEmptyParameters(params) { for (var p in params) { if (!params[p] || params[p] == 'undefined') { delete params[p]; } } return params; }
[ "sanitizeParams(params) {\n Object.keys(params).forEach(\n key => params[key] === undefined && delete params[key]\n );\n }", "function cleanInputs(params) {\r\n\tfor (var i = 0; i < params.length; i++) {\r\n\t\tdocument.getElementById(params[i]).value='';\r\n\t}\r\n}", "function delete_parameter(p) ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Setup one client (client number i)
function initClient(i) { //Only allows next client to be initialised //(i.e. if i clients exist, then client i+1 must be initialised next) if (i != clients.length) { throw "Attempted to initialise client " + i + " when only " + clients.length + " exist."; } clients.push(new graphicsfuzzserver.FuzzerServic...
[ "function Client (socket){\n this.username = `user ${Math.floor(Math.random()*10000)}`;\n this.socket = socket;\n clientPool.push(this);\n\n}", "function SetupClient ()\n{\n client.registry.registerDefaults ();\n client.registry.registerGroups ([\n [\"bot\", \"Bot\"],\n [\"user\", \"User\"]...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Navigates to `mainUrl`, then loads `redirectUrl` in an iframe. The iframe then redirects to a.test and dumps cookies that were sent. `redirectUrl` must match the pattern /redirect/.
async function redirectInIframeAndDumpCookies(mainUrl, redirectUrl, description) { helper.onceRequest(new RegExp(mainUrl)).fulfill({ responseCode: 200, body: btoa("<html></html>") }); // Navigate to the main page URL. await dp.Page.navigate({url: mainUrl}); // Load an iframe with `redire...
[ "async function loadIframeAndDumpCookies(mainUrl, description) {\n // Navigate to the main page URL.\n helper.onceRequest(new RegExp(mainUrl)).fulfill({\n responseCode: 200,\n body: btoa(\"<html></html>\")\n });\n await dp.Page.navigate({url: mainUrl});\n // Load iframe with a.test.\n se...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
FUNCTION NAME : createTopo AUTHOR : Mark Anthony Elbambo DATE : January 2, 2013 MODIFIED BY : REVISION DATE : REVISION : DESCRIPTION : sends xml file to create topo file PARAMETERS :
function createTopo(){ if(globalDeviceType=="Mobile"){ loading("show"); } var qry = getStringJSON(globalMAINCONFIG[pageCanvas]); $.ajax({ url: getURL("ConfigEditorTopo", "JSON"), // url: "https://"+CURRENT_IP+"/cgi-bin/Final/RM_CGI_AutoComplete/AutoCompleteCgiQuerryjayson/FindResource2.cgi", data : { "a...
[ "function convertTopoToXml(fname){\n\t$.ajax({\n\t\turl: getURL(\"ConfigEditorTopo\", \"JSON\"),\n\t\tdata : {\n\t\t\t\"action\": \"gettopofile\",\n\t\t\t\"query\": '{\"QUERY\": [{\"filename\": \"'+fname+'\", \"username\": \"'+globalUserName+'\"}]}'\n\t\t},\n\t\tmethod: 'POST',\n\t\tproccessData: false,\n\t\tasync:...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
aggregation function to nest raw data by area
function agg_areas(leaves) { var period_data = leaves.map(function(d){ return { 'period': d['period_date'], 'datum': +d[category] }; }); period_data.sort(function(a, b) { return a.period - b.period; }); // specific structure used by interquartile charting function retur...
[ "function aggregate_area_calculator(arr){\n\tlet aggregate_area = 0;\n\tarr.forEach(item => { aggregate_area += surface_area_calculator(item[0], item[1], item[2])})\n\treturn aggregate_area;\n}", "function makeAreaData(data){\n return data.map(function(d){\n return {\n \"Date\" : d[\"Date\"],\n ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
A custom hack that prevents layering issues at either side of carousel. This just numerates zindexes from the further back items to the furthest front. To do this, we check the offset().top values of each item, therefore a flat carousel doesn't work here.
function layerHack(oldActiveItem) { // NOTE: heights recorded before the css transition took place. // Sort the items by offset().top values var sortedItems = itemHeights.sort(function(a, b) { return a.top - b.top; }); // Loop through and s...
[ "function resetZ() {\n var elements = document.querySelectorAll('img');\n for (var i = elements.length - 1; i >= 0; i--) {\n elements[i].style.zIndex = 5;\n };\n }", "function prevThree(blockItems) {\n var newBlockItems = blockItems.slice(startingPoint - 6, startingPoint - 3);\n startingPoint...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
list reservations by date, sorted by time
function list(date) { return knex("reservations") .select("*") .where({ reservation_date: date}) .whereNot({ status: "finished"}) .andWhereNot({ status: "cancelled" }) .orderBy("reservation_time"); }
[ "function list() {\n return db(tableName).select(\"*\").orderBy(\"reservation_id\", \"ASC\");\n}", "function CollectReservationsByResource(id, cb) {\n\tvar d1 = new Date();\n\tvar d2 = new Date();\n\n\td1.setHours(0);\n\td1.setMinutes(0);\n\td1.setSeconds(0);\n\n\td2.setHours(maxDays * 24);\n\n\tvar args = {\n\t...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
this promise will return a true or false based on the given video id.
function isValidVideoId(id) { // this returns a promise and resolves to true if the video id is valid // in the interest of time this is the quickest way to return a 200 or 404 based on the given video id. return new Promise((resolve, reject) => { axios.get(`https://vimeo.com/api/oembed.json?u...
[ "equals(video) {\n if(video && video instanceof Video && video.id === this.id) {\n return true;\n }\n return false;\n }", "function checkDupeVideo(videoId)\n {\n for (var i = 0; i < videoList.length; i++)\n {\n if (videoId == videoList[i].id)\n {\n ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Remove a language from the `languages` cache. Mostly useful in tests.
function unloadLang(key) { delete languages[key]; }
[ "removeCourse(languageId) {\r\n\r\n }", "function clearLanguages() {\n\t\tlangs = [];\n\t}", "function getUniqueLanguages(languages) {\n return languages.filter((language, index, ar) => ar.indexOf(language) === index)\n}", "function setLanguage() {\n const queryParams = new URLSearchParams(window.l...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
GRBL communication Check if grbl is connected to backend
static check_connected(data) { if (data == "False") { // Send notification error bulmaToast.toast({ message: "Could not connect to printer... <a onclick=\"COM.reconnect_printer()\">Retry?</a>", type: "is-danger", position: "bottom-right", ...
[ "function checkConnAndReConn(){\n\t\t\t\n\t\t\t//try to reconnect\n\t\t\tif(mWebSocket.readyState == 3 || mWebSocket.readyState == 2 ){\n\t\t\t\tconsole.log(\"Trying to reconnect\");\n\t\t\t\t//reconnect\n\t\t\t\t mWebSocket = connectToMessenger();\n\t\t\t\t//TODO:add code to see if re-connection succeeded \n\t\t\t...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Creates an ElementRef given a node.
function createElementRef(tNode, lView) { return new ElementRef(getNativeByTNode(tNode, lView)); }
[ "function parseNode(node) {\n // Get node name.\n var nodeName = parseNodeName(node.nodeName.toLowerCase());\n\n if (!nodeName) {\n return null;\n } // Get node attributes in React friendly format.\n\n\n var nodeAttrs = {};\n acf.arrayArgs(node.attributes).map(parseNodeAttr).forEach(function ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Check if has main field
function checkIfHasMainField(fields, table){ var bHasMainField = false; if ((fields != undefined) && (fields != '')){ for (var i=0; i<fields.length; i++){ if (fields[i].table_name == table){ return true; } } } }
[ "function isInField(x, y)\n{\n if (g_field.x > x || x >= g_field.x + g_field.width )\n {\n return false;\n }\n if (g_field.y > y || y >= g_field.y + g_field.height )\n {\n return false;\n }\n return true;\n}", "function nullFields()\n{\n\treturn isEmpty(\"#myPattern\") || isEm...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
When the width changes work through breakpoints and reset state with the new width & breakpoint. Width changes are necessary to figure out the widget widths.
onWidthChange(width) { // Set new breakpoint var newState = {width: width}; newState.breakpoint = this.getBreakpointFromWidth(newState.width); newState.cols = this.getColsFromBreakpoint(newState.breakpoint); if (newState.cols !== this.state.cols) { // Store the current layout newSta...
[ "function handleWindowResize() {\r\n width = window.innerWidth;\r\n}", "updateWidth() {\n if (!this.isMounted() || !controller.$contentColumn.length) return;\n\n const left = controller.$contentColumn.offset().left - $(window).scrollLeft();\n const padding = 18;\n let width = $(document.body).hasClas...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Create the gauge chart
function gaugechart() { d3.json("data/samples.json").then(function(data) { var wash_freq = data.metadata[0].wfreq var trace3 = [ { domain: {x: [0,1], y:[0,1] }, bar: {color: "black"}, value: wash_freq, title: { text: "Belly button wash frequency" }, ...
[ "function initGaugeChart() { \n var data = [\n {\n domain: { x: [0, 1], y: [0, 1] },\n value: justmetadata[0].wfreq,\n title: { text: \"Belly Button Washing Frequency (Scrubs per week)\" },\n type: \"indicator\",\n mode: \"gauge+number\",\n gauge: {\n...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Play the next chord / track of the sequence
playNext() { // if it is the last chord of the sequence start again from the first one, otherwise go to the next one if (this.playing >= this.sequence.length - 1) { this.playing = 0; // set the number of the next track (here: the first one) } else { this.pl...
[ "playCurrent() {\n\n let chord = this.sequence[this.playing]; // get the current chord / track from the sequence\n\n this.tracks[chord][this.mode].play(); // play the track\n\n }", "function playClueSequence(){\n guessCounter = 0; // resets clue sequence counter to 0 for every new turn\...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
this function dynamically reposition the two rows of buttons by adjusting the spacing
function PositionButtons(nContainerWidth, nContainerHeight, bFullScreen) { var nTotalMaxGaps1 = 0; var nTotalMinGaps1 = 0; var nTotalButtonWidth1 = 0; for (i=0; i<g_nButtonsOnRow1; i++) { nIndex = g_FlexLayoutRow1[i][0]; nTotalButtonWidth1 += bFullScreen?g_nButPosFull[nIndex][2]:g_n...
[ "buttonPosition(index, columnStart) {\n const style = {\n position: 'relative',\n float: 'left',\n width: '4em',\n left: (columnStart + 5 * index) + 'em'\n };\n\n return style;\n }", "function arrange () {\n\n // repositioning the buttons for ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Deep copies and saves the new state of the graph into undoStates. If there are too many states, shifts the array. Also removes the undobuttons disabled attribute if it has one.
function saveUndoState() { // $.extend is used to deep copy the array because JIT doesn't >:| undoStates.push({ graph: $.extend(true, [], rgraph.toJSON('graph')), root: rgraph.root.id}); if(undoStates.length > MAX_UNDO) undoStates.shift(); $('#undo').removeAttr('disabled'); }
[ "function saveState() {\n\tvar stackMaxPlusOne = 4;\n\tif(gameType == 'creator') {\n\t\tstackMaxPlusOne = 11;\n\t}\n\tstate = {\n\t\t'level': level,\n\t\t'dimensions': level.dimensions,\n\t\t'row': row,\n\t\t'col': col,\n\t\t'moves': moves,\n\t\t'tiles': tiles,\n\t\t'curColumnsRight': curColumnsRight,\n\t\t'curColu...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Function: saveNotes() save notes to local storage
function saveNotes() { localStorage.setItem('notes', JSON.stringify(notes)); }
[ "async saveNotesToFile() {\n return await fs.writeFile(\n path.join(__dirname, \"../db/db.json\"),\n JSON.stringify(this.notes)\n );\n }", "function addNote(e) {\n let addTxt = document.getElementById(\"addTxt\");\n let addTitle = document.getElementById(\"addTitle\");\n let notes = loca...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Returns the history of the game (in outer form)
function getHistory() { let result = '' for (let m = 0; m < game.moves.length; ++m) { result += outerCell(game.moves[m]) } return { firstPlayer: outerPlayer(game.startPlayer), moves: result } }
[ "getHistory () {\n return this.game.history({ verbose: true })\n }", "getHistory(){\n\t\treturn this.history;\n\t}", "getHistory () {\n return this._historyStore.list();\n }", "updateHistory(board) {\n /* add current board to history and increment history index\n *** if historyIndex is le...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Take a loaded Swagger object and converts it to API Blueprint
function convert(swagger, done) { fury.parse({source: swagger}, function (parseErr, res) { if (parseErr) { return done(parseErr); } fury.serialize({api: res.api}, function (serializeErr, blueprint) { if (serializeErr) { return done(serializeErr); } done(null, blueprint); ...
[ "_bundle (schema){\n return SwaggerParser.bundle(schema, this.options);\n }", "merge (){\n const validatePromise = this._validate(this.swaggerInput);\n const bundlePromise = this._bundle(this.swaggerInput);\n const promiseArray = [validatePromise, bundlePromise];\n const that = this;\n\n // Mer...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
04. Cooking by Numbers
function cookingByNumbers(arr) { let num = arr.shift(); for (let i = 0; i < arr.length; i++) { num = perform(num, arr[i]); console.log(num); } function perform(num, operation) { switch (operation) { case 'chop': return num / 2; case 'dice': return Math.sqrt(num); case 'spice': return ++num; ...
[ "function showNumbers(min, high, countyBy){\n for(var i=min; i<high; i+=countBy){\n console.log(i);\n }\n}", "function Counting(){\n for(var i=1; i<=100; i++){\n if(i%5==0 && i%10==0){\n console.log('Coding Dojo');\n }else if(i%5==0){\n console.log('Coding');\n ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
The aggregate value of the `FormGroup`, including any disabled controls. Retrieves all values regardless of disabled status. The `value` property is the best way to get the value of the group, because it excludes disabled controls in the `FormGroup`.
getRawValue() { return this._reduceChildren({}, (acc, control, name) => { acc[name] = control instanceof FormControl ? control.value : control.getRawValue(); return acc; }); }
[ "getValue() {\n const { form, path } = this.props\n if (form && path) return form.getValue(path)\n return this.props.value\n }", "getRawValue() {\n return this.value;\n }", "function getRadioGroupVal(name) {\n return $('input:radio[name=\"' + name + '\"]:checked').val();\n ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Extracts loader's name independently of Webpack's version
function getLoaderName(entry) { return ( entry.loader || (entry.use && entry.use[0] && entry.use[0].loader) || '<unknown loader>' ); }
[ "function stripLoaderPrefix(str) {\n\tif (typeof str==='string') {\n\t\treturn str.replace(/(^|\\b|@)(\\.\\/~|\\.{0,2}\\/[^\\s]+\\/node_modules)\\/\\w+-loader(\\/[^?!]+)?(\\?\\?[\\w_.-]+|\\?({[\\s\\S]*?})?)?!/g, '');\n\t}\n\treturn str;\n}", "injectLoader(loaders) {\n const loader = {\n test: /sentry-webp...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
The extensions selected by the server. This is currently only the empty string or a list of extensions as negotiated by the connection
get extensions() { return this._ws ? this._ws.extensions : ''; }
[ "function formatExtensions() {\n\n if (opt.properties.validExtensions !== \"\") {\n var extensionList = opt.properties.validExtensions.replaceAll(\"*\", \"\");\n extensionList = extensionList.replaceAll(\";\", \",\");\n\n opt.properties.processedFileExtension ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Viewing the info of the selected proposal
function proposalInfo(proposal_id){ $(".info_proposal").load("../Tab_Proposal_Slip/proposal_info.php", { id: proposal_id },function(){ proposalDeleteConfirmation(); historyReplaceID(id=proposal_id); $(".info_proposal").collapse('show'); }); }
[ "function clickedProposal(){\n\t $(\".proposal_table tbody .rows\").click(function(e){\n\t \tvar proposal_id = $(this).attr('id').trim();\n\t \tproposalInfo(proposal_id);\n\t });\t\n\t}", "function setSelected(index) {\n selected = points[index];\n console.log('selected knowledge...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
function: recoveryUserByEmail() > genera la conexion y consulta si un usuario se encuentran en la base de datos Parametros: > email: email del usuario Retorno > fila con datos del usuario si existe > null si no existe
function recoveryUserByEmail (email,callback){ var mysql = require('mysql'); var connection = mysql.createConnection({ host : ipDataBase, user : usrDataBase, password : passDataBase, database : nameDataBase }); connection.connect(); var query = 'SELECT * FROM us...
[ "static findUserByEmail(email, callback) {\n Account.findOne({'email': email}, (err, data) => {\n if(err) {\n return callback(err, null);\n } else {\n return callback(null, data);\n }\n });\n }", "static checkUserExists(req, res, next...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Split attribute value into array. "a b c" > ["a", "b", "c"]
function parseAttr(elem, attr) { var val = elem.getAttribute(attr); return val ? val.replace(/, +/g, ",").split(/ +/g) : null; }
[ "function convertIntoArray(string){\n return string.split(\" \");\n}", "function splitValue(value) {\n return value.match(/.{1,3}/g)\n}", "function convertToArray(param) {\n if (Array.isArray(param)) {\n return param;\n } else {\n return param.split(' ');\n }\n}", "function toArray(...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Measures the CPU usage of a specific function.
static measure(name, executedFunction) { var usedTicks = Game.cpu.getUsed(); executedFunction(); usedTicks = Game.cpu.getUsed() - usedTicks; this._measurements.push( { name: name, usedTicks: usedTicks, }); }
[ "function check_cpu_utilization(tasks){\n var total_utilization = 0;\n\n for(var i=0;i<tasks.length;i++){\n var task = tasks[i];\n var utilization = task.WCET / task.period;\n\n total_utilization += utilization;\n }\n\n return total_utilization;\n\n}", "function monitorCPUUsage(ca...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
that the function only takes primitives as arguments. The function should return a function that, when called, will check if it has already computed the result and return that value instead if possible. Example: cacheAdd = myFunction(add); add(1,2) = 3 cacheAdd(1,2) = 3 > executes add function cacheAdd(1,2) = 3 > retur...
function myFunction() { const hash = {}; return sum =(...args) => { if (args.length < 1) { return 0; } if (args.length === 1) { return args[0]; } const stringifiedVal = args.toString(); if (hash[stringifiedVal]) { return hash[stringifiedVal]; } ...
[ "function cacheFn(fn) {\n var cache = {};\n return function(arg) {\n if (cache[arg]) {\n return cache[arg];\n } else {\n cache[arg] = fn(arg);\n return cache[arg];\n }\n };\n}", "function cached(fn) {\n\t var cache = new Map();\n\t return function cachedFn() {\n\t var key = a...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
A method which registers a component class or a functional stateless component for internationalization. When a component of that type is a direct or indirect child of `IntlProvider`, the locale of the provider is used. Otherwise, uses `en` as a default locale.
function registerForIntl(component) { component.contextType = __WEBPACK_IMPORTED_MODULE_2__globalization_GlobalizationContext__["a" /* GlobalizationContext */]; }
[ "function registerForLocalization(component) {\n component.contextType = __WEBPACK_IMPORTED_MODULE_2__globalization_GlobalizationContext__[\"a\" /* GlobalizationContext */];\n}", "function provideIntlService(component) {\n if (!component && \"development\" !== 'production') {\n throw \"Passed compone...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }