query
stringlengths
9
34k
document
stringlengths
8
5.39M
negatives
listlengths
19
20
metadata
dict
end tower_stat name: draw_txt description: a helper functionfor drawin text input: txt :the text to display x,y : the xy position of the text on the screen output:none
draw_txt(txt, x, y) { return () => { fill(255); textAlign(CENTER); text(txt, x, y); }; }
[ "function drawText()\n\t{\n\t\t// Choose a width based on the character count\n\t\tvar w = chooseSize();\n\n\t\t// Draw the text\n\t\ttext = that.add('text', {\n\t\t\tw: w,\n\t\t\ttext: that.text,\n\t\t\tfont: that.font || style.font,\n\t\t\tcolor: style.color,\n\t\t\talign: style.align,\n\t\t\tdepth: depth + 1,\t\...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
`toOverrideNode` must be the last thing in `toBeOverriddenNode` do nothing if there's a semicolon on `toOverrideNode.end` (no need to fix)
function overrideLocEnd(toBeOverriddenNode, toOverrideNode) { if (options.originalText[locEnd(toOverrideNode)] === ";") { return; } toBeOverriddenNode.range = [ locStart(toBeOverriddenNode), locEnd(toOverrideNode), ]; }
[ "static nodeWith(node, overrideProps) {\n return (0, _astNodeMutationHelpers.nodeWith)(node, overrideProps);\n }", "setOverride(override) {\n this.override = override;\n }", "function overrideMethod(overrideBody, ancestorBody)\n\t{\n\t var override;\n\t\tif(ancestorBody !== undefined)\n\t\t{\n\t\...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
deep compares 2 components, returning true if they are completely equal does not compare functions/nonreact objects otherwise does everything
function deepCompare(a, b) { var count = React.Children.count(a); if (count !== React.Children.count(b)) { return false; } // check if single item if (count === 1) { // if react element, continue recursion if (a.props && b.props) { // tag type and keys ...
[ "function deepCompare() {\n // ...\n}", "function deepCompare () {\n var i, l, leftChain, rightChain;\n\n function compare2Objects (x, y) {\n var p;\n\n // remember that NaN === NaN returns false\n // and isNaN(undefined) returns true\n if (isNaN(x) && isNaN(y) && typeof x === 'number' && typeof ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Get the date of the given changelist (as a Date object)
function getChangelistDate(changelist, callback) { if (typeof changelistCache[changelist] !== 'undefined') { callback(changelistCache[changelist]); } else { changelistCache[changelist] = null; p4Process = exec(config.p4BaseCmd + ' describe ' + changelist, { timeout: 30000, ...
[ "function convertDateOfProjectList(dat) {\n\tfor (var i = 0; i < dat.length; i++) {\n\t\tdat[i].finishingDate = formatDateMMDDYYYY(dat[i].finishingDate);\n\t}\n\n\treturn dat;\n}", "function convertDateOfProjectList(dat) {\n\tfor (var i = 0; i < dat.length; i++) {\n\t\tdat[i].startDate = formatDateMMDDYYYY(dat[i]...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
renderElement Based on the role, use MasterAsset or PlayerAsset.
renderElement(element, index) { if (["RM", "BM"].indexOf(this.props.role) !== -1) { return ( <Col key={index}> <MasterAsset cover={element.cover} color={element.color} type={element.type} asset={element.asset} index={index} ...
[ "generateAsset(r, idx) {\n const pack = this.assetsPacks.find(p => p.publisher == r.pub && p.name == r.pack)\n\n if(!pack) {\n return null\n }\n\n const URL = pack.isRemote || pack.isLocal ? \"\" : game.moulinette.applications.MoulinetteFileUtil.getBaseURL()\n\n r.sas = pack.sas ? \"?\" + pack.s...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Given a camera location, and a direction designated as up, generate a world to canonical view transform.
function determineCameraTransform(camLoc, up) { // Perspective Normalization far = 100; near = 0.01; var Sx = 1 / Math.tan(Math.PI/8); var Sy = 1 / Math.tan(Math.PI/8); var alpha = ((far + near) / (far - near)); var beta = -2 * near * far / (near - far); var perspectiveNormalizationXform = mat...
[ "static makeViewMatrix(cameraPos, target, cameraUp){\n // cameraForward\n let f = Vector.sub(cameraPos, target);\n Vector.normalize(f);\n \n // cameraRight\n let r = Vector.cross(cameraUp, f);\n Vector.normalize(r);\n \n // should be unit vector already\n let v = Vector.cross(f, r);\n ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
fetchStyle : String > Maybe (String)
function fetchDisplayStyle(key) { return storeFetch(displayStyleCache, key) }
[ "checkExistStyle() {\n const sql = 'select * from public.\"Style\" WHERE stylename = $1';\n return queryDB(sql, [this.stylename])\n }", "_getStyle(data, metaData) {\n if (data && data.get(\"schema\") && data.get(\"schema\").get(\"style\")) {\n let style = data.get(\"schema\").get(\"style\...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
small function to make a product of an array
function arrayProd(pArray) { return pArray.reduce(function(tot,item){return tot*=item},1,this) }
[ "function productOfArray(arr) {\n \n}", "function arrayProduct(array) {\n return array.reduce((product, factor) => {\n return product *= factor;\n },1);\n}", "function product(numbers){\n //calculate product of array\n\tfor(var i = 0; i < numbers.length; i++){\n //return product;\n\t numbers...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Supporting Functions // ///////////////////////////////////////////////////////////// creates, hides, or shows the helper toolbox on the page
function createHideOrShowHelper() { // get the draggable chrome helper let dragbox = $(global.helper.id), dragboxDisplay = dragbox.css('display'); // fade in helper for the first time if(dragboxDisplay == null){ // this catches null and undefined let $elem = findE...
[ "function createToolsWrapper() {\r\n if ($(\"#custom-tools-wrapper\").length === 0) {\r\n // Wrap existing Canvas Page Tools\r\n if ($(\"#editor_tabs\").length > 0) {\r\n $(\"#editor_tabs\").wrap('<div id=\"custom-tools-wrapper\" class=\"tabs\" />').wrap('...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Get column from tile id
getColFromTile(id){ let col; if(id.split('_')[2][1] != undefined){ col = id.split('_')[2][0] + id.split('_')[2][1]; }else { col = id.split('_')[2][0]; } return col; }
[ "function getCol(tile) {\n return parseInt(tile.id.split(\"_\")[2]);\n }", "getColFromTile(id) {\n let col;\n if (id.split('_')[2][1] != undefined) {\n col = id.split('_')[2][0] + id.split('_')[2][1];\n } else {\n col = id.split('_')[2][0];\n }\n return...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
returns a thread object, given the threadID
function getThread(threadID) { const query = `SELECT * FROM threads WHERE threadID = ${threadID}`; return new Promise( (resolve, reject) => { conn.query(query, function(err, result) { if (err) reject (err); console.log('result: ', result); ...
[ "getById(id) {\r\n return new Thread(this, id);\r\n }", "function getThread() {\n return {\n name: \"Mark Zuckerberg\",\n threadID: 111,\n color: \"#000000\",\n }\n}", "function getSingleThread(id) {\n GetAsync(\"/api/thread.lua?id=\" + id, null, displaySingleThread)\n}", "function get...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Displays the possible moves of the currently selected piece
function displayPossibleMoves(pieceId) { var sourceId = pieceId.substring(pieceId.length - 3, pieceId.length); sourceCoords = sourceId; var destinationIds = possibleMoves[sourceId]; if (!destinationIds) { return; } for (j = 0; j < destinationIds.length; j++) { var destination = $('#' + destinationIds[j]); v...
[ "function showPossibleMove() {\n let newLocations = game.possibleMoveAt.concat(game.possibleMoveAndKillAt, game.possibleFinish);\n showPossibleLocationsAndMove(newLocations)\n saveGameToLocalStorage();\n}", "function showMoves(){\n\n\t//search the possible moves\n\tpossibleMoves();\n\t//declare some vari...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
============ FUNCTIONS TO GET DATA FROM APIs ============= // Function to get top 20 Twitter Favorites
function getFavTweets() { var params = {screen_name: 'HafnerTest', count:20}; // console.log("before client get"); twitterClient.get('favorites/list', params,function(error, tweets, response) { if (!error) { // console.log('tweets: ', tweets); // console.log("tweets typeof: ", typeof(tweets)); ...
[ "function getTopArtists() {\n return spotifyApi.getMyTopArtists({\n limit: 5\n }).then(function (data) {\n return data.body.items\n }).catch(function (err) {\n console.error(err)\n });\n}", "function getFavoriteMovies() {\n fetch('/favorites')\n .then(function(response) {\...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Test the is in alphabet functionality
function testIsInAlphabet(){ var StringUtils = LanguageModule.StringUtils; var stringUtils = new StringUtils(); var encodings = stringUtils.stringEncodings; var lencodings = stringUtils.languageEncodings; var romanceTest1 = stringUtils.isInAlphabet("abcdef", encodings.ASCII, lencodings.ENGLISH); var romance...
[ "function checkAlphabet(str) {\n return str[0] == 'a' && alphabet.includes(str);\n}", "function isAlphabet(x){\n var as = \"abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ\";\n return (as.indexOf(x) != -1);\n}", "function isAlphabetical(value){\n if(isUpperCase(value) || isLowerCase(value)) retur...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Handles the event of toggling the audio debug recordings state.
onAudioDebugRecordingsChanged_() { const enabled = this.audioRoot_.getElementsByTagName('input')[0].checked; if (enabled) { chrome.send('enableAudioDebugRecordings'); } else { chrome.send('disableAudioDebugRecordings'); } }
[ "function switchRecordingStatus()\n{\n\tif (getRecordingStatus()) {\n\t\tsetRecordingStatus(false);\n\t} else {\n\t\tsetRecordingStatus(true);\n\t}\n}", "setAudioDebugRecordingsCheckbox() {\n this.audioRoot_.getElementsByTagName('input')[0].checked = true;\n }", "function onButtonClicked() {\r\n togg...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Seed a new cell of celltype "kind" onto position "p".
seedCellAt( kind, p ){ const newid = this.C.makeNewCellID( kind ) this.C.setpix( p, newid ) return newid }
[ "seedCell( kind, max_attempts = 10000 ){\n\t\tlet p = this.C.midpoint\n\t\twhile( this.C.pixt( p ) != 0 && max_attempts-- > 0 ){\n\t\t\tfor( let i = 0 ; i < p.length ; i ++ ){\n\t\t\t\tp[i] = this.C.ran(0,this.C.extents[i]-1)\n\t\t\t}\n\t\t}\n\t\tif( this.C.pixt(p) != 0 ){\n\t\t\treturn 0 // failed\n\t\t}\n\t\tcons...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Get current Guzzlr quest tier
function getTier() { var tier = (0, _property.get)("guzzlrQuestTier"); return tier === "" ? null : tier; }
[ "get tier() {\n return this._data.tier;\n }", "function currentQuestion () {\n return quiz.currentQns\n }", "function getTier(rank) {\n\tvar tier = 1;\n\t\n\twhile (true) {\n\t\tvar tierRanks = getRanks(tier, 1, 0, []);\n\t\tfor (var r=0; r<tierRanks.length; r++) {\n\t\t\tif (rank == tierRanks[r])...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
serialize the page size
serializePageSize(writer, pageSetup) { writer.writeStartElement(undefined, 'pgSz', this.wNamespace); // tslint:disable-next-line:max-line-length writer.writeAttributeString(undefined, 'w', this.wNamespace, this.roundToTwoDecimal(pageSetup.pageWidth * this.twentiethOfPoint).toString()); /...
[ "function serializeSizePrefix() {\n // Outpoint Hash 32 bytes + Outpoint Index 4 bytes + Outpoint Tree 1 byte +\n // Sequence 4 bytes.\n return 41;\n}", "function SBRecordsetPHP_getPageSize()\r\n\r\n{\r\n\r\n return this.getParameter(this.EXT_DATA_RR_PAGE_SIZE) ;\r\n\r\n}", "function serializeSize(output) ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
consume(x) consumes the upcoming token and returns a truthy value only if its type matches any character in x.
function consume(x){if(x.includes(token.t))return token=tokens[i++]}
[ "function consume(value) {\n if (value === token.value) {\n next();\n return true;\n }\n return false;\n }", "consume (expected) {\n if (expected) {\n let token = this.peek();\n\n if (!token || token.value != expected) {\n this.throw(`Unexpected token '${token.value}'`);\n ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Return the child given its token string
get_child_by_token_string(token_string){ return this.fc.get_fragment_by_id(this.children[token_string][0]).get_node_by_id(this.children[token_string][1]) }
[ "child(word) {\n let lookup = word;\n if (word.token) lookup = word.token;\n return this.children[lookup];\n }", "_getChild (str) {\n const match = str.match(this.childReg);\n let child, matchType, block;\n\n if (match && match.index > -1) {\n child = str.substring(match.index + match[0].l...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
show items generates all of the color divs, shuffles them, and adds them to the screen div
showItems() { this.generateItems(); this.shuffleItems(); this.items.forEach((item) => { screenDiv.appendChild(item.div); }); }
[ "function generateColor() {\n var shuffleColor = shuffle(colorArr)\n for (var i = 0; i < shuffleColor.length; i++) {\n $colorPanel.append('<div class=\"box ' + shuffleColor[i] + '\"></div>')\n }\n }", "function showCards() {\n $('#card-container').html(shuffle(cards));\n }", "generateIt...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Example: this will happen when trying to binary operate two precision 2 nodes and they have a distance of 0.25 (precision 4 to reach). So black nodes will subdivide into gray one with black kids until precision 4
forceBlackNodeToSubdivide(node, precision) { if (node == undefined || node.level == precision) return; for (let i = 0; i < node.kids.length; i++) { this.forceBlackNodeToSubdivide(node.kids[i], precision); } if (node.color == Octree.BLACK && node.kids.length == 0) { node.color = Octree.GRAY; var ...
[ "function trainColor(r,g,b)\n{\n if((r + g + b) > 383)\n return [1,0];\n else {\n return [0,1];\n }\n\n}", "function myConnectedComponentLabelingTwoPass(binary, label,width,height){\n // initialize label value \n var label_value = 0; \n var input=binary;\n var output=label;\n parent[0]=0;...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Time frame status Checking defined start and stop date are valid and with in 10 60 days checking end date is passed or not If end date is ending with more than 60 days calculating 60 days from starting date and rewriting the end time
function checkTimeFrames() { var start = new Date(settings.start), end = new Date(settings.stop), delta = (end - start) / (1000 * 60 * 60 * 24), min_delta = 10, max_delta = 60; if (isNaN(start.getTime())) { console.warn("Invalid start date.")...
[ "validateEndDate(start_time, end_time){\n let start_date = new Date(start_time);\n let end_date = new Date(end_time);\n if(start_date.getFullYear() == end_date.getFullYear()){\n if(start_date.getMonth() == end_date.getMonth()){\n if(start_date.getDate() == end_date.get...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
remove a node from the top
remove() { if (this.length == 0) return null; else if (this.length == 1) { let tempNode = this.top; this.top = null; this.last = null; this.length--; return tempNode; } else { let tempNode = this.top; this.top = this.top.next; this.length--; return tempN...
[ "removeFirstNode() {\n let currentNode = this.headNode;\n this.headNode = currentNode.nextNode;\n }", "pop(){\n if (this.top === null) return null;\n\n const removed = this.top; // store previous top\n this.top = this.top.next; // move top pointer\n removed.next = null...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
handle the status request
handleStatus (request, response) { // if we've been requested to shutdown, we'll try to get the load balancer to // stop sending us requests ... otherwise we're good to go if (this.api.shutdownPending) { response.status(410).send('SHUTDOWN PENDING'); } else { response.status(200).send('OK'); } }
[ "function handleStatus(status) {\n\n\t\t}", "_processStatus(data) {\n if (this.aborted) {\n return;\n }\n this.log('Processing status');\n var index = this.indexOfSubarray(data, [13, 10]);\n var padding = 2;\n if (index === -1) {\n index = this.indexOfSubarray(data, [10]);\n if (i...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
paste content to terminal using hidden textarea
function paste() { clip.focus(); //wait until Browser insert text to textarea self.oneTime(1, function() { self.insert(clip.val()); clip.blur().val(''); }); }
[ "pasteFromClipboard() {\n let text = atom.clipboard.read();\n this.onPaste(text);\n //this.pty.write(text);\n this.writeToPty(text);\n }", "function paste(){if(paste_count++>0){return;}function set(){_clip.val(command);fix_textarea();}function insert(text){self.insert(text);set();}if(self.isenabled()...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
get a wrapped list of event IDs
function getEventList(id) { var result = []; result.push(id); for (var i=0; i<eventList.length; ++i) { if (eventList[i].id === id) { break; } } while (result.length < eventList.length) { ++i; if (i == eventList.len...
[ "function getIdsOfEvents(){\n\n var now = new Date();\n var oneDay = new Date(now.getTime() + ( 1 * 1 * 24 * 60 * 60 * 1000));\n var twoDays = new Date(now.getTime() + ( 1 * 2 * 24 * 60 * 60 * 1000));\n var cal = CalendarApp.getCalendarById(\"---Calendard Id---\");\n var events = cal.getEvents(now, twoDays);...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
April 22nd Submission: Added much need comments, however there are no new comments on the new code, I tried adding them as I went but i did not have much time. I will add them next time. Included the three spell types with their respective damage. Players can use the spell by pressing u or e. At the moment to choose wh...
function main () { var w11 = document.getElementById('w11') var w12 = document.getElementById('w12') var w13 = document.getElementById('w13') var wizard1_spell_choices = [w11,w12,w13] var w21 = document.getElementById('w21') var w22 = document.getElementById('w22') var w23 = document.getElementById('w2...
[ "function spells() {\n playerspells = {\n basicAttack: {\n name: \"Basic Attack\",\n nameid: \"basicAttack\",\n levelReq: 1,\n damage: Math.floor(player.damage + player.addDamage + (player.strength / 5) + (player.agility / 5)),\n description: \"Basic ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Get an existing StreamingJob resource's state with the given name, ID, and optional extra properties used to qualify the lookup.
static get(name, id, opts) { return new StreamingJob(name, undefined, Object.assign(Object.assign({}, opts), { id: id })); }
[ "static get(name, id, state, opts) {\n return new Job(name, state, Object.assign(Object.assign({}, opts), { id: id }));\n }", "static get(name, id, state, opts) {\n return new JobDefinition(name, state, Object.assign(Object.assign({}, opts), { id: id }));\n }", "static get(name, id, state, o...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Cookies Update the cookie that remembers which modules are open.
function updateCookie() { var cookie = ""; $("#content").children(".section").each( function() { cookie = cookie + "+" + this.id; } ); setCookie('openmodules', cookie.replace(/\+/, '')); }
[ "function setCookies() {\n\t\tCookies.set('sidenotes', sidenotesOpen);\n\t}", "setCookies() {}", "function cookieClicked() {\n data.cookiesOwned ++; //increases data.cookiesOwned by 1;\n updateCookies(); //calls updateCookies function\n}", "function update_cookie() {\n js.set_cookie(\"dm3_workspace_i...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Creates a new Oracle Enterprise Edition instance engine.
static oracleEe(props) { try { jsiiDeprecationWarnings.aws_cdk_lib_aws_rds_OracleEeInstanceEngineProps(props); } catch (error) { if (process.env.JSII_DEBUG !== "1" && error.name === "DeprecationError") { Error.captureStackTrace(error, this.oracleEe); ...
[ "static oracleSe(props) {\n return new OracleSeInstanceEngine(props.version);\n }", "static oracleEeCdb(props) {\n try {\n jsiiDeprecationWarnings.aws_cdk_lib_aws_rds_OracleEeCdbInstanceEngineProps(props);\n }\n catch (error) {\n if (process.env.JSII_DEBUG !== ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
sc: Scenario, ss: Screenshot
takeScreenshot(scNumber, ssNumber) { cy.wait(1000) cy.screenshot(this.path + this.scenario + scNumber + '-' + ssNumber, { capture: 'viewport' }) }
[ "afterStep(uri, feature, scenario) {\n if (scenario.error) {\n driver.takeScreenshot();\n }\n }", "function Screenshot() { }", "function Screenshot() {\n}", "takeScreenshot () {\n alert('shot!')\n }", "function ScreenshotStatement(){\nimagename = \"OfficialStatement.png\"...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Set up double click handlers
addHandlers() { this.onDoubleClick = this.onDoubleClick.bind(this); document.addEventListener("dblclick", this.onDoubleClick); }
[ "function run_on_double_click(d) {\n clickedOnce = false;\n clearTimeout(timerClickedOnce);\n ConsoleLog(\"doubleclick\");\n dblclick(d);\n }", "function doubleClickBehavior(doubleClickCoords){\n //console.log(\"doub...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Checks if the input was valid. Site must be filled in (at the moment only checks for length < 0) A bad password is needed (5 letters) A random number from 0 to 9999
function validInput(site, password, number) { let valueForReturn = true; clearErrors(); if (site.search(/^[a-zA-Z0-9]{3,}$/)) { document.getElementsByClassName('error-log')[0].style.display = "block"; valueForReturn = false; } if (password.search(/^[a-zA-Z0-9]{5,}$/)) { document.getElementsByClass...
[ "function validPassword(d) {return (d.includes(\"!\") || d.includes(\"#\") || d.includes(\"&\")) && (!d.includes(\"password\") && !d.includes(\"PASSWORD\") && !d.includes(\"password!\") && !d.includes(\"password#\") && !d.includes(\"password$\")) && checkCase(d) && digit(d) && d.length > 5;}", "function passid_va...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Draws a node shape at the given coordinate and returns the shape object.
function drawNode(x, y) { var shape = new createjs.Shape(); shape.x = x; shape.y = y; shape.graphics.beginFill(color.GRAY).drawCircle(0, 0, nodeRadius); shape.snapToPixel = true; shape.cache(-nodeRadius, -nodeRadius, nodeRadius * 2, nodeRadius * 2); stage.addChild(shape); return shape...
[ "function draw(shape) {\n define(shape);\n ctx.fill();\n ctx.stroke();\n}", "function drawShape (shape, ctx, element, config) {\n component = $('#' + element.id)\n offset = component.offset();\n x = offset.left - $(window).scrollLeft() - element.padding;\n y = offset.top - $(window).scrollTop...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
function to rotate matrix by k times
function rotateMatrix($matrix, $numberOfRotation) { // temporary array // of size M $temp = []; // within the size // of matrix $numberOfRotation = $numberOfRotation % $rowLength; for ($i = 0; $i < $colLength; $i++) { // copy first M-k elements ...
[ "function rotateMatrix($matrix, $k) \n{ \n \n // temporary array \n // of size M \n $temp = []; \n \n // within the size \n // of matrix \n $k = $k % $M; \n \n for ($i = 0; $i < $N; $i++) \n { \n \n // copy first M-k elements \n // to temporary array \n ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Settles the message with the specified disposition.
settleMessage(message, operation, options) { return __awaiter(this, void 0, void 0, function* () { return new Promise((resolve, reject) => { if (!options) options = {}; if (operation.match(/^(complete|abandon|defer|deadletter)$/) == null) { ...
[ "async updateDispositionStatus(lockToken, dispositionType, \n // TODO: mgmt link retry<> will come in the next PR.\n options) {\n throwErrorIfConnectionClosed(this._context);\n if (!options)\n options = {};\n try {\n let dispositionStatus;\n if (dispositio...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Enter a parse tree produced by LUFileParsernormalItemString.
enterNormalItemString(ctx) { }
[ "main(){\n let argv = this.parseString.trim().split(' ');\n let directoryList = new Array();\n let fileList = new Array();\n let openFileList = new Array();\n let currentDirectory = \"\",\n currentFormat = \"\",\n rootPath = this.getRoothPathFromModal();\n\n if (argv.lengt...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Ajax Request for request.json
function requestJSON(success){ $.ajax({ type: 'get', dataType: 'json', url: encodeURI('api/twitch/'+apiRequestQuery["api"]+'/request.json'), async: true, success: success }); }
[ "function json_request(URL, dictionary, s, f) {\n $.ajax({\n type: 'POST',\n url: URL,\n data: JSON.stringify(dictionary),\n contentType: \"application/json\",\n dataType: \"json\",\n success: s,\n error: f\n });\n}", "function jsonRequest(action, data) {\r\n...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
check if any dishes have a quantity that is not an integer
function allQuantitiesAreIntegers(req, res, next) { const dishes = res.locals.dishes dishes.forEach((dish) => { if (typeof dish.quantity !== "number") { const index = dishes.indexOf(dish) next({ status: 400, message: `Dish ${index} must have a qua...
[ "function dishesHaveQuantity(req, res, next) {\n const { dishes } = res.locals;\n for (let i = 0; i < dishes.length; i++) {\n const dish = dishes[i];\n if (!Number.isInteger(dish.quantity)) {\n next({\n status: 400,\n message: `Dish ${dish.id} must have a quantity that is an integer great...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
populate rooms, the user is asked to select the number of rooms he want to check and this function will expand the form and will show the amount of rooms depends on the user selection and for each room will ask about how many adults and children will stay in each room
function populateRooms(sel) { let roomNumbers = document.getElementById("roomNumbers") let rooms = document.getElementById("roomsToDisplay") rooms.innerHTML = ""; let roomsNr = roomNumbers.options[roomNumbers.selectedIndex].value; let stringRooms = ""; for (let i = 0; i < roomsNr; ++i) { stringRooms += ...
[ "function autoPopulateNewRoomWidget(){\n\tvar defaultSelect = $('.selectRoomsOptions select.noOfRoomsSel');\n\tvar noRSelection = $('.selectRooms select.noOfRoomsSel._sub');\n\tvar getRoomElm = $('input[name=hiddena]'), getRoom=[];\n\tif(getRoomElm.length>0){\n\t\tgetRoom = getRoomElm.attr('data-val').split(',');\n...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Proceeding > (INCOMING REQUEST) > Proceeding
function tsip_transac_nist_Proceeding_2_Proceeding_X_request(ao_args){ var o_transac = ao_args[0]; /* RFC 3261 - 17.2.2 If a retransmission of the request is received while in the "Proceeding" state, the most recently sent provisional response MUST be passed to the transport layer for retransmission. */ if(o...
[ "function replySucceeded(){self.status=C.STATUS_WAITING_FOR_ACK;setInvite2xxTimer.call(self,request,desc);setACKTimer.call(self);accepted.call(self,'local');}// run for reply failure callback", "_sendNextRequest () {\n const ticket = this._nextTicketInLine\n let { request, requestSent } = this._requestMap.g...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
function for adding mousedown event listener for exit and download links for safari
function safariHandler(link){ if(s.lt(link.href)){ link.addEventListener('mousedown', function(evt) { if(((evt.which) && (evt.which == 1)) || ((evt.button) && (evt.button == 1))){ //left click only var linkHref=evt.currentTarget.href, linkType = s.lt(linkHref); if(linkType=='d'){ if(linkHref.mat...
[ "_onDownloadLinkClicked(e) {\n e.stopPropagation();\n }", "function kbDownHandler(e)\n {\n // Ctrl + Shift + D\n if ( e.ctrlKey == true && e.shiftKey == true && e.which == 68 )\n {\n // Remove all handlers, so the event doesn't fire twice and \n // previous non-saved comm...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Throw image onto canvas, crop
crop() { const canvas = this.refs.canvas.getDOMNode(); context = canvas.getContext('2d'); // # start with blank white canvas context.clearRect(0, 0, this.props.width, this.props.height); context.fillStyle = "white"; context.fillRect(0, 0, this.props.width, this.props.height); // # draw use...
[ "function cropImage(image) {\n \n let draw = new DrawContext()\n let rect = new Rect(crop.x,crop.y,crop.w,crop.h)\n draw.size = new Size(rect.width, rect.height)\n \n draw.drawImageAtPoint(image,new Point(-rect.x, -rect.y)) \n return draw.getImage()\n}", "function cropAndUpdate() {\n\n\t\tvar bounds = cr...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Create a new pastie with the given `options`.
function createPastie(options) { var isPublic = (typeof options.pub !== 'undefined') ? options.pub : true; Recipe.run(function(recipe) { var sel = (!recipe.selection.length)? new Range(0, recipe.length) : recipe.selection , output = '' , text = recipe.textInRange(sel) , form = new FormData(...
[ "create(pasta){}", "static async create(options) {\n const instance = new this(options);\n await instance.init();\n return instance;\n }", "create(options) {\n return overlays.createOverlay('ion-toast', options);\n }", "createClip(options) {\n return __awaiter(this, vo...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Process a directive on the current node after its creation.
function postProcessDirective(viewData,directive,def,directiveDefIdx){var previousOrParentTNode=getPreviousOrParentTNode();postProcessBaseDirective(viewData,previousOrParentTNode,directive,def);ngDevMode&&assertDefined(previousOrParentTNode,'previousOrParentTNode');if(previousOrParentTNode&&previousOrParentTNode.attrs)...
[ "function postProcessDirective(viewData, directive, def, directiveDefIdx) {\n var previousOrParentTNode = getPreviousOrParentTNode();\n postProcessBaseDirective(viewData, previousOrParentTNode, directive);\n ngDevMode && assertDefined(previousOrParentTNode, 'previousOrParentTNode');\n if (previousOrPare...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
======================================================================= Change an attribute of a field in a popup editor
function changeAttributeOfPopupField(fieldName, container, attribute, value) { var fieldCol = $("input[name=" + fieldName + "]", container); fieldCol.attr(attribute, value); }
[ "function replaceEditorTextWithAttribute(objEditor, type){\r\n\t\t\r\n\t\tvar text = objEditor.getSelection();\r\n\t\t\r\n\t\tif(!text)\r\n\t\t\treturn(false);\r\n\t\t\r\n\t\tvar selections = objEditor.getSelections();\r\n\t\tif(selections.length > 1)\r\n\t\t\treturn(false);\r\n\t\t\r\n\t\tvar type = \"text\";\r\n\...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Multiply two given matrices, MatA[i][j] and MatB[j][p]
function multiply(MatA, MatB) { let MatA_Row = MatA.row; let MatA_Col = MatA.col; let MatB_Row = MatB.row; let MatB_Col = MatB.col; if (MatA_Col !== MatB_Row) { throw new Error('Number of cols in Mat1 is different from Mat2 rows'); } let MatC = new Matrix(MatA_Row, MatB_Col); for...
[ "function matmul(A, B) {\n var shapeA = A.shape;\n var shapeB = B.shape;\n if (shapeA.length > 2 || shapeB.length > 2) {\n throw new Error('Array shape is > 2D, not suitable for ' +\n 'matrix multiplication');\n }\n // Treat a flat n-item array as 1xn matrix\n if (shapeA.length =...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
given an array of posts to delete, collect all the codemarks to delete, and their markers
async collectObjectsToDeleteFromPostCodemarks (posts) { // collect all the codemarks const codemarkIds = posts.reduce((arr, post) => { if (post.get('codemarkId')) { arr.push(post.get('codemarkId')); } return arr; }, []); if (codemarkIds.length) { this.toDelete.codemarks.push(...codemarkIds); ...
[ "async delete () {\n\t\tawait this.getPost();\n\t\tthis.toDelete = {\n\t\t\tposts: [this.post.id],\n\t\t\tcodemarks: [],\n\t\t\treviews: [],\n\t\t\tcodeErrors: [],\n\t\t\tmarkers: []\n\t\t};\n\t\tthis.codemarks = [];\n\n\t\t// collect all the objects to delete before we actually do the operations\n\t\t// this inclu...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Cards factory / Each instance created by Cards represents a collection of playing cards, stored as an array of Card objects. The factory takes no arguments and creates an object that inherits Array methods. It adds several additional methods: topCard() : returns a reference to the top Card (last element of the array). ...
function Cards() { "use strict"; // Construct the object var cards = Object.create(Array.prototype, { // Return card at end of array (without changing array). topCard: {value: function () { return this[this.length-1]; } ...
[ "function ArrayOfCards() {\n var acard;\n this.addCard = function (acard) { this.cards.push(acard); };\n this.removeCard = function () { return this.cards.pop(); };\n this.showAllCards = function () { return this.cards; };\n this.empty = function () { this.cards = []; };\n }", ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
getLookupMeaning will get lookup meaning based on the passed lookup_type, lookup_code, lookup_context. This function is not used for now because this has moved to the model lookup.js file.
function getLookupMeaning(lkup_type, lkup_code, lkup_context, callback) { // check to see if the lkup_context value is passed, if it is, then pass along to Lookup.finaOne if (lkup_context == null) { Lookup.all({where: {'lookup_type':lkup_type, 'lookup_code':lkup_code}}, function(err, lkup_meaning){ ...
[ "function buildLookup(scheme) {\n var lcshared = require('src/lookups/lcshared');\n var cache = [];\n var lu = {};\n lu.name = scheme.substr(scheme.lastIndexOf('/') + 1);\n lu.load = {};\n lu.load.scheme = scheme;\n if ( scheme.indexOf('id.loc.gov') > 0 && !scheme.ma...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Pass id and returns room
function getRoomById(id) { for (let i = 0; i < rooms.length; i++) { const room = rooms[i]; if (room.id == id) { return room; } } return null; }
[ "static async getById(id) {\n const res = await db.query(\n `SELECT * \n FROM rooms\n WHERE id = $1`,\n [id]\n );\n const room = res.rows[0];\n if (!room) throw new NotFoundError(`No room with ID: ${id}`);\n return room;\n }", "function getRoomById(id)\n{\n var...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
IMPORTANT Must add the following configuration options in the `userDefinedConfigs` object in config.json: matchSharedLinkAccessLevel: Access level you want to act upon newSharedLinkAccessLevel: Access level to change to (options are "open", "company", "collaborators") / performUserDefinedActions() param [string] ownerI...
async function performUserDefinedActions(ownerId, itemObj, parentExecutionID) { logger.log.debug({ label: "performUserDefinedActions", action: "PREPARE_USER_DEFINED_ACTION", executionId: parentExecutionID, message: `Performing user defined action for ${itemObj.type} "${itemObj.id}"`...
[ "async function simulateModifySharedLink(itemObj, newAccessLevel, executionID) {\n logger.log.info({\n label: \"simulateModifySharedLink\",\n action: \"SIMULATE_MODIFY_SHARED_LINK\",\n executionId: executionID,\n message: `Would have modified link ${itemObj.shared_link.url} from ${ite...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
generate the 52 card deck
function generate(){ deck = [] for(var x = 1; x<=13; x++){ for(var y=0; y<=3; y++){ if(x === 1){ deck.push(['A', suit[y]]); }else if(x===11){ deck.push(['J', suit[y]]); }else if(x===12){ deck.push(['Q', suit[y]]); }else if(x===13){ deck.push(['K', suit[y]]); }else{ deck.push([x.to...
[ "function deckGen () {\n for (var key in game.foundations) {\n for (var i = 13; i >= 1; i--) {\n game.deck.push(new card(i, key));\n };\n };\n \n return game.deck;\n}", "function generateDeck(){\n\t\tvar deck = [];\n\n\t\tfor(var x = 2 ; x < 15 ; x ++) {\n\t\t\tfor(var z = 0 ; z < 4 ; z ++){\n\t\t\...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
add new step to pattern and update count
addStep(color) { this.count = this.pattern.push(color) $(".count").html(this.count).css("color", "white"); }
[ "function act() {\n const pattern = PatternFactory.createEmptyPattern( amountOfSteps );\n commit( \"replacePatterns\", PatternUtil.addPatternAtIndex( song.patterns, patternIndex + 1, amountOfSteps, pattern ));\n }", "increment() {\n if (this.step < this.steps.length) {\n this.step++;\n ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
changing size of array function to update array
function update_array() { array_size=inp_as.value; generate_array(); }
[ "function update_array_size() {\n array_size = inp_as.value;\n generate_array();\n}", "function update_array(){\n\tno_of_ele_in_array = array_size_element.value;\n\tgenerate_new_array();\n}", "function updateArr(){\n arrSize = inpArr.value;\n genrateNewArray();\n}", "function update_arraysize() {\r\n\r\n ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
compares the id from url and id of the object and creates a dataToRender object in state object;
componentWillMount(){ const newsArr = this.state.data; const [dataToRender] = newsArr.filter((object) => { const urlId = this.props.match.params.id; if(urlId == object.id){ return object; } }); this.setState({ dataToRender :...
[ "function update_render( data, id)\n{\n $.each(data, function(key, value){\n if(typeof(value) == 'object' )\n update_render(value, id);\n $('#'+id).find('#'+key).html(data[key]);\n });\n}", "fetch(data){\n this.setState({\n fetching: true\n });\n let id = data.id;\n\n ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
TODO: Use transactions when working with MongoDB / Get all terms.
async function GetTerms(name, description, type, page = 1, count = 10){ let filter = {}; if(name != null){ filter.name = new RegExp(".*" + name + ".*", "i"); } if(description != null){ filter.description = new RegExp(".*" + description + ".*", "i"); } if(type != null){ filter.type = new Reg...
[ "async function retrieveTerms() {\n let terms = await Client.db(database.courses).collection(collections.terms).find().sort({_id: 1}).toArray();\n return {terms};\n}", "async _findDocs(terms) {\n const docs = new Map();\n for (const term of terms) {\n const termIndex = await this.wordsTable.findO...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
method to add a new node as the first node in the linked list, it takes some data
insertFirst(data){ // its head is a new node so it takes data and it takes a pointer this.head = new Node(data, this.head); // as we create a node we increase the size of the linked list this.size++; }
[ "addFirst(data) {\n let firstNode = new Node(data);\n firstNode.next = this.head;\n this.head = firstNode;\n }", "addFirstNode(data) {\n\t\tthis.headNode = new Node(data, null);\n\t\tthis.lastNode = this.headNode;\n\t}", "addNodeAtFirstPosition(data) {\n // 1. Crate a Node...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Deselects all selected chips.
deselectAll_() { this.selectedChips_.forEach((chipFoundation) => { chipFoundation.setSelected(false); }); this.selectedChips_.length = 0; }
[ "deselectAll_() {\n this.selectedChips_.forEach((chipFoundation) => {\n chipFoundation.setSelected(false);\n });\n this.selectedChips_.length = 0;\n }", "deselectAll() {\n this._setAllOptionsSelected(false);\n }", "deselect()\n...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Draws party selection UI elements in legendSvg , adds logic to them
function drawLegend(){ //var guide = "Valitse näytettävät puolueet:" var tick = 1; //helping function for positioning function getNextTick(){tick = tick +1;return tick;} //circles presenting the parties var partiesSelection = legendSvg.selectAll("circle.parties") .data(parties) .enter() .append("circ...
[ "function legendClick(passedInLegend) {\n var mainArea = d3.select(\".main-area\");\n var mainArea1 = d3.select(\".main-area-2\");\n if (passedInLegend === \"General Supply KWH\") {\n if (mainArea.style(\"fill-opacity\") === \"0.8\") {\n d3.select(\".main-area\").style(\"fill-opacity\", 0);\n } else {...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
given discrete state, for how many transitions can we expect the model to stay in the state?
function expectedDurationOfState(state, prob){ return 1/(1-prob[state][state]); }
[ "function countTransitions() {\n\t\tvar trans = 0;\n\t\tfor(var key in states) {\n\t\t\tvar state = states[key];\n\t\t\tfor(var t in state.Transitions) {\n\t\t\t\tvar tr = state.Transitions[t];\n\t\t\t\tif(tr !== undefined && tr.next !== undefined && tr.action !== undefined) {\n\t\t\t\t\ttrans++;\n\t\t\t\t}\n\t\t\t...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Convert form text to Khmer
function translateToKhmer() { var tstk; tstk = new TSTranslateKhmer(FormApp.getActiveForm()).translateText('en', 'km'); FormApp.getUi().alert('Form text has been translated to Khmer.'); }
[ "function translateToEnglish() {\n var tstk;\n tstk = new TSTranslateKhmer(FormApp.getActiveForm()).translateText('km', 'en');\n FormApp.getUi().alert('Form text has been translated to English.');\n}", "function convertKg(e) {\n let kg = e.target.value;\n $output.style.visibility = \"visible\";\n if (kg ===...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Remove empty fields from an object
function purgeEmptyFields(obj) { Object.keys(obj).forEach(key => { const val = obj[key]; if (val === '' || val === false || val === undefined || val === null) { delete obj[key]; } }); return obj; }
[ "function cleanObj(obj) {\n _.each(obj, function (ele, i) {\n if (_.isObject(ele) && _.isEmpty(ele) && !_.isDate(ele)) delete obj[i];\n else if (_.isObject(ele) && !_.isEmpty(ele)) obj[i] = cleanObj(ele);\n else if (_.isString(ele) && ele.trim() === '') delete obj[i];\n else if (_.i...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
function to create ingredient list
function ingrList(ingredients) { var ingredientsTitle = $("<h3>").text("Ingredient List"); ingredientsTitle.attr("style", "font-size: 24px; color: black;"); var ingredientList = $("<ul>"); for(i=0; i<ingredients.length; i++) { var ingredient = $("<li>").text(ingredients[i]); ...
[ "function genIngredientsList(ingredients) {\n\tvar list = ''.concat(\n\t\t'<table style=\"width: 100%\">',\n\t\t'<tr>',\n\t\t'<td><strong>Ingredient</strong></td>',\n\t\t'<td><strong>Price</strong></td>',\n\t\t'<td><strong>Out of Stock?</strong></td>',\n\t\t'<td><strong>Remove Ingredient</strong></td>',\n\t\t'</tr>...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Updates items count and toggle allItemsChecked flag
function testAllItemsChecked() { ctrl.allItemsChecked = ctrl.itemsCount > 0 && ctrl.checkedItemsCount === ctrl.itemsCount; }
[ "function updateCheckedCount(list) {\n var checkItems = list.checkItems;\n var checkedItems = 0;\n var allCheckedItems = 0;\n var allCheckItems = 0;\n\n angular.forEach(checkItems, function (checkItem) {\n if (checkItem.checked)\n {\n checkedItems++;\n }\n });\n\n list.checkItemsChecked =...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Close connection to headless
async shutdown() { winston.info(MODULE, 'start shutdown'); await this.headless.close(); await this.chrome.kill(); this.webappServer.close(); this.headless = null; this.chrome = null; this.webappServer = null; winston.info(MODULE, 'finished shutdown'); }
[ "close() {\n /* Disconnect Trueno session */\n process.exit();\n }", "function closeConnection() {\n nativeAppPort.disconnect();\n}", "close() {\n localTunnelService.close(this._socket);\n }", "function closeConnection() {\n voxAPI.disconnect();\n}", "close() {\n this.web3.cu...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Construct a new textfile object
function $textfile(path) { var thisPtr=this; var data=""; var file=null; var file_is_tmp = false; this.inlet1=new this.inletClass("inlet1",this,"data is appended to the buffer. methods: \"bang\", \"clear\", \"write\", \"cr\", \"tab\", \"dump\", \"open\", \"read\", \"query\", \"length\", \"line\", \"tmpfile\", \...
[ "function TextFile(){\n //merely indicating that these values will be filled.\n this.name = null;\n this.text = null;\n }", "TextFile (name, ext) {\n this._file = new TextFile()\n this._name = name || ''\n this._ext = ext || ''\n return this._file\n }", "function makeTextFile(text) {\n ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
delete doctor record AJAX
function deleteDoctorRequest() { removeDoctorRequest = new XMLHttpRequest(); removeDoctorRequest.open('get', 'delete_doctors_records.do?user_type_id=2&email=' + this.name + '&record_id=' + this.id, true); removeDoctorRequest.onreadystatechange = deleteDoctorRecord; removeDoctorRequest.send(null); }
[ "function delete_cad2d(id_cad2d){\n console.log(id_cad2d)\n $.ajax({\n url: '/jb/ajax/delete-cad2d/',\n data:{\n 'id_cad2d':id_cad2d,\n },\n dataType:'json',\n success:function(data){\n ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
this function sets a timer to run _updateFeatures function; this is done this way to avoid sequential feature updates from for loops etc.
function updateFeatures() { if(window.updateFeaturesTimer) clearTimeout(window.updateFeaturesTimer); window.updateFeaturesTimer = setTimeout(_updateFeatures, 1); }
[ "function updateFeatures() {\n if (window.updateFeaturesTimer) clearTimeout(window.updateFeaturesTimer);\n window.updateFeaturesTimer = setTimeout(_updateFeatures, 1);\n }", "function updateTimeSensitiveFeatures() {\n displayDateAndTime();\n setColours();\n}", "function setFea...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
ageIncrease method will increase the currentPet's age by 1 every 50 seconds
ageIncrease() { if(this.timeSpan % 50 === 0){ this.currentPet.age += 1; } }
[ "hungerIncrease() {\n\t\tif(this.timeSpan % 20 === 0) {\n\t\t\tthis.currentPet.hunger += 1;\n\t\t}\n\t}", "function ageUp(person) {\n person.age++;\n console.log(person.age);\n}", "sleepinessIncrease() {\n\t\tif(this.timeSpan % 25 === 0) {\n\t\t\tthis.currentPet.sleepiness += 1;\n\t\t}\n\t}", "celebrate...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
drawPointer draws a triangle in the spacecoordinate system
function drawPointer() { var centerX = (zeroX+squareSize/2) + Pointer.x*squareSize; var centerY = (zeroY+squareSize/2) + Pointer.y*squareSize; if(Pointer.dir == "up") { drawTri(centerX - triSize/2, centerY + triSize/2, Pointer.dir); } else if(Pointer.dir == "right") { drawTri(centerX - triSize/2, c...
[ "function debugDrawPointer() {\n ctx.fillStyle = COLOR_CROSSHAIRS;\n ctx.strokeStyle = COLOR_CROSSHAIRS;\n\n ctx.beginPath();\n\n // Vertical line\n ctx.moveTo(mouseX, 0);\n ctx.lineTo(mouseX, CANVAS_HEIGHT);\n\n // Horizontal line\n ctx.moveTo(0, mouseY);\n ctx.lineTo(CANVAS_WIDTH, mouse...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Adds multiple new attachment to the collection. Not supported for batching.
addMultiple(files) { // add the files in series so we don't get update conflicts return files.reduce((chain, file) => chain.then(() => this.clone(AttachmentFiles_1, `add(FileName='${file.name}')`, false).postCore({ body: file.content, })), Promise.resolve()); }
[ "function addAttachments() {\n if (item.itemType === Office.MailboxEnums.ItemType.Message) {\n Office.cast.item.toMessageCompose(item).addFileAttachmentAsync(\"https://i.imgur.com/ucI9vyz.png\", \"image file\", { asyncContext: null },\n function (asyncResult) {\n ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
ToggleGroup inherits Tag ToggleGroup does the following: renders a group of toggles note: if item.values is not assigned, it will first take values from item.labels and then from item.images until item.values have the same size as item.labels + item.images Arbitrary settings: item.type < automatically assigned item.id ...
function ToggleGroup(parent_id, item) { item.id = item.id || "Toggle_group_{0}".format(__TOGGLE_GROUP++); item.type = item.type || "checkbox"; item.name = item.name || item.id; item.label = item.label || item.id; item.needQuestion = (item.needQuestion == false) ? false : true; item.images = item...
[ "function GroupItemMetadataProvider(options) {\n var _grid;\n var _defaults = {\n checkboxSelect: false,\n checkboxSelectCssClass: \"slick-group-select-checkbox\",\n checkboxSelectPlugin: null,\n groupCssClass: \"slick-group\",\n groupTitleCssClass: \"slick-group-title\",\n total...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
We're only ready once the point is done fetching.
isReady() { return !this.state.point.isFetching; }
[ "function drawPointCompleted(e) {\n\t\t\tdrawPoint.deactivate();\n\t\t\tvar distanceVal = $(\"#disValue\").val().toString();\n\t\t\tvar queryByDistanceParams = new SuperMap.REST.QueryByDistanceParameters({\n\t\t\t\tqueryParams: new Array(new SuperMap.REST.FilterParameter({\n\t\t\t\t\tname: \"ParkingsGround@data\"\n...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
update payee in summary table
function update_payee(users, text, amnt) { show_div(); var table = document.getElementById("summary_table"); var amount = document.getElementById(amnt).value; var ul_len = document.getElementById(users).childNodes.length; var payee_amount = amount / ul_len; var row = table.insertRow(1); var ...
[ "async update({ params: { companyId, saleId }, request, response }) {\n const { total_amount } = request.post();\n //const user = await auth.getUser();\n //const company = await Company.find(companyId);\n const sale = await Sale.find(saleId);\n\n sale.merge({ total_amount });\n ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
scope handling testing note: this is a good example of the scope problems with my implementation as the amb dies once the scope of the function ends (it exists on the call stack) you cannot return it and expect the same behaviour, once the scope dies, the nondeterminism is locked to hold the scope (thanks to no tail ca...
function amb_range(low, high, c) { var test_func = function* (){ for (let n = low; n < high; n++) { yield n; } } amb(n, test_func()); c(n); if (n != high-1) {fail();} }
[ "function test_nondet_amb_return() {\n parse_and_eval(\"function f(x) {\\\n return amb(x*2, list(1,2,3), 'test_string');\\\n const f = amb(10, 20);\\\n f;\\\n }\\\n f(4);\");\n\n assert_equal(8, final_result);\n assert_equal(list(1,2,3), try_again());\n assert_equal(\"test_str...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
this function is used to save the assigned picklist values for a given role
function saveAssignedValues(moduleName, fieldName, roleid) { var node = document.getElementById('selectedColumns'); if (node.length == 0) { alert(alert_arr.LBL_DELETE_ALL_WARNING); return false; } var arr = new Array(); for (var i=0; i<node.length; i++) { arr[i] = node[i].value; } node = document.getEleme...
[ "function callbackSaveRoles(roles) \n { \n sessionStorage.setItem(\"roles\", JSON.stringify(roles));\n buildRolesDDL(); \n }", "function saveUserRole() {\n\t\t\tdailyMailScanDataService.getUserRole()\n\t\t\t\t.then(function (response) {\n\t\t\t\t\t//self.userRole=\"LexviasuperAdmin\";\n\...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Teardown the column fillup listeners
teardownColumnFillup() { this.get('_tableResizeSensor').detach(this.element); }
[ "teardownColumnFillup() {\n this._tableResizeSensor.detach(this._container);\n }", "function cleanUp(){\n\t$(\"td\").removeClass(\"sel-row\");\t//Remove row class\n\t$(\"td\").removeClass(\"sel-col\");\t//Remove column class\n\t$(\"td\").removeClass(\"sel-cor\");\t//Remove single cell class\n\tCLICK = 1;\t\t...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
This function tries to get the license from cache if not exits fetches from search api and sets to cache
function getLicenseFromCache (licenseSearchquery, tryfromcache, inputdata, cb) { async.waterfall([ function (CBW) { if (tryfromcache) { let keyNames = getKeyNames(inputdata) cacheManager.mget(keyNames, function (err, cacheresponse) { let cachedata = _.compact(cacheresponse) ...
[ "async getResults() {\n let start = new Date();\n\n try {\n let value = await myCache.get(this.company);\n\n if (value === undefined) {\n // Request custom search\n try {\n let response = await fetch('https://www.googleapis.com/cus...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
configure missing button properties with various fallback options
function fallbackBtnSetting(btn, groupDefaults, toolbarDefaults, actions, propName) { var target = btn; // skip it property is already set if (target[propName]) return; if (groupDefaults && groupDefaults[propName]) return target[propName] = groupDefaults[propName]; // if the toolbar ...
[ "setupButtons() {\n this.buttonApi_.attachButtonsWithAttribute(\n BUTTON_ATTRIUBUTE,\n [\n BUTTON_ATTRIBUTE_VALUE_SUBSCRIPTION,\n BUTTON_ATTRIBUTE_VALUE_CONTRIBUTION,\n ],\n {'theme': Theme.LIGHT}, // TODO(stellachui): Specify language in options.\n {\n [BUTTON_ATTRI...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Description: Groups of characters decided to make a battle. Help them to figure out wha group is more powerful. Create a function that will accept 2 variables and return one who's stronger. Rules: Each caracter have it's own power: A = 1, B = 2, ... Y = 25, Z = 26 and so on. 1. Only capital chatacters can participate a...
function battle(x, y) { // Lets the battle begin! var char = ["a", "b", "c", "d", "e", "f", "g", "h", "i" , "j", "k", "l", "m", "n", "o", "p", "q", "r", "s", "t", "u", "v", "w", "x", "y", "z"]; var char1 = x.split('').map((letter) => {return letter.toLowerCase()}), char2 = y.split('').map((letter) => {ret...
[ "function alphabetWar(fight) {\n // Define the variables.\n const RIGHT = \"Right side wins!\";\n const LEFT = \"Left side wins!\";\n const TIE = \"Let's fight again!\";\n // TODO: Delete this leftPower variable.\n const leftPower = {\n w: 4,\n p: 3,\n b: 2,\n s: 1,\n t: 0,\n };\n // TODO: De...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
from: from timestamp to: to timestamp notice that it won't generate any months that >= this month
function generateMonths(from, to) { let fromMoment = moment.unix(from).utc(); let toMoment = moment.unix(to).utc(); let monMoment = moment().utc().startOf('month'); let months = []; while (fromMoment.diff(toMoment) < 0 && fromMoment.isBefore(monMoment)) { months.push...
[ "writePastMonth() {\n const clone = this.currentMonthFirstDay.clone();\n const dayOfWeek = clone.weekday();\n\n // move for the correct day of the previous month\n clone.subtract(dayOfWeek + 1, 'days');\n\n // iterate on the remaining days of last month and plot then\n for (let i = dayOfWeek; i > ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
This function will provide state to props of components Here StoreStates is an argument which is receiving all store states provided by connect method When a change occurs, connect calls a function that we write called mapStateToProps(), and in mapStateToProps() we specify exactly which slice of the state we want to pr...
function mapStateToProps(StoreStates){ console.log("mapStateToProps",StoreStates); return{ count: StoreStates.count //Here we are using the count state from store and returning the same value as count object } }
[ "function mapStateToProps(state) {\n return {\n count: state.count\n }\n}", "function mapStateToProps(state){\n\tconsole.log('mapStateToProps');\n\n\t\treturn{\n\t\t count: state.count\n\t\t};\n}", "function mapStateToProps(state) {\n return {\n storeData: state\n };\n}", "function mapStateToProp...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Recursively converts a JS object into an ES5 map.
_convertObject(obj) { if (util_1.isArray(obj)) { for (let i = 0; i < obj.length; i++) { obj[i] = this._convertObject(obj[i]); } return obj; } else if (util_1.isObject(obj)) { const map = new Map(); for (const key in obj)...
[ "function $fixupJsObjectToDartMap(obj) {\n var map = new HashMapImplementation();\n var keys = Object.keys(obj);\n for (var i = 0; i < keys.length; i++) {\n map.$setindex(keys[i], obj[keys[i]]);\n }\n return map;\n}", "function toMap(obj, recursive = true) {\n let map = new Map();\n for (let k of Ob...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Flatten the given array and convert the bits into bytes
function packBits(array) { let flatArr = array.flat(); const returnArr = []; while (flatArr.length > 0) { // Grab the first 8 entries (bits) and join them into a string // Then pad the end with zeros if it's less than 8 entries const bitsStr = flatArr.slice(0, 8).join('').padEnd(8, 0); const byt...
[ "function bitsArrayToBytesArray(array) {\n\n for (x = 0; x < 4; x++) { // Boucle 4 fois pour les 4 bytes de 8 bits\n\n var pre_array = [];\n for (y = 0; y < 8; y++) { // Boucle 8 fois pour les 8 bits\n pre_array.push(array[0]); // On ajoute la première valeur\n ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
A channel class, really just a simple event target implementation
function Channel() { this._listeners = {}; }
[ "function channel(c){\nthisChannel = c;\n}", "function Channel() {\n this._listeners = new SortedTable();\n}", "function EventsChannel (name) {\n this.name = name;\n\n this.__ = {\n events: {},\n dispatchers: {},\n eventsTimeouts: {}\n };\n}", "bindChannelEvents(){\n var ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Notify host check out successfully
static async notifyHostCheckOut(tokens, bookingId, userName, bookingRef) { const noti = { title: `Booking #${bookingRef} check out.`, body: JSON.stringify({ bookingId, content: `${userName} checked out successfully.`, }), }; thi...
[ "function mailing(alive, host){\r\n let h = gardian.check.host(host)\r\n if(alive && hosts_down.includes(h)){\r\n hosts_down.splice(hosts_down.indexOf(h), 1 );\r\n postman.mail.send(\"Host \"+h+\" is up\", \"Watchdog message : this message indicate that the host at \"+h+\" now respond to our ping re...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Function: getPlace Return the parsed value of a number in a certain position in the target language. For example, if n = 123, getPlace(n, 1, 10) will return the equivalent of "twenty" in the target language, and getPlace(n, 1, 1) will return the equivalent of "two" in the target language.
function getPlace(n, which, scale) { return numbers[parseInt(n.toString()[which]) * scale]; }
[ "function getPlace(n, which, scale){\n return numbers[parseInt(n.toString()[which])*scale];\n }", "function getPosition(num, place) {\n return Math.floor(Math.abs(num) / Math.pow(10, place)) % 10;\n}", "function getDigit(num, place) {\n num = num.toString();\n\n if (place >= num.length) {\n re...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Check that n is a primitive number, an integer, and in range, otherwise throw.
function intCheck(n,min,max,name){if(n<min||n>max||n!==mathfloor(n)){throw Error(bignumberError+(name||"Argument")+(typeof n=="number"?n<min||n>max?" out of range: ":" not an integer: ":" not a primitive number: ")+String(n))}}// Assumes finite n.
[ "function intCheck(n, min, max, name) {\n if (n < min || n > max || n !== (n < 0 ? mathceil(n) : mathfloor(n))) {\n throw Error\n (bignumberError + (name || 'Argument') + (typeof n == 'number'\n ? n < min || n > max ? ' out of range: ' : ' not an integer: '\n : ' not a primitive number...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Runs the mount callback
function runMountCallback() { if (!hasMountCallbackRun && currentMountCallback) { hasMountCallbackRun = true; reflow(popper); currentMountCallback(); } }
[ "function runMountCallback() {\n if (!hasMountCallbackRun && currentMountCallback) {\n hasMountCallbackRun = true;\n reflow(popper);\n currentMountCallback();\n }\n }", "mount (drive, callback) {\n\t\texec(`${fusb} mount ${drive}`, (err, stdout, stderr) => {\n\t\t\tif (err || stderr) return ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Get the user's family name from the JWT payload.
function userFamilyName(jwtPayload) { if (exports.mappingUserFields.familyName) { return jwt_1.readPropertyWithWarn(jwtPayload, exports.mappingUserFields.familyName.keyInJwt); } }
[ "function userFamilyName(decodedToken) {\n if (exports.mappingUserFields && exports.mappingUserFields.familyName) {\n return jwt_1.readPropertyWithWarn(decodedToken, exports.mappingUserFields.familyName.keyInJwt);\n }\n}", "function userGivenName(jwtPayload) {\n if (exports.mappingUserFields.given...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Updates the events with type: value
updateValueEvents() { this.updateEventsContainer('value'); }
[ "set_type(event_type)\n\t{\n\t\tthis.type = event_type;\n\t}", "function Events_ValueChange(strId,strValue,blnRaise)\r\n{\r\n\tvar objEvent = Events_CreateEvent(strId,\"ValueChange\",null,true);\r\n\tEvents_SetEventAttribute(objEvent,\"Value\",strValue);\r\n\tif(blnRaise) Events_RaiseEvents();\r\n}", "static se...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
returns the state of the first container which is selectable or null if the element and none of its parents are selectable
function getSelectable(store, element) { let el = element; let data; while (!!el && !(data = getSelectableState(store, el))) { el = el.parentElement; } return data; }
[ "_getFirstFocusableElement () {\n let el = FocusMgr._getFirstFocusableFrom(this,true);\n\n // do not focus on '.child'\n if ( el && el.parentElement && el.parentElement.classList.contains('child') ) {\n return null;\n }\n\n return el;\n }", "selectStart() {\n\t\tvar first, items = this.getIte...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Loads in the recipes .json file and saves a new file (recipes_normalized.json) in which every recipe object now has a new field called "ingredients_normalized" which contains a list of ingredient objects. Each ingredient object consists of the fields "amount", "unit", and "item". However, some of these fields may be mi...
function normalizeRecipes(){ // Loads JSON object let recipes = require('../data/recipes.json'); let nutrition = require('../data/nutrition.json'); let recipes_normalized = [] for (let recipe of recipes) { if (recipe['ingredients']){ ingredients_normalized = []; for ...
[ "function normalizeRecipes(minecraftData) {\n minecraftData.recipes = _.flatten(_.map(minecraftData.recipes, function(variations, key) {\n return _.map(variations, function(recipe) {\n var normalizedIngredients;\n\n if (recipe.ingredients) {\n normalizedIngredients = normalizeIngredients(recipe...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
will we allow students to quit a clazz so he will not see exercises any more? TBD
function quitclazz(selected) { var uid = data.user().Id(); var cid = selected().Id(); // TODO: delete this record from UserClasses table }
[ "function quit() {\n // Used to calculate total score of all objectives, in this case 'Quiz 1' and 'Quiz 2'\n // This method will only calculate scores for the default group. You can optionally\n // pass in the group name as a parameter to calculate total scores for other groups.\n let totalScore = objectives.c...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
A schema is classified as a schema for a single property if: `type` is defined on the schema as a string. OR `default` is defined on the schema, as a reserved keyword. OR schema is empty.
function isSingleProperty (schema) { if ('type' in schema) { return typeof schema.type === 'string'; } return 'default' in schema; }
[ "function isSingleProperty (schema) {\n if ('type' in schema) {\n return typeof schema.type === 'string';\n }\n return 'default' in schema;\n}", "function getDefaultFromSchema(schema) {\n if (!schema || typeof schema.$ref === 'string') {\n var _schema$$ref;\n\n // get the schema from ajv\n return ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
null|Object getUserByUsername ( string username [ , boolean case_insensitive = false ] ) Gets a user with the specified username.
function getUserByUsername(username, case_insensitive) { return getUserByProperty('username', username, false, false, case_insensitive); }
[ "function findUserByUsername(username) {\n return User.findOne({username: username});\n }", "function findUserByUsername(username) {\n return User.findOne({ username: username });\n }", "async function getUserByUsername(username){\n let id = await $r.get(`username.to.id:${username.toLowerCa...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Outputs a number of spans to make up a line, taking highlighting and marked text into account.
function insertLineContent(line, builder, styles) { var spans = line.markedSpans, allText = line.text, at = 0; if (!spans) { for (var i = 1; i < styles.length; i+=2) builder.addToken(builder, allText.slice(at, at = styles[i]), interpretTokenStyle(styles[i+1], builder.cm.options)); retur...
[ "function respan (lines) {\n for (let i = 0; i < lines.length; i++) {\n const line = lines[i]\n\n // push tagStarts, pop tagEnds\n const spanStack = []\n for (let part of line.parts) {\n if (part.isTagStart) spanStack.push(part)\n if (part.isTagEnd) spanStack.pop()\n }\n\n // if no hang...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Do we have more tokens in the input?
hasMoreTokens () { return this.currentTokenIndex + 1 < this.tokens.length }
[ "function hasMore_Tokens()\n{\n if (this.tokensReturned < this.tokens.length)\n {\n return true;\n } // end if\n else\n {\n return false;\n } // end else\n}", "hasMoreTokens() {\n return this._cursor < this._string.length;\n }", "hasNextToken() {\n return this._cursor < this._stri...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }