query
stringlengths
9
14.6k
document
stringlengths
8
5.39M
metadata
dict
negatives
listlengths
0
30
negative_scores
listlengths
0
30
document_score
stringlengths
5
10
document_rank
stringclasses
2 values
Back to form from preview mode
function backForm(){ $("#form").show(); $(".preview").html(""); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function Back() {\r\n\tClearInputs();\r\n\tdocument.getElementById(\"formSelector\").style.display = \"block\";\r\n\tdocument.getElementById(\"applicationForm\").style.display = \"none\";\r\n\tdocument.getElementById(\"dataForm\").style.display = \"none\";\r\n\tdocument.getElementById(\"moderatorPage\").style.disp...
[ "0.6890183", "0.6685877", "0.66417253", "0.6598521", "0.65982926", "0.65805346", "0.654906", "0.6541586", "0.6528078", "0.6528078", "0.6498799", "0.6496211", "0.64904976", "0.6456155", "0.6393014", "0.6393014", "0.6393014", "0.6393014", "0.6393014", "0.6393014", "0.6393014", ...
0.7697017
0
TODO _j passport get user id
function getUserId(){ if(!passport.cookie || !passport.cookie.lenovoId){ return getCookie("leid"); }else{ return passport.cookie.lenovoId; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "getUserId() {\r\n // TODO:\r\n }", "function getUser(req, res) {\n return req.user._id.toString();\n}", "function getId(){\n return userService.$user.id;\n }", "function fetchUserId() {\n axios\n .get(`${config.apiUrl}/auth/user`)\n .then(res => {\n setU...
[ "0.7555063", "0.74819005", "0.74422795", "0.7409156", "0.7312321", "0.7309096", "0.71452814", "0.71019655", "0.7079271", "0.7002043", "0.6994993", "0.6962896", "0.69576156", "0.69382817", "0.6922679", "0.6879384", "0.68742645", "0.6860773", "0.68605185", "0.68397063", "0.6836...
0.749722
1
Getting the row data and showing google map
function getRowAndShowMap() { // Get raw row data var rawRow = getCheckedRow(); // Get parsed row var parsedRow = parseRow(rawRow); // Get coordinates var coordinates = parsedRow[4].split(/\|/); // Get row number var num = parsedRow[5]; $("#hid_btn" + num).show(); // Initial...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function ViewCustInGoogleMap(data) {\r\n\t\tvar mapOptions = {\r\n\t\t\tcenter: new google.maps.LatLng(9.9710364, 76.2382522), // Coimbatore = (11.0168445, 76.9558321)\r\n\t\t\tzoom: 7,\r\n\t\t\tmapTypeId: google.maps.MapTypeId.ROADMAP\r\n\t\t};\r\n\t\tmap = new google.maps.Map(document.getElementById(\"map_canvas...
[ "0.683336", "0.6623455", "0.6491364", "0.63397825", "0.63257676", "0.6275199", "0.62499833", "0.62145066", "0.618869", "0.6132193", "0.6129841", "0.61223596", "0.6113448", "0.6045683", "0.6037925", "0.6031621", "0.6020344", "0.60196704", "0.60181075", "0.60176855", "0.6007325...
0.70655584
0
Getting the parsed row data (for the current checked row)
function getParsedRowData() { // Get raw row data var rawRow = getCheckedRow(); // Get parsed row var headers = parseRow(rawRow); // Array for pushing row data var rowData = []; var mainHeaderRow = "<thead><th class='flight_info' colspan='10' name='location_header'>From: " + headers[0] ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function getCheckedRow()\n{\n var row = $(\":checked\").closest(\"tr\").attr('id');\n \n return row;\n}", "getAnswer(row, col) {\n return this.readInfo(this.state.csv, 'a' + row)[col];\n }", "function getCurrentRow(){\n return rows[currentRow];\n}", "getQuestion(row, col) {\n return this.r...
[ "0.6206253", "0.6051765", "0.58519125", "0.566767", "0.56070304", "0.5603695", "0.5531811", "0.5492941", "0.5483373", "0.5468542", "0.54595953", "0.5436166", "0.5419811", "0.53874266", "0.5379323", "0.53343964", "0.5333454", "0.53322154", "0.5331266", "0.5308619", "0.5273488"...
0.70881736
0
Setting the hidden label's value
function setHiddenLabel(data) { $("#hidden_lbl").val(data); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "set label(value) {\n this._label = value;\n }", "function setLabel(nod, action) {\n nod.each(function() {\n var value = $(this).val();\n if (!value) {\n $(this).prev(\"label\").css(\"display\", action);\n }\n });\n }", "function onSetShowLabel(value) {\n\tif...
[ "0.7150382", "0.69417095", "0.68410146", "0.68294424", "0.68213224", "0.6644753", "0.6599143", "0.65491724", "0.65491724", "0.65491724", "0.6498722", "0.64851564", "0.63757455", "0.63072723", "0.6259824", "0.62312645", "0.62312645", "0.6219907", "0.6163064", "0.61564964", "0....
0.8199869
0
Setting the hidden total price label (will not be visible on screen)
function setHiddenTotalPriceText(newPrice) { $('#hid_ttl_price').text(newPrice); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function showTotalPrice(totalPrice) {\n if($('.total-event-price'))\n $('.total-event-price').remove();\n const p = document.createElement('p');\n p.className = 'total-event-price';\n p.textContent = 'Total: $' + parseInt(totalPrice);\n $activityRegistrationFieldset.append(p);\n }", "functio...
[ "0.7278226", "0.6937905", "0.6924687", "0.6913066", "0.6865009", "0.67205733", "0.6712954", "0.6671551", "0.66382563", "0.66289365", "0.6625137", "0.6576893", "0.6505099", "0.6503462", "0.650066", "0.6493808", "0.6483784", "0.64750296", "0.6447037", "0.63849145", "0.6369399",...
0.7854198
0
Setting the update price label (to show the updated price on screen)
function setPriceLblText(newPrice) { $('#price_lbl').text(newPrice); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function updatePrice() {\n\tvar productId = getProductId();\n\tvar actualPrice = products.productActualPrices[productId];\n\tif (actualPrice == null) {\n\t\tactualPrice = 0;\t\t\t\t\t\n\t\t$('.product-actual-price-block').addClass('d-none');\n\t\t$('.product-price-block').removeClass('d-none');\n\t} else {\n\t\t$(...
[ "0.7576343", "0.7489563", "0.744832", "0.736818", "0.7193475", "0.708488", "0.7064166", "0.6990333", "0.6962191", "0.6955252", "0.6949541", "0.6923405", "0.687862", "0.68726575", "0.68418527", "0.68415403", "0.683724", "0.67991835", "0.6798457", "0.67734784", "0.6740676", "...
0.77075034
0
Getting the price label's text
function getPriceLblText() { return $('#price_lbl').text(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "getLabel() { return this.core.textContent; }", "function setPriceLblText(newPrice)\n{\n $('#price_lbl').text(newPrice); \n}", "function getPrice(label) {\n let re = /\\$\\d\\d\\d$/g;\n return parseInt(re.exec(label).toString().substring(1, 4));\n}", "get label() {\n return this._text;\n }",...
[ "0.6999048", "0.6960466", "0.6928786", "0.6633007", "0.65970695", "0.6329765", "0.63256264", "0.6239179", "0.6167201", "0.61526513", "0.61377895", "0.6106008", "0.609652", "0.6090048", "0.6084575", "0.6073391", "0.60336107", "0.6017109", "0.6017109", "0.60148066", "0.60148066...
0.8396633
0
=========================== Combine strings function Create a function named combineNames(combine_names in python, ruby) that accepts two parameters (first and last name). The function should return the full name.
function combineNames(firstName, lastName){ var combinedParams = firstName + " " + lastName; return combinedParams; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function combineName(first, last){\n\treturn 'your partner full name is: ' + first + ' ' + last; // we return the first and last name we assigned as parameters \n}", "function combine(){\n var middleName = \"William\" ; // local variable of fullName() => innner variable\n return `${firstName} $...
[ "0.82064664", "0.75631374", "0.7393474", "0.7343681", "0.731259", "0.7310305", "0.7211995", "0.71538997", "0.7033443", "0.70142585", "0.70116353", "0.70031327", "0.69969803", "0.69758636", "0.69758636", "0.6960153", "0.6947073", "0.6947073", "0.68787634", "0.68787575", "0.687...
0.80697453
1
============================ 5 In this kata you will create a function that takes a list of nonnegative integers and strings and returns a new list with the strings filtered out.
function filter_list(l) { // Return a new array with the strings filtered out return l.filter(function(x) { return typeof x === 'number'; }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function filter_list(l) {\n // Return a new array with the strings filtered out\n return l.filter((e) => {\n return Number.isInteger(e);\n });\n}", "function filter_list(l) {\n // Return a new array with the strings filtered out\n \n return l.filter(function(x) {return typeof x == 'number'})\n}", "fun...
[ "0.75706685", "0.72432095", "0.70673656", "0.70591336", "0.69474316", "0.6706427", "0.66229427", "0.65527624", "0.6241725", "0.61886364", "0.6168748", "0.6057134", "0.6048772", "0.6004032", "0.5836154", "0.58318603", "0.58104444", "0.579436", "0.57898384", "0.5766224", "0.569...
0.7299052
1
====================== add up all the whole numbers from 1 through a given number n. verify that n is a valid positive integer number. If not, please, return false
function f(n){ if (Number.isInteger(n) && n > 0) { var output = 0; for (var i = 0; i <= n; i = i + 1) { output += i; } return output; } else { return false; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function sum(n){\n\tvar result = 0;\n\twhile(n>0){\n\t\tresult = result + n;\n\t\tn = n-1;\n\t}\n\treturn result\n}", "function sumAmicableNum (n) {\n let factorOne = 0\n let factorTwo = 0\n var sumAmicible = 0\n for (let i = 2; i <= n; i++) {\n factorOne = sumFactor(i)\n if (factorOne > i && factorOne...
[ "0.7173535", "0.70829725", "0.7001226", "0.6992278", "0.693365", "0.68487436", "0.6837183", "0.6827108", "0.6825187", "0.67999053", "0.67894834", "0.6787925", "0.6787788", "0.6786534", "0.67785966", "0.67776877", "0.6774042", "0.6759954", "0.6757498", "0.67450076", "0.6711117...
0.7682421
0
============================= Mr. Scrooge has a sum of money 'P' that wants to invest, and he wants to know how many years 'Y' this sum has to be kept in the bank in order for this sum of money to amount to 'D'. The sum is kept for 'Y' years in the bank where interest 'I' is paid yearly, and the new sum is reinvested y...
function calculateYears(principal, interest, tax, desired) { // your code for (var y=0; ; y++) { if(principal >= desired){ return y; } else { var yearInterest = principal * interest; var yearTax = yearInterest * tax; principal = principal + (year...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function calculateYears(principal, interest, tax, desired) {\n // your code\n var p = principal;\n var i = interest;\n var t = tax;\n var d = desired;\n var y = 0;\n //use while loop to calculate the total sum of the principal each year\n while (p < d){\n var int = p*i\n p = p + int;\...
[ "0.75881416", "0.7466522", "0.7227972", "0.72088873", "0.7028358", "0.69441026", "0.67621326", "0.6674798", "0.6613537", "0.65707725", "0.654563", "0.65076774", "0.64679295", "0.6450229", "0.6403793", "0.6403793", "0.6395037", "0.6390964", "0.6347758", "0.6218247", "0.6151575...
0.7474361
1
selectRecipes() Takes the group of recipes selected by selectCategory(), and further filters them by the tiered search term (if one has been entered)
function selectRecipes() { // If no search term has been entered, just make the finalGroup array equal to the categoryGroup array — we don't want to filter the recipes further — then run updateDisplay(). if(searchTerm.value.trim() === '') { finalGroup = categoryGroup; updateDisplay(); } else { // Ma...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function initialize(recipes) {\n // grab the UI elements that we need to manipulate\n const category = document.querySelector('select');\n const searchTerm = document.querySelector('input');\n const searchBtn = document.querySelector('button');\n const main = document.querySelector('main');\n const viewRecip...
[ "0.75919026", "0.6597084", "0.6341104", "0.60274804", "0.5882065", "0.5853781", "0.58026654", "0.5770175", "0.5759563", "0.5613464", "0.55862105", "0.5583509", "0.5579193", "0.55790395", "0.555477", "0.54542613", "0.54488087", "0.5436298", "0.54045224", "0.5391972", "0.538413...
0.8471998
0
start the process of updating the display with the new set of recipes
function updateDisplay() { // remove the previous contents of the <main> element while (main.firstChild) { main.removeChild(main.firstChild); } // if no recipe match the search term, display a "No result to display" message if(finalGroup.length === 0) { const heading = document.createElement('h4...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "startDisplay () {\n // Display the console message that the list is starting.\n BaseCommand.displayToConsole( i18n.__(this._modified ? 'cli_pull_modified_started' : 'cli_pull_started'));\n\n // Start the spinner (progress indicator) if we're not doing verbose output.\n if (!this.getComm...
[ "0.62141776", "0.6081062", "0.59273624", "0.58963203", "0.5860871", "0.5859824", "0.5837746", "0.5761534", "0.57346356", "0.5725951", "0.56932867", "0.56864196", "0.56843203", "0.56786203", "0.5670326", "0.56550217", "0.5622895", "0.56214756", "0.5619068", "0.56036973", "0.56...
0.63274246
0
fetchBlob uses fetch to retrieve the image for that recipes, and then sends the resulting image display URL and recipes object on to showRecipes() to finally display it
function fetchBlob(recipes) { // construct the URL path to the image file from the recipes.image property let url = 'resources/' + recipes.image; // Use XHR to fetch the image, as a blob // Again, if any errors occur we report them in the console. const request = new XMLHttpRequest(); request.open('GET', ur...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function getDogImages() {\n fetch('https://random.dog/doggos/')\n //line 49&50 specific to Fetch\n .then(response => response.json()) //looking at response and turning into JSON data\n .then(data => displayDogImages(data)); //taking JSON data and doing something\n }", "...
[ "0.6508667", "0.6493743", "0.6409185", "0.6382994", "0.6366909", "0.6324674", "0.6277735", "0.62485284", "0.60892737", "0.60301846", "0.6011958", "0.59992355", "0.596187", "0.59014785", "0.58970743", "0.58922356", "0.5890301", "0.5885171", "0.587781", "0.5870033", "0.5863334"...
0.85265434
0
Generates a positionInformation div for EDUCATION.
function positionInformationEdu(varTime, h4Text, h5Text) { $dateDifferenceText = getTimeFirst(varTime); return '<div class="position-information"><h4 class="study-field">' + h4Text + '</h4><h5 class="education-name">' + h5Text + '</h5><p class="date-name">' + $dateDifferenceText + '</p></div>'; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function f_positionMainTable()\r\n{\r\n\tv_OutPut = '<table width=\"100%\" border=\"0\" summary=\"Preventive Maintenance Reports\">'+\r\n\t\t\t\t '<caption class=\"PageTytle\">'+\r\n\t\t\t\t\t'Preventive Maintenance Reports'+\r\n\t\t\t\t '</caption>'+\r\n\t\t\t\t\t '<tr>'+\r\n\t\t\t\t\t\t\t'<td valign=\"top\" cla...
[ "0.55418915", "0.5513934", "0.54923314", "0.5471519", "0.5466295", "0.54195976", "0.5419571", "0.5350154", "0.53396046", "0.52822036", "0.5258401", "0.5246032", "0.5217712", "0.52090365", "0.51912856", "0.5182259", "0.51686186", "0.51535076", "0.514696", "0.5112621", "0.51034...
0.59121734
0
Generates a positionInformation div for LANGUAGE.
function positionInformationLanguage(varTime, h4Text, h5Text) { $dateDifferenceText = getTimeFirst(varTime); return '<div class="position-information"><h4 class="language-name">' + h4Text + '</h4><h5 class="level">' + h5Text + '</h5><p class="date-name">' + $dateDifferenceText + '</p></div>'; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function showPosition(position) {\n lat = position.coords.latitude\n lang = position.coords.longitude\n initMap();\n}", "function buildLocation(el, text) {\n const details = el;\n details.innerHTML = text;\n // details[\"position\"] = xy;\n return details;\n}", "function showTranslatorInfo(trans...
[ "0.58665186", "0.5637173", "0.5486262", "0.5465427", "0.54361933", "0.5391083", "0.5375278", "0.5323667", "0.52928114", "0.52465147", "0.5241716", "0.5240832", "0.5228791", "0.5227411", "0.5170619", "0.5136373", "0.5112302", "0.51029587", "0.50921094", "0.5076757", "0.5063706...
0.6574031
0
gets mixins and variables needed for less files
function getLessDependencies (src, req) { var originalUrl = req ? _.get(req, 'originalUrl', ''): '/ui/css/common.css' var less = ''; var siteRoot = process.cwd(); // import variables and mixins every time, regardless of the file requested var lessFilenames = [ 'variables', 'mixins' ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function less(hljs) {\n var IDENT_RE = '[\\\\w-]+'; // yes, Less identifiers may begin with a digit\n var INTERP_IDENT_RE = '(' + IDENT_RE + '|@\\\\{' + IDENT_RE + '\\\\})';\n\n /* Generic Modes */\n\n var RULES = [], VALUE = []; // forward def. for recursive modes\n\n var STRING_MODE = function(c) { r...
[ "0.6434979", "0.6434979", "0.6203038", "0.60862005", "0.6045826", "0.6005852", "0.59526014", "0.574137", "0.5718462", "0.56289667", "0.5379393", "0.5307066", "0.52823144", "0.5158581", "0.51235515", "0.51133734", "0.5099586", "0.5099586", "0.50834394", "0.507374", "0.50132674...
0.6617674
0
gets a compiled and minified common.js
function getCommonJS (brwsrfy) { return new Promise(function(resolve, reject) { brwsrfy.exclude('request'); brwsrfy.transform(vueify); brwsrfy.transform("babelify", { presets: ["es2015"] }); brwsrfy.bundle(function(error, buffer){ var commonJs = ''; // Send the browerified r...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function jsConcatMinif() {\n\tconsole.log(\"ok\");\n\treturn src(['./js/a_compresser/*.js'])\n\t\t.pipe(sourcemaps.init())\n\t\t.pipe(babel({\n\t\t\tpresets: ['@babel/preset-env']\n\t\t}))\n\t\t.pipe(concat('mon_site.min.js', {newLine: ';'}))\n\t\t.pipe(uglify())\n\t\t.pipe(sourcemaps.write('.'))\n\t\t.pipe(dest('...
[ "0.6753411", "0.67502314", "0.66524124", "0.66221136", "0.66203845", "0.66112405", "0.656584", "0.6563341", "0.6550131", "0.65339124", "0.6455288", "0.64336365", "0.6353115", "0.6258831", "0.62463343", "0.6229891", "0.6216682", "0.6208185", "0.6184929", "0.61736894", "0.61607...
0.72026265
0
Publishes a guild to the server
async addGuild(id) { if (this.logger) this.logger.debug('Registering guild with GALL', id); return await this.fetch('POST', '/guild', { guild_id: id }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function saveGuild(guild, data) {\n return new Promise((resolve, reject) => {\n pool.query('UPDATE server_settings SET ? WHERE guild_id = ' + guild, data, err => {\n if (err) reject(err);\n else resolve();\n })\n });\n}", "function addGuild(guild) {\n return new Promi...
[ "0.63937175", "0.6210391", "0.59367883", "0.5820381", "0.57858217", "0.57530105", "0.5626868", "0.55189455", "0.5500358", "0.5467357", "0.5445828", "0.5421023", "0.5380161", "0.53303576", "0.5315461", "0.5287558", "0.52838707", "0.5281703", "0.5238876", "0.52317065", "0.52253...
0.62245286
1
Removes a guild from the server
async removeGuild(id) { if (this.logger) this.logger.debug('Registering guild with GALL', id); return await this.fetch('DELETE', `/guild/${id}`); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "async removeAllGuilds() {\n\t\tthis.checkInitialized();\n\t\tconst guilds = await this.db.collection(\"guilds\");\n\t\treturn guilds.deleteMany({});\n\t}", "function removeGuildfromJson(guild) {\n if (guildPrefixes.hasOwnProperty(guild)) delete guildPrefixes[guild];\n}", "function deleteGuildData(guild_id) ...
[ "0.6546262", "0.6467851", "0.63528585", "0.6306343", "0.59784675", "0.57391506", "0.5719594", "0.5597509", "0.5520523", "0.54378265", "0.54359967", "0.5395396", "0.5360477", "0.5353725", "0.53513455", "0.53448445", "0.5332948", "0.5254048", "0.5247548", "0.523692", "0.5185590...
0.76512
0
Parse a tag into a "panel" object.
function panel(panelTag) { var $panel = $(panelTag); return { advanced: $panel.attr('advanced') === 'true', groups: _.map($panel.find('parameters > label'), group) }; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function createPanel(article){\n var panel = \n $([\"<div class='panel panel-default'>\",\n \"<div class= 'panel-heading'>\",\n \"<h3>\",\n article.headline,\n \"<a class= 'btn btn-danger delete'>\",\n \"Delete From Saved\",\n \"</a>\",\n \"<a class= 'btn btn-info notes'>Article Notes</a...
[ "0.5412198", "0.539356", "0.5252543", "0.5053301", "0.49224886", "0.49224886", "0.49224886", "0.4909507", "0.48532882", "0.4843168", "0.48335078", "0.47841814", "0.4780123", "0.47472954", "0.47404763", "0.46916145", "0.46427795", "0.46427795", "0.46391624", "0.4620682", "0.46...
0.639422
0
Update the collection for Distributors
function updateDistributorsCollection(distributorData) { var distributors = angular.copy($scope.distributors); var newDistributorsList = []; if (typeof distributorData === 'string') { angular.forEach(distributors, function (value, key) { if (value....
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "async update() {\n try {\n const { year, month, amount, seller, brand, exported } = this;\n await FirestoreConnection.fs.collection('salesGoals').doc(this.id).set({\n year,\n month,\n amount,\n seller,\n brand,\n exported,\n });\n } catch (error) {\n ...
[ "0.60353047", "0.5691449", "0.54670155", "0.5453117", "0.54216", "0.54206854", "0.5341622", "0.53296655", "0.5319719", "0.51817787", "0.5088004", "0.5080475", "0.5075633", "0.5045821", "0.5041682", "0.5041682", "0.5041682", "0.5034641", "0.50289994", "0.50289994", "0.5028564"...
0.71382576
0
Returns email with random integer.
function randomEmail() { const prefix = "applicant"; const suffix = "@test.com"; const rng = spinTheWheel(); let email = prefix; email += rng; email += suffix; return email; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function getRandomEmail(){\n var email = \"\";\n var alphabet = \"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789\";\n for (var i = 0; i < 6; i++){\n email += alphabet.charAt(Math.floor(Math.random()*alphabet.length));\n }\n email += \"@gmail.com\";\n return email;\n}", "f...
[ "0.78224707", "0.6654959", "0.6593155", "0.65209323", "0.647387", "0.63192", "0.6297288", "0.6249489", "0.6230874", "0.6227235", "0.6224957", "0.6217042", "0.62105376", "0.62105376", "0.62105376", "0.6201529", "0.6172738", "0.6153792", "0.6150664", "0.6146221", "0.6140967", ...
0.75247973
1
Takes the event parameters and performs some variable substitution for the SQL query based on the actual S3 items being processed.
function createECSTaskVariablesFromS3Record(options, record) { const { event } = options; const { REGION } = options.env; const { util } = options.deps; // Create substituion variables from the S3 record const vars = util.createSubstitutionVariablesFromS3Record(options, record, 's3'); // Apply...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "async function execute_query(query, s3bucket, AWS) {\n const athena = new AWS.Athena();\n\n try {\n const output_location = `s3://${s3bucket}/query-results/`;\n const params = {\n QueryString: query,\n ResultConfiguration: {\n EncryptionConfiguration: { EncryptionOption: 'SSE_S3' },\n ...
[ "0.5384501", "0.5339253", "0.514412", "0.51044863", "0.50386333", "0.49912772", "0.49666893", "0.48636252", "0.48475605", "0.4841596", "0.48362315", "0.4814024", "0.48062715", "0.478739", "0.46410656", "0.46302575", "0.4627795", "0.46260092", "0.46188846", "0.45972258", "0.45...
0.5495643
0
Small utility function to look at a bash command line element and decide if it needs to be quoted and/or any characters escaped. Currently, it just takes are of doublequotes and does not do full nested escapes.
function quoteAndEscape(s) { // Escape any single quote chars using ASCII codes // @see https://stackoverflow.com/a/42341860/332406 // // Throw an exception if there are double-quotes in the command itself, soo much nested // escaping for now.... if (s.includes('"')) { throw new Error(`...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function quoteArg(item) {\n\tif (item == -Infinity) return \"none\"; // color sentinel\n\tif (typeof item == \"number\") return item.toString();\n\tif (typeof item == \"boolean\") return item ? \"T\" : \"F\";\n\tif (Array.isArray(item) && item.length === 2) return item.map(quoteArg).join(\"/\");\n\tif (!item) retu...
[ "0.5870656", "0.5583178", "0.55809265", "0.55809265", "0.55809265", "0.55809265", "0.55809265", "0.5512776", "0.5408914", "0.5399259", "0.5399259", "0.53986776", "0.53912604", "0.5355865", "0.5355865", "0.5355865", "0.5355865", "0.5355865", "0.5355865", "0.53218377", "0.53162...
0.6013646
0
Take an array of commands and modify it with a list of pre and post command to run in the image. This is primarily used to move files in and out of the container ephemeral storage.
function wrapContainerCommand(options, pre, command, post) { // We will run all of the commands as a chained bash command, so merge everything // together using '&&' chaining. // // We expect the pre/post arrays to be full commands, while the command array is a list // on individual pieces of a sing...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "addCommands(...commands) {\n commands.forEach((command) => this.addCommand(command));\n }", "function commandTransform(cmds, callback) {\n let transformed = [];\n\tfor (let cmd of cmds) {\n let newCmd = {type: cmd.type}\n for (let pair of [['x', 'y'], ['x1', 'y1'], ['x2', 'y2']]) {\n if (cm...
[ "0.6022115", "0.5882592", "0.56977874", "0.54162836", "0.53014857", "0.52865505", "0.52774817", "0.52366775", "0.52125347", "0.5203851", "0.5174039", "0.51261574", "0.50515324", "0.4994688", "0.49614835", "0.49340314", "0.4911313", "0.48806724", "0.48791268", "0.4877579", "0....
0.663822
0
Returns the appropriate ECS Task Definition name based on the current action
function getTaskDefinitionName(options, event) { const { GDAL_TASK_DEFINITION, TIPPECANOE_TASK_DEFINITION } = options.env; const { action } = event; switch (action) { case 'gdal': case 'ogr2ogr': case 'enrichment': return GDAL_TASK_DEFINITION; case 'tippecano...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function getName(){\r\n\treturn \"ExampleScriptTask\";\r\n}", "get action() {\n if (this._action !== undefined) {\n return this._action;\n }\n return this.parentTaskDefinition.action;\n }", "task(name, description, action) {\n if (!action) { [action, description] = [descri...
[ "0.65224767", "0.63908434", "0.61591285", "0.59328514", "0.5829725", "0.5753265", "0.57522225", "0.57041484", "0.57002336", "0.55817336", "0.5573599", "0.55636936", "0.5491119", "0.5485219", "0.54381794", "0.5426346", "0.5408943", "0.5367452", "0.5364571", "0.5342309", "0.534...
0.7374329
0
Returns the appropriate ECS Container Definition name based on the current action
function getFargateContainerDefinitionName(options, event) { const { GDAL_CONTAINER_DEFINITION, TIPPECANOE_CONTAINER_DEFINITION } = options.env; const { action } = event; switch (action) { case 'gdal': case 'ogr2ogr': case 'enrichment': return GDAL_CONTAINER_DEFINITI...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "getclassname() {\n return \"Container\";\n }", "getclassname() {\n return \"Container\";\n }", "static getclassname() {\n return \"Container\";\n }", "getServiceMethodName(action) {\n return _stringer.stringer.camelCase(action);\n }", "function actionName(action) {\n\t\tfor(var k in Action)...
[ "0.55090404", "0.55090404", "0.54485255", "0.54017645", "0.5284461", "0.5252323", "0.52500945", "0.52334505", "0.521821", "0.50611174", "0.5005865", "0.48987585", "0.489521", "0.4894204", "0.48758295", "0.48758295", "0.48616675", "0.48590156", "0.47980148", "0.4797167", "0.47...
0.7039521
0
Swap content panels on nav click
function panelSwitch(){ jQuery('nav.panel_switch li a').click(function(event) { // Stop link clicking through event.preventDefault(); // Get id of parent section var sectionID = jQuery(this).closest('section').attr('ID'); var sectionID = '#' + sectionID; // All nav links var panelLin...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function togglePage() {\n if (currentDivId == \"content\") {\n currentDivId = \"content1\";\n }\n else {\n currentDivId = \"content\";\n }\n}", "function switchMainContent(target) {\n const title = target.dataset.page;\n window.history.pushState({}, title, `${window.location.origin}/${title}`);\n...
[ "0.66870797", "0.6548572", "0.63837874", "0.6312815", "0.6284064", "0.62635374", "0.62040424", "0.61386466", "0.61175", "0.60690373", "0.599361", "0.5978743", "0.5965259", "0.59526414", "0.59318817", "0.5927636", "0.5910881", "0.58738923", "0.58696014", "0.58643955", "0.58518...
0.6864517
0
For each row in inputButtons const, create a row View and add an InputButton for each input in the row.
_renderInputButtons() { let views = []; for (var r =0; r < inputButtons.length; r++) { let row = inputButtons[r]; let inputRow = []; for (var i = 0; i < row.length; i ++) { let input = row[i]; inputRow.push( <InputButton value={input} key={...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "_renderInputButtons() {\n let views = [];\n\n for (var r = 0; r < inputButtons.length; r ++) {\n let row = inputButtons[r];\n\n let inputRow = [];\n for (var i = 0; i < row.length; i ++) {\n let input = row[i];\n\n inputRow.push(\n ...
[ "0.7989301", "0.659644", "0.6418744", "0.6363854", "0.63590664", "0.6163788", "0.61189246", "0.6115687", "0.5917047", "0.5900198", "0.58992904", "0.5853283", "0.580881", "0.572265", "0.5721938", "0.56789273", "0.563803", "0.5618752", "0.56077594", "0.5602981", "0.55938923", ...
0.8021352
0
test for valid click or enter key press
function isValidAction(e) { return e.key === 'Enter' || e.type === 'click'; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function isValidClick(e) {\n if (e.type == 'keydown') {\n let keycode = (e.keyCode ? e.keyCode : e.which);\n if (keycode != '13' && keycode != '32') {\n return false;\n }\n }\n return true;\n}", "function enterKey_check(e) {\n\t\tvar txtCommand = document.getElementById(\"txtCommand\...
[ "0.7588504", "0.7390666", "0.72778505", "0.71775484", "0.71775484", "0.71316195", "0.71209735", "0.71069187", "0.7084938", "0.7035765", "0.69943506", "0.6992609", "0.6923896", "0.6858311", "0.6807789", "0.67518204", "0.6736965", "0.6733332", "0.6729928", "0.6719223", "0.66825...
0.762049
1
This is Slicer with objectSortedCollection which uses ktree to accelerate collecting points process Not sure this is really fast :)
function FastSlicer(geometry) {// alert(' in fast slicer'); var xDim = 5; var yDim = 5; var zDim = 5; this.Slice = function(sliceStep) { if (sliceStep <= 0) return; var slicedObject = new SlicedObject(); slicedObject.objectSortedCollection = Constr...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function Slicer(sliceCommandSettings, minZ, maxZ, specPoints) {\n var currentActualPointIndex = 0;\n var actualPoints = [];\n\tvar modelMinZ = minZ;\n var modelMaxZ = maxZ;\n var zDistance = sliceCommandSettings.zDeltaDistance;\n var delta = modelMinZ;\n\tvar currentIndex = 0;\n\t\n var sortedPoi...
[ "0.6066633", "0.5887929", "0.55591273", "0.55571705", "0.55042833", "0.5423178", "0.5409972", "0.538606", "0.53121096", "0.5294375", "0.529317", "0.52821547", "0.52512497", "0.52394825", "0.52288747", "0.5195367", "0.5176534", "0.5166894", "0.5160319", "0.5130616", "0.5121494...
0.692267
0
msg: string, message color: string, [black, red, green, yellow, blue, purple, cyan, white] head: boolean, no print header text
function msg (msg, color=null, head=true) { let msgHeader = '' if (!head) { msgHeader = '[AYM] ' } else { msgHeader = '[AYM]' } const pallet = { "black": '\u001b[30m', "red": '\u001b[31m', "green": '\u001b[32m', "yellow": '\u001b[33m',...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "static colorPrint(colorMsg) {\n if (this.printAllowed) {\n colorMessage(colorMsg);\n }\n }", "function displayMsg(msg, color){\n $('#infos').append('<p class=\"center\" style=\"color:' + color + ';\">' + msg + '</p>');\n }", "function create(color, type, msg) {\n ...
[ "0.65465146", "0.6440794", "0.6381902", "0.62972313", "0.6221682", "0.6210718", "0.6164913", "0.6153773", "0.6077659", "0.6073313", "0.6072033", "0.6071703", "0.6007971", "0.5991945", "0.5988241", "0.5934411", "0.5931151", "0.5881489", "0.58649755", "0.58496374", "0.5823412",...
0.814054
0
cancel function, hide filter definition dialog
function reuropeCancel() { var fDiag = document.getElementById("reurope-dialog"); fDiag.style.display = 'none'; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function closeDialog() {\n setSelectedFilterCategory(null);\n }", "function cancelReport() {\n clearUserMarker();\n disableClickPlacement();\n hideInfoPanel();\n hideScrim();\n $('#add-report-modal').removeClass('show');\n showSearchBar();\n}", "function DoCancel() {\r\n try {\r\n $find(\"m...
[ "0.7192092", "0.6953028", "0.6807611", "0.6769823", "0.67410386", "0.67302537", "0.65940917", "0.65498", "0.65159565", "0.6457965", "0.642653", "0.6383468", "0.6381535", "0.6364032", "0.634779", "0.63383734", "0.63361377", "0.63333327", "0.63200575", "0.6312547", "0.6294704",...
0.6991353
1
retrieve ID's for all filters from local storage those ID's can be used to find filter buttons
function reuropeGetFilterIds() { var ids = []; for (var i = 0; i < localStorage.length; i++) { var key = localStorage.key(i); if (key.indexOf('reurope-filter-') == 0) ids.push (localStorage.key(i)); } ids.sort(); return ids; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function reuropeDumpFilters() {\n\tvar ids = reuropeGetFilterIds();\n\tfor (var i = 0; i < ids.length; i++) {\n\t\tvar filter = JSON.parse(localStorage.getItem(ids[i]));\n\t\tconsole.log (filter);\n\t}\n}", "function reuropeRestoreFilterList() {\n\tvar fIds = reuropeGetFilterIds();\n\tfor (var i = 0; i < fIds.le...
[ "0.77317554", "0.72342825", "0.7102137", "0.71000606", "0.64726645", "0.64475864", "0.62922907", "0.61379266", "0.61298037", "0.609063", "0.607501", "0.60475534", "0.5991596", "0.59914213", "0.59505045", "0.59308684", "0.5923431", "0.5915742", "0.5870869", "0.5834238", "0.583...
0.7915963
0
for debug, print all filter definitions
function reuropeDumpFilters() { var ids = reuropeGetFilterIds(); for (var i = 0; i < ids.length; i++) { var filter = JSON.parse(localStorage.getItem(ids[i])); console.log (filter); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function search_filter_runtime( )\n{\n console.log( \"search_filter_runtime\" );\n}", "function getFilters(options) {\n\tlet filters = options.filter;\n\tif (!filters) {\n\t\tfilters = options.filters;\n\t}\n\tif (!filters) {\n\t\treturn \"\";\n\t}\n\tif (Object.prototype.toString.call(filters) === \"[object St...
[ "0.61340755", "0.5991009", "0.59767985", "0.59598756", "0.5952558", "0.595153", "0.590528", "0.59020257", "0.5874422", "0.587173", "0.5861287", "0.584404", "0.5837439", "0.5837439", "0.5837439", "0.5837439", "0.5837439", "0.5837439", "0.5837439", "0.5837439", "0.5837439", "...
0.63392526
0
Unexport GPIO to free resources
function unExportGpio() { log.info("unExportGpio"); PIR_UpStairs.unexport(); PIR_UpStairs.unexport(); LedStrips.unexport(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function unexportOnClose() { //function to run when exiting program\n LED.writeSync(0); // Turn LED off\n LED.unexport(); // Unexport LED GPIO to free resources\n doorLed.writeSync(0);\n doorLed.unexport();\n sensorLed.writeSync(0);\n sensorLed.unexport();\n button.unexport(); // Unexport Button GPIO to fre...
[ "0.7651884", "0.70760465", "0.6388207", "0.61958134", "0.6144055", "0.6058346", "0.6018933", "0.5889962", "0.5866974", "0.58101255", "0.57890236", "0.5751356", "0.5671358", "0.5628664", "0.56078184", "0.55774873", "0.5565515", "0.5524477", "0.55026567", "0.5457273", "0.544059...
0.8129933
0
however, we have to close the connections even if no event happens because some proxies don't do well with longopen connections so, iterate over the server's long_connections and return an empty array of notifications to the tobeclosed connections
function cleanOldSessions(){ if(server.long_connections.length){ now = (new Date).getTime(); while( (server.long_connections[0].timestamp + TIMEOUT) < now){ server.long_connections.shift().json([]); if(!(server.long_connections.length)) break; } } setTimeout(cleanOldSessions, 1000)...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function cleanupConnections(connections) {\n ArrayExt.removeAllWhere(connections, isDeadConnection);\n }", "function disconnectAll() {\r\n return (dispatch, getState) => new Promise((resolve, reject) => {\r\n const { server } = getState();\r\n if (server) {\r\n // cannot map on a Set(),...
[ "0.5857462", "0.5847475", "0.5841118", "0.579424", "0.57426167", "0.5734301", "0.57224923", "0.57179374", "0.5698366", "0.56841445", "0.56700206", "0.5654658", "0.5651055", "0.5599519", "0.5590369", "0.5543746", "0.5543746", "0.5533128", "0.5529775", "0.5512714", "0.5495223",...
0.6189755
0
Utility method to get a resource ID from a string
function resIDFromString(variableName, resourceName) { return activity.getResources().getIdentifier(variableName, resourceName, activity.getPackageName()); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "get resourceID() {}", "function get_id(s) {\n return id_prefix + '-' + s;\n }", "function getReservationResourceId(resource) {\n if (!resource) {\n return undefined;\n }\n\n const resourceIsString = typeof resource === 'string';\n const isResourceId = resourceIsString;\n const isInlinedResource = !...
[ "0.7349527", "0.7038708", "0.68842447", "0.68692636", "0.6589604", "0.6334899", "0.6324507", "0.62802124", "0.61662215", "0.601613", "0.6013525", "0.59755063", "0.5966488", "0.59569913", "0.5926144", "0.59157664", "0.5901045", "0.5896536", "0.58923817", "0.58719695", "0.58684...
0.74157447
0
this function changes the word presented each time the black button is clicked.
function changeWord (index) { var m = index.shift() $("#sentenceWord").html(sentences[m]) $("#wordButton").show() if (index.length == 0) { $("#wordButton").hide() } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function chooseWord() {\n let wordIndex = Math.floor(Math.random() * Math.floor(wordBank.length));\n word = wordBank[wordIndex];\n for(let i = 0; i < word.length; i++)\n wordShown += \"_\";\n document.getElementById(\"wordShown\").innerText = wordShown;\n console.log(w...
[ "0.6743354", "0.6657414", "0.6611011", "0.6551647", "0.64721113", "0.6427554", "0.63860184", "0.63738245", "0.636931", "0.63627154", "0.6361999", "0.6330746", "0.6291821", "0.6280581", "0.6263489", "0.6252282", "0.6250272", "0.6241483", "0.62413675", "0.6240611", "0.6231909",...
0.6894094
0
Converte parametros (url Get) em um objeto
function ParametroToObjetct(parametros) { let objeto = new Object(); $.each(parametros.split("&"), (i, value) => { objeto[value.split("=")[0]] = decodeURIComponent(value.split("=")[1]); }); return objeto; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function getParam() {\n // capturamos la url\n let loc = document.location.href;\n // si existe el interrogante\n if (loc.indexOf('?') > 0) {\n // cogemos la parte de la url que hay despues del interrogante\n let getString = loc.split('?')[1];\n // obtenemos un array con cada clave...
[ "0.709209", "0.69527113", "0.6544252", "0.63842094", "0.6307867", "0.6163778", "0.6160822", "0.61033463", "0.6084619", "0.6083519", "0.6060044", "0.6047582", "0.60442674", "0.6019822", "0.60018057", "0.5978991", "0.5975526", "0.5948694", "0.594416", "0.5941885", "0.5888568", ...
0.7259589
0
componentWillMount is a lifecycle method in react it will always run before render e.g server request to get all tweets
componentWillMount() { $.get('/api/tweets', (fetchedDataFromServer) => { console.log('data: ', fetchedDataFromServer); this.setState({ tweets: fetchedDataFromServer }); }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "componentWillMount() {\n this.getChatHistory({\n count: 1\n });\n this.getBookmarks();\n }", "componentDidMount() {\n this.getTweets();\n }", "componentDidMount() {\r\n\r\n store.dispatch(loadTweets('/api/tweets/latest/0/5'));\r\n store.dispatch(...
[ "0.7895958", "0.7821231", "0.77803135", "0.772246", "0.772246", "0.7639663", "0.759844", "0.75213426", "0.7462647", "0.74563414", "0.7456027", "0.7424087", "0.7417066", "0.7417066", "0.7417066", "0.7406854", "0.7406854", "0.7406854", "0.73998946", "0.7394286", "0.7376332", ...
0.8076749
0
This function returns query params based on session storage filters.
function getParamsBasedOnSessionStorage(querySexes = true, queryRegions = true, queryYears = true, queryCountries = true) { let query = "?"; query += "dataset=" + getSessionStorageAsQuery("dataset"); query += "&"; query += "BMIFilter=" + getSessionStorageAsQuery("BMIFilter"); if (querySexes === true...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "static getSearchParams() {\n // TODO(zhangtiff): Make this use page.js's queryParams object instead\n // of parsing URL params multuple times, once charts is integrated with the SPA.\n return new URLSearchParams(document.location.search.substring(1));\n }", "function getUrlParams(){\n //Get params f...
[ "0.68693113", "0.66547096", "0.65918016", "0.65744275", "0.65354115", "0.6484793", "0.6438559", "0.63495815", "0.6328907", "0.63189805", "0.6307173", "0.62822765", "0.62661207", "0.62460643", "0.6242418", "0.6234255", "0.62048525", "0.61874866", "0.61738205", "0.61490244", "0...
0.7137215
0
This function's purpose is to load the specified dataset. Sets the session storage
function loadDataSet(datasetName) { if (datasetName === 'who' || datasetName === 'eurostat') { window.sessionStorage.setItem("dataset", datasetName); refreshFilters(); } else { window.sessionStorage.setItem("dataset", 'eurostat'); console.error("ERROR: wrong call on loadDataSet f...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function setDataset(session, datasetSelected) {\n let datasetPath =\n datasetsPath + datasetSelected + \"/\" + datasetSelected + \"_dataset\";\n let currentDataset = session.getCurrentDataset();\n if (currentDataset) {\n let currentDatasetPath = currentDataset.getDatasetPath();\n if (datasetPath == cur...
[ "0.6951108", "0.634657", "0.63167894", "0.62115496", "0.61238945", "0.60712785", "0.59341866", "0.59187496", "0.5876952", "0.58359796", "0.57841396", "0.5747575", "0.574737", "0.57443964", "0.5740841", "0.57336175", "0.57286555", "0.5669598", "0.56505924", "0.5644635", "0.561...
0.64473873
1
================INPUTS ===================== / This function is used below to autogenerate the sidenav of the manual. Given the DOM extracted from an HTML page string, extracts all h2 and h3 tags. Returns an array of objects, one object per found tag. Each object contains the "subtitle" (textual content of the header),...
function getHeaders( dom ) { const hTags = ["h2", "h3"]; const elements = dom.document.querySelectorAll(hTags.join()); const headers = []; elements.forEach(el => { const subtitle = el.innerHTML; const id = el.getAttribute("id"); headers.push({ id, subtitle, level: hTags.indexOf(e...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "getDOMContent({ href }) {\n\n // Assemble the local path to the file using its href.\n const filePath = path.join(\"public\", href, \"index.html\");\n\n // Read the file and parse it into a DOM tree.\n const content = fs.readFileSync(filePath, \"utf-8\");\n const { document } = n...
[ "0.6169469", "0.5546941", "0.5473833", "0.5384255", "0.53712934", "0.5362587", "0.5316167", "0.5300744", "0.5290292", "0.52674305", "0.52520114", "0.5209201", "0.5192756", "0.51313263", "0.51306516", "0.5123963", "0.51186675", "0.51025444", "0.5085481", "0.508105", "0.5029675...
0.66458553
0
This function is used below to autogenerate the sidenav of the manual. Given an array of h2/h3 headers (produced by getHeaders() above), builds a nested tree of the document structure. This assumes that the headers occur in the array in the order in which they occur on the page (which should be the case). Returns an ar...
function headerTree( headers ){ const headertree = [] for( let h of headers ){ const lev = h.level if( lev === 0 ){ headertree.push( h ) } else if ( lev === 1 ){ const last = headertree.length-1 if( !headertree[ last ].hasOwnProperty("subsec") ){ headertree[ last ].subsec = [] } headertree[la...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function buildTOC() {\n // Find headings for table of contents.\n var headings = [];\n findHeadings(bodyElm, headings);\n var headingsLen = headings.length;\n\n if (!headingsLen) {\n return;\n }\n\n // Exclude first heading (page title)\n headings.shift();\n headingsLen--;\n\n if...
[ "0.6236634", "0.6037767", "0.59179354", "0.58216184", "0.5760273", "0.5749383", "0.5612317", "0.5484773", "0.54391456", "0.5385939", "0.53647554", "0.53564966", "0.53316915", "0.53146774", "0.5313254", "0.52712303", "0.5228496", "0.52021307", "0.51953644", "0.5195106", "0.516...
0.6186883
1
A function to render the templates, converting them to the output html pages in the public/ folder.
function renderPage( name, view ){ fs.writeFileSync( "public/"+name+".html", Mustache.render(fs.readFileSync("templates/"+name+".mustache").toString(), view, partials) ) }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function createHtmlRender(template) {\r\n return function render(locals, callback) {\r\n // read template\r\n fs.readFile(template, 'utf8', function (err, str) {\r\n if (err) return callback(err);\r\n\r\n var body = str\r\n .replace(/\\{style\\}/g, locals.style.concat(iconStyle(locals.fileL...
[ "0.6404397", "0.6388985", "0.6361914", "0.6342944", "0.63285995", "0.62688655", "0.6241501", "0.62414646", "0.6238513", "0.6190354", "0.61587924", "0.6149919", "0.6146695", "0.6137637", "0.61238796", "0.6109136", "0.60572755", "0.60534656", "0.6044994", "0.6036795", "0.603293...
0.6424516
0
This function returns an array of objects, one object per separate manual section (as entered in the site.json file). This is used to construct the "fixed" portion of the manual side nav, which contains only a link to the main title of each manual page. Later, we'll add for each individual manual page also the links to...
function mainNav(){ const mnav = [] for( let p of view.manual ){ mnav.push({ title : p.title, tag : p.tag, nav : [], active : false }) } return mnav }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function genNav(source) {\n var headers = [];\n var lines = source.split(/\\r?\\n/);\n // First pass: Scan the Markdown source looking for titles of the format:\n // `### Title ###`. Record the line number, header level (number of\n // octothorpes), and text of each matching title.\n lines.forEach(function (...
[ "0.6586391", "0.57814384", "0.57532436", "0.56430835", "0.5567191", "0.549926", "0.5493092", "0.5485648", "0.5456099", "0.5421493", "0.5387347", "0.53676456", "0.5361583", "0.5361234", "0.5351073", "0.533277", "0.5319464", "0.5314637", "0.52829856", "0.52669483", "0.52629155"...
0.6542895
1
create the box, on which the data from the mpl in the all matches page is going to be displayed
function mplBoxCreate() { var mplResp ={ "country": "Casiopea_0", "competition": "TerraMAlgon_0", "compId": 0, "serinr": 1, "lfml": [ { "t1": "Sarpsborg 08", "t2": "Lillestrøm", "ft1": 1, "ft2": 9, "ht1": 1, "ht2": 3, "h1": 0.0, ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function _generateTapBoxes() {\n $(snapPoints).each(function (index) {\n if (clickPosition) {\n $(sliderContainer).append('<div class=\"slider-tap-box\">' + sliderValues[index] + '</div>');\n }\n });\n $(sliderContainer).children('.s...
[ "0.59675735", "0.59108084", "0.58772576", "0.58273417", "0.58214045", "0.5798435", "0.57944286", "0.5782838", "0.5776966", "0.5762675", "0.57614756", "0.57347333", "0.5711653", "0.5711653", "0.56610906", "0.5642259", "0.56407535", "0.56351626", "0.56348056", "0.5623649", "0.5...
0.71217257
0
create the extra data colapsable pannel for the mpl
function collapsablePannelCreator(line_i){ //build the colapsable pannel for the graphical and statistical data //the div that keeps all the data var collapseDiv = document.createElement('div'); $(collapseDiv).attr("id","collapsePanel"+line_i); $(collapseDiv).attr("class","panel-collapse collapse"); $(collapseDi...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function addVPanel(conteneur){\nvar groupe = conteneur.add('group');\ngroupe.orientation = 'column';\ngroupe.alignChildren = ['fill','fill'];\ngroupe.spacing = 2;\ngroupe.margins = 1;\n//expertMode ? groupe.alignment = ['left','top'] : groupe.alignment = ['center','top'];\ngroupe.alignment = ['fill','fill'];\nretu...
[ "0.5813609", "0.56455815", "0.56237894", "0.55941606", "0.559066", "0.55906445", "0.5553655", "0.54489833", "0.5436211", "0.5430483", "0.5412498", "0.5397848", "0.5346172", "0.5336008", "0.5335701", "0.5334599", "0.53306687", "0.5305089", "0.5286886", "0.52692497", "0.5248582...
0.57768846
1
Checks whether the Vertex is stable.
isStable() { if (this.grains >= 4) { // NOTE: Can swap this out for a `maxGrains` arg to generalize return false; } else { return true; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "_checkVertexUpdate() {\r\n if (!this._needsVertexUpdate) return;\r\n this._updateVertexBuffer();\r\n this._needsVertexUpdate = false;\r\n }", "hasVertices() {\n return this.vertices.length > 0;\n }", "is_available(idx,value) {\n return ((idx!=value) && (!this.vertices[i...
[ "0.6772854", "0.58107513", "0.5260962", "0.52503824", "0.5211114", "0.52004224", "0.51866496", "0.5158633", "0.51535416", "0.5135301", "0.5106529", "0.5061483", "0.50505435", "0.5049466", "0.5037333", "0.503555", "0.50343895", "0.5024", "0.5024", "0.5016508", "0.500884", "0...
0.6259452
1
Adds a Vertex to this Vertex's neighbors. Used in LatticeGraph setup.
addNeighbor(vertex) { this.neighbors.push(vertex); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "_implementAddVertex() {\n const v = this.getNumVertices();\n const neighbors = new Array();\n this.adjListMap.set(v, neighbors);\n }", "addVertex(vertex) {\n this.nodes.add(vertex);\n }", "addVertex(vertex) {\n this.nodes.add(vertex);\n }", "_implementAddEdge(v, w) {\n ...
[ "0.77360946", "0.74093914", "0.74093914", "0.6826537", "0.6796305", "0.67521757", "0.6728586", "0.6660456", "0.662367", "0.66084063", "0.66009104", "0.6554866", "0.6551847", "0.6533818", "0.65311575", "0.65250343", "0.6515123", "0.6506813", "0.64696103", "0.6468562", "0.64556...
0.8046541
0
Returns a string of the xycoordinates of this Vertex's neighbors.
neighborsToString() { let str = ''; for (let neighbor of this.neighbors) { str += `(${neighbor.hash()}), `; } return str.slice(0, -2); // Cut off the final trailing ', ' }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "toString() {\n return `Vertex: (${this.hash()}), grains: ${this.grains}, stable: ${this.isStable()}\\n` +\n ` neighbors: ${this.neighborsToString()}`;\n }", "function toString(xy) {\n return xy.x + ', ' + xy.y;\n }", "toString() {\n let s = this.totalVertic...
[ "0.67241704", "0.6431075", "0.6074854", "0.59060067", "0.5826933", "0.57368374", "0.57190746", "0.5609666", "0.5574485", "0.557137", "0.556372", "0.55306876", "0.5523355", "0.5519932", "0.5513931", "0.5473698", "0.54337966", "0.54199636", "0.54156995", "0.54006207", "0.537963...
0.67511684
0
Make sure the Stripe library has been loaded before using it.
waitForLibrariesThenInit () { if (typeof Stripe !== 'undefined') { this.stripe = Stripe(this.settings.public_key, { locale: document.documentElement.lang, }) this.initElements() } else { window.setTimeout(() => { this.waitForLibrariesThenInit() }, 100) } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "componentDidMount() {\n this.stripe = window.Stripe('pk_test_hJ3fbHvbQZFxyrbtjNnBrU4k00A6Mx6jvD', {\n betas: ['checkout_beta_4'],\n })\n }", "function onGooglePayLoaded() {\n \n // Initialize the client and determine readiness to pay with Google Pay:\n // 1. Instantiate the client using th...
[ "0.58601314", "0.58388907", "0.58010346", "0.5620954", "0.5600377", "0.55949515", "0.55410564", "0.54579455", "0.5331284", "0.52893335", "0.5272181", "0.51901954", "0.51561147", "0.5116809", "0.506934", "0.5062242", "0.5055112", "0.504552", "0.50008", "0.49691907", "0.4962870...
0.7345255
0
Read font sources from the settings. If the item is an object, we just pass it on. If it is a string, we assume it is a URL to a CSS with fontface declarations and wrap it in a new settings object for Stripe JS.
getFontSrc () { return this.settings.font_src.map((item) => { if (typeof item === 'string') { return { cssSrc: item } } else { return item } }) }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function initializeToolboxFonts() {\n // TODO: Verify that custom fonts are required\n if (Blockly.Css.CONTENT) {\n const font = getURLParameter('font');\n\n if (font) {\n // Replace font family in Blockly's inline CSS\n for (let f = 0; f < Blockly.Css.CONTENT.length; f++) {\n Blockly.Css....
[ "0.58458877", "0.57050216", "0.56809264", "0.5560418", "0.55566657", "0.5504353", "0.54981434", "0.5397501", "0.5339778", "0.5290999", "0.5253419", "0.5246595", "0.52283376", "0.52270865", "0.52000505", "0.5164412", "0.5163061", "0.5153384", "0.51519495", "0.512912", "0.51267...
0.684505
0
Initialize empty containers with Stripe elements (iframes for form input).
initElements () { this.stripeElements = this.stripe.elements({ fonts: this.getFontSrc() }) const options = { style: this.getStyles(), classes: { invalid: 'invalid', complete: 'valid', focus: 'focus' } } this.$element.find('[data-stripe-element]').each((i, field) => { const name = field...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function injectStripeElements() {\n stripe = Stripe(localStorage.pk_test);\n var elements = stripe.elements();\n card = elements.create(\"card\", {\n style: {\n base: {\n iconColor: \"#666EE8\",\n color: \"#31325F\",\n lineHeight: \"40px\",\n fontWeight: 300,\n fontFam...
[ "0.6736698", "0.60569525", "0.5853418", "0.5780747", "0.5753221", "0.5634403", "0.5556088", "0.555244", "0.554427", "0.55390316", "0.5502097", "0.5493273", "0.5461942", "0.54528046", "0.5451422", "0.5442074", "0.53970337", "0.5385399", "0.5383132", "0.5366534", "0.536284", ...
0.6608904
1
Pass the Stripe id to the backend via a hidden form field.
setStripeId (value) { this.$element.find('[name$="[stripe_id]"]').val(value) }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function stripeTokenHandler(token) {\n// Insert the token ID into the form so it gets submitted to the server\nvar form = document.getElementById('stripe-form');\nvar hiddenInput = document.createElement('input');\nhiddenInput.setAttribute('type', 'hidden');\nhiddenInput.setAttribute('name', 'stripeToken');\nhidde...
[ "0.6639763", "0.6534949", "0.6257512", "0.6164208", "0.61597395", "0.6133849", "0.60605156", "0.60353357", "0.5723193", "0.569789", "0.56300384", "0.5557919", "0.55002284", "0.5475612", "0.5470989", "0.54401904", "0.5424537", "0.53933", "0.5335125", "0.531106", "0.5296732", ...
0.72708064
0
Read values for Stripe payment method from extra data and Stripe fields.
paymentMethodData () { const data = {} this.$element.find('[data-stripe]').each((i, field) => { const keys = field.dataset.stripe.split('.') const value = $(field).val() if (value) { deepSet(data, keys, value) } }) data.card = this.stripeElements.getElement('cardNumber') ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function createPaymentMethod({ card }) {\n const customerId = $('#id_customer_id').text().slice(1, -1);\n let billingName = $('#id_billing_name').text().slice(1, -1); \n let billingEmail = $('#id_billing_email').text().slice(1, -1); \n let priceId = $('#id_price_id').text().toUpperCase().slice(1, -...
[ "0.55137515", "0.54736966", "0.54613227", "0.54137343", "0.5397672", "0.5290467", "0.52541536", "0.51824105", "0.5172199", "0.5132855", "0.51125693", "0.5048367", "0.4993179", "0.49835873", "0.49774823", "0.4918126", "0.48950955", "0.4839001", "0.48253095", "0.48017207", "0.4...
0.66057867
0
Checks whether clientside validation is enabled for this form.
clientsideValidationEnabled () { return typeof Drupal.clientsideValidation !== 'undefined' && typeof Drupal.myClientsideValidation.validators[this.form_id] !== 'undefined' && typeof Drupal.settings.clientsideValidation.forms[this.form_id] !== 'undefined' }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function MvcControlsToolkit_FormIsValid(elementField, validationType) {\n if (validationType == ValidationType_UnobtrusiveClient) {\n return $('#' + elementField).parents('form').validate().form();\n }\n else {\n return true;\n }\n }", "validate () {\n if (...
[ "0.6687309", "0.6672551", "0.66645783", "0.6660323", "0.6610101", "0.6573633", "0.64087653", "0.64047134", "0.64047134", "0.6375526", "0.63537884", "0.63172436", "0.63165605", "0.62928545", "0.62879616", "0.6227166", "0.6227166", "0.6204438", "0.6202424", "0.6187323", "0.6186...
0.7893647
0
Plugin: DefinePlugin Description: Define free variables. Useful for having development builds with debug logging or adding global constants. Environment helpers See:
static defineConstants() { return new webpack.DefinePlugin({ __DEV__: helpers.isDevelopment(), __PRODUCTION__: helpers.isProduction(), __TEST__: helpers.isTesting() }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function getVarsSetup (app : App) {\n var ret = \"\";// return string\n app.state.vars.filter(v => v.enabled !== false).forEach(v => {// for each enabled var\n if(typeof v.type.setupDefinition === \"string\") {// if the definition is valid\n const name = v.name.replace(\" \", \"_\");// get valid var name...
[ "0.5727754", "0.5700325", "0.55485123", "0.54864234", "0.54775614", "0.54535353", "0.5404166", "0.54018384", "0.5380714", "0.5356498", "0.5352509", "0.5340736", "0.5282754", "0.5279641", "0.52781695", "0.52543616", "0.5233701", "0.52238464", "0.5203262", "0.51995325", "0.5180...
0.66879576
0
Plugin: HtmlWebpackPlugin Description: Simplifies creation of HTML files to serve your webpack bundles. This is especially useful for webpack bundles that include a hash in the filename which changes every compilation. See:
static htmlCreation() { return new HtmlWebpackPlugin({ chunksSortMode: 'dependency', template: './src/index', inject: 'body', minify: false }) }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function generateHTMLPlugins (templateDir) {\n const templates = fs.readdirSync(path.resolve(__dirname, templateDir))\n return templates.map(item => {\n // Split names and extension\n const parts = item.split('.')\n const name = parts[0]\n const extension =...
[ "0.64949393", "0.6258618", "0.62517923", "0.6236102", "0.61503667", "0.61292225", "0.61292225", "0.6074799", "0.6023301", "0.59848124", "0.5849621", "0.58229", "0.5770413", "0.5721163", "0.5718383", "0.5659501", "0.56577915", "0.56389457", "0.5632605", "0.5628764", "0.5606637...
0.74790657
0
Plugin: ContextReplacementPlugin Description: Provides context to Angular's use of System.import See: See:
static angularContext() { return new webpack.ContextReplacementPlugin( /angular(\\|\/)core(\\|\/)@angular/, helpers.root('src')); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "constructor() {\n this._context = ServiceLocator.instance.locate('context');\n }", "livelySystemAccessor (varName = 'livelySystem') {\n return `${this.livelyModulesAccessor()};\n var ${varName} = (typeof lively !== \"undefined\" && lively.systemInterface)\n || System.get(System.decanonicalize(\"...
[ "0.5565829", "0.53743255", "0.53155065", "0.53085893", "0.5294885", "0.5281457", "0.52537143", "0.5198243", "0.51852125", "0.518185", "0.51792", "0.51638436", "0.5144678", "0.51113856", "0.50969267", "0.5050654", "0.50349635", "0.50349635", "0.50349635", "0.50318676", "0.5029...
0.66454065
0
Plugin: ExtractTextPlugin Description: Extracts imported CSS files into external stylesheet See:
static extractCss() { return new ExtractTextPlugin(helpers.isProduction() ? '[name].[contenthash].css' : '[name].css') }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function extractForProduction(loaders) {\n return ExtractTextPlugin.extract('style', loaders.substr(loaders.indexOf('!')));\n}", "function extractCSS(source, tempDir, context) {\n var parts = source.split('<style>', 2);\n\n if (parts.length == 2) {\n var end = parts[1].split('</style>', 2);\n var fileNa...
[ "0.6037145", "0.5909258", "0.5778007", "0.5740832", "0.55718017", "0.54951316", "0.54392004", "0.53760576", "0.53239423", "0.52957886", "0.52386326", "0.52374405", "0.521657", "0.52072376", "0.5112018", "0.5109143", "0.5104421", "0.5102839", "0.51016116", "0.5093997", "0.5088...
0.7283733
0
Plugin: UglifyJsPlugin Description: Minimize all JavaScript output of chunks. Loaders are switched into minimizing mode. See:
static uglify() { return new webpack.optimize.UglifyJsPlugin({ beautify: false, //true output: { comments: false }, mangle: { screw_ie8: true }, compress: { sequences: true, //true properties: false, //false dead_code: true, //false ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function minifyJs() {\n return Elixir.Plugins.uglify(Elixir.config.js.uglify.options);\n}", "minify() {\n const name = this.pkg.name;\n const dest = 'dist/' + name + '.js';\n const code = fs.readFileSync(dest).toString('utf-8');\n const u = uglify(code, {\n 'output': {\n...
[ "0.7215443", "0.7074055", "0.69999987", "0.6942476", "0.6860019", "0.6853009", "0.68323416", "0.66162366", "0.65989375", "0.6568731", "0.6474386", "0.6470218", "0.6457712", "0.6428989", "0.63889855", "0.63397574", "0.6331092", "0.6274164", "0.62604094", "0.6242067", "0.624087...
0.7667817
0
Plugin: CommonsChunkPlugin Description: Shares common code between the pages. It identifies common modules and put them into a commons chunk. See: See:
static commonChunks() { return [ new webpack.optimize.CommonsChunkPlugin({ name: [ 'vendor' ], minChunks: function(module){ return module.context && module.context.indexOf("node_modules") !== -1; } }), new webpack.optimize.CommonsChunkPlugin({ ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function define(_, chunk) {\nif (!shared) {\n shared = chunk;\n} else if (!worker) {\n worker = chunk;\n} else {\n var workerBundleString = 'var sharedChunk = {}; (' + shared + ')(sharedChunk); (' + worker + ')(sharedChunk);'\n\n var sharedChunk = {};\n shared(sharedChunk);\n minemap = chunk(shar...
[ "0.58451897", "0.57251406", "0.5680285", "0.5628825", "0.5628825", "0.5628825", "0.5628825", "0.5628825", "0.5628825", "0.56179416", "0.56179416", "0.56179416", "0.56179416", "0.56179416", "0.56179416", "0.56064177", "0.5562595", "0.5550981", "0.55140835", "0.547419", "0.5440...
0.75957894
0
Plugin: ForkCheckerPlugin Description: Do type checking in a separate process, so webpack don't need to wait. See:
static typeChecker() { return new CheckerPlugin(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function typecheck$$1(type, value) {\n // if not in dev-mode, do not even try to run typecheck. Everything is developer fault!\n if (process.env.NODE_ENV === \"production\")\n return;\n typecheckPublic$$1(type, value);\n}", "function typecheck$$1(type, value) {\n // if not in dev-mode, do not ...
[ "0.5830719", "0.5542751", "0.5474229", "0.5454509", "0.5211383", "0.5154645", "0.5122771", "0.51077336", "0.50259906", "0.50259906", "0.500539", "0.48607126", "0.48236448", "0.47680342", "0.4749744", "0.4707067", "0.46830943", "0.46614477", "0.46432146", "0.46412984", "0.4585...
0.6055025
0
Webpack plugin to optimize a JavaScript file for faster initial load by wrapping eagerlyinvoked functions. See:
static optimizeJs() { return new OptimizeJsPlugin({ sourceMap: false }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function lazyLoad (file, opts) {\n var fn = null\n return function _lazyLoad (params, options, callback) {\n if (fn === null) {\n fn = __webpack_require__(\"./node_modules/@elastic/elasticsearch/api/api sync recursive ^\\\\.\\\\/.*\\\\.js$\")(`./${file}.js`)(opts)\n }\n return fn(params, options, c...
[ "0.62000114", "0.6117152", "0.5914579", "0.5880662", "0.5829241", "0.5789548", "0.5735163", "0.56765974", "0.5661625", "0.55446565", "0.5529311", "0.55181223", "0.55102825", "0.55021673", "0.5501986", "0.5470897", "0.546238", "0.543481", "0.5429009", "0.54190856", "0.5412054"...
0.63278276
0
Remove from front: remove and return the first node in the SLL
removeFromFront(){ if(this.isEmpty()) return null; var removed = this.head; this.head = this.head.next; removed.next = null; this.length--; return removed; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "removeFromFront() {\n if (this.head === null) {\n return null;\n } else {\n var firstNode = this.head;\n var secondNode = firstNode.next;\n this.head = secondNode;\n firstNode.next = null;\n this.size--;\n return firstNode;\...
[ "0.834742", "0.8126718", "0.7900879", "0.77904344", "0.77674514", "0.7722075", "0.7679767", "0.76459205", "0.75428057", "0.7495667", "0.7494918", "0.7335787", "0.7308321", "0.7237641", "0.7222821", "0.7139646", "0.71198875", "0.7115974", "0.7094602", "0.70846915", "0.70569664...
0.8129504
1
Gets if it's a rest parameter.
isRestParameter() { return this.compilerNode.dotDotDotToken != null; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function hasRest(node) {\n return t.isRestElement(node.params[node.params.length - 1]);\n}", "function restParameters(first, ...rest) {\n return rest[0] === 1 && rest[1] === 2;\n }", "needsArguments(transforms) {\n\t\treturn (\n\t\t\ttransforms.spreadRest &&\n\t\t\tthis.params.filter(param => param.type =...
[ "0.7064254", "0.6251951", "0.5953123", "0.5953123", "0.57251704", "0.5712494", "0.57077235", "0.56896454", "0.56705886", "0.565547", "0.56461626", "0.5427368", "0.5402277", "0.53714776", "0.53382546", "0.5201821", "0.5184402", "0.51747006", "0.51508135", "0.5112124", "0.50984...
0.76570374
0
Gets if this is a property with a scope or readonly keyword (found in class constructors).
isParameterProperty() { return this.getScope() != null || this.isReadonly(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "isReadonly() {\n return Boolean(\n this.field.readonly || get(this.field, 'extraAttributes.readonly')\n )\n }", "get readonly() { return this._readonly; }", "function hasProperty() {\n return false;\n}", "function isThisProperty(node) {\n var kind = node.kind;\n return (kin...
[ "0.62704504", "0.6177671", "0.58990335", "0.5839974", "0.5836081", "0.5835483", "0.57721406", "0.5771457", "0.5771457", "0.572918", "0.57272524", "0.5606768", "0.5596247", "0.5573946", "0.5444307", "0.5443417", "0.5414454", "0.53618664", "0.52943677", "0.5270193", "0.52560097...
0.6662181
0
Sets if it's a rest parameter.
setIsRestParameter(value) { if (this.isRestParameter() === value) return this; if (value) { addParensIfNecessary(this); manipulation_1.insertIntoParentTextRange({ insertPos: this.getNameNode().getStart(), parent: this, ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "isRestParameter() {\r\n return this.compilerNode.dotDotDotToken != null;\r\n }", "set(structure) {\r\n callBaseSet_1.callBaseSet(exports.ParameterDeclarationBase.prototype, this, structure);\r\n if (structure.isRestParameter != null)\r\n this.setIsRestParameter(structure.isRest...
[ "0.7014801", "0.64584166", "0.5967588", "0.5939679", "0.5902267", "0.5861285", "0.5549231", "0.54582274", "0.52994436", "0.52994436", "0.52947336", "0.52164304", "0.52162206", "0.5186081", "0.5186081", "0.5186081", "0.5159927", "0.51333886", "0.50695497", "0.50695497", "0.506...
0.6679236
1
Methods to override to add parens Sets if this node has a question token.
setHasQuestionToken(value) { if (value) addParensIfNecessary(this); super.setHasQuestionToken(value); return this; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function setQuestion(question) {\n\n}", "processQuestion(node) {\n this.processAttributeWithoutOverride(node, 'header', false, 'header');\n this.processAttributeWithoutOverride(node, 'hint', false, 'hint');\n this.processAttributeWithoutOverride(node, 'answer', false, 'answer');\n }", "function add_q...
[ "0.5384541", "0.5355042", "0.5205145", "0.51377726", "0.5104502", "0.5078655", "0.49672547", "0.49367172", "0.48880178", "0.48326087", "0.48280448", "0.47906628", "0.47537583", "0.4725666", "0.47046232", "0.4692671", "0.46302336", "0.46263722", "0.4615949", "0.4615846", "0.45...
0.74435675
0
1a. Write an isVowel function that takes one parameter, a letter, and returns true if it is a vowel and false if not.
function isVowel(letter) { if (letter == 'a' || letter == 'b' || letter == 'c' || letter == 'd' || letter == 'e') { return true; }else { return false; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "static is_vowel(a_char) { return \"aeiou\".includes(a_char) }", "function isVowel(letter){\n var letter = letter.toLowerCase();\n if (letter === \"a\" || letter === \"e\" || letter === \"i\" || letter === \"o\" || letter === \"u\"){\n return true;\n } else {\n return false;\n }\n}",...
[ "0.8631593", "0.8626112", "0.8487627", "0.8480018", "0.8453965", "0.8444831", "0.84397024", "0.84230435", "0.84207034", "0.8401634", "0.8393146", "0.83925635", "0.83818626", "0.8377603", "0.8369961", "0.83633035", "0.8353911", "0.83479303", "0.83462197", "0.8341603", "0.83180...
0.86372656
0
2a. Write a convertTemp function that takes two parameters: The first is a temperature, and the second is either "toC" or "toF", which tells you whether to covert Fahrenheit to Celsius, or Celsius to Fahrenheit. The function should return the converted temperature.
function convertTemp(temp, convertTo) { if (convertTo == "toC") { return (temp - 32) * (5 / 9); }else if (convertTo == "toF") { return temp * (9 / 5) + 32; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function tempConvert(temperature,convert) { \n\n var con;\n if(convert==\"CF\" || convert==\"cf\" || convert==\"Cf\" || convert==\"cF\")\n {\n con=((temperature*9/5)+32);\n \n }\n else if(convert==\"FC\" || convert==\"fc\" || convert==\"fC\" || convert==\"Fc\")\n {\n con=(temperature-32...
[ "0.8209415", "0.75531024", "0.74446213", "0.74429977", "0.7351871", "0.73170054", "0.7286426", "0.72647434", "0.7263659", "0.72508293", "0.7248034", "0.72078407", "0.71756953", "0.7142355", "0.7126702", "0.71073765", "0.70871127", "0.70798194", "0.70295846", "0.70056045", "0....
0.8505093
0
Gas leaks picker event handler
function OnGasLeaks_Change( e ) { Alloy.Globals.UsersResidentsModeInfrastructure["GAS_LEAKS"] = e.id ; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function newPicker() {\n google.load('picker', '1', {\"callback\" : createPicker});\n }", "constructor(qw, iid, is_item, do_highlight) {\n const { style, vcolors } = Config\n\n const pointer = is_item ? \"me\" : iid\n this.code = is_item ? \"1a\" : \"1\"\n this.qw = qw\n this.iid = iid\n...
[ "0.599194", "0.57177824", "0.5618119", "0.56114435", "0.5610287", "0.55554575", "0.5545708", "0.55348694", "0.5510751", "0.55085284", "0.5501223", "0.5499585", "0.5483414", "0.54186034", "0.5411499", "0.5408552", "0.53556484", "0.53423244", "0.5331668", "0.5331455", "0.531927...
0.6039787
0
Electric current operation picker event handler
function OnElectricCurrentOperation_Change( e ) { Alloy.Globals.UsersResidentsModeInfrastructure["ELECTRIC_CURRENT_OPERATION"] = e.id ; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "_selected(e) {\n let key = e.target.getAttribute(\"data-selected\");\n e.preventDefault();\n e.stopPropagation();\n if (typeof this._elements[key] !== typeof undefined) {\n // haxElement is a unique case\n if (this.pickerType == \"gizmo\") {\n this._elements[key].replace = true;\n ...
[ "0.62990415", "0.6057647", "0.5992635", "0.59256136", "0.59060305", "0.5899055", "0.5894621", "0.5864176", "0.5864113", "0.5844581", "0.5797981", "0.57663924", "0.574911", "0.57312924", "0.56974673", "0.56936854", "0.5651931", "0.5641849", "0.5631739", "0.5626927", "0.5615350...
0.6911565
0
Assigns a time to each chunk of words in an array.
function setTiming(array) { var wpm = 180; var word_length = 5; var delay = 1500; var bonus = 1000; for (var i = 0; i <= array.length - 1; i++) { var words = (countWords(array[i]))/word_length; var words_time = ((words/wpm) * 60) * 1000; total_time = (delay + words_time + bonus)/100; timingArray.push(tota...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function addTimeStrings(array) {\n let duration = 0;\n for (let item of array) {\n duration += durationFromTimeString(item);\n }\n return timeStringFromSeconds(duration);\n}", "function storyMiniLinter (arr) {\n console.log(wordCounter(arr));\n console.log(sentenceNum(arr));\n overusedTimes(overusedWor...
[ "0.59125185", "0.5536925", "0.5412293", "0.53912723", "0.53733003", "0.5369589", "0.5343018", "0.5328744", "0.53256387", "0.5268355", "0.52445376", "0.52068967", "0.5205335", "0.52029425", "0.51988244", "0.51925445", "0.5183568", "0.5169647", "0.51472354", "0.5136435", "0.513...
0.7300087
0
An array of plugins
get plugins() { return Array.from(this.pluginsMap.values()); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function arrayPlugins(){\n var salida = new Array();\n salida.push(plugins());\n salida.push(getFlashVersion());\n salida.push(adblock());\n return salida;\n}", "getPlugins() {\n const plugins = [];\n this._pluginsByName.forEach((regByName) => {\n Reflect.ownKeys(regByName...
[ "0.7673093", "0.7618656", "0.7586108", "0.70319563", "0.69559443", "0.6944712", "0.69312614", "0.67978567", "0.6787157", "0.67722094", "0.6683338", "0.6666572", "0.6634367", "0.6630378", "0.66089356", "0.6604729", "0.6570331", "0.65427256", "0.64864016", "0.64670175", "0.6449...
0.7686508
0
Loads plugin(s) from a given file
async loadFile(path) { // Ensure we have access await fs.access(path); let plugin = require(path); if (typeof plugin === "undefined") { return null; } plugin = await this.parseRequiredFile(plugin); const plugins = []; for (let key in plugin) { ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "loadPlugins() {\n\n SvgEditor.sortPluginsByPriority(this.pluginsConfig);\n\n for (let i=0; i < this.pluginsConfig.length; i++) {\n let pluginConfig = this.pluginsConfig[i];\n if (typeof pluginConfig['class'] === 'undefined') {\n throw new Error('Could not load the plugin at positio...
[ "0.6809091", "0.6672265", "0.6465122", "0.6358701", "0.6314053", "0.61189675", "0.6097251", "0.60582334", "0.598941", "0.59700835", "0.5924599", "0.58320236", "0.57833904", "0.5758326", "0.5679976", "0.5661348", "0.5650219", "0.5620399", "0.5606922", "0.5606922", "0.5606922",...
0.7266282
0
Loads a single, raw plugin (presumably from a class object)
async loadRaw(raw) { const plugin = new raw(this.mainInstance); if (this.options.rawPluginValidator(plugin)) { this.DoNotLoadLoadedPlugins(plugin.identifier); plugin.init && await plugin.init(); return plugin; } return null; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "use(plugin) {\n console.assert(\n plugin.constructor === Object, 'Plugin must be a plain object!');\n Object.setPrototypeOf(plugin, loader);\n return $global.loader = plugin;\n }", "async loadCached(plugin) {\n if (!this.pluginPathCache.has(plugin)) {\n throw new Refe...
[ "0.64577174", "0.6118394", "0.60006976", "0.59650964", "0.59650964", "0.59650964", "0.5933884", "0.5927255", "0.58994496", "0.5841316", "0.5829355", "0.58040243", "0.57395595", "0.57341367", "0.5694133", "0.566817", "0.5661487", "0.5661042", "0.5655565", "0.565206", "0.561087...
0.75039566
0
Get a plugin with the given name
plugin(name) { return this.pluginsMap.get(name) || null; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function queryPlugin(name) {\n var retval = Modul_widget; // fallback if no such plugin exists\n $.each(plugins.modules, function (index, module) {\n if (module.widgetname == name) { retval = module; return false; }\n });\n return retval;\n }", "function loadPlugin(name,...
[ "0.7379439", "0.72320694", "0.6576709", "0.64642304", "0.63065845", "0.62903786", "0.60752565", "0.60539806", "0.59912694", "0.5988702", "0.5977047", "0.5868221", "0.5783821", "0.5762622", "0.5758294", "0.5726288", "0.5722064", "0.5722064", "0.5701371", "0.5689365", "0.567458...
0.777905
0
Unloads all plugins currently in the DylibLoader
async unloadAll() { const reloads = []; for (const [, plugin] of this.pluginsMap) { reloads.push(this.unload(plugin)); } await Promise.all(reloads); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function pluginUnload() {\n\t\n\t\t\t// List of plugins that require detachment\n\t\t\tvar pluginList = ['.datepicker', '.rangepicker', '.colorpicker', '.rgbapicker', '.timepicker', '#graph'];\n\t\t\t\n\t\t\t// Cycle through each plugin and detach its handler\n\t\t\t$.each(pluginList, function(i, e) {\n\t\t\t\tif ...
[ "0.73225105", "0.67836016", "0.66650635", "0.65951747", "0.654753", "0.6418948", "0.6337254", "0.6299826", "0.62149304", "0.6190144", "0.6132111", "0.60614526", "0.6036222", "0.6026874", "0.6024187", "0.59711546", "0.5947402", "0.5930935", "0.5918891", "0.5908635", "0.5904791...
0.7505479
0
Reloads all plugins currently in the DylibLoader
async reloadAll() { const reloads = []; for (const [, plugin] of this.pluginsMap) { reloads.push(this.reload(plugin)); } await Promise.all(reloads); return this.pluginsMap; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "async unloadAll() {\n const reloads = [];\n for (const [, plugin] of this.pluginsMap) {\n reloads.push(this.unload(plugin));\n }\n await Promise.all(reloads);\n }", "function loadPlugins() {\n\t\tEvent.plugins();\n }", "loadCorePlugins () {\n Object.keys(corePlug...
[ "0.6904016", "0.63695216", "0.6323641", "0.62759393", "0.6145566", "0.6133922", "0.60107166", "0.60091186", "0.5952963", "0.5901564", "0.59003145", "0.58862656", "0.58682054", "0.5841422", "0.5728003", "0.56577927", "0.5655005", "0.561842", "0.561842", "0.56071043", "0.556417...
0.67864025
1
Reloads a given plugin
async reload(plugin) { plugin = typeof plugin === "string" ? this.pluginsMap.get(plugin) : plugin; if (!plugin) { return null; } const { identifier } = plugin; await this.unload(plugin); const newPlugin = await this.loadCached(identifier); return newPl...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "static reloadPlugin(plugin) {\n plugin.scriptURLs = plugin.scriptURLs || {};\n plugin.scriptURLs.forEach(scriptURL => {\n this.loadScript(scriptURL).onload = function() {}\n });\n\n let scriptURL = plugin.url;\n\n if (plugin.allowCaching === false) {\n scrip...
[ "0.71207523", "0.70844483", "0.60305566", "0.5898701", "0.5882327", "0.58644956", "0.57653767", "0.5674421", "0.5593777", "0.55624557", "0.5461003", "0.5433692", "0.54164857", "0.5409275", "0.5381434", "0.5377442", "0.5351732", "0.5350759", "0.53439593", "0.53221375", "0.5308...
0.7139844
0
Unload a plugin that is currently loaded
async unload(plugin) { plugin = typeof plugin === "string" ? this.pluginsMap.get(plugin) : plugin; if (!plugin) { return; } this.pluginsMap.delete(plugin.identifier); await this.reflect(plugin); // Stop dispatching events. Object.defineProperty(plugin,...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "async _unloadPlugin() {\n if (this.adapter.loaded) this.adapter.unload();\n this.adapter.loaded = false;\n this.adapter.socket.close();\n }", "function pluginUnload() {\n\t\n\t\t\t// List of plugins that require detachment\n\t\t\tvar pluginList = ['.datepicker', '.rangepicker', '.colorpic...
[ "0.7985668", "0.78886425", "0.726318", "0.7047968", "0.6944321", "0.6748293", "0.6748293", "0.6748293", "0.67394966", "0.6647612", "0.6595897", "0.65942544", "0.6591058", "0.65885675", "0.6582701", "0.6561319", "0.65597117", "0.65415126", "0.653554", "0.6521337", "0.651829", ...
0.79726875
1
Dispatches an event to all plugins (given they pass checkpoints)
async dispatch(name, event) { const events = []; for (const plugin of this.plugins) { if (!this.shouldReceiveEvent(plugin, name, event)) { continue; } events.push(plugin.event(name, event)); } await Promise.all(events); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "execute(event, trigger) {\n const key = trigger + \":\" + event;\n const hooks = this.find(event, trigger);\n _.each(hooks, (hook) => {\n CHHooks.log(\"hooks exec \" + key + \" \" + util.inspect(hook));\n // Event holds changes to core objects\n hook.hook(event, trigger);\n });\n }", ...
[ "0.6140184", "0.561179", "0.56017375", "0.55276597", "0.547309", "0.54299486", "0.54178435", "0.54146206", "0.5364362", "0.5364362", "0.5364362", "0.5364362", "0.5364362", "0.5351919", "0.5351919", "0.5351919", "0.5351919", "0.5351919", "0.53469473", "0.53469473", "0.53469473...
0.5994803
1
Iterate over a plugin map and add them to the main ledger
async intake(plugins) { for (const [key, value] of plugins) { this.pluginsMap.set(key, value); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function initPlugins() {\n\t\tObject.keys(plugins).forEach(initPlugin(name));\n\t}", "function handlePlugins(inputs, calendar) {\n calendar.addPluginInputs(inputs); // will gracefully handle duplicates\n }", "function handlePlugins(inputs, calendar) {\n calendar.addPluginInputs(inputs); // wil...
[ "0.61851466", "0.6180017", "0.6180017", "0.6147851", "0.6147851", "0.6141783", "0.6064927", "0.6019644", "0.5881808", "0.57976335", "0.5760562", "0.5759971", "0.57474357", "0.5683935", "0.56608325", "0.5581251", "0.5579526", "0.55611235", "0.5525177", "0.5497215", "0.5490202"...
0.68253046
0
Returns whether a plugin should receive a given event
shouldReceiveEvent(plugin, eventName, event) { return !this.isInternalEventBlocked(plugin) && !!plugin.takesEvents && !!plugin.event && (this.options.shouldReceiveEvent ? this.options.shouldReceiveEvent(plugin, eventName, event) : true); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function supports(event) {\n if (defaultOptions.mode === MODE_DEV) return !!handlers[event];\n return connect.supports(event);\n}", "supports(eventName) {\n return KeyEventsPlugin.parseEventName(eventName) != null;\n }", "supports(eventName) {\n return KeyEventsPlugin.parseEventName(even...
[ "0.6555014", "0.6552965", "0.6552965", "0.6552965", "0.6552965", "0.6552965", "0.6552965", "0.6552965", "0.6552965", "0.6552965", "0.6552965", "0.64963096", "0.62744397", "0.62744397", "0.62744397", "0.62744397", "0.62744397", "0.62744397", "0.62744397", "0.62744397", "0.6274...
0.72114295
0
Sets the internal eventlistening state
updateInternalListeningState(plugin, value) { Object.defineProperty(plugin, "__listening", { value, writable: false, configurable: true }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "fireStateChangedEvent(){\n for (let listener of this.stateChangedListeners){\n listener();\n }\n }", "function _setListeners(){\n\t\tthis.bgOn.pipe(this);\n\t\tthis.bgOff.pipe(this);\n\t\tthis.slider.pipe(this);\n\n\t\tthis._eventInput.on('click', function(){\n\t\t\tthis.changeState()...
[ "0.5863191", "0.5768734", "0.5683262", "0.5683262", "0.5683262", "0.5683262", "0.56595904", "0.5654967", "0.5612584", "0.5586312", "0.5586312", "0.5586312", "0.55638236", "0.55638236", "0.55638236", "0.55638236", "0.55638236", "0.55638236", "0.55638236", "0.55638236", "0.5563...
0.5852552
1
Determines whether a plugin is internally blocked from events
isInternalEventBlocked(plugin) { const listening = plugin.__listening; return typeof listening === "undefined" ? false : typeof listening === "boolean" ? !listening : false; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function isBlockUIEnabled(source) {\n return configurationOf(source).blockUIOnSubmit;\n }", "function _pprConsumeBlockedEvent(evt)\n{\n var rv = true;\n\n if (_pprBlocking)\n {\n var blockTheEvent = true;\n\n if (window._pprFirstClickPass)\n {\n var newDate = new Date();\n var dif...
[ "0.6379826", "0.6278112", "0.62275034", "0.59749454", "0.59749454", "0.5941641", "0.58256745", "0.58256745", "0.58256745", "0.5816504", "0.5780061", "0.5779736", "0.5779736", "0.5779736", "0.5779736", "0.5779736", "0.5779736", "0.5779736", "0.5779736", "0.5779736", "0.5779736...
0.8048459
0
Resolves a fuzzy plugin to a plugin or null
resolveFuzzy(plugin, mapOverride = this.pluginsMap) { return typeof plugin === "string" ? (mapOverride.get(plugin) || null) : plugin; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "_checkFuzzy() {\n if (!isObject(this._suggestOpts.fuzzy)) {\n this._suggestOpts.fuzzy = {};\n }\n }", "async function SearchByNameFuzzy(exact, fuzzy= '') {\n if(fuzzy === '') {\n return {};\n }\n try {\n let response = await dependencies.request(encodeURI(`${api...
[ "0.5808798", "0.52840745", "0.5243156", "0.5209582", "0.52028424", "0.5177346", "0.5140708", "0.51364195", "0.51326066", "0.50957525", "0.50957525", "0.49877688", "0.49101678", "0.48635477", "0.48334602", "0.48202795", "0.48027796", "0.4767818", "0.4749915", "0.4749915", "0.4...
0.75295603
0
Throws if the plugin is already loaded
DoNotLoadLoadedPlugins(plugin) { if (this.pluginsMap.has(plugin)) { throw new Error("Will not load a plugin that is already loaded."); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "load() {\n const logger = this.application.logger;\n const plugins = this.plugins.length\n ? this.resolvePluginPaths(this.plugins)\n : this.discoverNpmPlugins();\n if (plugins.some((plugin) => plugin.toLowerCase() === \"none\")) {\n return true;\n }\n ...
[ "0.6404678", "0.6190919", "0.6181244", "0.6128692", "0.6128692", "0.6080496", "0.59500057", "0.5901975", "0.58705837", "0.5860425", "0.5846174", "0.5838118", "0.58345735", "0.57722586", "0.5732394", "0.5717648", "0.5655616", "0.5633639", "0.5582183", "0.55785865", "0.5562699"...
0.67355376
0
We are at (x, y) and move with speed (vx, vy). When (if at all) will we pass (0, 0) at a distance <= r? That is, we have (x + t vx)^2 + (y + t vy)^2 = r^2 as equation for t, i.e. (vx^2 + vy^2) t^2 + 2 (x vx + y vy) t + x^2 + y^2 r^2 = 0, with solutions ((x vx + y vy) + sqrt(d)) / (vx^2 + vy^2), where d = (x vx + y vy)^...
function getCollisionTime (x, y, vx, vy, r) { var v2 = pythagoras(vx, vy), s = y * vx - x * vy, d = r * r * v2 - s * s; if (d < 0) { return Infinity; } d = Math.sqrt(d); s = -(x * vx + y * vy); if (s - d <= 0) { return Infinity; } return (s - d) / v2; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function relToPos(p1x, p1y, p2x, p2y, self) {\n let deltas = unitMoveDeltas[self.me.unit];\n //let fuelCosts = unitMoveFuelCosts[self.me.unit];\n \n let closestDist = qmath.dist(p2x,p2y,p1x, p1y);\n let bestDelta = [0,0];\n for (let i = 0; i < deltas.length; i++) {\n\n let nx = p1x+deltas[i][0];\n let ...
[ "0.65721047", "0.6189964", "0.61869", "0.602448", "0.59850156", "0.5982157", "0.5960697", "0.59329337", "0.5897199", "0.5894892", "0.5865777", "0.5841846", "0.5787344", "0.5778897", "0.57295233", "0.5719303", "0.5715349", "0.56889117", "0.5687571", "0.5658144", "0.56310195", ...
0.63814384
1
updateRows updates rows matching query with values
function updateRows(query, values){ [].forEach.call(document.querySelectorAll(query), function(row){ [].forEach.call(row.querySelectorAll('input'), function(input, i){ input.setAttribute('value', values[i]); }); }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "static update(values, conditions) {\n return new Promise((resolve, reject) => {\n require(\"../helpers/\" + index.getDBEngine() + \"Requester.js\").updateTable(this.TABLE_NAME, values, this.SQL_MAPPING, conditions).then((rows) => {\n resolve(rows);\n }, function (err) {\...
[ "0.6604504", "0.6580072", "0.6519978", "0.64998007", "0.6318604", "0.62426883", "0.6176552", "0.6169522", "0.616343", "0.6132148", "0.61296886", "0.6080405", "0.602803", "0.5979061", "0.59157306", "0.58728695", "0.5846862", "0.5772546", "0.57630557", "0.574557", "0.5727244", ...
0.702328
0
drawing yufo1 with its parts
function drawYufoparts(yufx,yufy,yufSize,yufLayer){ // color of the body based on size of body if (yufSize > 90) { col = color(201,101, 104); } else { col = color(63, 176, 172); } //Size of the lights based on size of body if (yufSize>80){ var c = 3; } else { var c=...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "printBackground () {\n\n\t\tthis.ctx.lineWidth = 5;\n\t\t// Color linea\n\t\tthis.ctx.strokeStyle = \"#000000\";\n\t\t// Color relleno\n\t\tthis.ctx.fillStyle = \"#4D4D4D\";\n\n\t\t// Edificio Izquierda\n \tthis.ctx.moveTo(18 - this.x, 66 - this.y);\n \tthis.ctx.lineTo(175 - this.x, 66 - this.y);\n \tthis...
[ "0.60687363", "0.6057949", "0.57905823", "0.5789242", "0.57845485", "0.5783949", "0.5781767", "0.57786256", "0.57651186", "0.5764559", "0.5755927", "0.5754067", "0.57419604", "0.5739007", "0.57275736", "0.5725218", "0.57236356", "0.5706259", "0.56999046", "0.5698907", "0.5698...
0.74737173
0
drawing the glass and aliens inside yufo!!
function drawGlass(x2,y2,glassLength, glassHigth){ //blue glass push(); translate(x2 ,y2); noStroke(); fill(138,204,212); ellipse(0,0,glassLength,glassHigth); pop(); //green aliens push(); strokeWeight(3); stroke(10,102,37); line(x2,y2, x2+( glassLength/4),y2-( glassHigth...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function draw(){\n background(0);\n\n textSize(65);\n textStyle(NORMAL)\n textAlign(CENTER, CENTER);\n stroke(0)\n fill(167);\n textFont('Oi');\n text (\"BLACK LIVES MATTER\",0,0,width/1.111111111,height/1.25);\n\n// adding a gif\n image(gif, width-(gif.width*0.2), height-(gif.height*0.2), gif.width*0.2, ...
[ "0.67214704", "0.6720008", "0.6645282", "0.6618941", "0.6588362", "0.6567137", "0.65245736", "0.6485307", "0.64656556", "0.64498484", "0.64338475", "0.642879", "0.6394744", "0.6392194", "0.6384173", "0.63821226", "0.63804245", "0.63718885", "0.6364214", "0.6361098", "0.634751...
0.7373342
0
drawing body of yufo
function drawBody(xb,yb,sizeb1,sizeb2,rad,col,col3){ push(); stroke(151,131,134); strokeCap(ROUND); strokeWeight(5); line(xb,yb,xb+(2* sizeb2/3),yb+(2*sizeb2/3)); line(xb,yb,xb-(2* sizeb2/3),yb+(2*sizeb2/3)); pop(); // body with color(col) based on size push(); rectMode(CENTER);...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function drawYufoparts(yufx,yufy,yufSize,yufLayer){\n\n // color of the body based on size of body\n if (yufSize > 90) {\n col = color(201,101, 104);\n } else {\n col = color(63, 176, 172);\n }\n\n //Size of the lights based on size of body\n if (yufSize>80){\n var c = 3;\n }\n e...
[ "0.729001", "0.64004946", "0.6328449", "0.6196476", "0.61796135", "0.59667575", "0.59163076", "0.5897727", "0.5891949", "0.586824", "0.5848479", "0.58333266", "0.5793823", "0.5762131", "0.5749178", "0.56814915", "0.5666783", "0.56488204", "0.56298244", "0.55996513", "0.559574...
0.6559698
1
Toggle the todo item selection. Select/deselect all the descendants node
todoItemSelectionToggle(node, $event) { this.checklistSelection.toggle(node); const descendants = this.treeControl.getDescendants(node); if (this.checklistSelection.isSelected(node)) { this.checklistSelection.select(...descendants); } else { this.checklist...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "todoLeafItemSelectionToggle(node) {\n this.checklistSelection.toggle(node);\n this.checkAllParentsSelection(node);\n }", "todoLeafItemSelectionToggle(node) {\n this.checklistSelection.toggle(node);\n if (this.checklistSelection.isSelected(node)) {\n this.checklistfoncs.p...
[ "0.7862386", "0.71908355", "0.64857996", "0.64508873", "0.6328842", "0.62496036", "0.6161096", "0.61508083", "0.61001796", "0.60485643", "0.60319114", "0.6031534", "0.6008104", "0.5975604", "0.59750134", "0.5973957", "0.5963106", "0.59298843", "0.5910548", "0.5873747", "0.586...
0.7822702
1
Toggle a leaf todo item selection. Check all the parents to see if they changed
todoLeafItemSelectionToggle(node) { this.checklistSelection.toggle(node); this.checkAllParentsSelection(node); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "todoLeafItemSelectionToggle(node) {\n this.checklistSelection.toggle(node);\n if (this.checklistSelection.isSelected(node)) {\n this.checklistfoncs.push(node);\n }\n else if (this.checklistfoncs.some(x => x === node)) {\n node.readOnly = 0;\n this.checkl...
[ "0.7815568", "0.7778667", "0.68385834", "0.6404974", "0.6360769", "0.6360107", "0.62139004", "0.61485547", "0.6099188", "0.60350025", "0.5968064", "0.5962206", "0.5917906", "0.5893287", "0.5882285", "0.58803934", "0.5867031", "0.5854487", "0.5819629", "0.5810784", "0.5809441"...
0.82744414
0