query
stringlengths
9
34k
document
stringlengths
8
5.39M
negatives
listlengths
19
20
metadata
dict
Create a metadata.xml for local use samlp doesn't provide good internals access so it's actually easier to fake out its Express request handler than to try to get it to just generate the metadata string
function generateMetadata () { const fakeReq = { originalUrl: '', protocol: 'http', headers: { host: 'localhost:3000' } } const fakeRes = { set: () => {}, send: value => { fakeRes.value = value } } samlp.metadata(samlOptions())(fakeReq, fakeRes) return fakeRes.value }
[ "function idpMetadata(req, res) {\n samlp.metadata({\n issuer: issuer,\n cert: credential.cert,\n redirectEndpointPath: redirectEndpointPath,\n postEndpointPath: postEndpointPath\n })(req, res);\n}", "function sendMetadata(req, rsp) {\n\tlet userDetails = getUserDetails(req);\n\n\tlet baseURL = 'htt...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Esta funcion es llamada desde el boton ver. se usa asincrona para que no recargue toda la pagina, Esta funcion al ser asyncrona usa promises ,
async function verPrestamo(id){ event.preventDefault(); var botonVer = document.querySelector(`#btnVerItem_pre_${id}`); botonVer.classList.replace('show','hide'); data = await fetch(`http://localhost:41062/www/prestamos/buscar/${id}`) .then(res =>res.json()) .then(j...
[ "function cargarPublicaciones(){\n console.log(\"Cargar publicaciones\");\n onRequest({ opcion : 20}, respCargarPublicaciones);\n \n \n \n}", "async function verPagos(id){\n\n event.preventDefault();\n \n \n data = await fetch(`http://localhost:41062/www/user/buscar/${id}`)\n .th...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
HELPER FUNCTIONS Use to initialise a currency formatter function, E.g. const currency2DP = newCurrencyFormater("USD", 2)
function newCurrencyFormater(currencyType, decimalPlaces) { try { const formatter = new Intl.NumberFormat("en-US", { style: "currency", currency: currencyType, minimumFractionDigits: decimalPlaces, maximumFractionDigits: decimalPlaces }) return formatter }...
[ "function currencySelection()\n {\n // Get the value from page. Create the format for each currency. When user choose which type of currency they want. Return the value to the function\n var formatter = \"\";\n if (document.getElementById(\"currencySelector\").value == \"CAD\")\n ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
writeBottomText writes the bottom text box to the image frame PARAMETERS: imageView: image id line: 1,2 or 3 columns: 2 or 3 (if columns=2, block can only be "left" or "right") block: "left", "center" or "right" text: text to be added to the image frame
function writeBottomText(imageView, line, columns, block, text) { var horizontalOffset = 0; //measure length of rendered text var textLength = renderTextDimensions(text, bottomFont.fontName, bottomFont.fontSize).length; //calculate horizontal offset based on block switch(block) { case "left...
[ "function createBottomTextBox(text) {\n var textBoxConfig = {\n fontSize: 36,\n height: 60,\n fontFamily: 'Impact',\n top: canvas.height - 60,\n left: 0,\n width: canvas.width,\n stroke: 'black',\n strokeWidth: 5,\n strokeLineJoin: 'round',\n textAlign: 'center',...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
The input to the function will be an array of three distinct numbers (Haskell: a tuple). For example: gimme([2, 3, 1]) => 0 2 is the number that fits between 1 and 3 and the index of 2 in the input array is 0. Another example (just to make sure it is clear): gimme([5, 10, 14]) => 1 10 is the number that fits between 5 ...
function gimme(numbers) { let max = numbers[0]; let min = numbers[0]; let newArr = []; for(let i = 0; i < numbers.length; i++) { if(max < numbers[i]) { max = numbers[i] } if(min > numbers[i]) { min = numbers[i]; } newArr.push(numbers[i]) ...
[ "function arrayRandomNumbers(quantityElementGen, minNumGen, maxNumGen) {\n\n if (quantityElementGen > (maxNumGen - minNumGen + 1)) {\n return alert(\"ERROR\");\n }\n\n var myArray = [];\n\n for (var i = 0; i < quantityElementGen; i++) {\n var tempRandomNumber = randomNumber(minNumGen, maxNumGen);\n\n w...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Match a Contact by the field and filter specified as parameters Callbacks is an object that declares onmatch and onmismatch callbacks
function matchBy(aContact, field, filterOper, callbacks, poptions) { var options = poptions || {}; var values = []; if (Array.isArray(aContact[field])) { aContact[field].forEach(function(aField) { if (typeof aField.value === 'string') { values.push(aField.value.trim()); } ...
[ "function searchContact(ev) {\n setContacts(contacts.filter((_) => _.name.toLowerCase().match(ev.toLowerCase())));\n }", "function matchByName(aContact, callbacks, options) {\n // First we try to find by familyName\n // Afterwards we search by givenName\n var isSimContact = (Array.isArray(aCon...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
This syntax allows other code to retrieve the cellWidth as if it were a variable instead of a function. You use someGrid.cellWidth rather then someGrid.cellWidth()
get cellWidth() { return (min(width, height) - 2*GRID_BUFFER) / this.cols; }
[ "get widthInCells() {\n return this.cellsInTile * this.width\n }", "get gridItemWidth() {\n return windowWidth / this.perRow;\n }", "get gridItemWidth() {\n return windowWidth / this._cols;\n }", "function gridWidth() {\n return document.getElementById(\"inputWidth\").value;\n}", "fun...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
When a pill is taken the function is run a number of times a second to check to see if pacman has killed a ghost
function pacKill(ghost){ console.log('can pac kill') for( let i=0; i<16; i++) { clearInterval(caughtIdOne) clearInterval(caughtIdTwo) clearInterval(caughtIdThree) clearInterval(caughtIdFour) } // so pacMan can kill ghost if(gridSquare[pacIndex] === gridSquare[ghost.ghostIndex...
[ "function pilltaken(ghost) {\n ghost.bias = 2\n gridSquare[ghost.ghostIndex].classList.remove('ghostDead')\n gridSquare[ghost.ghostIndex].classList.remove(ghost.ghostClass)\n gridSquare[ghost.ghostIndex].classList.add('ghostFlee')\n for( let i=0; i<16; i++) {\n clearInterval(caughtIdOne)\n ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Mutates and returns a nested `SplitQueries` structure, updating any deferred "ref queries" to actually reference their contexts.
function buildQueries(splitQueries) { if (splitQueries.required && isEmpty(splitQueries.required)) { splitQueries.required = null; } splitQueries.deferred = splitQueries.deferred.map(function (nestedSplitQueries) { var descriptor = nestedSplitQueries.__refQuery__; if (descriptor) { // Wra...
[ "function buildQueries(splitQueries: SplitQueries): SplitQueries {\n if (splitQueries.required && isEmpty(splitQueries.required)) {\n splitQueries.required = null;\n }\n splitQueries.deferred = splitQueries.deferred.map(nestedSplitQueries => {\n const descriptor = nestedSplitQueries.__refQuery__;\n if (...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Attach a target to this secret
attach(target) { const id = 'Attachment'; const existing = this.node.tryFindChild(id); if (existing) { throw new Error('Secret is already attached to a target.'); } return new SecretTargetAttachment(this, id, { secret: this, target, });...
[ "addTargetAttachment(id, options) {\n return new SecretTargetAttachment(this, id, {\n secret: this,\n ...options,\n });\n }", "_setTarget(target) {\n this.#target = target;\n }", "sendAddTarget(targetId) {\n this.streamHelper.write({\n targetCha...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Populate `_hostNode` on each child of `inst`, assuming that the children match up with the DOM (element) children of `node`. We cache entire levels at once to avoid an n^2 problem where we access the children of a node sequentially and have to walk from the start to our target node every time. Since we update `_rendere...
function precacheChildNodes(inst, node) { if (inst._flags & Flags.hasCachedChildNodes) { return; } var children = inst._renderedChildren; var childNode = node.firstChild; outer: for (var name in children) { if (!children.hasOwnProperty(name)) { continue; } var childInst = children[name];...
[ "function precacheChildNodes(inst, node) {\n if (inst._flags & Flags.hasCachedChildNodes) {\n return;\n }\n var children = inst._renderedChildren;\n var childNode = node.firstChild;\n outer: for (var name in children) {\n if (!children.hasOwnProperty(name)) {\n continue;\n }\n var childInst = ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Here lies the meat and potatoes of the algorithm. `_handleObjectClone` is responsible for creating deep copies of complex objects. Its parameters are the same as for `_isClone`.
function _handleObjectClone(input, mMap, options) { // First we make sure that we aren't dealing with a circular reference. var _selfRef = mMap.get(input); if (_selfRef !== undefined) { return _selfRef; } // We also check up front to make sure that a client-defined custom // procedure has...
[ "function cloneObject(input) {}", "clone(noodle, obj, clone, flatList = [], flatClone = []) {\n cloneCounter++;\n //flatClone.push(clone);\n if (obj == undefined)\n return obj;\n\n if (typeof obj == 'object') {\n //If clone is undefined, make it an empty array or ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
set_css_all extrapolates all vendorspecific css strings.
function set_css_all( str1, str2 ) { return set_css(prefixes.join(str1 + ';') + ( str2 || '' )); }
[ "function setCssAll( str1, str2 ) {\n/* 297 */ return setCss(prefixes.join(str1 + ';') + ( str2 || '' ));\n/* 298 */ }", "function setCssAll( str1, str2 ) {\nreturn setCss(prefixes.join(str1 + ';') + ( str2 || '' ));\n}", "function setCssAll (str1, str2) {\n return setCss(prefixes.join(str1 + '...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
adds the board to the HTML page
addBoard() { boardDiv.appendChild(this.toHTML()); }
[ "function putBoardOnPage(){\n\tconsole.log(\"Putting the board on the page!!!\");\n\tvar boardHTMLString = '<div class=\"theBoard\">' + theBoard + '</div>';\n\t$('#chessBoard').append(boardHTMLString);\n}", "function renderBoard() {\n //log(\"renderBoard\");\n //log(board);\n // var htmlString = \"\";\n ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
if the user hovers over an hour, give specific information about the weather for that hour
handleHourMouseEnter(obj) { var newComponents = []; newComponents.push(<p key={0} className="datestring">{obj.date.toString().substring(0,15) + " " + obj.time12}</p>) newComponents.push(<p key={1} >{obj.weatherDescription.toLowerCase().split(' ').map((s) => s.charAt(0).toUpperCase() + s.substri...
[ "function getHourlyWeather(lat, long, day) {\n var d = new Date();\n var currentHour;\n var ms;\n if(day == \"td\") {\n currentHour = d.getHours();\n d.setHours(0,0,0,0); // Set time to 12:00 AM\n }\n else if(day == \"tm\") {\n d.setTime(d.getTime() + 86400000);\n }\n else {\n console.error(\"In...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Toplevel decoder for any TRS80 file.
function decodeTrs80File(binary, filename) { var _a, _b, _c, _d; let trs80File; const extension = filename === undefined ? "" : getExtension(filename); if (extension === ".JV1") { return (_a = Jv1FloppyDisk_1.decodeJv1FloppyDisk(binary)) !== null && _a !== void 0 ? _a : new RawBinaryFile_1.RawBi...
[ "function decodeTrs80File(binary, filename) {\n var _a, _b, _c, _d;\n let trs80File;\n const extension = filename === undefined ? \"\" : getExtension(filename);\n if (extension === \".JV1\") {\n return (_a = decodeJv1FloppyDisk(binary)) !== null && _a !== void 0 ? _a : new RawBinaryFile_RawBinary...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
reports a list of PR base on the input array of github PR json objects
reportPRList(dataPR) { if (dataPR === undefined) { return ( <div> <h3>Array was undefined</h3> </div> ); } if (dataPR.length === 0) { return ( <div> </div> ); ...
[ "async getPRForRepo(state=\"closed\") {\n try {\n const response = await axios.get(this.getBaseUrl() + `pulls${this.getAuthParameters()}&state=${state}`, headers);\n let data = response.data;\n data = data.map((pr) => {\n return {\"created_at\": pr.created_at,\...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
removeAll :: (a > boolean) > [a] > [a] remove all elements matching a predicate
function removeAll(f, a) { var l = a.length; var b = new Array(l); var j = 0; for (var x, i = 0; i < l; ++i) { x = a[i]; if (!f(x)) { b[j] = x; ++j; } } b.length = j; return b; }
[ "function remove(xs, pred) /* forall<a> (xs : list<a>, pred : (a) -> bool) -> list<a> */ {\n return filter(xs, function(x /* 20433 */ ) { return !(pred(x));});\n}", "function keep(ar, f){\n return ar.map(f).filter(function(x){return !(x === false);});\n}", "RemoveAll(predicate) {\n re...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
support customize accepts function
accepts() { const fn = config.accepts || utils_1.accepts; return fn(this); }
[ "function isValidAcceptOrSetDefaultAccept(accepts){\n if(isBlankNullUndefined(accepts))\n {\n console.info(\"'accepts' parameter undefined/null/blank; using default value '\" + applicationResources.resources.defaultAjaxParameters.accepts + \"' instead.\");\n return applicationResources.resources...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
function to create blocks
function createBlocks(){ for(let j=1; j < 17; j++){ if(j%2==0){ for(let i=1; i < 25; i++){ if(i%2==0){ blockArray.push(new Block((i-1)*50,(j-1)*50,50,50)); } } } } }
[ "createBlock() {\n // TBD\n }", "function createBlocks(){\n\n\tvar i, j; \n\n\tvar x = 50; \n\tvar y = 30; \n\tvar z = 0; \n\n\tfor(i = 0; i < 5; i++){\n\n\t\tx = 50; \n\n\t\tfor(j = 0; j < 5; j++){\n\t\t\tvar tempBlock = new Block(x, y, colors[z]);\n\t\t\tblocks.push(tempBlock); \n\t\t\tx += 85; \n\t\...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Makes a backup of provided sheet. Backup in same spreadsheet
function backupSheet(sheet) { if (_MAX_SHEET_BACKUPS>0) { var name = sheet.getName(); var spreadsheet = sheet.getParent(); spreadsheet.insertSheet(getBackupSheetName(name), 1, {"template" : sheet}); Logger.log("Created backup: " + getBackupSheetName(name)); } removeOldBackups(sheet, _MAX_SHEET_BAC...
[ "function backup() {\n var spreadsheet = SpreadsheetApp.getActiveSpreadsheet();\n var now = new Date();\n var date = getFormattedDate(now);\n var spreadsheetName = spreadsheet.getName();\n var backupSpreadsheet =\n spreadsheet.copy(\"Backup - \" + spreadsheetName + ' - ' + date);\n var spreadsheetUrl = b...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
creates a hash of the virtual path where integers and ranges will collide but everything else is unique.
function getHashFromVirtualPath(virtualPath) { var length = 0; var str = []; for (var i = 0, len = virtualPath.length; i < len; ++i, ++length) { var value = virtualPath[i]; if (typeof value === 'object') { value = value.type; } if (value === Keys.integers || valu...
[ "function generateHashSpace() {\n verticesHashTable = [];\n //hashing_size x hashing_size squares in grid\n for (i = 0; i <= ceil(cWidth / hashing_size) * ceil(cHeight / hashing_size); i++) {\n verticesHashTable.push([]);\n\n }\n}", "hashCode () {\n\n let hsh = -2128831035;\n hsh = Math.imul(16777619...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Draws minor ticks on a Gauge logarithmic scale.
drawGaugeLogarithmicScaleMinorTicks(majorTickValues, majorStep, drawMinor) { const that = this.context; let firstWholePower; if (majorStep instanceof JQX.Utilities.BigNumber) { majorStep = parseFloat(majorStep.toString()); } for (let i in majorTickValues) { ...
[ "drawGaugeLogarithmicScaleMinorTicks(majorTickValues, majorStep, drawMinor) {\n const that = this.context;\n let firstWholePower;\n\n if (majorStep instanceof JQX.Utilities.BigNumber) {\n majorStep = parseFloat(majorStep.toString());\n }\n\n for (let i in majorTickValue...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Returns the list of files which are outside of the current site root
function FileRefList_getOutsideOfSite(theSiteURL) { var file, retList = new Array(); for (var i=0; i < this.list.length; i++) { file = this.list[i].file; if (file.exists() && file.getAbsolutePath().toLowerCase().indexOf(theSiteURL.toLowerCase()) != 0) retList.push(MMNotes.localURLToFilePath(file.getAb...
[ "getOwnFiles() {\n //source scope only inherits files from global, so just return all files. This function mostly exists to assist XmlScope\n return this.getAllFiles();\n }", "getUnreferencedFiles() {\n let result = [];\n for (let filePath in this.files) {\n let file = th...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
this is called after our slider has been resized
onSliderResized() { }
[ "function onSizeChange(){\n\t\t\t\n\t\tplaceSlider();\n\t\t\t\t\n\t}", "onSliderResized() {\n }", "onResizeEnd() {}", "onResize() {\n }", "function handleWindowResize() {\n\t\tdrawSlider();\n\t\tanimateSlider();\n\t}", "onResize () {\n if (this._isDestroyed) return\n\n this.setWidths()\n...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
called by service.getDetails(request, dcallback) which got called when user saves checked links (savlks) . Creates an object of place details that it stringifys and puts in localStorage. Then it calls on displayLinks() to recreate the lkoptions link list on the LinkOptions page
function dcallback(place, status) { if (status == google.maps.places.PlacesServiceStatus.OK) { var pobj = new Object(); pid = 'LINK' + place.id; pobj.place = place.name; pobj.address = place.formatted_address; pobj.phone = place.formatted_phone_number; pobj.url = place.website; if (pobj.url==...
[ "function displayLinks() {\n\tinitiate_geolocation();\n\t$('#lkoptions').empty(); \n\tfor(var i=0, len=localStorage.length; i<len; i++) {\n\t\tconsole.log(i);\n\t var key = localStorage.key(i);\t \n\t if (key.substr(0,4)=='LINK') {\n\t \tvar value = localStorage[key];\n\t \tvar lobj =JSON.parse(val...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
save preload module by target
function savePreloadModule(target) { return saveModule(exports.PRELOAD_MODULE_KEY, target); }
[ "function preload() {}", "save(module) {\n this.stack.push(module);\n }", "function loadtarget(xxx, incfrozen, loadinputs) {\n var xobj = xxxxobj(xxx);\n if (incfrozen === undefined) incfrozen = keysdown.indexOf(\"ctrl\") === -1;\n tryseteleval(\"savename\", xobj.name); // early, so we know wh...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
FUNCTION FOR COMPANY VALIDATION
function companyValidator(req, res, next) { check(''+req.body.backlogsAllowed).isInt; check(''+req.body.minimumCGPA).isInt; check(''+req.body.package).isAlpha; next(); }
[ "function CompanyValidation() { \n var Lo_Obj = [\"ddlCompPrefer\", \"txtCompName\", \"textCompRAddres\", \"txtCompCPIN\", \"txtCompDBE\", \"txtCompPan\", \"textCompPAddress\",\n \"txtCompPPIN\", \"textCompPermanentAddress\", \"txtCompPermanentPPIN\", \"txtCompEmail\", \"txtCompPhone\", \"txtC...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
\ class AnimatorJS(element) takes in an optional element and contains interface for building out an animation using chainable function calls. ended by AnimationJS.render or AnimationJS.start \
function AnimatorJS(element, continuum) { this.Element = element; this.Animation = []; this.current = {}; this.resetNext = !continuum; }
[ "function GlobalAnimatorJS(element) {\n return new AnimatorJS(element);\n }", "function jsAnimObject(c, d, a) {\n\tthis.id = d;\n\tthis.obj = c;\n\tthis.paused = false;\n\tthis.animEntries = new Array();\n\tthis.animLoops = new Array();\n\tthis.current = 0;\n\tthis.manager = a;\n\tthis.step = function()...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
delete the relation from one codemark to the one being deactivated
async deleteRelation (relatedCodemarkId, codemarkId) { const now = Date.now(); const op = { $pull: { relatedCodemarkIds: codemarkId }, $set: { modifiedAt: now } }; const updateOp = await new ModelSaver({ request: this.request, collection: this.data.codemarks, id: relatedCodemarkId...
[ "async deleteCodemarkRelations (codemark) {\n\t\tconst relatedCodemarkIds = codemark.get('relatedCodemarkIds') || [];\n\t\tif (relatedCodemarkIds.length === 0) {\n\t\t\treturn;\n\t\t}\n\t\tthis.transforms.unrelatedCodemarks = [];\n\t\tawait Promise.all(relatedCodemarkIds.map(async relatedCodemarkId => {\n\t\t\t// d...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
App Logic add back disable and hide splash screen.
function appLogic() { $.support.cors = true; $.mobile.allowCrossDomainPages = true; document.addEventListener("backbutton", onBackKeyDown, false); function onBackKeyDown(e) { e.preventDefault(); } setTimeout(function() { navigator.splashscreen.hide(); }, 2000); }
[ "function autoHideSplashScreen() {\n switch (getEnv()) {\n case WL.Env.ANDROID:\n if (initOptions.autoHideSplash) {\n WL.App.hideSplashScreen();\n }\n break;\n \n\t\t\tcase WL.Env.IPHONE:\n case WL.Env.IPAD:\n ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Radio Yes or No [to open or close the next form]
function openForm() { if (document.getElementById('wantAnimalYes').checked) { document.getElementById('ifYes').style.display = 'block'; } }
[ "function leadOk() {\n if (document.getElementById('trfYes').checked) {\n // switch Yes on\n document.getElementById('yesForm').style.display = 'block';\n //document.getElementById('approval-msg').style.display = 'block';\n // switch No off\n document.getElementById('noForm').style.display = 'none';...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
function to convert utc to ist time
function UtcToIst(data) { var dt = new Date(data); return dt; }
[ "utcToLocalTime(utcTime) {\r\n let dateIsoString;\r\n if (typeof utcTime === \"string\") {\r\n dateIsoString = utcTime;\r\n }\r\n else {\r\n dateIsoString = utcTime.toISOString();\r\n }\r\n return this.clone(TimeZone_1, `utctolocaltime('${dateIsoString...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
create textures from the map
function makeTextureMaps(img) { var n = img.width / 16; var textures = []; for (var i=0; i < n; i++) { var texture = new THREE.Texture(img); texture.needsUpdate = true; // arrgh! texture.magFilter = THREE.NearestFilter; texture.minFilter = THREE.N...
[ "function mapPlantTextures() {\r\n plantTextures = {};\r\n\r\n for (let plant in plantDict) {\r\n let texture = PIXI.loader.resources[\"images/\" + plant + \".png\"].texture;\r\n plantTextures[plant] = texture;\r\n }\r\n}", "getTextureMap() {\r\n\r\n const t00 = [0,0];\r\n con...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Write a function acc that takes a function and an initial value and returns a function that runs the initial function on each argument, accumulating the result
function acc(func, initial) { return function (...args) { return args.reduce((result, curr, idx) => { return func(result, curr, idx) }, initial); }; }
[ "function reduce(arr, func, intitial_value){\n accumulator = intitial_value\n for(let i =0; i< arr.length; i++){\n accumulator = func(arr[i], accumulator)\n }\n return accumulator\n}", "function callBack(acc, curr) {\r\n return acc + curr;\r\n}", "function acc(argument) {\n return state => ({\n .....
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
display message in lightbox
function showLightBox(message, message2) { //set the messages document.getElementById("message").innerHTML = message; document.getElementById("message2").innerHTML = message2; //show lightbox changeVisibility("lightbox"); changeVisibility("boundryMessage"); }
[ "function showMessage(msg) {\n\tif(!lightbox_css_added) {\n\t\t$jq(document).find(\"head\").append(\"\\t<link rel=\\\"stylesheet\\\" href=\\\"/css/lightbox.css\\\" />\");\n\t\tlightbox_css_added = true;\n\t}\n\t$jq(document.body).prepend(\"<div class=\\\"lightbox-bg\\\"></div><div class=\\\"lightbox-msg\\\">\"+msg+...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Prints TryStatement, prints block, handlers, and finalizer.
function TryStatement(node, print) { this.keyword("try"); print.plain(node.block); this.space(); // Esprima bug puts the catch clause in a `handlers` array. // see https://code.google.com/p/esprima/issues/detail?id=433 // We run into this from regenerator generated ast. if (node.handlers) { p...
[ "function TryStatement(node, print) {\n this.keyword(\"try\");\n print.plain(node.block);\n this.space();\n\n // Esprima bug puts the catch clause in a `handlers` array.\n // see https://code.google.com/p/esprima/issues/detail?id=433\n // We run into this from regenerator generated ast.\n if (node.handlers) ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
The function pay() is called when the customer clicks on pay button, the function initializes new order of customer and save it in database as waiting for complete payment process then after the order has a unique number, the function requests checkout page, If the result of the response was successfully, the function ...
function pay() { //1. create new customer`s order with unique number, // save this order in database with status wait // ...... your code is here for save order....// //2. request checkout page var dataToPost = { "token": "5BC4B469-1EC0-4222-AF1F-7CE632F29A23", "FcmToken ":"XXXXXXXXXXX...
[ "function proceedPaymentCredit() {\n url = '/order/current/pay/';\n dataToSend = {};\n requestWrapper.post(url, dataToSend).then(function (newStatus) {\n // redirect page\n $window.location.href = '#/client/finalisepayment?credit=true&status='+newStatus;\n });\n ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Define an async test based on a generator function
function asyncTest(generator) { return () => Task.spawn(generator).then(null, ok.bind(null, false)).then(finish); }
[ "testAsync() {\n var test = async( function* () {\n var blah = yield wait(1000);\n log(`waited in between`);\n yield wait(2000);\n log(`finally all done!`);\n });\n\n test();\n }", "function foo() {return __asyncGen(function*(){\n yield yield{__...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Geolocation Part, could be an object as this function bundled several others utility function. Use Google Maps API to geo decode latitude and longitude As well as updating the form with matching address
function geolocation() { if (navigator.geolocation && navigator.onLine) { // Update form's address fieldset with geodecoded location updateFormFunction = function updateFormWithPosition() { // Get form adress fields elements var street_adr1_elm = document.getElementById('street_address1...
[ "function getCoordinatesFromAddress(formFieldIds = ['street', 'city', 'postcode', 'county', 'state', 'country'], formFieldLatLngIds = {'lat': 'latitude', 'lng': 'longitude'}) {\n let address = '';\n const geocoder = new google.maps.Geocoder();\n\n for (let i = 0; i < formFieldIds.length; i++) {\n le...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Render out the active card if one is set, or clear discard pile.
renderDiscardPile() { //this won't always be set if nothing in discard pile. var $pile = $('.deck__card--discard-pile'); if (this.activeCard) { let card = this.activeCard; let altText = card.value.toLowerCase() + ' of ' + card.suit.toLowerCase(); let $cardImg = $('<img>').prop('src', card.images.png).pro...
[ "function drawFromCommunity(){\n\tif(!discardPile)\n\tcardInPlay = discardPile.pop();\n}", "function clear() {\n $card.removeClass(active);\n }", "_renderHandIfChanged() {\n const targetElement = document.querySelector(`.card-dock[data-player-id=\"${this.id}\"]`);\n const frag = document.creat...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
ClearPvTable() / / NAME : GameBoard.CheckUp() Stops the searching in the AI if it exceeds the time limit set. SYNOPSIS : CheckUp() DESCRIPTION Stops the searching in the AI if it exceeds the time limit set. This is done by setting the SearchController.stop to true. RETURNS : NOTHING AUTHOR : Srijan Prasad Joshi DATE : ...
CheckUp() { if ( Date.now() - this.SearchController.start > this.SearchController.time ) { this.SearchController.stop = true } }
[ "ClearPvTable() {\n\t\tlet index\n\n\t\tfor (index = 0; index < PVENTRIES; index++) {\n\t\t\tthis.GameBoard.m_PvTable[index].move = NOMOVE\n\t\t\tthis.GameBoard.m_PvTable[index].poskey = 0\n\t\t}\n\t}", "ClearForSearch() {\n\t\tlet index = 0\n\n\t\tfor (index = 0; index < 14 * BRD_SQ_NUM; ++index) {\n\t\t\tthis.G...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Adds place dropped onto trip card to trip in Firebase
function addPlace(event) { event.preventDefault(); const cardId = event.dataTransfer.getData("text"); const placeId = cardId.split('-title')[0]; const tripName = event.target.getAttribute('data-tripname'); addPlaceToTrip(tripName, placeId); }
[ "onPressNewTrip() {\n const { navigate } = this.props.navigation;\n const { tripname, destination1, destination2, members } = this.state;\n\n\n\n // gets the current user email\n var email = firebase.auth().currentUser.email;\n\n var encod = email.replace(\".\", \",\");\n\n ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
1)When clicked, the hold function reveals the dealers face down card, i.e removes the back card from the board, and replaces it with a random card 2) The dealer continues to be dealt cards until they have a greater total than the players 3) When that happens the dealers hand total and the players hand total are compare...
function hold() { dealerscore.innerHTML = (dealerHand.total); var x = document.getElementsByClassName("coverCard")[0]; x.parentNode.removeChild(x); disableActions(); dealerCards(); newgame.disabled = true; while (dealerHand.total <= playerHand.total) { ...
[ "function onDealCardsClicked(){\n\t\tif(poker._bet > 0){\n\t\t\t$(\"#commandbutton_2\").off(\"click\").addClass(\"disabled\");\n\t\t\t$(\"#commandbutton_3\").off(\"click\").addClass(\"disabled\");\n\t\t\t$(\"#commandbutton_4\").off(\"click\").addClass(\"disabled\");\n\t\t\tcardsFliped = false;\n\t\t\tswitch (draw){...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
get the app configs
function getAppConfigs() { let fs = require('fs'); if (fs.existsSync("./config/env.json")) { return JSON.parse(fs.readFileSync("./config/env.json", 'utf8')); } else { throw "/config/env.json file doesnot exists"; } }
[ "function getEcoConfigs(cb) {\n pm2.connect(err => {\n pm2.list((err, list) => {\n\n // the array to be returned\n let ecoConfigs = [];\n\n // run through the list and get the config for each unique app name\n let appNames = [];\n list.forEach(proc => {\n if (proc...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
set active element from storage
function setActiveElement() { const id = sessionStorage.getItem(ACTIVE_EL_STATE_KEY); if (id) { var item = document.getElementById(id); item.classList.add('active'); // focus element as well so tab // navigation can pick up where it left off if (item.firstElementChild && item.firstElementChild.tagName === '...
[ "static setCurrent(anchor) {\n for (let item of this.items) {\n item.element.classList.remove('active');\n }\n anchor.element.classList.add('active');\n this.currentItemId = anchor.id;\n }", "updateActiveElement() {\n let itemSelected;\n this.tabLinks.forEach((item, index) => {\n ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
pre:position of chest,slot pos:[id,data,count] set chest============set item in chest
function setChest(chest, slot, item, count) { Level.setChestSlot(chest[0], chest[1], chest[2], slot, item[0], item[1], count); }
[ "function setChest(chest, slot, item, count) {\r\n Level.setChestSlot(chest[0], chest[1], chest[2], slot, item[0], item[1], count);\r\n}", "function fillUpChest(pt, item, amount) {\n for (var i = 0; i < 27; i++) {\n Level.setChestSlot(pt[0], pt[1], pt[2], i, item[0], item[1], amount);\n }\n}", "...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Checks if access token and refresh token are present. If they are, and if the access token is expired or is about to expire in the next 10 seconds, calls `this.refresh()` to obtain new access token.
refreshIfNeeded(requestOptions = {}) { const accessToken = this.getState("tokenResponse.access_token"); const refreshToken = this.getState("tokenResponse.refresh_token"); const expiresAt = this.state.expiresAt || 0; if (accessToken && refreshToken && expiresAt - 10 < Date.now() / 1000) { return t...
[ "function validateTokens() {\n let time = Date().toString();\n // if the refresh token is expired, then reset both tokens\n if (compareTimeDifference(details.access_last_update, time, Minutes30)) {\n resetAccessToken();\n }\n}", "function validateTokens() {\n let time = Date().toString();\n ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Installs latest AWS SDK v3
function installLatestSdk(packageName) { console.log('Installing latest AWS SDK v3'); // Both HOME and --prefix are needed here because /tmp is the only writable location (0, child_process_1.execSync)(`HOME=/tmp npm install ${packageName} --omit=dev --no-package-lock --no-save --prefix /tmp`); installed...
[ "function installLatestSdk() {\n console.log('Installing latest AWS SDK v2');\n // Both HOME and --prefix are needed here because /tmp is the only writable location\n (0, child_process_1.execSync)('HOME=/tmp npm install aws-sdk@2 --production --no-package-lock --no-save --prefix /tmp');\n latestSdkInsta...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Function that updates the table that is displayed for the user based on the value of the checked radio
async function updateTable(){ let checked_value = document.getElementById('tableDisplay').value; if (checked_value == "createdPosts"){ displayCreatedPosts(); } else if (checked_value == "likedPosts") { await retrieveLikedPosts(); } else if (checked_value == "dislikedPosts"){ retrieveDislikedPosts(...
[ "function searchButtonFunction(){\n \n //Getting reference to the radio buttons\n searchBySerialNoRadioButton=document.getElementById(\"searchBySerialNoRadioButton\");\n searchByAreaAndDistrictRadioButton=document.getElementById(\"searchByDistrictAndAreaRadioButton\");\n advancedSearchRadioButton=document.getE...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Get an item from local storage, ensure the item is a number Only assign to variable if the item passes the test
function getFromLocalIsNumber(key, variable) { if (!isEmpty(localStorage.getItem(key)) && !isNaN(localStorage.getItem(key))) { variable = localStorage.getItem(key); variable = parseInt(variable); } return variable; }
[ "function getIntItem(key){\r\n var val = 0;\r\n try{\r\n val = parseInt(window.localStorage.getItem(key));\r\n }catch(e){}\r\n if(val == null || val == \"\"){\r\n val = 0;\r\n }\r\n return val;\r\n}", "function getFromLocalGreaterThanZero(key, variable) {\r\n\tif (localStorage.getItem(key) > 0) {\r\n\...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
This runs over eventData in order to normalize all date/time stamps used
function normalizeTime() { eventData.forEach(event => { event.date = (new Date(event.date)).getTime(); }); }
[ "function fixEventArrayTS(eventArray){\n\n\t\tfor(var i in eventArray)\n\t\t{\n\t\t\teventArray[i].timestampms = parseDateToMs(eventArray[i].timestamp);\n\t\t}\n\t\treturn eventArray;\n\t }", "function preProcessData(data) {\n data.forEach(function (d) {\n d.u = new Date(d.u * 1000);\n })...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Called when opacity overlay is clicked. Sets visibility of fullScreenDisplay to hidden. Ditto for opacityOverlay
function dismissFullSize(){ $("#fullScreenDisplay").addClass('hidden'); $("#opacityOverlay").addClass('hidden'); }
[ "function overlayClicked(){\n\t//\tonly proceed if the overlay isn't already fading out\n\tif(!overlayFading){\n\t\t$(\".overlay\").hide();\t\t\t\t//\thide the overlay\n\t\t$(\"#display-window\").hide();\t\t//\thide the display window\n\t\tdisplayOpen = false;\n\t\trestoreDisplayToDefaults();\n\t}\n}", "@action h...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Shows the inputs to add an account after all the other listed subscriptions
function showAddAcc() { $('#addAcc').insertAfter("#newAccList"); $('#addAcc').show(); }
[ "function showSubAccountsAdd() {\n BinSetup().addSubAccount(SpreadsheetApp.getUi());\n}", "function addSubscriptionEntry(subscription)\n{\n var template = document.getElementById(\"subscriptionTemplate\");\n var element = template.cloneNode(true);\n element.removeAttribute(\"id\");\n element._subscription = ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
name: queryDB preconditions: sql contains string sql query values is array of arguments for sql statement mysql is connection to db postconditions: returns Promise. Upon successful execution of sql statement Promise resolves with results, else rejects with error message. description: queryDB is a helper function for qu...
function queryDB(sql, values, mysql) { return new Promise((resolve, reject) => { mysql.pool.query(sql, values, (err, results, fields) => { if (err) { reject(err); } else resolve(results); }); }); }
[ "function executeSql (sql_string, user) {\n\treturn new Promise(function(resolve, reject) {\n \t// perform passed query on database\n \tconnection[user].query(sql_string, function(err, results, fields) {\n \t\tif (err) {\n \t\t\tconsole.log(Date() + \": error in query: \" + err);\n \t\t\treject(err);\n \t\t\t...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
=================================================================== Class to compute Spherical Harmonics Ref. "Spherical Harmonics Lighting: The Gritty Details", Robin Green
function SphericalHarmonics(numBands, numSamples) { this.numBands = numBands; this.numSamplesSqrt = parseInt(math.sqrt(numSamples)); this.numSamples = this.numSamplesSqrt * this.numSamplesSqrt; this.numCoeffs = numBands * numBands; this.samples = []; this.coeffs = []; for (var i = 0; i < this.numCoeffs; +...
[ "function buildSphere() {\n vertices = [];\n normals = [];\n indices = [];\n textureCoords = [];\n\n // The resolution of the sphere. (In vertices)\n vSegs = 32;\n hSegs = 32;\n\n // For each vertex, calculate it's position using a cosine and sin wave.\n for (var i = 0; i <= vSegs; ++i)\n...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Retrieve the user doc from database
function getUserDocWithId(userId) { console.log("Getting user doc from db..."); var userDoc = db .collection("users") .doc(JSON.stringify(userId)) .get() .then((doc) => { console.log("Retrieved user: (" + userId + ") doc from db."); console.log(doc.data()); })...
[ "function current_User_Doc(req,res){\n User.findOne({username:req.session.name}, function(err,foundUser){\n res.send(foundUser);\n });\n}", "listOneDoc(req, res) {\n const user = req.decoded;\n\n Document.findOne({ where: { id: req.params.id } })\n .then((document) => {\n if (!docum...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Launches the recording UI to create a timeline recording.
record_() { this.checkSupport_(); var recorder = this.getRecorder(); launchRecordingUI(recorder); }
[ "function createTimelineFromRecording() {\n timeline.type = 'recorded';\n for (const description of recorded.steps) {\n let step;\n switch (description.step.type) {\n case 'zoom':\n step = new ZoomStep(event_1.findZoomEvent(description.step.sourc...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Returns the transliterated name of the masechta (tractate) of the Daf Yomi. The list of mashechtos is: Berachos, Shabbos, Eruvin, Pesachim, Shekalim, Yoma, Sukkah, Beitzah, Rosh Hashana, Taanis, Megillah, Moed Katan, Chagigah, Yevamos, Kesubos, Nedarim, Nazir, Sotah, Gitin, Kiddushin, Bava Kamma, Bava Metzia, Bava Basr...
getMasechtaTransliterated() { return Daf.masechtosBavliTransliterated[this.masechtaNumber]; }
[ "getMasechta() {\n return Daf.masechtosBavli[this.masechtaNumber];\n }", "function getTeamMascot(abbr) {\n\n\t\tteamMascot = \"\";\n\t\tteams.forEach(function(teamName) {\n\t\t\tif (abbr === teamName.abbr) {\n\t\t\t\tteamMascot = teamName.name;\n\t\t\t}\n });\n \n\t\treturn teamMascot;\n\t...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Decode a quality value
function decodeQuality(value) { assert(typeof value === "string"); return coretypes_1.quality.decode(value).toString(); }
[ "set quality(value) {}", "function encodeQuality(value) {\n assert(typeof value === \"string\");\n return coretypes_1.quality.encode(value).toString(\"hex\").toUpperCase();\n}", "function getQuality()\r\n {\r\n return quality;\r\n }", "function convertQualityToString(quality) {\n swi...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Manages api calls for game screens. Makes Async call to node back end based upon value in currentScreen.
function gameScreen(screenNumber) { if(screenNumber) { currentScreen = screenNumber; } var gameContainer = document.getElementById("gameContainer"); console.log("requesting page: /game/getNewGameScreen/" + currentScreen); // make async call to server to get requested gameScreen html fe...
[ "ws_request_screen() {\n\tthis.ws.send('screen'); // request screen content\n }", "function updateScreen(){\n\tconsole.log(\"update screen\");\n\tObject.keys(state.stops).forEach(function(item){\n\t\tgetDataFromApi(item.substring(2), updateData);\n\t});\n\tdisplayData();\n}", "async getWidgetInfosOfCurrentSc...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Factory for a stream of PouchDB changes.
function changes(db, options) { return xstream_1.default.create(new PouchChangeProducer(db, options)); }
[ "function processNewChange(args) {\n const changeStream = args.changeStream;\n const error = args.error;\n const change = args.change;\n const callback = args.callback;\n const eventEmitter = args.eventEmitter || false;\n\n // If the changeStream is closed, then it should not process a change.\n if (changeSt...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
override the implemented FW_cmd function to allow page reloading when the XMLHttpRequest is finished
function FW_cmd(arg) { var req = new XMLHttpRequest(); req.onreadystatechange=function() { if (req.readyState == 4 && req.status == 200) { window.location.reload(); } }; req.open("GET", arg, true); req.send(null);}
[ "function hookAjax() {\r\n var _send = XMLHttpRequest.prototype.send;\r\n XMLHttpRequest.prototype.send = function(param){\r\n var onready= this.onreadystatechange;\r\n this.onreadystatechange = function(){\r\n if(onready !== null){\r\n onready.c...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Helper that returns an OAuth token.
function getOAuthToken() { return ScriptApp.getOAuthToken(); }
[ "async getOAuthToken() {\n throw Components.Exception(\n \"getOAuthToken not implemented\",\n Cr.NS_ERROR_NOT_IMPLEMENTED\n );\n }", "static getToken(){\r\n\t\tvar accessCode = OfficeAuth.getJsonFromUrl().code;\r\n\t\tvar params = { \r\n\t\t\tgrant_type: \"authorization_code\", \r\n\t\t\tcode: ac...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Returns true if the value is a number 0
function zero (x) { return typeof x === 'number' && x === 0 }
[ "isZero($number) {\n return $number === 0;\n }", "function zero(x) {\n\t return typeof x === 'number' && x === 0;\n\t }", "isZero() {\n return this.value == 0;\n }", "function isZero(number) {\n return number === 0;\n\n }", "isNotZero() {\n if(this.value == 0) {\n ret...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
gets the ranks of each topic by year
function getRelativeRanks(keys) { var tenByYr = [] // each year in topic data $.each(topic_data, function(k, v) { tempArr = []; //each key in the keys array $.each(keys, function(index, value) { tempArr.push({ topic : value, // get the rank as the index of the key in the overall ...
[ "function getStatisticsForYear(dataOfYear, numPubs, numCollabs) {\n\n var matrix = [];\n //pre-fill array with zeros\n for (var i = 0; i < dataOfYear.peoplePerYear.length; i++) {\n matrix[i] = newFilledArray(dataOfYear.peoplePerYear.length, 0);\n }\n names = new Array(dataOfYear.peoplePerYear....
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Submits separate problem trim when submitted from progressNotes trim.
function submitProblemTrim(element) { new Ajax.Request('submitProblem.ajaxcchit', { method: 'get', parameters: "element="+element, onSuccess: function(response){ }, onFailure: function(reponse) { } }); }
[ "function formTrim(form, trim) {\n\n // Loop through form elements.\n for (var i = 0; i < form.elements.length; i++) {\n\n // Loop through the types of elements to trim.\n for (var j = 0; j < trim.length; j++) {\n\n // If the current element type is one of the types to trim, then trim it.\n if (fo...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Make this function return the most expensive item.
function mostExpensive(items) { var current = groceries[0].cost; for(var i = 0; i < groceries.length; i++){ if(groceries[i].cost > current) { current = groceries[i].cost; } } return current; }
[ "function mostExpensive(items) {\n var mostExpensiveItem = items[0];\n for (var i = 1; i < items.length; i++) {\n if (items[i].cost > mostExpensiveItem.cost) {\n mostExpensiveItem = items[i];\n }\n }\n return mostExpensiveItem;\n}", "function mostSpentOnItem(obj){\n let mostExpensiveItem = false...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Gets the download data of featured download items
featuredDownloadFor(productName) { let downloads = this.allAvailableDownloads(); let request_header = {"Content-Type": "application/json"}; let response = request('GET', `${this.baseUrl}/${downloads.get(productName)}?nv=1`, {headers: request_header}); let downloadData = JSON.parse(respon...
[ "getDownloadItems() {\n return axios.get(DOWNLOAD_API_BASE_URL + \"/get\");\n }", "featuredDownloadFor(productName) {\n let downloads = this.allAvailableDownloads();\n let request_header = {\"Content-Type\": \"application/json\"};\n let response = request('GET', `${this.baseUrl}/dow...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Start a tournament battle after selecting a team
function startTournamentBattle(e){ var teams = [ multiSelectors[0].getPokemonList(), multiSelectors[1].getPokemonList() ]; var difficulty = $(".difficulty-select option:selected").val(); if((teams[0].length < partySize)||((teamSelectMethod == "manual")&&(teams[1].length < partySize))){ ...
[ "function startBattle(e){\n\t\t\t\t// Only start if league and cup are selected\n\t\t\t\tvar val = $(\".league-cup-select option:selected\").val();\n\n\t\t\t\tif(val == \"\"){\n\t\t\t\t\tmodalWindow(\"Select League\", $(\"<p>Please select a league or cup.</p>\"));\n\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\n\n\t\t\t\t...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Return a single cargo
function get_single_cargo(id){ console.log("inside get_single_cargo: " + id); const key = datastore.key([CARGO, parseInt(id,10)]); return datastore.get(key).then( result => { var cargo = result[0]; cargo.id = id; //Add id property to ship return cargo; ...
[ "getCargoObj() {\n const cargoType = this.props.contractObj.cargo;\n const cargoIndex = cargoTypes\n .findIndex(cargo => cargo.name === cargoType);\n return cargoTypes[cargoIndex];\n }", "function get_cargo(id) {\n let key = datastore.key([CARGO, parseInt(id, 10)]);\n cons...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
format Addresses for Directions
function formatAddressForMaps(addresses) { //var address = addresses.lat + ',' + addresses.lng + '(' + addresses.name + ', ' + addresses.street + ', ' + addresses.zip + ' ' + addresses.city + ')'; var address = addresses.lat + ',' + addresses.lng; if(addresses.name || addresses.street || addres...
[ "function formatAddress(acc) {\n return T_Address.canonicalize(acc); // TODO: typing\n }", "formatAdress(adress) {\n return `${adress.first_name} ${adress.last_name}<br>${adress.address1}<br>${\n adress.city\n }, ${adress.province}, ${adress.zip}`\n }", "function formatAddress(address) {...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Deletes the order and subtracts the revenue (both locally and to the server)
async function purchaseOrder(index) { if (Number(revenue) > Number(atomOrders[atomLoggedCustomer][index].total)) { const id = getOrderId(index) // *** Fetch -> DELETE order await fetch( `http://my-json-server.typicode.com/AlexAxis/alexis-teamleader-codingtest-ordering/orders/${id}`, ...
[ "function deleteServiceOrder(req, res) {\n serviceOrder.findOneAndUpdate({ _id: req.body.orderId }, { deleted: true }, function (err, estimatedetail) {\n if (err) {\n res.json({ code: Constant.ERROR_CODE, message: err });\n } else {\n res.json({ code: Constant.SUCCESS_CODE, me...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
generate query from object
function obj2query ( obj ) { var list = []; for( var key in obj ) { var k = encodeURIComponent(key); var v = encodeURIComponent(obj[key]); list[list.length] = k+'='+v; } var query = list.join( '&' ); return query; }
[ "function objectToGetQuery( object ){\n let queryString = \"\";\n\n for (const key in object) {\n queryString += key+\"=\"+object[key]+\"&\"; \n }\n \n return queryString.slice(0 , (queryString.length-1));\n}", "function selectQuery(obj){\r\n var selectQueryName= \"SELECT * from studen...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Attempt to log the provided message to the provided logger. If no logger was provided or if the log level does not meet the logger's threshold, then nothing will be logged.
log(logLevel, message) { if (this._logger && this.shouldLog(logLevel)) { this._logger.log(logLevel, message); } }
[ "function log(level, msg) {\n if (!options.logger) { return }\n options.logger[level](msg);\n }", "log(logLevel, message) {\n this._options.log(logLevel, message);\n }", "function log(level, message) {\n if (level <= log_level) {\n console.log(message);\n }\n}", "function log() {\n va...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Bearing given two points
function bearing(lat1, lon1, lat2, lon2) { lat1r = deg2rad(lat1); lon1r = deg2rad(lon1); lat2r = deg2rad(lat2); lon2r = deg2rad(lon2); y = Math.sin(lon2r - lon1r) * Math.cos(lat2r); x = Math.cos(lat1r) * Math.sin(lat2r) - Math.sin(lat1r) * Math.cos(lat2r) * Math.cos(lon2r - lon1r); ...
[ "static getBearing(p1, p2) {\n const deg2rad = (deg) => deg * (Math.PI / 180);\n const rad2deg = (rad) => rad * (180 / Math.PI);\n const y = Math.sin(deg2rad(p2.longitude) - deg2rad(p1.longitude)) * Math.cos(deg2rad(p2.latitude));\n const x = (Math.cos(deg2rad(p1.latitude)) * Math.sin(de...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
looks ahead cnt without changing the internal data "pointers" of the data source (this is mostly needed by LazyStreams, because they do not know by definition their boundaries)
lookAhead(cnt = 1) { var _a; let lookupVal; for (let loop = 1; cnt > 0 && (lookupVal = this.inputDataSource.lookAhead(loop)) != ITERATION_STATUS.EO_STRM; loop++) { let inCache = (_a = this._filterIdx) === null || _a === void 0 ? void 0 : _a[this._unfilteredPos + loop]; if...
[ "peek(idx) {\n if (idx >= 0 && idx < this.size) {\n return this._data[this._currIdx + idx];\n }\n }", "function loadAndAdvance () {\n if (false === hasMoreItems) {\n return;\n }\n return load().then(function (loadedCount) {\n offset += loadedCount;\n ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Given the current step, calculate the appropriate ending x value for a step line.
function get_line_x2(step) { return get_line_x1(step + 1); }
[ "function get_line_x1(step) {\n\treturn 75 + step * 50;\n}", "function get_point_x(step) {\n\treturn 73 + step * 50;\n}", "function calcXInc(){\n\t\treturn Math.sqrt(Math.pow(step_size,2) / (1+Math.pow(slope, 2)));\n\t}", "function get_text_x(step) {\n\treturn 75 + step * 50;\n}", "function lineval(s, e, x)...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Determine whether the given properties match those of a `KafkaClusterClientAuthenticationProperty`
function CfnConnector_KafkaClusterClientAuthenticationPropertyValidator(properties) { if (!cdk.canInspect(properties)) { return cdk.VALIDATION_SUCCESS; } const errors = new cdk.ValidationResults(); if (typeof properties !== 'object') { errors.collect(new cdk.ValidationResult('Expected an...
[ "function CfnPipe_SelfManagedKafkaAccessConfigurationCredentialsPropertyValidator(properties) {\n if (!cdk.canInspect(properties)) {\n return cdk.VALIDATION_SUCCESS;\n }\n const errors = new cdk.ValidationResults();\n if (typeof properties !== 'object') {\n errors.collect(new cdk.Validatio...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
rotate star around x axis
function rotate_x() { curr_sin = Math.sin(map.degree); curr_cos = Math.cos(map.degree); var y = (this.y * curr_cos) + (this.z * (-curr_sin)); this.z = (this.y * curr_sin) + (this.z * (curr_cos)); this.y = y; }
[ "function star(x, y) {\r\n ctx.translate(x + 25, y + 25);\r\n ctx.rotate(Math.PI/16);\r\n ctx.beginPath();\r\n ctx.moveTo(20, 0);\r\n ctx.lineTo(5, 5);\r\n ctx.lineTo(0, 20);\r\n ctx.lineTo(-5, 5);\r\n ctx.lineTo(-20, 0);\r\n ctx.lineTo(-5, -5);\r\n ctx.lineTo(0, -20);\r\n ctx.lineT...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
lookupinvoice 1.0.18 return status of invoice 1.0.19 get sub total
function lookupInvoice(invoiceNo) { var internalID=''; var invoice = null; // Arrays var invoiceSearchFilters = new Array(); var invoiceSearchColumns = new Array(); try { //search filters invoiceSearchFilters[0] = new nlobjSearchFilter('tranid', null, 'is',invoiceNo); ...
[ "function calculateTotal (invoice) { // ①\n return invoice.subtotal -\n invoice.discount +\n invoice.tax\n}", "function subTotal() {\n purchaseAmount += PRICE_PHONE + PRICE_ACCESSORY;\n }", "function calculate_service_invoice_total() {\n\tvar grand_total = 0;\n\tvar subtotal\t= 0;\n\tvar tax_total \t...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Create a QUnit adaptor which inherits methods from the adaptor template (.venus/adaptors/adaptortemplate.js) Creates a new adaptor for QUnit
function Adaptor() {}
[ "function setupTestAdapter() {\n _ember.default.Test.adapter = _emberQunit.QUnitAdapter.create();\n }", "function setupTestAdapter() {\n Ember.Test.adapter = _adapter.default.create();\n }", "function Adaptor() {\n mocha.setup({ ui: 'bdd', ignoreLeaks: true });\n}", "function qunitAdapter(socket) {\n...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
render an insight using red if it's priority 50 or higher
function renderInsightText(insight) { var priorityClass = (insight.p > 50 ? 'highPriority' : 'lowPriority'); return {text:insight.m,sp_class:priorityClass}; }
[ "function getLessIsBetterHighlight( x ) {\r\n if( x <= 0 ) {\r\n return \"secondary\";\r\n }\r\n else if( x < 0.25 ) {\r\n return \"info\";\r\n }\r\n else if( x < 0.5 ) {\r\n return \"warning\";\r\n }\r\n ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
This class defines a complete generic visitor for a parse tree produced by GoobScraperParser.
function GoobScraperVisitor() { antlr4.tree.ParseTreeVisitor.call(this); return this; }
[ "visit(type, iterator) {\n visit(this.ast, type, iterator)\n }", "function ParseTreeTransformer() {}", "visit(node) {\n node.visit(this);\n }", "visit(node, context) {\n if (node instanceof AST) {\n node.visit(this, context);\n }\n else {\n...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
var desiredBT = 0;
function setDesiredBT(newVal) { desiredBT = parseInt(newVal); }
[ "function ABHighBet() {\n ForceBet = 1;\n if (Pl === 0) {\n NewABPlaceBet();\n }\n}", "function ABRandomBet() {\n ForceBet = 4;\n if (Pl === 0) {\n NewABPlaceBet();\n }\n}", "get bendFactor() {}", "function calcStichprobenumfang() {\r\n\r\n\t}", "function findMaxBT(root) {\n ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Update state to launch quiz from socket connection
socketLaunch() { startQuiz((err, quiz) => { this.setState({ quiz }); this.showQuiz(); }); }
[ "function updateState(curState, message) {\n var twProceed, twOffline, alertClass;\n $(document).data('tw-state', curState);\n\n // Add message to page if we need to\n if (message) {\n alertClass = (curState === 'error' ? ' alert-error' : '');\n ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Render function, returns the inputField, the progressCircle, stepcount and button.
render() { const { textStyle } = this.props; const progressColor = this.getProgressColor(); return ( <View style={{ alignItems: "center" }}> <View style={{ marginTop: 25 }} /> <ProgressCircle radius={110} percent={this.getProgressPercent()} borderWidth={1...
[ "function renderStep(){\n\t\tbackButton.removeAttr(\"disabled\");\n\t\tnextButton.val(settings.textNext);\n\n\t\t\tif(previousStep != undefined){\n\t\t\t\tsteps.eq(previousStep).hide()\n\t\t\t\t\t.find(\":input\")\n\t\t\t\t\t.attr(\"disabled\",\"disabled\");\n\t\t\t}\n\n\t\t\tsteps.eq(currentStep)\n\t\t\t.fadeIn()\...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Builds the list of frames from the current document. This method collects all elements with tag "sozi:frame" and retrieves their geometrical and animation attributes. SVG elements that should be hidden during the presentation are hidden. The resulting list is available in frames, sorted by frame indices.
function readFrames() { var soziFrameList, soziLayerList, svgWrapper, svgElementList, svgRoot = document.documentElement, SVG_NS = "http://www.w3.org/2000/svg"; // Collect all group ids of <layer> elements soziLayerList = Array.prototype.slice.call(document.g...
[ "function readFrames() {\n var frameElements = document.getElementsByTagNameNS(SOZI_NS, \"frame\"),\n frameCount = frameElements.length,\n svgElement,\n i,\n newFrame;\n\n for (i = 0; i < frameCount; i += 1) {\n svgElement = document.getElementByI...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
If need save rows to other filer set _newWorkbook to null, its create new file
getNewWorkbook() { if (!this._newWorkbook) { this._newWorkbook = { SheetNames: [], Sheets: {} } } return this._newWorkbook; }
[ "if (product.productType && product.productType !== lastProductType) {\n lastProductType = product.productType\n lastExport = exportByProductType[lastProductType]\n\n // if we haven't started exporting this productType yet\n if (!lastExport) {\n // generate a temp file name\n ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Fetches donations from the Gonator API and updates to UI
function updateGonator() { let xhr = new XMLHttpRequest(); xhr.open("GET", gonator_url); xhr.onreadystatechange = function() { if (xhr.readyState == 4) { var donations = JSON.parse(xhr.responseText); const sum = updateDonations(donations); updateDonationbar(sum); ...
[ "function getDonations(item_categoryID) {\n console.log(\"in function getDonations - by category: \" + item_categoryID)\n $.get(\"/api/donations/\" + item_categoryID, function (data) {\n console.log(\"Donations::: \", data);\n donations = data;\n console.log(donations);\n\n if (!donations ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
gestureStart vets if a start event is legitimate (and not part of a 'ghost click' from iOS/Android) If it is legitimate, we initiate the pointer state and mark the current pointer's type For example, for a touchstart event, mark the current pointer as a 'touch' pointer, so mouse events won't effect it.
function gestureStart(ev) { // If we're already touched down, abort if (pointer) return; var now = +Date.now(); // iOS & old android bug: after a touch event, a click event is sent 350 ms later. // If <400ms have passed, don't allow an ev...
[ "function gestureStart(ev){// If we're already touched down, abort\nif(pointer)return;var now=+Date.now();// iOS & old android bug: after a touch event, a click event is sent 350 ms later.\n// If <400ms have passed, don't allow an event of a different type than the previous event\nif(lastPointer&&!typesMatch(ev,las...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
1. Get all Active leaves with tag = "Untagged"
function GetAllActiveLeaves(){ var LeavesGO = GameObject.FindGameObjectWithTag("Leaves"); LeavesActiveInScene = LeavesGO.GetComponentsInChildren.<Collider2D>(); LeavesActiveInSceneGO = new Array(); for (var a : int = 0; a < LeavesActiveInScene.Length; a++) { if (LeavesActiveInScene[a].g...
[ "allLeafs() {\n return this.allBranches().map((b) => b.leaf).flat().filter((l) => l !== undefined);\n }", "function GetAllActiveLeaves(){ //1. Get all Active leaves -----------------------------------------------------\n\t\t\tvar LeavesGO = GameObject.FindGameObjectWithTag(\"Leaves\"); \n\t\t\tLeavesActiveInS...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Function statswapOK is the callback function for the ajax statSwap call.
function statswapOK(resp) { if (resp.indexOf("<!doctype html>") !== -1) { // User has timed out. window.location = "access-denied.html"; } var msg; if(resp === 'success') { document.location.reload(true); } else if(resp === 'failure') { msg = "The toggle of the game status failed. "; msg +=...
[ "function defaultSyncSuccessHandler(data, status, jqxhr) {\n if (data != null)\n api.state.syncRet = data;\n else if (jqxhr.responseText.length > 0)\n api.state.syncRet = JSON.parse(jqxhr.responseText);\n else\n api.state.syncRet = '';\n api.state.syncSta...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
return name that wopiclient can use as the value of XWOPIRelativeTarget in a future PutRelativeFile operation
function returnValidRelativeTarget(res, filename) { res.setHeader(reqConsts.requestHeaders.ValidRelativeTarget, filename); // set the X-WOPI-ValidRelativeTarget header res.sendStatus(409); // file with that name already exists }
[ "get relativePathName()\n\t{\n\t\treturn true;\n\t}", "function relName(filename, basePath){\n //relative to basePath\n return path.relative(basePath, filename);\n }", "get __generateRequestURL() {\n const {\n folderName,\n name\n } = this.fsProcessor.file;\n\n return String(`$...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Creates a random continuous subset of inputted data Subset length is an inputted parameter equal to the number of years
function createSubset(data, years) { var totalNumWeeks = data.length; var targetNumWeeks = years * 52; var maxIndex = totalNumWeeks - targetNumWeeks; var startIndex = Math.floor(Math.random() * maxIndex); return data.slice(startIndex, startIndex + targetNumWeeks); }
[ "get_random_subset(data) {\n let sub_x = [];\n let sub_y = [];\n \n // No examples\n let size = parseInt(data.no_examples() * this.sample_size);\n \n // Copy examples (examples can appear more than once)\n for (let i = 0; i < size; i++) {\n let inde...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Prints IntersectionTypeAnnotation, prints types.
function IntersectionTypeAnnotation(node, print) { print.join(node.types, { separator: " & " }); }
[ "function IntersectionTypeAnnotation(node, print) {\n print.join(node.types, { separator: \" & \" });\n}", "function UnionTypeAnnotation(node, print) {\n\t print.join(node.types, { separator: \" | \" });\n\t}", "function UnionTypeAnnotation(node, print) {\n print.join(node.types, { separator: \" | \" });\n}"...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Given an absolute path, returns the corresponding tree DOM id.
function idFromPath(path) { return menuId + path.replace( /(\/)/g,"."); }
[ "function parsePathToId(path)\n{\n return parsePathToIdArray(path).join('-');\n}", "function makeId(path) { return ('/' + path.join('/')); }", "function _explorerTreeGetId(element) {\n var e = _explorerTreeGetRoot(element);\n var id = e ? e.getAttribute('id') : '';\n return (!id || id == '') ? 'default' :...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Patterns to identify here: 1. We've got iteration happening. 2. We need to use the values array to figure out the 'score' for each letter. 3. We want to accumulate scores for the whole word into a single variable.
function scrabble(word, values) { var total = 0; // todo: to lower case for (var i = 0; i < word.length; i++) { // Finding the score for each letter. // Only add points if there is a score defined. if (values[word[i]] !== undefined) { total += values[word[i]]; } ...
[ "function wordValue(word) {\n passwordRate = 0;\n for (let i = 0; i < word.length; i++) {\n Object.keys(rating).forEach(rate => {\n letterValue(word[i], rate);\n });\n }\n }", "scoreWord(word) {\n //create letterScore\n const letterScore = {\n ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
register an image listener to be notified when an image is added or deleted from the gallery
function notifyImageListeners(image){ let state = window.history.state; if (image) { updateState(image._id, state.imagePage, state.commentPage, state.currentAuthor); } else { // no image updateState(0, 1, 1, state.currentAuthor); } imageListeners.forEach(...
[ "listenToImageLoad(image) {\n image.addEventListener('load', this.getImageLoadListener());\n }", "function setImageListeners() {\n\t\t// Image Scrollers listeners\n\t\tdocument.getElementById(\"next_image\").addEventListener(\"click\", function(e){\n\t\t\tif (currArrayIndex < currIds.length-1) {\n\t\t\t\tcurr...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Clicks the PrimitiveMenu trigger element.
async clickTrigger() { await (await this.trigger).click(); }
[ "clickTrigger() {\n $(this.triggerElement).click();\n }", "clickMenu() {\n this.clickElem(this.lnkMenu);\n }", "function triggerClick() {\n $('.menu-icon-link').trigger('click');\n checkClass();\n }", "function clickOnMenu() {\n $('.menu-icon-link')....
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }