query stringlengths 9 34k | document stringlengths 8 5.39M | negatives listlengths 19 20 | metadata dict |
|---|---|---|---|
SCSS Copy src to app | function scssCopy(done) {
gulp.src('src/scss/**/*')
.pipe(errorNotify('Error On Copy SCSS Files'))
.pipe(gulp.dest('app/assets/scss/'));
done();
} | [
"function scssTask() {\n return src(files.scssPath)\n .pipe(sourcemaps.init()) // initialize sourcemaps first\n .pipe(sass({\n includePaths: [require('path').resolve(__dirname, 'node_modules')]\n })) // compile SCSS to CSS\n .pipe(postcss([autoprefixer(), cssnano()])) // PostCSS plugins\n .pipe... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Highlights lines in the ace editor. Always moves the previous highlight with the same class to the new location. If the row parameters are not supplied, just clear the last highlight. | function highlightAceLines (aceEditor, className, startRow, startColumn, endRow, endColumn) {
var session = aceEditor.getSession();
className = className || 'ace_step';
if (lastHighlightMarkerIds[className]) {
session.removeMarker(lastHighlightMarkerIds[className]);
lastHighlightMarkerIds[className] = nul... | [
"function highlightAceLines(aceEditor, className, startRow, endRow) {\n var session = aceEditor.getSession();\n className = className || 'ace_step';\n if (lastHighlightMarkerIds[className]) {\n session.removeMarker(lastHighlightMarkerIds[className]);\n lastHighlightMarkerIds[className] = null;\n }\n if (... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
init log configuration. config item: logLevel: trace, debug, info, warn, error format: appender: filename: format: | function initConfig(cfg){
logManager.initConfig(cfg)
rootLogger = logManager.getLogger('')
} | [
"function init() {\n logger = bunyan.createLogger({\n name: config.logger.appname,\n src: true,\n streams,\n });\n}",
"function configureLogger() {\n }",
"function configureLog() {\n log4js.configure(config);\n}",
"function configLogger(module) {\n\tvar errorModule = 'error-'+module;\n\tv... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Cannot use _.isEqual because tree data in use will include properties like expanded and uid that would not be in pending tree data | isTreeDataEqual(a, b) {
const _isItemEqual = (itemA, itemB) => {
return (itemA && itemA.data && itemA.data.selectionId &&
itemB && itemB.data && itemB.data.selectionId &&
itemA.data.selectionId === itemB.data.selectionId &&
this.isTreeDataEqual(itemA.children, itemB.children));
};
... | [
"isIdentical(root1, root2) {\n //your code here\n if (!root1 && !root2) return true;\n if (!root1 || !root2) {\n return false;\n }\n return (\n root1.data === root2.data &&\n this.isIdentical(root1.left, root2.left) &&\n this.isIdentical(root1.right, root2.right)\n );\n }",
... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Delete a metadata file from the file system. | async removeMetadata(id) {
let filename = this._formatMetadataFilename(id);
await fs.unlink(filename);
} | [
"function deleteFile() {\n\t\t\tfs.unlinkSync('articles.json');\n\t\t}",
"static deleteEntry(path) {\n Databases.fileMetaDataDb.remove({path: path}, (err, numDeleted) => {\n if (err) {\n console.log(err);\n }\n });\n }",
"removeMetadata() {\n const meta... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
The rhino is turning for RHINO_TURN_TIME | setTurning() {
this.turning = Constants.RHINO_TURN_TIME;
} | [
"_obtenerTurno(turno) {\t\n let fechaYhora = new Date();\n let horas = fechaYhora.getHours() ;\n \n\tif ((horas >= 8) && (horas <= 10)) {\n turno = 1;\n }\n else if ((horas > 10) && (horas <= 12)) {\n turno = 2;\n\t\t}\n else if ((horas > 12) && (horas <= 14)) {\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
reset expires time time typeof number[7days] | function resetTime(time) {
if (time != null) {
if (isNaN(time)) {
throw new Error('The typeof time argument in resetTime(time){...} must be number. But the typeof your argument "' + time + '" is ' + typeof time);
}
time = time > 0 ? time : -1;
} else {... | [
"resetExpires() {\n if (this.expires && this.maxAge) {\n this.expires = new Date(Date.now() + this.maxAge * 1000);\n }\n }",
"function expireDate() {\n var date = new Date(Date.now());\n date.setUTCHours(date.getUTCHours() - SESSION_LENGTH);\n return date;\n}",
"function sixHourTimer() {\n\n c... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Injects query parameter from the received socket request. | function SocketQueryParam(name) {
return function (object, methodName, index) {
var format = Reflect.getMetadata("design:paramtypes", object, methodName)[index];
var metadata = {
target: object.constructor,
method: methodName,
index: index,
type: Param... | [
"prepare(req) {\n // try to leverage pre-existing `req._query` (e.g: from connect)\n if (!req._query) {\n req._query = ~req.url.indexOf(\"?\") ? qs.parse(parse(req.url).query) : {};\n }\n }",
"injectCustomParams() {\n // Get all paramTypes that require substitution.\n const subParamTypes = th... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
When a team buys a boat, they should be able to add it. | addBoat(boat) {
this.boats.push(boat)
} | [
"function addBoat(boatIndex, type, direction, player, clicked){\n const boatArray = []\n const boatLength = boats.find(boat => boat.name === type).length\n if(direction === 'horizontal'){\n for (let i = 0 ; i < boatLength ; i++){\n boatArray.push(boatIndex + i)\n }\n } else if (direction === 'vertica... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
provide an array and return an array of subarrays if the provided array's elements are all separate by 0.5 interval. | function checkArray(arrayTimes) {
var i = arrayTimes.length - 1;
var subArray;
var newArray = [];
while (i > 0) {
if (arrayTimes[i] - arrayTimes[i-1] != 0.5) {
subArray = arrayTimes.splice(i);
newArray.unshift(subArray);
if (i == 1) {
... | [
"function specArr(array) {\n var newArr = [];\n for (var i = 0; i < array.length; i++) {\n if (array[i]/2+5 === 0) {\n newArr[i] = 20;\n } else {\n newArr[i] = array[i]/2+5;\n }\n }\n return newArr;\n}",
"function fiveAndGreaterOnly(arr) {\n result = [];\n... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Send the refund tx to the server | function send_refund() {
console.log("Sending refund");
refund_tx = consumer.setupRefund();
console.log("Refund expires at: " + refund_tx.nLockTime);
var msg = new Message({
"type": Message.MessageType.PROVIDE_REFUND,
"provide_refund": {
"multisig_key": client_key.toPublicKey().toBuffe... | [
"function refundTransaction(options)\n{\n\tif(options.accessToken.indexOf(\"Bearer \") == -1)\n\t{\n\t\toptions.accessToken = 'Bearer ' + options.accessToken;\n\t}\n\toptions.host = domain+baseEndPoint + 'Transactions/' + options.transactionId+ '?Action=' + options.action;\n\tWL.Logger.debug(options.host);\n\tvar r... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Premio segun todos los slots resultantes | function getPremioSlots(slots) {
operarSlots(slots, function(slots, indice){ sumaPremio(slots[indice]) });
if(esPleno(slots))
banco.setPremio(banco.getPremio() * (multiplicadorPorPleno || slots.length));
} | [
"function buscarPares(){\n index__array = 0\n \n for (let index = index__MIN; index <= index__MAX; index++) {\n if (esMultiploDeCinco(index) && esPar(index) ){\n array__valores[index__array]=index\n index__array++\n }\n }\n mostrarValores()\n}",
"function carg... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Update size on cols and rows change. | _updateSizeRowsCols() {
const that = this;
that.$.container.removeAttribute('style');
setTimeout(function () {
if ((that.horizontalScrollBarVisibility === 'disabled' || that.horizontalScrollBarVisibility === 'hidden') && (that.verticalScrollBarVisibility === 'disabled' || that.vert... | [
"function updateBoardSize(){\n\t\tboard.setDimensions(boardWidth.value, boardHeight.value)\n\t\tboardView.onBoardResized()\n\t\tpainter.onBoardResized()\n\t\tpainterPreview.onBoardResized()\n\t\tboardView.requestRender()\n\t}",
"recomputeCellSizesAndPositions() {\n this._calculateSizeAndPositionDataOnNextUpdat... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
function to check existing pallet kitted unit of transaction detail | function checkTransactionKittedUnit() {
if (checkTransactionStatus()) {
if (null != transaction_details[getFieldValueById("trxtransactiondetails-pallet_no")]) {
var trx_kitted_unit = transaction_details[getFieldValueById("trxtransactiondetails-pallet_no")]['kitted_unit'];
var trx_kit... | [
"function checkTransactionKittedUnit() {\n if (checkTransactionStatus()) {\n if (null != transaction_details[getFieldValueById(\"trxtransactiondetails-pallet_no\")]) {\n var trx_kitted_unit = transaction_details[getFieldValueById(\"trxtransactiondetails-pallet_no\")]['kitted_unit'];\n \n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Loads all the Mustache JS templates for displaying CRUD page components. See: "_settings.templates" section above. | function loadTemplatesCrud() {
plugin.loadTemplates(self.settings().templates, true);
// more templates can be provided in the page controller settings
var settingsMethod = self.settings().controller.settings;
if(settingsMethod) {
plugin.loadTemplates(settingsMethod().templat... | [
"function loadTemplates(){\n\n}",
"function loadTemplates() {\n plugin.loadTemplates(self.settings().templates, true);\n }",
"function initLoad(){\n\t\tconsole.log('loading all templates');\n\t\t\n\t\t/*\n\t\t So I wanted to have the external templates specified in <script> tags\n\t\t <script id=\"fla... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
generates random HP to Enemy() | function hp(gen) {
if (gen === "Ancient Dragon") {
return (Math.floor((Math.random() * 20)) + 81);
} else if (gen === "Prowler") {
return (Math.floor((Math.random() * 20)) + 50);
} else {
return (Math.floor((Math.random() * 20)) + 20);
}
} | [
"function monsterHP (max_HP, RNG) {\n // HP = MAX - ((MAX * rand(0, 255)) / 1024)\n var HP = max_HP - parseInt(((max_HP * RNG.integer(0, 255)) / 1024), 10);\n return HP;\n}",
"function randomEnemy() {\n enemy3.defense.length = 0;\n enemy2.defense.length = 0;\n enemy1.defense.length = 0;\n enemy3.at... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
When the get quote button is clicked it creates a summary of the items and displays this summary as an alert | function createQuote(e) {
var clickedButtonId = e.srcElement.id;
if (clickedButtonId == "submit") {
var total = 0;
var orderSummary = "";
for (let i=0; i< orderList.length; i++) {
var x = orderList[i];
//To fix formatting of bools
if (listOfProducts[x].newRelease == true) {
... | [
"function alertItem() {\n alert(\"Your current total is R \" + shoppingCart.taxCart());\n openModal();\n}",
"function displayQuote(data) {\n return data.prices[0].instrument + \n \"\\nsell price: \" + data.prices[0].bid + \n \"\\nbuy price: \" + data.prices[0].ask;\n}",
"function On... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
display the town on the map and request for sunrise,sunset and weather info | function displayMap(para) {
//check the property of the return data, if it is not a city or state, show error message
if (para.results[0].locations[0].geocodeQuality != "CITY" && para.results[0].locations[0].geocodeQuality != "STATE")
{
alert("Invalid town name.");
return;
}
//get the latitude and longitude fr... | [
"function showWeatherLocation (place) {\n \n showWeatherDetails(\"hidden\") ;\n \n if (iJS.isString( place ) || iJS.isObject( place )) {\n \n var searchParams = {} ;\n searchParams.units = \"metric\" ;\n searchParams.appid = \"b4ba2ba099fb66e6e49df3cfdad599df\" ;\n if ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Removes all characters which do NOT appear in string bag from string s. | function stripCharsNotInBag (s, bag)
{ var i;
var returnString = "";
// Search through string's characters one by one.
// If character is in bag, append to returnString.
for (i = 0; i < s.length; i++)
{
// Check that current character isn't whitespace.
var c = s.charA... | [
"function stripCharsNotInBag(s, bag)\r\n{\r\n\tvar i;\r\n\tvar returnString = \"\";\r\n\r\n\tfor (i = 0; i < s.length; i++)\r\n\t{\r\n\t\tvar c = s.charAt(i);\r\n\t\tif (bag.indexOf(c) != -1) returnString += c;\r\n\t}\r\n\r\n\treturn returnString;\r\n}",
"function stripCharsNotInBag(s, bag)\r\n\r\n{\r\n var i;\r... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
The above functions will make it possible for systems to select relevant entities and process them as needed. What we're still missing is a nice and easy way for the client to select relevant systems and call them as needed. This will be our final function. We're going to set this up as a curried function of sorts. Tha... | function systematic() {
// This is just a varargs trick. It captures all of the argumenst to the
// function in an array.
var systems = Array.prototype.slice.call(arguments, 0)
// This function then just iterates over this list, and invokes each of the
// functions in turn, forwarding the arguments t... | [
"processSystems() {\n for (var i = 0, length = this.systems.length; i < length; i++) {\n var system = this.systems[i];\n if (system.shouldProcess()) system.process();\n }\n }",
"function SystemProc(psystem, msg, param1, param2)\r\n{\r\n if(set.debug)\r\n {\r\n trace(\"syste... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Add to free list by CPF | freeByCpf(req, res) {
// Count the hits
config.TOTAL_HITS++;
// Validate CPF
if (CPF.validate(req.params.cpf)) {
// If CPF is masked, remove the mask
if (CPF.isMasked(req.params.cpf))
req.params.cpf = CPF.unMask(req.params.cpf);
// U... | [
"add(_allocPoint, _lpToken, _withUpdate) {\n this._verifyFromDataManager()\n\n this.poolContract.call('add', _allocPoint, _lpToken, _withUpdate)\n }",
"static _AddToExportedList(ListRef,AnObj){\r\n CJC_DATA.objLists[ListRef].push(AnObj);\r\n }",
"add(_allocPoint, _lpToken, _withUpdate) {\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Internal: Delegates method to map proxy | function _delegateToMapProxy(method) {
return function() {
var args = arguments;
return this.mapProxy[method].apply(this.mapProxy, arguments)
}
} | [
"wrapMap(result_obj, dbg) { return dbg ? result_obj : Map(result_obj); }",
"map(id, source) {}",
"map(id, source) { }",
"function ObjectMap(){\n this.map = function(doFunction){\n let result = {};\n let index = -1;\n let valArr = Object.values(this).... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
add an address to a notification in Alchemy | async function addAddress(new_address) {
console.log("adding address " + new_address);
const body = {
webhook_id: 151538,
addresses_to_add: [new_address],
addresses_to_remove: [],
};
try {
fetch("https://dashboard.alchemyapi.io/api/update-webhook-addresses", {
method: "PATCH",
body: ... | [
"addAddress(address, context) {\n this._addresses[address] = {\n context: context,\n minLedger: 1,\n };\n }",
"fbAddAddress(commit, payload) {\n let addressRef = firebaseDb.ref(\"addresses/\" + payload.id);\n addressRef.set(payload.address);\n }",
"addAddress(id, address) {\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Determines the template for the Dialog section of the window. By default headerTemplate is null. Property type: any | get headerTemplate() {
return this.nativeElement ? this.nativeElement.headerTemplate : undefined;
} | [
"function dlgTemplate() {\n CUI.rte.Templates[\"dlg-\" + INSERT_DIALOG_CONTENT_DIALOG] =\n Handlebars.compile('<div data-rte-dialog=\"' + INSERT_DIALOG_CONTENT_DIALOG +\n '\" class=\"coral--dark coral-Popover coral-RichText-dialog\">' +\n '<iframe width=\"1100px\" hei... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
default_version computed: true, optional: false, required: false | get defaultVersion() {
return this.getStringAttribute('default_version');
} | [
"requireVersion(_version){\n requiredVersion = _version;\n }",
"_setDefaultVersion() {\n return Config.getDefaultVersion().then(config => {\n const defaultVersionCode = config.value;\n debug(\"Default version from config %o\", defaultVersionCode);\n\n this.default... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Helper function: Create API node and fill it in with data based on the current tree state. | function createAndFillApiNode(apiInstance, groupApiData) {
/**
* Should've called cloneAndReplaceVars() here but for some reason
* the K6 engine crashes when I do.
*/
let instanceApiData = {
name: groupApiData.name,
groupApiData: groupApiData.groupApiData,
configObject: groupApiData.configObject,
path: ... | [
"function makeApiNode(apiData, meaningfulName) {\n\tlet node = makeNode(false);\n\tnode.apiData = apiData;\n\tnode.meaningfulName = meaningfulName;\n\treturn node;\n}",
"createNewNode(data){\n const newNode = new node(data);\n return newNode;\n }",
"function create_node(error, result) {\n if... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Below you will note our "jsdocs" style of comments which will explain the needed functionality of the functions included in this file. The first function "initiateApp" is completed to show you how the docs are structured. Note the explanatory comments on the "initiateApp" jsdocs below initiateApp ``This section will co... | function initiateApp(){
/*BONUS FUNCTIONALITY: add jquery sortable call here to allow resorting of the images
//on change, rebuild the images array into the newly sorted order
Documentation: http://api.jqueryui.com/sortable/
Example or sorting in action: https://jqueryui.com/sortable/
*/
makeGallery(pictures);... | [
"function photoGallery() {\n\n\t\t// get all <a.gallery_link>s in document (ignore <div>s with same class)\n\t\tvar arrGalleryLinks = document.querySelectorAll('a.gallery_link'),\n\t\t\tnumGalleryCount = arrGalleryLinks.length;\n\n\t\t// check if arrGalleryLinks is not empty\n\t\tif (numGalleryCount === 0) {\n\t\t\... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Attempt to attach template over the network. It attempts to derive an HTML tag from the filename, but we could do anything here. | static async attachRemote(filename) {
const filenameMatches = filename.match(/\/([^\.\/]+)\.html/i);
if (filenameMatches) {
const id = filenameMatches[1];
const response = await fetch(filename);
const text = await response.text();
const fragment = documen... | [
"function appendTemplateToElement(el,file){\t\n\tvar msg = $.ajax({type: \"GET\", url: chrome.extension.getURL(file), async: false}).responseText;\n\tvar dataToAppend =$($.parseHTML(msg));\n\t$(el).append(dataToAppend);\n}",
"function prepareTemplate (filename, options = {}) { \n try {\n const templatePath =... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
FUNCTION: dwscripts.getConnectionURL DESCRIPTION: Returns a string which represents the relative path from the current document to the connection file for the given connection name ARGUMENTS: connectionName string the connection name to return the URL for siteRelative boolean RETURNS: string | function dwscripts_getConnectionURL(connectionName, siteRelative)
{
var retVal = "";
if (connectionName)
{
var dom = dw.getDocumentDOM();
var fileUrl = dom.URL;
var siteUrl = dw.getSiteRoot();
var siteUrlPrefix = dom.getSiteURLPrefixFromDoc();
if (siteRelative && siteUrl)
{
retVa... | [
"function ConnectionMenu_getPath()\r\n{\r\n var retVal = \"\";\r\n\r\n var connName = this.getValue();\r\n \r\n retVal = dwscripts.getConnectionURL(connName);\r\n \r\n return retVal;\r\n}",
"function dwscripts_getCFDataSourceName(connectionName)\n{\n var retVal = connectionName;\n \n if (dwscripts.hasSer... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
delete comment with cid on photo with id | function deleteComment(cid, id) {
url = "deleteComment.php?id=" + id + "&cid=" +cid;
doAjaxCall(url, "updateComment", "GET", true);
} | [
"function deletePhoto(id) {\n return photodb('photos').where({ id }).first().delete();\n}",
"removeComment(commentId, photoId) {\n // DELETE AJAX request, delete comment using comment ID\n let promise = $.ajax({\n type: 'DELETE',\n url: `${config.apiHost}/api/comments/${commentId}`,\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Add a method which add certification. | addCertification(newCertification) {
this._certifications.push(newCertification);
} | [
"AddCertificate(EncodingType, string) {\n\n }",
"addMethod(method) {\n this.methods.push(method);\n }",
"SetCertificateExtension(string, int, int, Variant) {\n\n }",
"function createContextMethod( prop ){\n self[ prop ] = function(){\n //console.log('proxy method:',prop);\n... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
spawn the telepointers for the passed occupants | function spawnTelepointers(occupants){
//==================================================
//spawn the telepointers for all the connected users.
//==================================================
var telepointer_spawn_point = document.getElementById('telepointer_spawn_point');
//first remove any... | [
"function assignTasksToPeasants() {\n for (let roomName in Game.rooms) {\n let room = Game.rooms[roomName];\n\n let coordinators = [\n new DeliveryEnergyToController(room),\n new DeliverEnergyToSpawn(room),\n new DeliverEnergyToExtensions(room),\n new Del... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Cosine similarity between vector of frequencies of bigrams within str, and vector which assumes all bigrams made of neighboring pairs on the keyboard are equally likely, and no others appear | function bigramSimilarityToMashing(str) {
const bigrams = _bigrams(str);
const counts = bigrams.reduce((r, bigram) => {
r[bigram] = r[bigram] ? r[bigram] + 1 : 1;
return r;
}, {});
const freqs = Object.keys(counts).reduce((r, bigram) => {
r[bigram] = counts[bigram] / bigrams.length;
return r;... | [
"function bigramSimilarityToCorpus(str) {\n const bigrams = _bigrams(str);\n\n const counts = bigrams.reduce((r, bigram) => {\n r[bigram] = r[bigram] ? r[bigram] + 1 : 1;\n return r;\n }, {});\n\n const freqs = Object.keys(counts).reduce((r, bigram) => {\n r[bigram] = counts[bigram] / bigrams.length;\n... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Get's the status of robot (if present) | GetRobotStatus() {
if (this._shallExecute()) {
return this.robot.position;
}
return null;
} | [
"function get_status() {\n //TODO\n\n }",
"static async status() {\n return await this._makeRequest('status', 'get', `/system/status`);\n }",
"function getStatus() {\n\tapi({ data: \"cmd=getstatus\" },syncStatus);\n}",
"function _getStatus ()\n {\n return {status: 1, msg: \"Not Ready\" };\n }",... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Discovers work that needs to be done since the last pass. If viewport has changed, it will try to build new elements, measure changed elements, and schedule layouts and preloads within a reasonable distance of the current viewport. Finally, this process also updates inViewport state of changed elements. Layouts and pre... | discoverWork_() {
// TODO(dvoytenko): vsync separation may be needed for different phases
const now = this.win.Date.now();
// Ensure all resources layout phase complete; when relayoutAll is requested
// force re-layout.
const {
elementsThatScrolled_: elementsThatScrolled,
relayoutAll_:... | [
"queueUpdateViewport() {\n this.queueRenderUpdate().updateViewport = true;\n }",
"scheduleUpdate() {\n if (this._nextUpdate !== null) {\n return;\n }\n\n this._nextUpdate = this.schedule('sync', () => {\n this._nextUpdate = null;\n\n // cache previous values\n this._prevFirs... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
creates a hidden span | function makeScreenReaderSpan()
{
const span = makeSpan();
span.addClass("hidden");
return span;
} | [
"function buildNonclickableSpan(textToShow) {\n return \"<span class='noclickhashtagspan'>\" + textToShow + \"</span>\";\n}",
"function createHiddenId(id) {\n var hiddenId = document.createElement(\"span\");\n hiddenId.textContent = id;\n hiddenId.className = \"hiddenId\";\n return hiddenId... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
function requests API data, then creates a listener on the submit button also populates pulldowns with data from the API button will then perform calculations with conversion rates pulled from data | function fetchAndAddButton() {
fetch(currencyAPI)
.then((response) => response.json())
.then((data) => {
console.log(data.rates)
for (item in data.rates) {
let option1 = document.createElement('option')
let option2 = document.createElement('option')
option1.innerText = item... | [
"function startPage() {\nfetch(listURL + accessKey)\n.then(function(results) {\n return results.json();\n})\n.then(function(data) {\n loadList(data);\n});\n\n function loadList (data) {\n console.log(data);\n for (syms in data.crypto) {\n let option = document.createElement(\"option\");\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
displays tournament on screen | function setupTournament(event) {
var data = event.data.replace("contestantInfo","");
data = data.split(";");
for(var i=0; i<data.length; i++) {
data[i] = data[i].split("#");
}
data.pop();
var playerTournieArr = data;
document.getElementById("tournieScreen").style.display = "block";
for(var i=0; i<playerTourn... | [
"function showTournament(data, tourid) {\n\tvar t;\n\tfor (var i = 0; i < data.tournaments.length; i++) {\n\t\tif (data.tournaments[i].tid == tourid\n\t\t || data.tournaments[i].shortcode == tourid) {\n\t\t\tt = data.tournaments[i];\n\t\t}\n\t}\n\tif (!t) {\n\t\treturn;\n\t}\n\tvar src = genTournament(t, true);\n\... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
The below creates a BST from an array in place. This works by self balancing the sorted array by inserting from median position of the array slices. | function sortedArrayToBst(array, start = 0, end = array.length - 1) {
if(start > end) {
return;
}
let median = Math.floor(start + ((end - start) / 2));
let item = array[median];
let node = { key: item };
node.left = sortedArrayToBst(array, start, median - 1);
node.right = sortedArrayToBst(array, med... | [
"function sortedArrayToBstBySlice(array) {\n if(array.length === 0) {\n return;\n }\n\n let medianIndex = Math.floor(array.length / 2);\n let leftSlice = array.slice(0, medianIndex);\n let rightSlice = array.slice(medianIndex + 1)\n\n let item = array[medianIndex];\n let node = { key: item };\n node.left... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
function for pagininating friendRibbon results | function friendRibbon(page_no, results_per_page) {
$('#friendRibbonContainer').load(
'/opengraph/paginateFriendRibbon',
{ page_no: page_no, results_per_page: results_per_page },
function() { friendRibbonHover(); }
);
} | [
"function listPagination() {\n\n if ( nbItemsDisplayed == 0 ) {\n //consoleLog(nbItemsDisplayed);\n reInitFilter();\n } else {\n //Suppression du message d'erreur\n setTimeout( function(){\n //consoleLog('Out');\n $('#noResult').fadeOut()\n resultFr... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Check for vertical win | function verticalWinCheck() {
for(var col=0;col<7;col++) {
for(var row=0;row<3;row++) {
if(colorMatchCheck(returnColor(row,col),returnColor(row+1,col),returnColor(row+2,col))) {
console.log('vertical');
reportWin(row,col);
return true;
... | [
"function checkVerticalWin() {\n\tfor (var col = 0; col <7; col++) {\n\t\tfor (var row = 0; row < 3; row++) {\n\t\t\tif (colorMatchCheck(getColor(row,col), getColor(row+1,col), getColor(row+2,col), getColor(row+3,col))) {\n\t\t\t\tconsole.log('horiz');\n\t\t\t\treportWin(row,col);\n\t\t\t\treturn true;\n\t\t\t} els... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Send an image using the Send API. | sendImageMessage( recipientId, imageUrl ) {
var messageData = {
recipient: {
id: recipientId
},
message: {
attachment: {
type: "image",
payload: {
url: imageUrl
... | [
"function sendImageMessage(recipientId){var messageData={recipient:{id:recipientId},message:{attachment:{type:\"image\",payload:{url:SERVER_URL+\"/assets/rift.png\"}}}};callSendAPI(messageData);}",
"function sendImageMessage(recipientId) {\n var messageData = {\n recipient: {\n id: recipientId\n },\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Perform a splitVideo request | function splitVideo(videoName, splitTimeInSeconds) {
var requestData = '{'
+ '"command" : "splitVideo",'
+ '"arguments" : {'
+ '"video" : "' + videoName + '",'
+ '"splitTimeInSeconds" : ' + splitTimeInSeconds + ''
+ '}'
+ '}';
makeAsynchronousPostRequest(requestData, ... | [
"function splitVideo(){\n \n var resultDisplayed = $(\".videocontainer\");\n if(resultDisplayed.length == 0){\n\n displayErrorMessage(ERR6);\n }\n else if(searchRunning){\n\n displayErrorMessage(ERR7);\n }\n else if(resultDisplayed.length > 0){\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Functions sets a new locale | function SetLocale(locale)
{
localeUsed = locale;
Update();
} | [
"static set locale(value) { _locale = value; }",
"static function setLocale(name : string) : void {\n _Locale.setCurrentLocale(name);\n }",
"function setLocale() {\n if (settings.locale_id && !settings.locale) {\n var locale = $(settings.locale_id).html().trim();\n if (locale === \"... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Cleanbooks takes only parameters to be used | function cleanBooks(books){
return books.map(book => {
const bookInfo = book.volumeInfo;
const id = book.id;
const imgLink = ( bookInfo.imageLinks ) ? `https${bookInfo.imageLinks.smallThumbnail.substring(4)}` : "";
const title = ( bookInfo.title ) ? bookInfo.title : "";
const authors = (... | [
"function filterISBN(books) {\n\tif (!books) {return null};\n\tvar isbn;\n\tfor (var i = 0; i < books.length; ) {\n\t\tisbn = getISBN(books[i]);\n\t\tif (getISBN(books[i]) == -1) {\n\t\t\tbooks.splice(i, 1); // Remove book without isbn\n\t\t} else {\n\t\t\ti++;\n\t\t}\n\t}\n\treturn books;\n}",
"function removeAl... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
retrieves the collection from the db specified by collection name, creating it if it does not already exist | function getOrCreateCollection(db, collectionName) {
db.collection(collectionName, {strict:true}, function(err, col) {
if (err) {
db.createCollection(collectionName, {}, function(err, createdCol) {
if (err) {
return err;
}
});
}
});
return db.collectio... | [
"getOrCreateCollection(name:string) {\n let col = this.db.getCollection(name)\n if (!col) {\n col = this.db.addCollection(name, this.getCollectionOptions(name))\n }\n return col\n }",
"function getCollectionByName(name) {\n return function(db) {\n return new Promise(function(resolve, reject)... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Get all the jobs: params JSON Object. Can include the value of the job's "execution" status, and any other key/value pair to search for into job's params. execution String, the execution status for the jobs to return. Return all jobs if no execution status is given. limit Integer, max number of Jobs to retrieve. By def... | function getJobs(params, callback) {
var executions = ['queued', 'failed', 'succeeded',
'canceled', 'running', 'retried', 'waiting'];
var list_name;
var execution;
var offset;
var limit;
if (typeof (params) === 'object') {
execution = params.execu... | [
"getListOfJobs(limit, startingAfter) {\n return __awaiter(this, void 0, void 0, function* () {\n let params = [];\n if (limit) {\n params.push(`limit=${limit}`);\n }\n if (startingAfter) {\n params.push(`starting_after=${startingAfter}... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Filter & Sort Items | function FilterSortItems() {
var pageSize = 10;
var currentPage = 0;
localStorage.setItem("CurrentPage", currentPage);
CarryoutItemsList(10, 0);
} | [
"sort() {\n this.filterList.sort( function( a, b ) {\n var alc = a.item.toLowerCase();\n var blc = b.item.toLowerCase();\n if ( alc < blc ) {\n return -1;\n } else if ( alc > blc ) {\n return 1;\n } else {\n r... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
set the value of image_to drop down based on values of image_from and image_count | function setImageTo(){
count_from = null;
selected_img_from = $('#image_from').val();
image_to_options = $("#image_to > option");
image_count = $('#image_count').val();
image_to_options.each(function(i){
if(selected_img_from == $(this).text()){
count_f... | [
"function setImageCount(){\n count_from = null;\n count_to = null;\n selected_img_from = $('#image_from').val();\n selected_img_to = $('#image_to').val();\n image_to_options = $(\"#image_to > option\");\n image_to_options.each(function(i){\n if(selected_img_from ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
For whitelisting the urls | function addWhiteList(url) {
var url = url.replace(/#.*$/, '');
url = getLocation(url).hostname ;
var temp1 = localStorage.getItem("whiteListObject");
if(temp1 !== "" && temp1 !== null){
whitelistObject = JSON.parse(temp1);
}
whitelistObject[url] = url;
localStorage.setItem("whiteL... | [
"function hitWhitelist(url) {\n return whitelist.some(item => url.startsWith(item) || (item.test && item.test(url)))\n }",
"function onWhitelist(url, whitelist)\n{\n if (!whitelist || !url)\n return false;\n let splitWl = whitelist.trim().split(',');\n let parsedUrl = parseHost(url);\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Filtragem por CheckBox de Areas | FiltrarAreas(idArea)
{
let chk = document.getElementById("checkboxArea"+idArea);
let check = true;
// Se checked adiciona no State
if (chk.checked == true)
{
this.setState({
aFiltroArea: [... this.state.aFiltroArea, idArea]
})
this.ExibeFiltro(idArea, 'Area', 'S');
}
e... | [
"checkboxFilterSelection() {\n const housingTypeSelection = $('[name=\"housing_type\"]').map(() => [this.checked]);\n this.HousingTypeFilter.setFilter(\n housingTypeSelection[0], // Family\n housingTypeSelection[1], // Senior\n housingTypeSelection[2], // Student (Not Used {default: false})\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Utility function to read a file, parse it, walk it, and then return the finalized tree. On error it prints a nice error report and then calls `process.exit`. | function treeForFile (file) {
var contents = null
try {
contents = fs.readFileSync(file).toString()
} catch (err) {
if (err.code === 'ENOENT') {
logger.error("File not found: "+file)
process.exit(1)
}
throw err
}
var name = path.basename(file),
parser = new Parser()
... | [
"function treeForFile (file) {\n var contents = fs.readFileSync(file).toString(),\n name = path.basename(file),\n parser = new Parser()\n\n parser.file = name\n // Parse and type-check the file; catch and report any errors\n try {\n var tree = parser.parse(contents),\n typesystem... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
runBot decides what the bot's next move will be depending on the difficulty chosen by the user. | runBot(){
let botMove = this.randomMove();
if(!this.XO[botMove].classList.contains("selected") && !this.XO[botMove].classList.contains("grayed")){
this.board.selClass = this.board.XTurn? "XSelect" : "OSelect";
this.board.XTurn = !this.board.XTurn;
if(this.board.selClass == "XSelect"){
... | [
"runBot(){\r\n let botMove = this.nextMove();\r\n if(!this.XO[botMove].classList.contains(\"selected\") && !this.XO[botMove].classList.contains(\"grayed\")){\r\n this.board.selClass = this.board.XTurn? \"XSelect\" : \"OSelect\";\r\n this.board.XTurn = !this.board.XTurn;\r\n if(this.board.selCla... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
SelectAllOptions set all options to selected | function SelectAllOptions(theSelect) {
for (var i = 0; i < theSelect.options.length; i++) {
theSelect.options[i].selected = true;
}
} | [
"selectAll() {\n this._setAllOptionsSelected(true);\n }",
"selectAll() {\n return this._setAllOptionsSelected(true);\n }",
"function selectAllOptions(obj) {\n if (!hasOptions(obj)) { return; }\n for (var i=0; i<obj.options.length; i++) {\n obj.options[i].selected... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
SELECTION RELATED FUNCTIONS These functions returns the position of the selection anchor | function getSelectionAnchor() {
return [selectionAnchorLine, selectionAnchorColumn];
} | [
"positionFromSelection() {\n this.position(this.view.tracker.selections[0].note.renderedBox);\n }",
"_positionOnSelectedItem() {\n return TopSelectionMarker._positionOnItem(this.selectedItem);\n }",
"function getPositionForSelectionRectBackground(){\n //console.log(\"getPositionForSelectionRectBa... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
zoomEl: target that is being zoomed into scaleEl: element on which CSS Transform is applied containerEl: container that the zoomed element fully fills toggleEl: click element that toggles zoom state | function make_element_zoomable({ containerEl, scaleEl, zoomEl, toggleEl }) {
assert(containerEl && scaleEl && zoomEl);
toggleEl = toggleEl || zoomEl;
DEBUG && console.log("[zoom] setup", { zoomEl, scaleEl, containerEl });
if (DEBUG && window.location.hostname === "localhost") {
// Show cursor position
... | [
"function setZoom(zoom, el) {\n transformOrigin = [0, 0];\n el = el || instance.getContainer();\n var p = [\"webkit\", \"moz\", \"ms\", \"o\"],\n s = \"scale(\" + zoom + \")\",\n oString = (transformOrigin[0] * 100) + \"% \" + (transformOrigin[1] * 100) + \"%\";\n\n for (var i = 0; i < p.l... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Decodes a Uint8Array into a tree The Uint8Array is decoded into a JSON string, which is then parsed into an expanded tree. The tree is then collapsed | function decodeTree(u8arr) {
let utf8decoder = new TextDecoder();
let str = utf8decoder.decode(u8arr);
//console.log(str);
return collapseTree(JSON.parse(str));
} | [
"function decodeBuffer(arrBuff) {\n\t\tlet u8arr = new Uint8Array(arrBuff);\n\t\t\n\t\tfunction byteToStr(byte) {\n\t\t\tlet str = byte.toString(2);\n\t\t\twhile (str.length < 8) {\n\t\t\t\tstr = \"0\" + str;\n\t\t\t}\n\t\t\treturn str;\n\t\t}\n\t\t\n\t\tlet headerLength = 4;\n\t\tlet treeBytes = \"\";\n\t\t\n\t\tf... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Set the score to a particular value | _setScore(score) {
this._score= score;
this._updateScore();
} | [
"set score(aValue) {\n this._score = aValue;\n }",
"function setScore(element, score) {}",
"update_score (value) {\n this.set('score', this.get('score') + this.sanitize_score(value));\n }",
"setScore(value) {\n\t\tthis.$element.find('.score').html(value + ' points')\n\t}",
"setScore(num) {\n\t\tthis... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
functions for genes and gene sets | function geneSave(){
return {'genes':window.biogen,
'geneSets':window.bioGeneGrp}
} | [
"function populateGeneCollection() {\n geneCollection[0] = new Gene([0, 0, 0, 1]);\n geneCollection[1] = new Gene([0, 0, 1, 0]);\n geneCollection[2] = new Gene([0, 1, 0, 0]);\n geneCollection[3] = new Gene([1, 0, 0, 0]);\n }",
"function setgenes(xxx, o) {\n const dispobj = xxxdis... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
init contract with provider and wallet | async initContracts() {
this.contract = new ethers.Contract(
this.evn.SUPPORT_ADDRESS,
this.evn.SUPPORT_ABI,
this.wallet
);
this.contract.provider.polling = false;
} | [
"_initContract () {\n if (this.contract) return\n this.contract = new this.web3.eth.Contract(plasmaChainCompiled.abi)\n this.registryContract = new this.web3.eth.Contract(\n registryCompiled.abi,\n this.options.registryAddress\n )\n }",
"function initContract() {\n\tconsole.log(\"Load contr... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
handle a click of the back to login button | handleBackToLogin() {
this.props.displayRegister(false);
} | [
"function loginBackButtonPressed() {\n // do nothing\t\n}",
"backToLogin(){\n\t\t window.location.href = '#/c/login';\n\t }",
"function handleLoginClick() {\n history.push(\"/login\");\n }",
"handleGoBack_() {\n if (this.$.signinFrame.canGoBack()) {\n this.$.signinFrame.back();\n this.$.sign... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
======================================================== react/packages/reactreconciler/src/ReactFiber.js ======================================================== Detects if a passed element is a Fiber object instead of an element. Is needed as `ReactDOM.findDOMNode()` returns a Fiber in `reacttestrenderer` that can ca... | function isFiberRef(node) {
if (node === null) {
return false;
}
if (node instanceof Element || node instanceof Text) {
return false;
}
return !!(node.type && node.tag);
} | [
"function getFiber(grid) {\n var key = Object.keys(grid).find(function (key) {\n return key.startsWith('__reactFiber$');\n });\n invariant(typeof key === 'string', 'Cannot find the __reactFiber$'); // @ts-ignore\n\n return grid[key];\n }",
"function checkIfClassHasReactRender(currentClass) {\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Compute the new clip plane from the new position (pos) Update the Triangle Set for rendering | function createClipping(pos){
// Plane Equation is a*X + b*Y +c*Z + d = 0
let res = TETRAMESH.makeSlice(0, 1, 0, Number(pos));
let triCoord = res["vertex"];
let trisetData = res["data"];
let sliderValues;
if (triCoord.length !== 0) {
x3domUtils.updateCoordPoint(get("triSetCoordinate"), t... | [
"function updateVertices(){\n \n // Setting the vertices of the plane to these vertices\n for(let y = 0; y < length; ++y){\n for(let x = 0; x < length; ++x){\n if(vertices[y][x] > 0){\n plane_geo.vertices[(y + 1) * (length + 2) + (x + 1)].z = vertices[y][x];\n }\n... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
remove stray newlines from the rendered HTML to simplify diffing | function normalize (html) {
return html.replace(/(?:\r?\n)+/g, '\n')
} | [
"function baynote_removeHtml(raw) {\n\tif (!raw) return;\n\traw = raw.replace(/\\<[^>]*\\>/g, \"\");\n\traw = raw.replace(/\\<.*/, \"\");\n\traw = raw.replace(/\\ /g, \" \");\n\traw = raw.replace(/^\\s+/, \"\");\n\traw = raw.replace(/\\s+$/, \"\");\n\traw = raw.replace(/\\n/g, \" \");\n\treturn raw;\n}",
"to... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Fixes the options that change the original text so that they all encompass the same edit area For example, if one person edited [4, 10] and another [5, 11], we want them all to look like they edited [4, 11]. | function fixEditAreas(outputPatch, patch) {
var fieldEditingText = getEditedTextOptions(outputPatch);
var previousSentences = patch.sentences.slice(0, patch.sentenceRange().startSentence);
previousSentences.push(""); // to simulate the sentence that we're starting
var editOffset = previousSent... | [
"function mergeOptions(patches, startPatch, endPatch, curPatch, paragraph_index, editStart, editEnd, fieldName) {\r\n var alternatives = new Array();\r\n\tvar dmp = new diff_match_patch();\t\r\n \r\n var prefix = getParagraph(paragraphs[paragraph_index]).substring(editStart, patches[curPatch].editStart);\r... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Group all adjacent accesses into groups, each of size 'stepsPerCycle' In the visualization, these accesses will seem to happen in the same time This increases performance of the animation loop | function groupAccessPatterns(accessPatterns, stepsPerCycle) {
const accessPatternGroups = new Map;
const allCycles = Array.from(accessPatterns.keys());
let maxCycle = -1;
for (let c of allCycles) {
maxCycle = Math.max(c, maxCycle);
}
for (let cycle = 0; cycle <= maxCycle + stepsPerCycle; cycle += stepsPerCycle)... | [
"function runGroupingStep() {\n var groupColors = [\"#1abc9c\", \"#3498db\", \"#9b59b6\", \"#2ecc71\",\n \"#f1c40f\", \"#e67e22\", \"#e74c3c\",\n \"#16a085\", \"#27ae60\", \"#2980b9\", \"#8e44ad\",\n \"#f39c12\", \"#d35400\",\"#... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
set node optimized value | function setNodeOptimizedVal(node, val) {
node.type = typeof val;
node.value = val;
node.wasOptimized = true;
delete node.left;
delete node.right;
} | [
"setNodeValue(id, value) {\n let n = this.node(id);\n if (n) n.value = value;\n }",
"set(index_num, value){\n var needed_node = this.get(index_num);\n if(needed_node !== null){\n needed_node.val = value;\n console.log(\"SET - success!\");\n return tr... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
create structure response for restaurant | function createItemOfStructureResponseForRestaurant(item) {
var structureObj = {};
structureObj.title = item.restaurantName;
structureObj.image_url = item.thumbpath;
structureObj.subtitle = item.addressName;
var buttons = [];
var button1 = createButton("Xem chi tiết", config.BUTTON_TYPE.web_url... | [
"function parse_zomato(response) {\n var parsed_restaurants = [];\n var restaurants = response.restaurants;\n\n restaurants.forEach(element => {\n var temp_restaurant = {\n name: element.restaurant.name,\n cost: element.restaurant.average_cost_for_two / 2,\n cuisines: element.rest... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Determines rank progression in Arena matches. | function determineRank(val) {
var startValue;
var nextRankValue;
var previousValue;
var angleStart;
var reportID = '#report-' + val.id;
// If the player ranked up.
// If player is unranked.
if (val.player.PreviousCsr === null && val.player.MeasurementMatchesLeft > -1) {
$(reportID... | [
"function rankBoard(board) {\n let rank = 0;\n\n let sawBlack = false;\n let isEndGame = true;\n // The \"endgame\" is when there is no possibility of either player being sent to the bar\n for (let i = 25; i >= 0; i--) {\n if (board.pips[i].top === -1) sawBlack = true;\n else if (board.... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
webPageElements establishes references to various parts of the page | function webPageElements() {
pageElements.input = document.getElementById('input');
pageElements.output = document.getElementById('output');
pageElements.linksCount = document.getElementById('linksCount');
pageElements.alertText = document.getElementById('alertText');
pageElements... | [
"function PageElements(){}",
"function buildPageElements() {\n \n var pageHeader = document.getElementsByTagName(\"header\")\n if(pageHeader.length > 1) { console.log(\"Page out of spec: Too many <header> elements.\") }\n else { buildGlobalNavigation('header') }\n\n var pageTitle = document.getElem... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
switch pointerevents on the drop_targets while dragging to allow item_preview on mouseover for lower zindex children | function drag(ev) {
ev.dataTransfer.setData("text", ev.target.id);
ev.dataTransfer.setDragImage(ev.target, 25,25, 0);
Array.from(document.getElementsByClassName("drop_target")).forEach(o => {
o.style.pointerEvents = "auto";
});
} | [
"function on_drag_drop(action, x, y, mask) {}",
"function on_drag_over(action, x, y, mask) {}",
"addDragEvents() {\n for (let userId in this.state) {\n if (!this.state[userId].list) alert(\"cannot add drag\");\n this.state[userId].list.mousedown((e) => {\n // #1\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
renderLogOutLink() Returns the log out button if the patron has been logged in. | renderLogOutLink() {
return (this.props.isLoggedIn) ?
<a
href={this.props.logOutLink}
className={`${this.props.className}-catalog-link`}
onClick={() => utils.trackHeader('My Account', 'Log Out')}
style={styles.logOutLink}
>
<LogoutIcon className="logoutIcon" ariaH... | [
"renderLogOutLink() {\n return (this.props.isLoggedIn) ?\n <a\n href={this.props.logOutLink}\n className={`${this.props.className}-catalog-link`}\n onClick={() => utils.trackHeader('My Account', 'Log Out')}\n style={styles.logOutLink}\n >\n LOG OUT\n </a> : <div ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Handle the app going from foreground to background, and vice versa. | handleAppStateChange(nextAppState) {
if (
this.state.appState.match(/inactive|background/) &&
nextAppState === "active"
) {
// App has moved from the background (or inactive) into the foreground
this.appIsNowRunningInForeground();
store.dispatch(updatePlayback());
} else if (
... | [
"function handleAppStateChange(nextAppState) {\n if (\n appState.current.match(/inactive|background/) &&\n nextAppState === 'active'\n ) {\n console.log('App has come to the foreground!')\n foregroundAction()\n }\n\n if (appState.current.match(... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Handles month selection in the year view. | _monthSelectedInYearView(normalizedMonth) {
this.monthSelected.emit(normalizedMonth);
} | [
"monthSelectedInYearView(normalizedMonth) {\n this.monthSelected.emit(normalizedMonth);\n }",
"_monthSelected(event) {\n const month = event.value;\n const normalizedDate = this._dateAdapter.createDate(this._dateAdapter.getYear(this.activeDate), month, 1);\n this.monthSelected.emit(... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Input: Output: None just triggers the classification of the counties, histogram, and dots | function classify() {
if (colorScheme == "null" && numberOfClasses == -1 && classScheme == "Single"){
set_fill_single_color("counties", fillColor);
set_fill_single_color("dots", fillColor);
set_fill_single_color("bars", fillColor);
return;
}
classBreaks = get_class_breaks(c... | [
"function processSVMresult(result){\n var distance = result.distance;\n var classification = result.classification;\n var label = result.label;\n var misclassified = 0;\n var class1Size = result.classSize1;\n var class2Size = result.classSize2;\n top.SVMdirectionVec = result.directionVec;\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
CAM739 Test to check the import/export functionality for DFR record length. | function CAM_739()
{
try
{
Log.Message("Started TC:-Test to check the import/export functionality for DFR record length.")
var DataSheetName = Project.ConfigPath +"TestData\\CAM-739.xlsx"
var File_Name = Project.ConfigPath +"TestData\\CAM-739_Export-Import Configuration\\Configuration.cfg"
//St... | [
"function CAM_734_Verification(OmirconSeqFile,expectedRecordDurationPrevRec,expectedRecordDurationLatestRec,dataSheetName,expectedPrefault,prefaultBuffer=0)\n{\n try\n {\n Log.Message(\"Log Start:-Test to check DFR record length when Trigger comes at end of first record with Seq .\" + OmirconSeqFile)\n //Ste... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
xAnimation, Copyright 20062007 Michael Foster (CrossBrowser.com) Part of X, a CrossBrowser Javascript Library, Distributed under the terms of the GNU LGPL / This needs much more testing. mf, 25Sep06 / Other properties of xAnimation: x,y // instantaneous point af // acceleration factor ap // acceleration period t1 // st... | function xAnimation(e, at, qc, tt, orf, otf, oed, oea, oef) // Object Prototype
{
this.init(e, at, qc, tt, orf, otf, oed, oea, oef);
var a = xAnimation.instances;
var i;
for (i = 0; i < a.length; ++i) { if (!a[i]) break; } // find an empty slot
a[i] = this;
this.idx = i;
} | [
"function Animation(){}",
"function xEllipse(e, xRadius, yRadius, radiusInc, totalTime, startAngle, stopAngle)\r\n{\r\n if (!(e=xGetElementById(e))) return;\r\n if (!e.timeout) e.timeout = 25;\r\n e.xA = xRadius;\r\n e.yA = yRadius;\r\n e.radiusInc = radiusInc;\r\n e.slideTime = totalTime;\r\n startAngle *... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
List available data types | function listAvailableDataTypes() {
Object.keys(tableau.dataTypeEnum).forEach((dataType) => {
const item = document.createElement('li');
item.appendChild(document.createTextNode(dataType));
$("#tableau_availableDataTypes")[0].appendChild(item);
});
} | [
"function getTypeList() { return typeList; }",
"function dataTypes() {\n console.log(typeof true);\n console.log(typeof null);\n console.log(typeof undefined);\n console.log(typeof 5);\n console.log(typeof NaN);\n console.log(typeof 'Hello');\n\n}",
"function getDataTypeList() {\n try {\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Takes a uri to a picture and creates an asset in phone storage, returns uri to to asset | async savePicture(uri) {
const img = await ImageManipulator.manipulate(uri, [], { compress: 0.2 });
const assetImg = await MediaLibrary.createAssetAsync(img.uri);
return assetImg.uri;
} | [
"function createNewFileEntry(imgUri) {\n window.resolveLocalFileSystemURL(cordova.file.cacheDirectory, function success(dirEntry) {\n\n // JPEG file\n dirEntry.getFile(\"tempFile.jpeg\", { create: true, exclusive: false }, function (fileEntry) {\n\n // Do something with it, like write to... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Popup a message if the move cannot proceed. | function cannotProceedMessage(message) {
$.fancyDialog({
title: indiciaData.lang.recordsMover.cannotProceed,
message: message,
cancelButton: null
});
} | [
"function badMove(error){\n\tclearMessage();\n\t$(\"#message\").append($(\"<p>\").append(error));\n\tresetRackPositions();\n}",
"moveError(text) {\n\t\t// alert() is a standard browser feature.\n\t\talert('Invalid move: ' + text);\n\t}",
"function wrongMove() {\n playSound('#wrong');\n switchPlayerTurn();... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
R E N D E R T R A N S L A T I O N S M E T H O D S ===================================================================================================================== Method responsible for displaying the correct translation of the 'About Us' section based on the language | renderAboutUs(language) {
switch(language) {
case 'en':
this.setState({aboutUs: 'About Us'});
break;
case 'is':
this.setState({aboutUs: 'Um Okkur'});
break;
default:
break;
}
} | [
"renderAboutUsTitle(language) {\n switch(language) {\n case 'en':\n this.setState({aboutUsTitle: 'The story of STORMRIDER'});\n break;\n case 'is':\n this.setState({aboutUsTitle: 'Um Okkur STORMRIDER'});\n break;\n d... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Assign a model to this relationship. This method handles coupling in both directions. The second parameter is reserved for internal use. | set(model, _asConstruction=false) {
// Prepare for work by asserting this relationship is loaded, except
// when this is during construction of an ephemeral model, in which
// case this proxy has no state yet.
if (!_asConstruction) this._assertLoaded();
// Ensure we actually... | [
"push(model) {\n // Prepare for work.\n this._assertLoaded();\n this._assertValidFriend(model);\n\n // Additionally assert the included model is not already present in\n // this relation.\n if (this._value.indexOf(model) >= 0) throw new ModelStateError(\n `${ ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Resize the canvas and update the max bubbles upon window resize | function windowResized() {
resizeCanvas(windowWidth, windowHeight);
scaleMaximums();
} | [
"function resizeBubble() {\n for (let i = 0; i < language.length; i++) {\n language[i].style.height = `${language[i].clientWidth}px`;\n }\n for (let i = 0; i < framework.length; i++) {\n framework[i].style.height = `${framework[i].clientWidth}px`;\n }\n }",
"ca... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Bootstrap execution for the env "qa" | function bootstrapForQa() {
var tasks = [];
//Define the tasks in order of execution
tasks.push(createSuperAdminUserIfDoesNotExist);
async.series(tasks, function () {
log.info("Finished executing Bootstrap for 'qa'");
});
} | [
"bootstrapTests() {\n global.app = require('./app');\n app.bot.jobs = {};\n app.raven = null;\n\n this.prepareConfig(false);\n app.config.environment = 'testing';\n app.config.database = {\n type: 'sqlite3',\n filename: ':memory:'\n };\n\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Scene_GameEnd The scene class of the game end screen. | function Scene_GameEnd() {
this.initialize.apply(this, arguments);
} | [
"function GFS_End() {\n\tGameFlowState.call(this);\n\tthis.id = GFS_End.id;\n\tthis.name = 'game ended';\n\tthis.eventHandler = function(gameMessage) {\n\t\t// shouldn't have anything here\n\t\treturn false;\n\t};\n}",
"function end() {\n reset();\n newScene();\n typeEnd();\n}",
"drawEndScene() {\n co... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Event used as a delayed command start. Sets DRQ, generates a DRQ interrupt, sets any additional bits specified, and schedules a lostData() event. | firstDrq(bits) {
this.status |= STATUS_DRQ | bits;
this.machine.diskDrqInterrupt(true);
// Evaluate this now, not when the callback is run.
const currentCommand = this.currentCommand;
// If we've not finished our work within half a second, trigger a lost data interrupt.
t... | [
"firstDrq(bits) {\n this.status |= STATUS_DRQ | bits;\n this.machine.diskDrqInterrupt(true);\n // Evaluate this now, not when the callback is run.\n const currentCommand = this.currentCommand;\n // If we've not finished our work within half a second, trigger a lost data interrupt.... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
slides to the HIGH SCORE SCREEN | function highScoreScreen() {
if (currentPage === 'creditspage') {
$box3.animate({left: $screenWidth}, 150); // slides creditspage back to original location hidden offscreen - 150 is the speed in mlilliseconds
} else if (currentPage === 'highscorepage') {
$box2.animate({left: 0}, 150); ... | [
"function menuScreen() {\n if (currentPage === 'highscorepage') {\n $box2.animate({left: $screenWidth}, 150); // slides highscorepage back to original location hidden offscreen - 150 is the speed in mlilliseconds\n } else if (currentPage === 'creditspage') {\n $box3.animate({left: $screenWidth}, 1... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
wrapper function specific to Google Maps, to make a converstion to lat/lng return a GLatLon instance. takes a usng string, converts it to lat/lng using a call to USNGtoLL, and returns an instance of GLatLng | function GUsngtoLL(USNGtoLL) {
return function(str) {
if (isFunction(GLatLng)) {
var latlng = []
USNGtoLL(str, latlng)
return new GLatLng(aget(latlng, 0), aget(latlng, 1))
} else {
throw new Error('GLatLng not defined.')
}
}
} | [
"function usngToLatLong(usngStr_input) {\n var usngp,\n coords,\n latlon;\n\n usngp = parseUsng(usngStr_input);\n\n // convert USNG coords to UTM; this routine counts digits and sets precision\n coords = usngToUtm(usngStr_input);\n\n // southern hemisphere ca... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Returns true if the mouse is currently over the given note | function mouseIsOver(arcNote){
const pastStart = mouseTheta() < arcNote.stopAngle;
const beforeEnd = mouseTheta() > arcNote.startAngle;
const distToNote = Math.abs(mouseToCenter() * 2 - arcNote.distance);
return pastStart && beforeEnd && distToNote < 10;
} | [
"mouseIsOver() {\n return mouseX >= this.pos.x -this.w/2 && mouseX <= this.pos.x + this.w/2\n && mouseY >= this.pos.y -this.h/2 && mouseY <= this.pos.y + this.h/2;\n }",
"mouseIsOver(){\n return (mouseX >= this.x) && (mouseX <= this.x + this.legWidth) && (mouseY <= ground_height) && (mous... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
The literalize button will automatically change specified characters ( currently &, < and [ ) into their HTML entities in the selected section. This allows users to quickly and easily change these special characters in e.g. code samples so they display correctly. Bugs go to rootbeer277 | function literalize(which) {
myField = document.getElementById(which);
var selectedText = '';
if (document.selection) {
myField.focus();
var sel = document.selection.createRange();
if (sel.text.length > 0) {
selectedText = sel.text;
}
}
else if (myField.selectionStart || myField.selectionStart == '0') {... | [
"function _specialCharsHTML() {\n // Create special characters html.\n return \"\\n <div class=\\\"fr-buttons fr-tabs fr-tabs-scroll\\\">\\n \".concat(_renderSplCharsCategory(categories, selectedCategory), \"\\n </div>\\n <div class=\\\"fr-icon-container fr-sc-container\\\">\... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Subscribes to the interrupt using the specified function. | subscribe(fn) {
this.sub = this.source.onInterrupt.subscribe(fn);
} | [
"Interrupt() {\n\n }",
"[INTERRUPT_DELAY]() {\n this.interrupt = true;\n }",
"subscribeToNotifyCC(func) {\n // Do something with the data recieved.\n this.socket.on('notify-cc', (data) => {\n func(data);\n });\n }",
"function subscribe(topic, func) {\n if (!subscriptions[topic]) {... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Map a given locale to a layout name. | mapLocale(locale = this._defaultLocale) {
let layout;
const country = locale
.split('-')
.shift();
// search for layout matching the
// first part, the country code
if (this.availableLocales[country]) {
layout = this.availableLocales[locale];
... | [
"getLocaleMapping(locale, group = 'default') {\n locale = (0, utils_1.formatLocale)(locale);\n const langMap = this.localeTextMap.get(locale);\n if (langMap) {\n return langMap.get(group);\n }\n }",
"function MapLocale() {\n this.localeID = 0;\n this... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
And for a doughnut chart | function draw_doughnut(ctx) {
var myDoughnutChart = new Chart(ctx, {
type: 'doughnut',
data: {
datasets: [{
data: [available, used],
backgroundColor: [
... | [
"function doughnutChart(){\n let donut_pie_Chart = document.getElementById(\"donut_pie_Chart\");\n let donut_chart = new Chart(donut_pie_Chart, {\n type: 'doughnut',\n data: {\n labels: [\"female\", \"male\",],\n datasets:[\n { \n data:[\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Prints ForStatement, prints init, test, update, and body. | function ForStatement(node, print) {
this.keyword("for");
this.push("(");
this._inForStatementInit = true;
print.plain(node.init);
this._inForStatementInit = false;
this.push(";");
if (node.test) {
this.space();
print.plain(node.test);
}
this.push(";");
if (node.update) {
... | [
"function ForStatement(node, print) {\n\t this.keyword(\"for\");\n\t this.push(\"(\");\n\n\t print.plain(node.init);\n\t this.push(\";\");\n\n\t if (node.test) {\n\t this.space();\n\t print.plain(node.test);\n\t }\n\t this.push(\";\");\n\n\t if (node.update) {\n\t this.space();\n\t print.plain(n... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
fetch list of states | function fetchStatesList() {
return $http({
url: EnvironmentConfig.api + 'shippers/skipAcl_fetchUsStates',
method: 'POST',
})
.then(getDataComplete)
.catch(getDataFailed);
} | [
"static getStates() {\r\n return CensusApi.apiCall(CensusApi.buildUrl(CensusApi.PRODUCTS.ACS_5_10_14, 'get=NAME&for=state:*'));\r\n }",
"async function fetchStates() {\n const res = await fetch(AIR_API_CALL.states);\n const data = await res.json();\n const objStates = data.data;\n const arrayOfState... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
bar position offset and width calculation bl1 is a list of traces (in calcdata) to look at together to find the maximum size bars that won't overlap for stacked or grouped bars, this is all vertical or horizontal bars for overlaid bars, call this individually on each trace. | function barposition(bl1) {
// find the min. difference between any points
// in any traces in bl1
var pvals = [];
bl1.forEach(function(i) {
gd.calcdata[i].forEach(function(v) { pvals.push(v.p); });
});
var dv = Lib.distinctV... | [
"function barposition(bl1) {\n // find the min. difference between any points\n // in any traces in bl1\n var pvals=[];\n bl1.forEach(function(i){\n gd.calcdata[i].forEach(function(v){ pvals.push(v.p); });\n });\n var dv = Plotly.Lib.d... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
this controls flow of the updating snow | function snow() {
for (i = 0; i < flakes.length; i += 1) {
flakes[i].update();
}
snowTimeout = requestAnimationFrame(function () { snow() });
} | [
"function snow(){\n\t\t\t\tfor( i = 0; i < flakes.length; i += 1){\n\t\t\t\t\tflakes[i].update();\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tsnowTimeout = setTimeout(function(){snow()}, 30);\n\t\t\t}",
"function floatySnow() {\n setCond({\n amp: 250,\n speedMin: .1,\n speedMax: 1,\n spinMin: .001,\n spinMax: .... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Button Functions your code START BUTTON Button Functions When Mouse is clicked Down we remove q1State style from q1 | function mouseDown(){
document.getElementById('q1').classList.remove("q1State");
} | [
"function buttonpush(butid){\r\n alloff();\r\n setbuttonstate(butid,'on');\r\n colorize();\r\n}",
"actionOnClick(){\n continueButton.setStyle({ color: '#ff0'});\n }",
"showButton()\n\t{\n\t\tif (mouseX > this.x && mouseX < this.x + this.length &&\n\t\t\t mouseY > this.y && mouseY < this.y + this.height)... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Creates a SentryRequest from an event. | function eventToSentryRequest(event, api) {
// since JS has no Object.prototype.pop()
var _a = event.tags || {}, samplingMethod = _a.__sentry_samplingMethod, sampleRate = _a.__sentry_sampleRate, otherTags = Object(tslib_es6["d" /* __rest */])(_a, ["__sentry_samplingMethod", "__sentry_sampleRate"]);
event.ta... | [
"function eventToSentryRequest(event, api) {\n var useEnvelope = event.type === 'transaction';\n var req = {\n body: JSON.stringify(event),\n type: event.type || 'event',\n url: useEnvelope ? api.getEnvelopeEndpointWithUrlEncodedAuth() : api.getStoreEndpointWithUrlEncodedAuth(),\n };\n... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Call server to mark an issue as done | function mark_as_done(issue_id){
var dataObj = {
"content" : [ {
"session_id" : get_cookie()
}, {
"issue_id" : issue_id
} ]
};
call_server('mark_as_done', dataObj);
} | [
"done() {\n this.fireEvent(\"done\");\n this.setStatus(\"done\");\n }",
"_issueNewRequests() {\n this._updateNeeded = true;\n setTimeout(() => this._issueNewRequestsAsync(), 0);\n }",
"updateTaskToDone(taskId) {\n this.getTask(taskId).status = \"Done\";\n }",
"async issue(nut) {\n nu... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |