query
stringlengths
9
34k
document
stringlengths
8
5.39M
negatives
listlengths
19
20
metadata
dict
float MouseDragThreshold; // = 6.0f // Distance threshold before considering we are dragging
get MouseDragThreshold() { return this.native.MouseDragThreshold; }
[ "function mouseDragged(){\n if(dist(mouseX,mouseY,ball.x,ball.y) <= 1.5*ball.r){\n\tball.drag();\n }\n//use the slider control\n if(dist(mouseX,mouseY,slider.x,slider.y) <= 30){\n \tslider.drag();\n slider.control();\n }\n}", "function GetMouseDragDelta(button = 0, lock_threshold = -1.0, out = new ImVec2(...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
++ | ILIAS open source | ++ | Copyright (c) 19982006 ILIAS open source, University of Cologne | | | | This program is free software; you can redistribute it and/or | | modify it under the terms of the GNU General Public License | | as published by the Free Software Foundation; either version 2 | | of the License, or (a...
function ADLObjStatus() { }
[ "get status() {\n this._status = getValue(`cmi.objectives.${this.index}.status`);\n return this._status;\n }", "function ADLSeqUtilities() \r\n{\r\n\tthis.satisfied = new Object();\r\n\tthis.measure = new Object();\r\n\tthis.status = new Object();\r\n\tthis.score_raw = new Object();\r\n\tthis.score_min = ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
8. O functie "invers" care primeste un parametru de tip numar si intoarce inversul acestuia (ca numar) (123 => 321)
function invers(numar) { let inv = 0; let nr = numar; let rest = 0; while (nr != 0) { rest = nr % 10; inv = inv * 10 + rest; nr = (nr - rest) / 10; } return inv; }
[ "dividir(otroNumero){\n //Gracias al test de Carolina\n if(otroNumero.num == 0){\n return new Numero(Infinity);\n }\n //tres.dividir(dos)\n let respuesta = 0;\n for(let resto = this.num;;respuesta++){\n resto -= otroNumero.num;\n if(resto < ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Stop any sound currently playing from the myAudio variable.
stopSound() { if (this.myAudio) this.myAudio.load(); }
[ "function stopAudio() {\n for (var key in audioSrcList) {\n if (audioSrcList.hasOwnProperty(key)) {\n audioSrcList[key][0].pause();\n audioSrcList[key][0].currentTime = 0;\n }\n }\n}", "function stopMusic() {\n music_audio.play();\n}", "stop() {\n this.queueLock = true;\n this.queue = [...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Function to insert HTML into a selector
function insertHtml(selector, html) { var targetElem = document.querySelector(selector); targetElem.innerHTML = html; }
[ "function appendToSelector( selector, pseudo )\n{\n\tvar transform = function ( selectors )\n\t{\n\t\tvar selectorIndex = -1;\n\t\tvar selector;\n\t\t\n\t\twhile ( selector = selectors.nodes[++selectorIndex] )\n\t\t{\n\t\t\tselector.append(\n\t\t\t\tselectorParser.pseudo( {value: pseudo} )\n\t\t\t);\n\t\t}\n\t};\n\...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Function for creating a new list row for patients
function createPatientRow(patientData) { var newTr = $("<tr>"); newTr.data("patient", patientData); newTr.append("<td>" + patientData.name + "</td>"); // newTr.append("<td> " + patientData.Posts.length + "</td>"); newTr.append("<td> " + patientData.Schedules.length + "</td>"); newTr.append("<td>...
[ "function getPatients() {\n $.get(\"/api/patients\", function(data) {\n var rowsToAdd = [];\n for (var i = 0; i < data.length; i++) {\n rowsToAdd.push(createPatientRow(data[i]));\n }\n renderPatientList(rowsToAdd);\n nameInput.val(\"\");\n });\n }", "function createList(data...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
v actual i expected
function vector_description(name, v, i) { describe(name, function() { var e = 1e-10; it("Should equal based on x and y", function() { assert.isOk(v.equals(i)); }); it("Gets x and y", function() { assert.closeTo(v.x(), i.x(), e); assert.closeTo(v.y(...
[ "static mxVMult(v,m) {\r\n\t\tvar res = new mVec3(); \r\n\t\tres.x = (v.x * m.M[0]) + (v.y * m.M[4]) + (v.z * m.M[8]) + m.M[12];\r\n\t\tres.y = (v.x * m.M[1]) + (v.y * m.M[5]) + (v.z * m.M[9]) + m.M[13];\r\n\t\tres.z = (v.x * m.M[2]) + (v.y * m.M[6]) + (v.z * m.M[10]) + m.M[14];\r\n\t\treturn res; \r\n\t}", "func...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
sort output by style definition names / output is by [html][class][id]
function sortcss(sin){ var sout = sin.substring(0,sin.length-1); //strip last -}- and split by -}- var css = new Array(); var c='';var i=0; css[0] = sout.split('}'); //create array of styles css[1]= new Array(); css[2]= new Array(); css[3]= new Array(); for(i=0;i<css[0].length;i++){ c=(css[0][i]).charAt(0); ...
[ "function compress(sin, bs, ic,bsort){\nvar sout= '';\nvar comp = 0;\nvar re;\n sout = sin;\n\n bs=(typeof(bs)=='undefined')?false:bs;\n ic=(typeof(ic)=='undefined')?false:ic; \n bsort=(typeof(bsort)=='undefined')?false:bsort;\n \n // I've not a lot of experience with Regular Expressions,\n // Any for a...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Toggle the approved/rejected state for any reviewable block Expected arguments: id the id of the block which should be toggled context the context that this block belongs to which should be shown refresh whether the details iframe should be reloaded
function toggleApproval(args) { const approved = !$(`.review-button[data-id="${args.id}"]`).hasClass('approved') $(`.review-button[data-id="${args.id}"]`).toggleClass('approved', approved) $(`.review-block[data-id="${args.id}"]`).toggleClass('approved', approved) if (args.context == 'content') { // This se...
[ "function enableEditingOptionViewForStudentID(id) {\n\n // Hide options button\n $(`#${uniqueIDPrefix}options${id} .on-hover-show button`).attr('class', 'edit-content-hidden');\n $(`#${uniqueIDPrefix}options${id} .on-hover-show div.dropdown-content`).attr('class', 'edit-content-hidden');\n\n // Show edi...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
I made a change here to how obects are added to the collections. They are now added with "unshift", in order to put the new objects at the start of the array
add(collection, obj) { this.db .get(collection) .unshift(obj) .last() .value(); }
[ "function unshift(collection, el, key) {\n key = key || 'id';\n let res = [], tmpEl;\n collection.forEach(c => {\n if (c[key] === el[key]) {\n tmpEl = el;\n } else {\n res.push(c);\n }\n });\n if (tmpEl) {\n res.unshift(tmpEl);\n }\n return res;\n}", "function addItemToFront(arr, item...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
sendRecheck Send a request to recheck a list of tlds.
function sendRecheck(KeyWord,tld){ $.ajax({ type: "POST", url: baseUrl + "/api/domains/check?recheck", data: { keyword: KeyWord, tld: tld, _token: $('[name="_token"]').val(), action: 'getStatus' }, timeout: fundamental_vars.requ...
[ "function reloadCheck() {\n var fileName = $('#check_input').data('file_name');\n var checkName = fileName.substr(0, fileName.indexOf(\".\"))\n\n // Test it once with new configuration\n sendMessage(\"checks/run/\" + checkName + \"/once\", \"\", \"post\",\n function(data, status, xhr){\n $(\"#manage_checks\...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Class representing a ExportTx.
constructor(networkid = undefined, blockchainid = buffer_1.Buffer.alloc(32, 16), destinationChain = buffer_1.Buffer.alloc(32, 16), inputs = undefined, exportedOutputs = undefined) { super(networkid, blockchainid); this._typeName = "ExportTx"; this._typeID = constants_1.EVMConstants.EXPORTTX; ...
[ "function toTxResult(pe) {\n return new TransactionResult(pe);\n}", "static transactionWithOutputs(senderWallet,outputs) {\r\n\t\tconst transaction = new this();\r\n\t\ttransaction.outputs.push(...outputs);\r\n\t\tTransaction.signTransaction(transaction,senderWallet);\r\n\t\treturn transaction;\r\n\t}", "fun...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
a delete measurement button was clicked
function deleteMeasurement(event) { if (window.confirm('Are you sure you want to delete the selected measurement?')) { event.stopPropagation(); // determine the measurement to delete var id = $('tbody > tr.rowSelected').attr('id'); var measurementPieces = id.split('_'); var measurementType = measur...
[ "function deleteVassalOnClick(e){\r\n // Remove the element\r\n g_vassals.splice(parseInt(e.currentTarget.parentNode.id.split('vassal_')[1]), 1);\r\n\r\n setVassals();\r\n setVassalTable();\r\n}", "function CtrlDelete() {\n //in case we are in state 1 . we simply delete all filled coupons.\n ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Initializes the print extent layer.
initPrintExtentLayer() { if (!(this.extentLayer instanceof OlLayerVector)) { const extentLayer = new OlLayerVector({ name: BaseMapFishPrintManager.EXTENT_LAYER_NAME, source: new OlSourceVector(), style: new OlStyleStyle({ fill: new OlStyleFill({ color: 'rgba(255, ...
[ "updatePrintExtent() {\n if (this.isInitiated()) {\n const printExtent = this.calculatePrintExtent();\n if (this._extentFeature) {\n this._extentFeature.setGeometry(fromExtent(printExtent));\n }\n }\n }", "function initialiseMgraphics() {\n mgraphics.init();\n mgraphics.relative_coo...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
attrs can have: type field translate translatecontext label helptext modelbase rows // for textarea useformify showlabel params
function aptField_Compile(elem, attrs) { // preserveNgAttrs(elem, attrs); /// return { pre : function (scope, elem, attrs) { preserveNgAttrs(elem, attrs); }, post: ...
[ "_label(label) {\n return `${label}${label && this.required ? '*' : ''}`;\n }", "label(attributeName) {\n const arg = this.args[attributeName];\n return arg ? arg.label : null;\n }", "#syncLabel() {\n let labelElement = typeof this.getLabel === 'function' ? this.getLabel() : null;\n if ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Hier wordt de previousImage variable geset. Eerst wordt er gekeken of er een div naast de div is waar de image in zit(de vorige div). Zo ja wordt de previousImage de image in de previous div. Ander wordt er automatisch gekeken naar de laatste div in de container en wordt de nextImage de image in die div.
function setPreviousImage(image) { if(document.getElementById(image.id).parentNode.previousSibling !== null){ previousImage=document.getElementById(image.id).parentNode.previousSibling.firstChild; } else{ previousImage = document.getElementById('container').lastChild.firstChild; } }
[ "function prevImage(){\n imgIndex--;\n $(\"#main-image\").attr(\"src\", images[imgIndex]);\n}", "function snapDivsBackAndSwapContentPrev() {\r\n galleryContainer.style.left = posOfParent + 'px';\r\n if (currentVisibleImageIndex == galleryImages[0]) {\r\n leftDiv.innerHTML = galleryImage...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
js version on BxBaseFunction::centerContent function sSel jQuery selector of content to be centered sBlockSel jquery selector of blocks
function bx_center_content (sSel, sBlockStyle) { var sId = 'id' + (new Date()).getTime(); $(sSel).wrap('<div id="'+sId+'"></div>'); //$(document).ready(function() { var eCenter = $('#' + sId); var iAll = $('#' + sId + ' ' + sBlockStyle).size(); var iWidthUnit = $(...
[ "function centerContent() {\r\n $('.container').css({\r\n position:'absolute',\r\n left: ($(window).width() - $('.container').outerWidth())/2,\r\n top: ($(window).height() - $('.container').outerHeight())/2\r\n });\r\n }", "function alignElementVerticalyCenter(){\...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
returns milliseconds from h hours, m minutes, s seconds, ms milliseconds
function getTimeInMilliseconds(h, m, s, ms){ return h * 3600000 + m * 60000 + s * 1000 + ms; }
[ "function MillisecondsToCMIDuration(n) {\n\tvar hms = \"\";\n\tvar dtm = new Date();\tdtm.setTime(n);\n\tvar h = \"000\" + Math.floor(n / 3600000);\n\tvar m = \"0\" + dtm.getMinutes();\n\tvar s = \"0\" + dtm.getSeconds();\n\tvar cs = \"0\" + Math.round(dtm.getMilliseconds() / 10);\n\thms = h.substr(h.length-4)+\":\...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
check if the course is already in the course bin
function checkCourseExist(id) { var likeCourses = getLikeCourses(); var takenCourses = getTakenCourses(); var courses = likeCourses.concat(takenCourses); for ( i = 0; i < courses.length; i++) { if (id == courses[i]) { return true; } } return false; }
[ "function courseExists(id) {\n for (i in grades) {\n if (grades[i].courseId == id) {\n return true;\n }\n }\n return false;\n}", "function addCourseArray(key){\n\t\n\tvar courseArray = getCourseArray();\n\t\n\tif(courseArray.includes(key)){ //Check if already registered\n\t\talert(\"You are already ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Returns the currency symbol for a given currency code, or the code if no symbol available (e.g.: format narrow = $, format wide = US$, code = USD) If no locale is provided, it uses the locale "en" by default
function getCurrencySymbol(code, format, locale) { if (locale === void 0) { locale = 'en'; } var currency = getLocaleCurrencies(locale)[code] || CURRENCIES_EN[code] || []; var symbolNarrow = currency[1 /* SymbolNarrow */]; if (format === 'narrow' && typeof symbolNarrow === 'string') { return sym...
[ "static getCurrencyName(code) {\n let currencyName = this.getPhrase(code, \"CurrencyCode\");\n if (currencyName != \"\" && currencyName.length > 0)\n return currencyName;\n else\n return code;\n }", "function getCurrency(amount) {\n\tvar fmtAmount;\n\tvar opts = {Mini...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Internal function that gets called from `defineExtendsPolyfill()`. Because this is a named function it gets called only once if added to 'DOMContentLoaded' multiple times. In SPA sites that use or pages that use the needed function `polyfillCustomElements()` will get called, however if components such as are loaded on ...
function runPolyfill() { polyfillCustomElements(document); }
[ "function BARegisterDOMMethodsRoundRobin() {\n\tif ((typeof Node == 'object' || typeof Node == 'function') && Node.prototype) return;\n\tif (BAAlreadyApplied(arguments.callee)) return;\n\tdocument.getElementsByTagNameBA('*').forEach(BARegisterDOMMethodsTo);\n}", "function patchAddEventListener() {\n if (_a...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Now let's Create a new constructor named Programmer inherit things from Employee Constructor
function Programmer(name,salary,experience,language) { // This will call Employee's Constructor and set name,salary and experience(Reusability) Employee.call(this,name,salary,experience); this.language = language; }
[ "function Programmer (name, title, age, language) {\n\tthis.name = name;\n\tthis.title = title;\n\tthis.age = age;\n\tthis.language = language;\n\tthis.printInfo = function () {\n\t\tconsole.log(\"name: \" + this.name + \"\\ntitle: \" + this.title + \"\\nage: \" + this.age + \"\\nlanguage: \" + this.language);\n\t}...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Sets column alignment for a given column
function setColumnAlign( opts: Options, change: Change, align: string = ALIGN.DEFAULT, at: number ): Change { const { value } = change; const { startBlock } = value; const pos = TablePosition.create(value, startBlock); const { table } = pos; // Figure out column position if (ty...
[ "alignColumn(alignment, options) {\n this._withTable(options, ({ range, lines, table, focus }) => {\n let newFocus = focus;\n // complete\n const completed = formatter.completeTable(table, options);\n if (completed.delimiterInserted && newFocus.row > 0) {\n ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
The `HttpsProxyAgent` implements an HTTP Agent subclass that connects to the specified "HTTP(s) proxy server" in order to proxy HTTPS requests.
function HttpsProxyAgent(opts) { if (!(this instanceof HttpsProxyAgent)) return new HttpsProxyAgent(opts); if ('string' == typeof opts) opts = url.parse(opts); if (!opts) throw new Error( 'an HTTP(S) proxy server `host` and `port` must be specified!' ); debug('creating new HttpsProxyAgent instance...
[ "function createHttpAgent(proxy) {\n if (!proxy) {\n // Attempt to default to the proxy env vars.\n //\n // Note: Envars used are a convention that were based on:\n // - curl: https://curl.haxx.se/docs/manual.html\n // - wget: https://www.gnu.org/software/wget/manual/html_node/...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Setup names for divs
function setDivsForCount(id, name) { name = name.postCount; var dataType = "postcount-user"; $("h6[data-" + dataType + "id='" + id + "']").html(name); $("h5[data-" + dataType + "id='" + id + "']").html(name); $("h4[data-" + dataType + "id='" + id + "']").html(name); $("h3[data-" + dataType + "id...
[ "function initNames(){\n\tvar names = $('#names .aro_box[type=name]');\n\t$.each(names, function(){\n\t\tvar name = this;\n\t\tvar display = $(name).children('.aro_box_display').find('h1');\n\t\tvar type = $(name).children('.aro_box_display').find('input[name=type]').val();\n\t\tvar parts = $(name).children('.aro_b...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Switches the display to the long zonal stats
function viewLongZonalStats(shortElem) { if (shortElem) { enableMainZonalButton(); shortElem.nextElementSibling.classList.add('active'); setGraphsState(shortElem.nextElementSibling.getAttribute('id'), 'graph'); document.getElementById('zonal-header').classList.add('d-none'); shapeNavOff(); Zon...
[ "function buildLongStatsHtml(wrapper) {\n // lint complains otherwise, but due to chaining of functions it's mistaken\n var innerWrapper = wrapper;\n // const region = store.getStateItem('region');\n innerWrapper.innerHTML = ZonalLong; // eslint-disable-line\n var inputData = WMSLayers.filter(function (layer) ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Executes an operation represented by the iterator `iter`, using `handler` to handle the effects.
function exec(iter, handler) { let state = iter.next(); while (!state.done) { let eff = state.value; if (eff instanceof Return) { return eff.value; } let selector = 'handle' + eff._kindName; let result = handler[selector](eff); state = iter.next(result); } }
[ "function applyEach(thing, func) {\n var i;\n if (isArray(thing)) {\n for (i = 0; i < thing.length; i += 1) {\n thing[i] = func(thing[i], i);\n }\n } else {\n var keys = Object.keys(thing);\n for (i = 0; i < keys.length; i += 1) {\n var key = keys[i];\n ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
toLeafletLayer :: (Map, Geometry) > L.ILayer
function toLeafletLayer(self, geometry) { return _private(self).leafletSerializer.serialize(geometry); }
[ "addKmlLayer(layer) {\n const newLayer = this._wrapper.getNativeMap().then(m => {\n return new google.maps.KmlLayer({\n clickable: layer.clickable,\n map: m,\n preserveViewport: layer.preserveViewport,\n screenOverlays: layer.screenOverlays,\n s...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
handle a heart beat message
heartBeatHandler(err,msg) { var jo=msg.body; var sv=simulatorVerticle; if (sv.debugHeartBeat) console.log(JSON.stringify(jo)); sv.heartBeatCount++; if (sv.onHeartBeat && sv.self) { sv.onHeartBeat(sv.self,sv.heartBeatCount); } }
[ "function handleHeartRateNotifications(event) {\n // In Chrome 50+, a DataView is returned instead of an ArrayBuffer.\n let value = event.target.value;\n value = value.buffer ? value : new DataView(value);\n let id = event.target.service.device.id;\n let timestamp = new Date().getTime();\n let flags...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Method to delete multiple Offers
static deleteMultipleOffers(offersArray) { while (offersArray.length > 0) { this.deleteOffer(offersArray.pop()); this.deleteMultipleOffers(offersArray); } }
[ "deleteMultiple() {}", "deleteItemsEventsEtc() {\n let items_buffer = getReferencesOfType('AGItem');\n items_buffer.forEach(function (buffer) {\n deleteItem(buffer);\n });\n let conditions_buffer = getReferencesOfType('AGCondition');\n conditions_buffer.forEach(functi...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Compute constraintApi with fieldConstraintApiWithProxyInput.
get _constraint() { if (!this._constraintApi) { this._constraintApi = new FieldConstraintApiWithProxyInput( () => this ); this._constraintApiProxyInputUpdater = this._constraintApi.setInputAttributes( { type: () => 'number'...
[ "function getDependentOptions (apiKey, objName, ctrlFieldName, depFieldName, namespace) {\n\tsforce.connection.sessionId = apiKey\n if(namespace){\n objName = namespace + objName;\n ctrlFieldName = namespace + ctrlFieldName;\n depFieldName = namespace + depFieldName;\n }\n\n // Isolate...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Custom object for dynamic form building. Holds uer friendly name, size of column and placeholder for the input
function FieldAndSize(userFriendlyName, size, placeholder) { this.userFriendlyName = userFriendlyName; this.size = size; this.placeholder = placeholder; }
[ "function JobWidgetForm() {\n this.search = '';\n this.place = '';\n this.radius = '';\n this.recruiter = '';\n this.nrOfJobs = '';\n this.width = '';\n }", "function getInputFieldsHtml(template_name)\n{\n //variables which change depending on the input type\n var num_input_index=0;\n var st...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Validator for an array of features. Iterates the given features to validate them. After the validation, issues can be printed. features: Array of features cityName: Name of the city the features belong to
function FeaturesValidator(features, cityName) { this.features = features; this.cityName = cityName; this.errorsCount = 0; this.warningsCount = 0; this.featureValidators = []; this.validate = function() { for (var i = 0, length = features.length; i < length; ++i) { var feat...
[ "function FeatureValidator(feature, cityName) {\n\n this.feature = feature;\n this.cityName = cityName;\n this.errors = [];\n this.warnings = [];\n\n this.validate = function() {\n var feature = this.feature;\n if (feature === undefined) {\n this.errors.push(new CustomIssue(\...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
FUNCTION TO GET A RANDOM TILE ID
function getRandomTile(){ return allTiles[ Math.floor( Math.random() * allTiles.length ) ].id; }
[ "function getRandomTileIndex() {\r\n\t\tvar x = mMapNextIndex.x,\r\n\t\t\ty = mMapNextIndex.y,\r\n\t\t\tx_tiles_rem = mWidth - x,\r\n\t\t\ty_tiles_rem = mHeight - y;\r\n\t\t\ttiles = _.filter(cTileTypes, function(tile){\r\n\t\t\t\tvar result = false;\r\n\t\t\t\tif (tile.w_factor <= x_tiles_rem && tile.h_factor <= y...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
that size using asterisks. Example: makeSquare(5)
function makeSquare (size) { var line = '' for (var i1 = 0; i1 < size; i1++){ for (var i = 0; i < size; i++){ line = line + '*' } line = line + '\n' } return line }
[ "function Square() {}", "function Size(width,height){this.width=width;this.height=height;}", "function makeSquares() {\n squareSize = sizeArray[j];\n //squareSize = sizeArray[j];\n for (let x = 0; x < width; x += squareSize) {\n for (let y = 0; y < height; y += squareSize) {\n fill(int(random(200, 25...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Check if this provider can provide triples for the given patter?
hasTriples(subject, predicate, object) { throw new Error('hasTriples has not been implemented'); }
[ "function canHandleTrPxMan() {\n\t\tvar c, s1, s2;\n\t\tc = document.createElement(\"canvas\");\n\t\tc.width = 2;\n\t\tc.height = 1;\n\t\tc = c.getContext('2d');\n\t\tc.fillStyle = \"rgba(10,20,30,0.5)\";\n\t\tc.fillRect(0,0,1,1);\n\t\ts1 = c.getImageData(0,0,1,1);\n\t\tc.putImageData(s1, 1, 0);\n\t\ts2 = c.getImag...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Generate paramaters for conditional orders (stop loss or take profit)
async order_params_conditional(type, params) { params = this.utils.lower_props(params); switch (type) { case 'stoploss' : var [stub, symbol, side, trigger, triggertype, price, reduce, tag] = this.utils.extract_props(params, ['stub', 'symbol', 'side', 'stoptrigger', 'triggertype', 'stoppr...
[ "async add_order_defaults(type, params) {\n if (params.symbol != undefined && params.stub != undefined && params.size == undefined && params.base == undefined && params.quote == undefined && params.usd == undefined && params.scale == undefined) {\n var stub = params.stub;\n var symbol =...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Creates material for normaldepth shader including alternative variants for instancing and with/without cutplanes.
function createDepthMaterial() { // create main/default override material first var depthShader = zvs.NormalsShader; _depthMaterial = zvs.createShaderMaterial(depthShader); _depthMaterial.blending = THREE.NoBlending; _depthMaterial.packedNormals = true; // normally the color target will write to the ...
[ "function ShadowDepthWrapper(baseMaterial, scene, options) {\n var _this = this;\n this._baseMaterial = baseMaterial;\n this._scene = scene;\n this._options = options;\n this._subMeshToEffect = new Map();\n this._subMeshToDepthEffect = new MapMap();\n this._meshes = ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
jsSID by Hermit (Mihaly Horvath) : a javascript SID emulator and player for the Web Audio API (Year 2016) adapted for Cowbell by Gasman 2017
function jsSID (samplerate, background_noise) { this.author='Hermit'; this.sourcecode='http://hermit.sidrip.com'; this.version='0.9.1'; this.year='2016'; //user functions callable from outside this.loadinit = function(sidurl,subt) { loaded=0; initSID(); subtune=subt; //stop playback before loading new tune var ...
[ "function WebGLSound() {}", "function CPU () //the CPU emulation for SID/PRG playback (ToDo: CIA/VIC-IRQ/NMI/RESET vectors, BCD-mode)\n { //'IR' is the instruction-register, naming after the hardware-equivalent\n IR=memory[PC]; cycles=2; storadd=0; //'cycle': ensure smallest 6510 runtime (for implied/register in...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Builds the page meta inputted by the user in Notion format from a parent page
buildPageMeta(parentPage) { const filteredMeta = this._filterProps(parentPage); return this._buildNotionPageMeta(filteredMeta); }
[ "buildPageProperties(parentProperties) {\n const filteredProperties = this._filterProps(parentProperties);\n return this._buildNotionPageProperties(filteredProperties);\n }", "function create_extended_information_page(event, identifier){\n var subpage = $('#extended-information').clone();\n ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Triggered from portal to update Yocto firmware / istanbul ignore next
function OnUpdateFirmware(force, connid) { let RaucHandler = require('./RaucHandler'); let raucHandler = new RaucHandler(); raucHandler.on('progress', function (progressInfo) { log(progressInfo); }); raucHandler.raucGetSlotStatus(function (err, platformStatus) { ...
[ "function applyCocoaPodsModifications(contents) {\n // Ensure installer blocks exist\n let src = addInstallerBlock(contents, 'pre');\n // src = addInstallerBlock(src, \"post\");\n src = addMapboxInstallerBlock(src, 'pre');\n // src = addMapboxInstallerBlock(src, \"post\");\n return src;\n}", "fu...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Bouwt een brug tussen twee dircte buren (Zit geen controle op)
function verbind(a, b){ var verbonden = a.isVerbondenMet(b), verbindingen = ''; if(verbonden){ verbindingen = 'dubbel'; a.nieuweBrug(b, 2); b.nieuweBrug(a, 2); } else { a.nieuweBrug(b, 1); b.nieuweBrug(a, 1); } if(a.pos.x === b.pos.x){ // Geef de steden ...
[ "function makeHollandsBroodje() {\r\n console.log('neem een broodje. Leg er ham op. sluithet broodje')\r\n}", "kiesDeBeurt()\n {\n if (this.spelActief) {\n this.gi.innerHTML = \"Het is de beurt aan: Speler \" + this.actieveSpeler + \" <span class='player\"+this.actieveSpeler+\"'>(\" + this...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Remove file\folder from server.
remove() { // call action to remove file\folder. this.props.remove(); }
[ "_removeFile(req, file, callback) {\r\n let matches;\r\n let pathsplit;\r\n const { filename } = file;\r\n const reqFile = file;\r\n const links = path.join(this.uploadPath, filename);\r\n let paths = [];\r\n\r\n // delete the file properties\r\n delete reqFile.filename;\r\n delete reqFil...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
add output table into the retain tables list
onTableAdd (name) { if (this.tablesRetain.length >= this.tableCount) return // all tables already in the retain list if (!name) { console.warn('Unable to add table into retain list, table name is empty') return } // add into tables retain list if not in the list already let...
[ "onTableRemove (name) {\n if (this.tablesRetain.length <= 0) return // retain tables list already empty\n if (!name) {\n console.warn('Unable to remove table from retain list, table name is empty')\n return\n }\n this.$q.notify({ type: 'info', message: this.$t('Suppress output tabl...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Update Quality of item
updateQuality() { const newQuality = this.getNewQuality(); if (newQuality > 50) return (this.item.quality = 50); if (newQuality < 0) return (this.item.quality = 0); this.item.quality = newQuality; }
[ "getNewQuality() {\n return this.item.quality + 1 * this.getUpdateRatio();\n }", "function updateVideoQuality(value) {\n var item = new Array;\n\n //! Update Video Quality\n item.modified = new Date();\n item.id = 1\n item.quality = value;\n Storage.updateVideoQuality(item);\n strVi...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
return a random value in range [0, upTo)
function random(upTo) { return Math.floor(Math.random() * upTo); }
[ "function randomFromInterval(from,to){return Math.floor(Math.random()*(to-from+1)+from);}", "function randomInt(start, end) {\n return Math.floor(Math.random() * (end-start)) + start;\n}", "function uniformInt(min, max) {\n return min + Math.floor(Math.random() * (max - min + 1));\n }", "function r...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Starting function for multi runner Load numClients clients starting from client i (recursive) Hugues: not sure why Daniel made that function recursive. A loop might be clearer.
function loadClient(i, numClients) { var containingElem = document.createElement("tr"); containingElem.setAttribute("id", "containing-element"); document.getElementById("table").appendChild(containingElem); // Hugues: it is not trivial to get rid of jQuery for the call on "load" here. // So I leav...
[ "function initClient(i) {\n //Only allows next client to be initialised\n //(i.e. if i clients exist, then client i+1 must be initialised next)\n if (i != clients.length) {\n throw \"Attempted to initialise client \" + i + \" when only \" + clients.length + \" exist.\";\n }\n clients.push(new graphicsfuzzse...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
returns the smallest difference (value ranging between directions/2 to + directions/2). between two angles (where 0 <= angle < directions)
function angleDiff(angle1, angle2, directions) { if (angle1 >= directions / 2) { angle1 = angle1 - directions; } if (angle2 >= directions / 2) { angle2 = angle2 - directions; } var diff = angle2 - angle1; if (diff < -directions / 2) { diff += directions; } if (d...
[ "subtractAngles (rad1, rad2) {\n const PI = Math.PI\n let dr = rad1 - rad2\n if (dr <= -PI) dr += 2 * PI\n if (dr > PI) dr -= 2 * PI\n return dr\n }", "function calcAngle(a, b) {\n return Math.atan2(b[1] - a[1], b[0] - a[0]) * 180 / Math.PI;\n}", "function findAngle(object, unit, directions) ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
basic vector subtraction of vectors a and b a b = returned vector
function subtractVectors(a, b) { return [a[0] - b[0], a[1] - b[1], a[2] - b[2]]; }
[ "static vSub(a,b) { return newVec(a.x-b.x,a.y-b.y,a.z-b.z); }", "function subVectors(vec1, vec2) {\n return new Vector(vec1.x - vec2.x, vec1.y - vec2.y);\n}", "static mxSub(a,b) { \r\n\t\tvar res = new mx4(); \t\t\r\n\t\tfor (var i=0; i<16; ++i) { res.M[i] = a.M[i] - b.M[i]; }\r\n\t\treturn res; \r\n\t}", "s...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
program logic This function recursively calls itself to spawn up to [max_children] worker processes unlike the generate function below, which uses the async module's queue functionality to process a large amount of parallel workers. These workers then download the image from the URLs passed, up to six at a time per pro...
function download(images, callback) { if (children < max_children) { var options = []; if (images.length == 0) { if (children == 0) { callback(); } } else { var left = images.splice(0, 6); options = [__dirname + '/slave.js', __dirname + '/images/f']; o...
[ "autoFetch() {\n while (this.processes.length > 0) {\n\n // Remove url from 'process' array\n const xmUrl = this.processes.pop();\n log.log(`Queuing ${xmUrl}`);\n \n this.counter = this.counter + 1;\n\n // Push the url to 'processCompleted'\n ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Send log message with info severity.
info() { return this._send(format.apply(this, arguments), SysLogger.Severity.info); }
[ "log(_a) {\n var { severity, message } = _a,\n data = __rest(_a, ['severity', 'message']);\n if (!severity) severity = 'INFO';\n this.write(Object.assign({ message }, data), 'INFO');\n }", "info(entry) {\n this.write(entry, 'INFO');\n }", "log() {\n return this._send(format.apply(this, arg...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Subs_.getSubscriptionLeft() Private Functions Check that the Subs object has been initialised
function checkInitialised() { ns.log.functionEntryPoint() if (ns.properties === null || ns.log === null || ns.trialLength === null || ns.fullLength === null) { throw new Error('The Subs object has not been initialised, call Subs.get() first') } ...
[ "isSubscribed(topic) {\n return this.getSubscriptions()\n .then(subscriptions => {\n return subscriptions.indexOf(topic) >= 0;\n });\n }", "handleSubClick_() {\n const {userProfile: {signedIn}} = getStore();\n\n if (this.subIconWrapper_.getAttribute(\"type\") === \"subscribe\") {\n ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Functions to filter by time and distance
function filterByDistance() { //filter by Distance will only show "pins" within 1 mile of users location }
[ "function getTimesFromFilter(filterParams, data) {\n\tlet openSlide = 0;\n\tlet closeSlide = 0;\n\tlet enabled = false;\n\tlet restaurantData = [];\n\tfor (let key in filterParams) {\n\t\tif (key == \"timesEnable\") enabled = true;\n\n\t\tif (key == \"slider-time\" && enabled) {\n\t\t\tlet split = filterParams[key]...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Rewrites properties of given names to fire changed events when property is set. this implementation currently loses any custom getters/setters on an object, so only "this.propertyName = null" declarations work.
makeObservable(propertyNames) { var that = this; for (var propertyName of propertyNames) { // wrap into anonymous function to get correct closure behavior (function(pn) { const fieldName = "_" + pn; that[fieldName] = that[pn]; // ensure initial val...
[ "function updatePropertyInternal(conn, targets, propertyName, value) {\n\tvar me = controller.findActivePlayerByConnection(conn);\n\n\tif (!Array.isArray(targets)) \n\t\ttargets = [targets];\n\n\tvar ftargets = targets.filter(function(obj) {\n\t\treturn obj.ownerId === me.id;\n\t});\n\n\tif (ftargets.length === 0) ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Called when the add button is pressed, generates a new task cell and updates its id (index in task array)
function addTask() { //idNum starts at 0 idNum = Task.ALLTASKS.length //id is how many tasks there are total, including deleted //a task element's id is also its index in the Task.ALLTASKS array, for easy *findage* task = new Task("No Name"); var table = document.getElementById("table"); var ro...
[ "function generateTaskListElements() {\n // getData();//For getting data\n var tabpr = document.getElementById('pr');//accessing parent table\n var newrw = document.createElement(\"tr\");//creating a new row\n var idrw = \"id\";\n var idname = \"fit\" + x;\n newrw.setAttribute(idrw, idname);//Id a...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Pans the map back to the City Hall location, in case they lose track of where they are.
function panToCityHall(){ // let startPoint = new google.maps.LatLng(43.044240, -87.906446); map.panTo(new google.maps.LatLng(43.044240, -87.906446)); }
[ "function moveWest() {\n currentLonPoint -= 0.00050\n console.log(currentLonPoint)\n map.setView([currentLatPoint, currentLonPoint], 18)\n\n }", "function updatePlacesLocationInformation() {\n\tupdatePlacesLocationInformationFromCategory(\"\", \"All Categories\");\n}", "function moveEast...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Set the current value of a name, and optionally set it globally too. Local set() sets the current value and (when appropriate) adds an undo operation to the undo stack. Global set() may change the undo operation at every level, so takes time linear in their number.
set(name, value, global) { if (global === void 0) { global = false; } if (global) { // Global set is equivalent to setting in all groups. Simulate this // by destroying any undos currently scheduled for this name, // and adding an undo with the *new* val...
[ "setVariable (index, isGlobal, tee) {\n if (isGlobal) {\n if (tee) {\n this\n .op(\"set_global\").varuint(index, \"global_index\")\n .op(\"get_global\").varuint(index, \"global_index\");\n } else {\n this.op(\"set_global\").varuint(index, \"global_index\");\n }\n ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Evaluates whether the previous reading is not blank and current reading = previous reading
static evalIsPreviousReadingNotEmptyAndReadingEqualsPrevious(context, dict) { if (!libThis.evalIsPreviousReadingEmpty(dict)) { return libThis.evalPreviousReadingEqualsReading(context, dict); } else { return false; } }
[ "static evalIsPreviousReadingEmpty(dict) {\n return libVal.evalIsEmpty(dict.PrevReadingValue);\n }", "static evalPreviousReadingEqualsReading(context, dict) {\n return (libLocal.toNumber(context, dict.PrevReadingValue) === libLocal.toNumber(context, dict.ReadingSim));\n }", "static evalReadi...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Bring back changes from Order Review
function return_from_review_order() { //Hide the order review screen $("#next_profile_div").hide(); recalculate_selected_suppliers(); //TBI //update back array - TBD }
[ "handleReviewOrder(){\n this.props.orderStore.deliveryInfo = this.props.orderStore.currentOrder.deliveredPrices[this.state.mailingOptions];\n browserHistory.replace(\"/revieworder\");\n }", "undoCheckout() {\n return spPost(File(this, \"undoCheckout\"));\n }", "revertAll() {\n this._pend...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Return the amount of private working memory required by the generated encryptor/decryptor.
function m_private_memory_size() { return 4224; // This is specific to descrypt8m }
[ "computeNodeBytes() {\n return sizeof(this.value) + 160;\n }", "availableBytes() {\n return this.buffer.byteLength - this.currPtr;\n }", "function getSimulationSize() {\n return Math.floor(MAX_SIZE / sizePerElection);\n } // getSimulationSize", "function checkMemory() {\n const used = pr...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
fatch all center from firebase
function centerData() { var CENTERS_KEY="centers" var firestore=firebaseConnection(); const allCentres = firestore.query(CENTERS_KEY).execute(); //Logger.log(allCentres); return allCentres; }
[ "function readState(state){\n var centers;\n var ref = firebase.database().ref(state);\n ref.on('value', (data) => {\n centers = data.val();\n document.getElementById(\"result\").innerHTML =\"<br>\"+centers.toUpperCase();\n })\n}", "function centro(){\n for(var i=1;i<6;i++){\n ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Returns the stored play matrix value at (row,col) position
getLocalPlayMatrixValue(row, col){ return this.state.playMatrix[row][col]; }
[ "function GetInputValue(inputV , row , col) {\r\n mat [row] [col] = parseInt(inputV); \r\n}", "function row(matrix, i) {\n return matrix[i]\n}", "function getMouseRowCol(m) {\n m.col = Math.floor(m.x / game.cell_size_px);\n m.row = Math.floor(m.y / game.cell_size_px);\n\n return m;\n}", "get(po...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Sends a "install notice" to the Passmarked servers, which is also a welcome page for new users.
function installNotice() { // check if not already set ... chrome.storage.sync.get(CONSTANTS.INSTALL_KEY, function(result) { // and .. ? if(!result.install) { // get current timestamp var now = new Date().getTime(); // params to save params = {}; // set our initial items para...
[ "function onInstall(currentVersion) {\n var installURL = '%installUrl%';\n if ( installURL !== '' ) {\n setTimeout(function() { chrome.tabs.create({ url: installURL }); }, 500 );\n }\n}", "function welcomeUser(user) {\n user.notify('Welcome ' + user.getName() + '!');\n}", "setNewInstall() {\n this._...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
used to find collision between rotating rectangle and circle Credit: Explanation:
collideCircleWithRotatedRectangle(circle, rect) { var rectCenterX = rect.x; var rectCenterY = rect.y; var rectX = rectCenterX - rect.width / 2; var rectY = rectCenterY - rect.height / 2; var rectReferenceX = rectX; var rectReferenceY = rectY; // Rotate circle's center point back var unrotate...
[ "function collision2D(mode, alpha, R, m1, m2, r1, r2, x1, y1, x2, y2, vx1, vy1, vx2, vy2, error) {\n\n let r12,m21,d,gammav,gammaxy,dgamma,dr,dc,sqs,t,dvx2,a,x21,y21,vx21,vy21,pi2,vx_cm,vy_cm;\n\n // ***initialize some variables ****\n pi2=2*acos(-1.0);\n error=0;\n r12=r1+r2;\n m21=m2/m1;\n ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
creates and returns an array of pokemon type JSX elements for a pokemon
getTypes(pokemon) { let types = []; for(let i = 0; i < pokemon.types.length; i++) { const type = pokemon.types[i].type.name; types.push( <span className={"b-outline type type-" + type} key={type} > ...
[ "renderPokedex() {\n let pokemonList = [];\n if (this.state.pokemon.results) {\n this.state.pokemon.results.forEach(\n pokemon => pokemonList.push(\n <Pokemon\n url={pokemon.url}\n key={pokemon.name}\n ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Makes sure the given string does not contain characters that can't be used as Firebase Realtime Database keys such as '.' and replaces them by ''.
function makeKeyFirebaseCompatible(key) { return key.replace(/\./g, '*'); }
[ "function keyify(str) {\r\n str = str.replace(/[^a-zA-Z0-9_ -]/g, '');\r\n str = trim(str);\r\n str = str.replace(/\\s/g, '_');\r\n return str.toLowerCase();\r\n}", "function _sanitize(value) {\n\t\t\treturn (\"\" + value).replace(/[^a-zA-Z0-9_]/g, \"\").replace(/^_+/, \"\");\n\t\t}", "function _getMongoDbN...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Opens the information window for this marker
openInfoWindow() { myMap.closeTempInfoWindow(); PermMarker.permInfoWindow.open(this); }
[ "function openMarkers(){\n infoWindow.setContent(info);\n animation();\n infoWindow.open(map,marker)\n }", "function showInfoWindow() {\n var marker = this;\n hotels.getDetails({placeId: marker.placeResult.place_id}, function(place, status) {\n if (status !== google.maps.pla...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Remote client posts flash media in room.
function pmRmMsgFlash (message) { var client_id = message[0]; var room_id = message[1]; var url = message[2]; var comment = message[3]; var x = userFind(client_id); if (x < 0) { printPlus("text_div", '<span class="cln_err">RM_MSG_FLASH from '+client_id+'</span>'); return ...
[ "function transferPlayback(device_id) {\n pausePlayback();\n $.ajax({\n url: \"https://api.spotify.com/v1/me/player\",\n type: \"PUT\",\n data: '{\"device_ids\": [\"' + device_id + '\"], \"play\": false}',\n beforeSend: function(xhr){xhr.setRequestHeader('Authorization', 'Bearer ' + access_token );},\n ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
dynamicOptions(curSelected): This function dynamically show the user an updated group of options based on their previous preferences (used in functionality selections) curSelected previous preference based on user's previous selection curSection show which section is the user adjusting (left,right,middle)
function dynamicOptions(curSelected, curSection, SDchoice) { modifyCurrentSelected(curSelected, curSection); // function has to consider three of the displayed options independently. modifyList(curSelected, curSection); // ShapeDiver API call for respective section functionality var curSection_SDFormat = curSec...
[ "function modifyCurrentSelected(curSelected, curSection) {\n\n var topCurrentDisplay = document.getElementById(curSection.concat(\"1\")).getElementsByClassName('select-box-top__input');\n var middleCurrentDisplay = document.getElementById(curSection.concat(\"2\")).getElementsByClassName('select-box-middle__input'...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Function for the vampireRoom state
function vampireRoom() { // CHANGE STATE VARIABLE TO vampireRoom! States.currentState = 'vampireRoom'; // Do vampire room stuff c("There's a vampire in this room! She's extra friendly and has geeky glasses. You think she is cute."); }
[ "static updateRoomStatus(room) {\n if (!room) {\n return;\n }\n if (!Memory.Traveler) {\n Memory.Traveler = {}\n Memory.Traveler.rooms = {}\n }\n if (!Memory.Traveler.rooms[room.name])\n Memory.Traveler.rooms[room.name] = {};\n if...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Finishes the dialog close by updating the state of the dialog and disposing the overlay.
_finishDialogClose() { this._state = 2 /* CLOSED */; this._overlayRef.dispose(); }
[ "@action closeDialog() {\r\n\t\tif (this.dialog) this.dialog.opened = false;\r\n\t}", "close() {\n this.showModal = false;\n\n this.onClose();\n }", "function disposeOverlay(overlay){\n\t\t\tif(overlay){\n\t\t\t\toverlay.setVisible(false);\n\t\t\t\toverlay.dispose();\n\t\t\t}\n\t\t}...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Process move to step result. If moveToStepResult is positive, then execute successfullyMovedCallback
processMoveToStepResult(moveToStepResult, successfullyMovedCallback) { if (moveToStepResult === true) { successfullyMovedCallback(); } if (moveToStepResult && typeof moveToStepResult.then === 'function') { this.isLoading = true; moveToStepResult.then((result = {}) => { const { finish...
[ "moveCompleted() {\n // Housekeeping\n this.from = null;\n // Check if the game is actually over!\n let moves = this.getMoves();\n if (moves.length === 0) {\n if (this.game.in_check()) {\n // CHECKMATE\n this.showResult(true, this.getTurn(false));\n }\n else {\n //...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Create a direction line to where the user needs to go from their current location what it needs is the end location (location) and what travel mode (mode)
function showDirection(location, mode){ //If there is already a direction line on the map then remove it if(directionDisplay){ directionDisplay.setMap(null); } //Create a new instance of DirectionsService var directionService = new google.maps.DirectionsService(); //Create a new instance of DirectionRendere //...
[ "function showDirectionLineAndDetails(originCoordinates, destinationCoordinates, originName, destName, mode, name) {\n\n\tvar directionQuery = generateDirectionQuery(mode, \n\t\t\t\t\t\toriginCoordinates[0], originCoordinates[1],\n\t\t\t\t\t\tdestinationCoordinates[0], destinationCoordinates[1]);\n\t\n\tvar layerNa...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Generate the shadow object.
generateShadowObject(contextType, attrs) { let shadow = new Group(this, 'group', contextType, attrs); let queue = get(this, '_shadowRegistrationQueue'); set(this, '_shadowRegistrationQueue', []); set(this, 'shadow', shadow); queue.forEach(childShadow => { shadow.add(childShadow); }); }
[ "function ShadowGenerator(mapSize,light,useFullFloatFirst){this._bias=0.00005;this._normalBias=0;this._blurBoxOffset=1;this._blurScale=2;this._blurKernel=1;this._useKernelBlur=false;this._filter=ShadowGenerator.FILTER_NONE;this._filteringQuality=ShadowGenerator.QUALITY_HIGH;this._contactHardeningLightSizeUVRatio=0....
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Send the file given by path to the server using the appropriate putter.
function send(path, node) { info("sendingPath", {path, node}) // Find a putter for the file type. const putterFunction = putterMap.get(classify(path)) // There should always be a putter but make sure. if (putterFunction) { return putterFunction(path) } else { warn("fileIsNotRecognized", {name: pa...
[ "function sendFile (channel, filenames, msg) {\n\tmsg = msg || \"\"\n\tconst options = {\n\t\tfiles: filenames\n\t}\n\n\tchannel.send(msg, options)\n}", "function sendFile() {\r\n $(\"#alert\")\r\n .text(\"Enviando arquivo!\")\r\n .attr(\"class\", \"btn btn-light float-right\");\r\n const file = event.tar...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Construct a sfen text from ban[] and set it to text box
function constructText(ban) { var num = 0; var text = ''; for(var iy=0; iy<nrow; iy++) { for(var ix=0; ix<nrow; ix++) { var index = nrow*iy + ix; if(ban[index]) { if(num > 0) { text += num; num = 0; } text += ban[index]; } else { num+...
[ "function constructBan(sfen) {\n const n = sfen.length;\n\n // Pices on board\n var i;\n var ix = 0;\n var iy = 0;\n var iban = 0;\n\n for(var i = 0; i <nrow*nrow; i++)\n editor.ban[i] = '';\n\n for (i = 0; i < n; i++) {\n p = sfen.charAt(i);\n\n if (p === '+') {\n p = sfen.substring(i, i + 2)...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Get the part of the token after the first nonvowel following a vowel
function getR1(token) { var match = token.match(/[aeiouyæåø]{1}[^aeiouyæåø]([A-Za-z0-9_æøåÆØÅäÄöÖüÜ]+)/); if (match) { var preR1Length = match.index + 2; if (preR1Length < 3 && preR1Length > 0) { return token.slice(3); } else if (preR1Length >= 3) { return match...
[ "function step5a(token) {\n\tvar m = measure(token);\n\n\tif(token.length > 3 && ((m > 1 && token.substr(-1) == 'e') || (m == 1 && !(categorizeChars(token).substr(-4, 3) == 'CVC' && token.match(/[^wxy].$/)))))\n\t\treturn token.replace(/e$/, '');\n\n\treturn token;\n}", "function step1a(token) {\n\tif(token.match...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Check Meeting Specific Card News & video Tab Content Date
waitFor_raceMeetingNewsVideo_ContentDate() { if(!this.raceMeetingNewsVideo_ContentDate.isVisible()){ this.raceMeetingNewsVideo_ContentDate.waitForVisible(5000); } }
[ "get raceMeetingNewsVideo_ContentDate() {return browser.element(\"//android.view.ViewGroup[3]/android.widget.ScrollView/android.view.ViewGroup/android.view.ViewGroup[1]/android.view.ViewGroup/android.widget.TextView[2]\");}", "function checkCalendarwidget() {\r\n\r\n\r\n var inlineCalendarViewElement=docum...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Returns the three.js intrinsic Euler order corresponding to FBX extrinsic Euler order ref:
function getEulerOrder( order ) { order = order || 0; var enums = [ 'ZYX', // -> XYZ extrinsic 'YZX', // -> XZY extrinsic 'XZY', // -> YZX extrinsic 'ZXY', // -> YXZ extrinsic 'YXZ', // -> ZXY extrinsic 'XYZ', // -> ZYX extrinsic //'SphericXYZ', // not possible to support ]; if ( order =...
[ "function getEulerOrder( order ) {\n\n\t\tvar enums = [\n\t\t\t'ZYX', // -> XYZ extrinsic\n\t\t\t'YZX', // -> XZY extrinsic\n\t\t\t'XZY', // -> YZX extrinsic\n\t\t\t'ZXY', // -> YXZ extrinsic\n\t\t\t'YXZ', // -> ZXY extrinsic\n\t\t\t'XYZ', // -> ZYX extrinsic\n\t\t//'SphericXYZ', // not possible to support\n\t\t];\...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Add new polygon region to the manager.
addPolygonRegion(id, regionData, tagsDescriptor) { this.menu.hide(); const region = new PolygonRegion_1.PolygonRegion(this.paper, this.paperRect, regionData, this.callbacks, id, tagsDescriptor, this.tagsUpdateOptions); this.registerRegion(region); }
[ "function editRegionWithPolygon(polygon) {\n \n var regionToEdit;\n for (var i = 0; i < regionList.length; i++) {\n if (regionList[i].polygon === polygon) {\n regionToEdit = regionList[i];\n break;\n }\n }\n \n if (regionToEdit == null) {\n alert(\"There ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
fetchTempSensor connects to the local API to fetch all of the devices and filter for just one temperature sensor
async function fetchTempSensor() { const tempSensorResp = await fetch("/api/v1/device") const devices = await tempSensorResp.json(); const tempDeviceIdentifier = 216; const tempSensors = Object.values(devices) .filter((dev) => dev.deviceIdentifier === tempDeviceIdentifier); // Just use the...
[ "function readTemp() {\r\n\tvar temperature;\r\n\tsensor.read(2, function(err, res) {\r\n\t\tif(err) {\r\n\t\t\tconsole.log(\"readTemp: err: \" + err);\r\n\t\t}\r\n\t\t// console.log(\"readTemp: \" + res);\r\n\t\ttemperature = ((((res[0]<<8) + res[1]) * 175.72) / 65536) - 46.85;\r\n\t\tconsole.log(\"temperature: \"...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
buildIncrementalRoleLinks provides incremental build the role inheritance relations.
buildIncrementalRoleLinks(rm, op, sec, ptype, rules) { var _a, _b; return __awaiter(this, void 0, void 0, function* () { if (sec === 'g') { yield ((_b = (_a = this.model .get(sec)) === null || _a === void 0 ? void 0 : _a.get(ptype)) === null || _b === void...
[ "buildRoleLinks(rm) {\n return __awaiter(this, void 0, void 0, function* () {\n const astMap = this.model.get('g');\n if (!astMap) {\n return;\n }\n for (const value of astMap.values()) {\n yield value.buildRoleLinks(rm);\n ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Load instances of `Quote` instead of rendering a `div`, and make sure to pass the correct props: a quote object and the `likeQuote` method
render() { return ( <div> {this.state.quotes.map(q => { return <Qoute key={q.id} quote={q} likeQuote={this.likeQuote} /> })} </div> ) }
[ "loadQuotes() {\n const quotes = this._quotes ? this._quotes : [];\n\n for (const [id, quote] of Object.entries(QUOTES)) {\n const audioTag = this.pageElements.audio[0],\n newQuote = new Quote({ ...quote, id, audioTag });\n\n quotes[id] = newQuote;\n }\n\n ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Update Y Axis Plot
function updateYPlot() { y.domain([0,globalymax]) yAxis.transition().duration(1000).call(d3.axisLeft(y)) }
[ "function update_y_axis(y) {\n var new_y_offset = Math.abs(y - data[0]) * (1 + graph_buffer);\n if(new_y_offset > y_axis_offset) {\n y_axis_offset = new_y_offset;\n var y_axis_min = data[0] - y_axis_offset;\n var y_axis_max = data[0] + y_axis_offset;\n chart.yAxis[0].setExtremes(y_...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Exit a parse tree produced by Java9ParserambiguousName.
exitAmbiguousName(ctx) { }
[ "exitMultiVariableDeclaration(ctx) {\n\t}", "exitSimpleIdentifier(ctx) {\n\t}", "endGroup() {\n if (this.undefStack.length === 0) {\n throw new ParseError(\"Unbalanced namespace destruction: attempt \" + \"to pop global namespace; please report this as a bug\");\n }\n\n const undef...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Useful for hooking the WWA scheduler's APIs which are on the MSApp object. When the WWA scheduler is enabled, calls fn and returns. Otherwise, provides the below semantics for hooking MSApp. This only affects the scheduler's private version of the MSApp object. Parameters: hooks: an object mapping MSApp function names ...
function withMSAppHooks(hooks, fn, options) { options = options || {}; var forceHooksInWwa = options.forceHooksInWwa; if (S._usingWwaScheduler && !forceHooksInWwa) { return fn(); } else { var originalMSApp = S._MSApp, hookedMSApp = Object.create(o...
[ "function runHooks(hooks, callback) {\n\t try {\n\t var promise = hooks.reduce(function (promise, hook) {\n\t // The first hook to use transition.wait makes the rest\n\t // of the transition async from that point forward.\n\t return promise ? promise.then(hook) : hook();\n\t }, null);\n\t } c...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
hidePass() Hides the cleartext password (Called from onMouseOut on password)
function hidePass(){ // Thanks again to Sathanus, on discord, for the suggestion of keeping // the password hidden var currentDisplayText=document.querySelector("#password"); if(currentDisplayText.value.split(" ")[1]!="password") document.querySelector("#password").value=dummyText; ny2qX*RH }
[ "function hideForceResetPwdMsg() {\n $(\"#forcedPwd\").hide();\n $(\"#new_pwd\").val(\"\");\n $(\"#new_pwd\").removeClass(\"error_red_border\");\n $(\"#re_new_pwd\").val(\"\");\n $(\"#re_new_pwd\").removeClass(\"error_red_border\");\n\n $(\"#wrong_resetpwd\").text(\"\");\n $(\"#wrong_resetpwd\"...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Draw the vehicles and check they're within the grid space
function drawVehicles() { for (i=0;i<vehicles.length;i++) { //Left side, right side+image width, top side, bottom side if (vehicles[i][0].pos[0] >= (window.innerWidth/2)-(10*tileSize)/2 && vehicles[i][0].pos[0] <= (window.innerWidth/2)+(10*tileSize)/2-vehicles[i][0].image.width*2 && vehicles[i][0].pos[1] >= (...
[ "draw()\n {\n var canvas = document.getElementById(\"CANVAS\");\n var ctx = canvas.getContext(\"2d\");\n var cVehicles = this.getVehicleCount();\n\n ctx.save();\n ctx.scale(def.scale, def.scale);\n\n this._drawRoute(ctx);\n for (let iVehicle = 0; iVehicle < cVehicles; iVehicle ++)\n...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
REQUETES UTILSATEUR : Onglet : Personnes TAPEZ ICI LE CODE DE LA REQUETE D'INSERTION
function User_Insert_Personnes_Adresse_5(Compo_Maitre) { /* ***** INFOS ****** Nbr d'esclaves = 5 Id dans le tab: 182; simple Nbr Jointure: PAS DE JOINTURE; Id dans le tab: 183; simple Nbr Jointure: PAS DE JOINTURE; Id dans le tab: 184; simple Nbr Jointure: PAS DE JOINTURE; Id dans le tab: 185; simple Nbr Jointur...
[ "function User_Insert_Codes_postaux_Codes_postaux0(Compo_Maitre)\n{\n\n/*\n***** INFOS ******\n\nNbr d'esclaves = 3\n\nId dans le tab: 203;\nsimple\nNbr Jointure: PAS DE JOINTURE;\n\nId dans le tab: 204;\nsimple\nNbr Jointure: PAS DE JOINTURE;\n\nId dans le tab: 208;\ncomplexe\nNbr Jointure: 2;\n Joint n° 0 = co...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Create a truffle contract abstraction file
function fillTemplate(contractName, contractArgs) { return `'use strict' Object.defineProperty(exports, '__esModule', { value: true }) const contract = require('@truffle/contract') const ${contractName} = contract(${JSON.stringify(contractArgs, null, 1)}) if (process.env.NODE_ENV === 'test') { try { eval('${...
[ "contract(contractName) {\n contractName = this.normalizeName(contractName);\n let sourcePath = this.getSourcePath(contractName);\n\n if (!this.contractExists(contractName))\n throw new Error(`Contract source not found: ${sourcePath}`);\n\n\n let dataPath = this.getDataPath(contractName);\n if ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
function for checking if the user has saved a card
hasSaved(cardId) { for(const card of this.user.savedCards){ if(card.cardID == cardId)return true; } return false; }
[ "static isValid(card) {\n return card && card.name && card.value && card.color && \n Card.colors.includes(card.color);\n }", "function CheckOverallValidity(card, cardnum){\n card.checkNumValidity(cardnum);\n card.checkLengthValidity();\n card.checkDateValidity();\n \n\n if(card...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Create a map texture from the base map
function createMapTexture() { var ctx = svgCanvas.getContext('2d'); ctx.fillStyle = '#fff'; ctx.fillRect(0, 0, svgCanvas.width, svgCanvas.height); if (mapImage.width) { ctx.drawImage(mapImage, 0, 0, svgCanvas.width, svgCanvas.height); } var map = ctx.getImageData(0, 0, svgCanvas.width, sv...
[ "map (tu, tv) {\n if (this.internalBuffer) { \n // using a % operator to cycle/repeat the texture if needed\n let u = Math.abs(((tu * this.width) % this.width)) >> 0;\n let v = Math.abs(((tv * this.height) % this.height)) >> 0;\n\n let pos = (u + v * this.width) * ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Converts a parameters block from the configuration for an endpoint and turns it into a parameter definition by applying default values and handling simple parameter configurations that only contain the description.
function readParameters(parametersBlock) { if (_.isUndefined(parametersBlock)) { return []; } let defaults = { required: true, type: 'path', } let parameters = []; for (let name of Object.keys(parametersBlock)) { let values = parametersBlock[name]; let ...
[ "function prepareInput(block, input) {\n const newInput = Object.assign({}, input);\n\n block.params.forEach((param) => {\n newInput[param.name] = input[param.name] || param.defaultValue;\n });\n\n return { block, input: newInput };\n}", "_initializeParams() {\n // the real value for the par...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
The SecondNumber function is called by Addition function to generate the second number of the math problem.
function SecondNumber() { var secondNumber; secondNumber = Math.floor(Math.random() * 10); Number(secondNumber); return(secondNumber); }
[ "function muti2( num,num2)\n { \n \t if(num>num2)\n \t {\n \t \treturn \" you have to but the smaller number first \";\n \t }\n if(num == num2)\n {\n \treturn num2;\n }\n \n return num*muti2(num+1,num2);\n\n }", "function two (num) {\n if (num>=2) {...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Constructs a new instance of SPHttpClientConfiguration with the specified flags. The default values will be used for any flags that are missing or undefined. If overrideFlags is specified, it takes precedence over flags.
function SPHttpClientConfiguration(flags, overrideFlags) { return _super.call(this, flags, overrideFlags) || this; }
[ "function getCommandDefaults(flags) {\n const f = flags;\n Object.entries(f).forEach(([key]) => {\n f[key] = (0, default_flag_args_1.getDefaultValue)(key) || flags[key];\n });\n // this will return a bunch of flags that don't have values\n // and wont know which are required or not\n return...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Override the builtin month abbreviations
function CP_setMonthAbbreviations() { for (var i = 0; i < arguments.length; i++) { this.monthAbbreviations[i] = arguments[i]; } this.copyMonthNamesToWindow(); }
[ "function DateTimeDayMonth() { }", "monthViewTitle({ date, locale }) {\n return new Intl.DateTimeFormat(locale, {\n year: 'numeric',\n month: 'long'\n }).format(date);\n }", "function CP_setMonthNames() {\r\n for (var i = 0; i < arguments.length; i++) { this.monthNames[...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
match relationships in schema
function getRelationships(newSchema){ var newRelationships = []; // first match 1:n relationships _.each(newSchema, function(r){ _.each(r.fields, function(valueOne, keyOne){ if (valueOne.object){ // 1:n, 1 side, seek n side var nSideRelation = _.findWhere(newSchema, { name: valueOne.object }); var nSi...
[ "function relationshipLogger(obj) {\n var relationships = obj.relationships\n if ((relationships && relationships.friends.length > 0) || (relationships && relationships.matches.length > 0)) {\n console.log(obj.relationships); \n }\n else{\n console.log(\"You have no relationships :(\");\...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Get awards from each movie by running a API call to OMDb on each movie in the movieData dict
async function getAwards(movieData) { let movieID = Object.keys(movieData); // Get movie Ids of all movies in dict // Loop through all movies by ID for (let i=0; i<movieID.length; i++) { // OMDb API URL for each movie let awards_omdb_url = 'https://www.omdbapi.com/?apikey=874a2978&i=' + m...
[ "async function getMovieDetails_Requested(movieData) {\n // Get ids of all movies\n let movie_id = Object.keys(movieData);\n\n // Loop through movie_ids and retrieve requested data\n for (let i=0; i<movie_id.length; i++) {\n // Ensure this runs before proceeding\n await getMovieDetails(mov...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
foldername of the test
function getTestFolderName(tokens) { return getFolderName(TEST262DIR,tokens); }
[ "folder_name(x){\n\t\tlet extension = path.extname(x)\n\t\tlet folder_name = path.basename(x)\n\t\tif(extension.length) folder_name = path.basename(x.replace(folder_name,''))\n\t\treturn folder_name\n\t}", "function removeTestDuplicateFolders() {\n var folderName = 'duplicate folder';\n removeFolder(folderName)...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Creates an allocator for a temporary variable. A variable declaration is added to the statements the first time the allocator is invoked.
function temporaryAllocator(statements, name) { var temp = null; return function () { if (!temp) { statements.push(new DeclareVarStmt(TEMPORARY_NAME, undefined, DYNAMIC_TYPE)); temp = variable(name); ...
[ "VariableStatementInit() {\n this._eat(\"let\");\n const declarations = this.VariableDeclarationList();\n return {\n type: \"VariableStatement\",\n declarations,\n };\n }", "function createVariable() {\n\t var id = nextVariableId++;\n\t var name = '$V';\n\t\n\t do {\n\t name...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }