Search is not available for this dataset
query
stringlengths
7
355k
document
stringlengths
9
341k
metadata
dict
negatives
listlengths
0
101
negative_scores
listlengths
0
101
document_score
stringlengths
3
10
document_rank
stringclasses
102 values
Function to calculate final score
function CalculateScore(score, homeworkCount) { let submittedHW = homeworkCount / this.presentations.length; let result = score * 3 + submittedHW; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function calculateFinalScore() {\n finalScore = Crafty(\"Score\")._score; // Accesses the Score entity. This requires there to be only one score entity at a time. \n metrics.set(\"finalScore\", finalScore);\n}", "function calculateTotalScore () {\r\n /* METHOD STUB */\r\n}", "function update_final_sco...
[ "0.79352653", "0.74808806", "0.7302292", "0.7284277", "0.7191067", "0.70747596", "0.7069892", "0.70640916", "0.70553213", "0.70511216", "0.6980357", "0.6943111", "0.69063896", "0.6899175", "0.6896487", "0.68811625", "0.68608224", "0.67925096", "0.6772747", "0.676808", "0.6761...
0.6672363
26
Function to compare objects by property finalscore
function compare(student1, student2) { if (student1.finalscore < student2.finalscore) { return -1; } if (student1.finalscore > student2.finalscore) { return 1; } return 0 }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function compare(a, b) {\n return b.score - a.score;\n}", "function compareObjs(a, b){\n if (a.score > b.score){\n return -1;\n } else if ( a.score < b.score){\n return 1;\n } else {\n return 0;\n }\n}", "function compare(x, y){\n return x.score - y.score;\n }", "function compare(a,...
[ "0.7220038", "0.7165041", "0.6810334", "0.65675545", "0.65515727", "0.6471839", "0.6418349", "0.63756454", "0.63416487", "0.6340064", "0.6124541", "0.6084593", "0.6080678", "0.6077053", "0.6067057", "0.5995857", "0.5990349", "0.597821", "0.5959132", "0.5920109", "0.59127915",...
0.67596674
3
The "Not" SOLUTION elimiated because allows ANYTHING not listed in the dependent properties. 1) push oneOf onto anyOf and create new empty oneOf array 2) create new 'optional' schema and also push it onto anyOf 3) populate optional schema allOf with a 'not' for each member of the original oneOf
fixOptionalChoiceNot(jsonSchema, node) { const originalOneOf = new JsonSchemaFile(); originalOneOf.oneOf = jsonSchema.oneOf.slice(0); jsonSchema.anyOf.push(originalOneOf); const theOptionalPart = new JsonSchemaFile(); jsonSchema.oneOf.forEach(function(option, index, array) { ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "fixOptionalChoicePropertyDependency(jsonSchema, node) {\n const originalOneOf = new JsonSchemaFile();\n originalOneOf.oneOf = Array.from(jsonSchema.oneOf);\n jsonSchema.anyOf.push(originalOneOf);\n const theOptionalPart = new JsonSchemaFile();\n jsonSchema.oneOf.forEach(function(...
[ "0.72278905", "0.6569246", "0.6534929", "0.57626754", "0.57360935", "0.5575363", "0.5418899", "0.5402593", "0.5338816", "0.5285391", "0.5222821", "0.51388353", "0.5136812", "0.5120309", "0.5096512", "0.5081625", "0.5046744", "0.5037802", "0.50368506", "0.5006997", "0.50051916...
0.76521164
0
The "Property Depenency" SOLUTION 1) push oneOf onto anyOf and create new empty oneOf array 2) create new 'optional' schema and also push it onto anyOf 3) populate optional schema allOf with a 'not' for each member of the original oneOf
fixOptionalChoicePropertyDependency(jsonSchema, node) { const originalOneOf = new JsonSchemaFile(); originalOneOf.oneOf = Array.from(jsonSchema.oneOf); jsonSchema.anyOf.push(originalOneOf); const theOptionalPart = new JsonSchemaFile(); jsonSchema.oneOf.forEach(function(option, in...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "fixOptionalChoiceNot(jsonSchema, node) {\n const originalOneOf = new JsonSchemaFile();\n originalOneOf.oneOf = jsonSchema.oneOf.slice(0);\n jsonSchema.anyOf.push(originalOneOf);\n const theOptionalPart = new JsonSchemaFile();\n jsonSchema.oneOf.forEach(function(option, index, arr...
[ "0.7319744", "0.7117131", "0.65272176", "0.60550106", "0.56520355", "0.5649956", "0.5437877", "0.5339148", "0.5315379", "0.529031", "0.52059853", "0.51803946", "0.5155045", "0.51506424", "0.51393145", "0.50344056", "0.50040984", "0.49771178", "0.49434978", "0.49400032", "0.49...
0.7239358
1
singleBarChart is a function called by drawBarChart to draw the chart area for a single bar chart. The function takes in three parameters: data: object with four properties: values, labels, scale, and title (as defined for drawBarChart) options: object with eight properties: width, height, spacing, colour, labelColour,...
function singleBarChart(data, options, element) { // extracts needed information from data var values = data.values; var scale = data.scale; // extracts needed information from options var chartWidth = options.width; var chartHeight = options.height; var space = options.spacing; var colour = options.c...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function singleCharts(array) {\n var wBar, elColor;\n\n // Transforming answers in percentage values for single charts and coloring them\n for( i=0; i<array.length; i++) {\n wBar = array[i]*33.33;\n elColor = assignColor(array[i]);\n $('.result-value[data-answer=\"'+(i+1)+'\"]').find(...
[ "0.6524454", "0.62346333", "0.61319315", "0.608345", "0.6016062", "0.5950113", "0.5916212", "0.5851982", "0.5845821", "0.58424866", "0.5810507", "0.57719165", "0.57687485", "0.57134056", "0.5710223", "0.5689678", "0.5689102", "0.5667784", "0.5666508", "0.5657772", "0.5638386"...
0.8171392
0
stackedBarChart is a function called by drawBarChart to draw the chart area for a stacked bar chart. The function takes in three parameters: data: object with five properties: values, labels, scale, title, and legend (as defined for drawBarChart) options: object with seven properties: width, height, spacing, labelColou...
function stackedBarChart(data, options, element) { // extracts needed information from data var values = data.values; var scale = data.scale; var legend = data.legend; // extracts needed information from options var chartWidth = options.width; var chartHeight = options.height; var space = options.spac...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function createStackedBars() {\n //manipulate chart data\n chart.data.forEach(function(d) {\n //set first y value\n var y0 = 0;\n\n //set series\n d.values = axis.serieNames.map(function(name) {\n //set value objec...
[ "0.7348736", "0.70619696", "0.67652744", "0.6759999", "0.66592455", "0.6576328", "0.6548318", "0.6509565", "0.64895177", "0.6407146", "0.6300988", "0.62215704", "0.6205661", "0.6186884", "0.6179971", "0.6116541", "0.611118", "0.61039746", "0.6102327", "0.6101192", "0.60309696...
0.8084221
0
drawXlabels is a function called by drawBarChart to draw the X axis labels for a bar chart. The function takes in three parameters: labels: array of strings representing the labels associated with each value to be displayed on the Xaxis options: object with eight properties: width, height, spacing, colour, labelColour,...
function drawXlabels(labels, options, element) { // extracts needed information from options var chartWidth = options.width; var chartHeight = options.height; var space = options.spacing; // determines the width of the bars displayed var barWidth = (chartWidth / labels.length) - space; // creates the l...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function drawXAxis(labels) {\n paper.leonardo.hLine(plotArea.x, plotArea.y + plotArea.height, plotArea.width);\n\n // TODO: Get rid of magic number. Base labelText on font size.\n var labelY = plotArea.y + plotArea.height,\n labelTextY = labelY + (2 * opts.tickSize);\n\n plot...
[ "0.6941435", "0.68144256", "0.64335173", "0.6410791", "0.6227759", "0.6153292", "0.60808617", "0.60734314", "0.5860482", "0.5813109", "0.5799382", "0.57330227", "0.5689548", "0.56673825", "0.5614415", "0.5596643", "0.5564148", "0.5540618", "0.54914796", "0.54555374", "0.54474...
0.8319586
0
drawYlabels is a function called by drawBarChart to draw the Y axis labels for a bar chart. The function takes in three parameters: data: object with four properties: values, labels, scale, and title (as defined for drawBarChart) chartHeight: positive integer representing the height of the chart area (excluding titles,...
function drawYlabels(data, chartHeight, element) { // extracts scale from data var scale = data.scale; // determines the maximum value to be displayed on the Y axis of the chart var maxY = findMaxY(data.values, scale); // creates the label area that the labels are rendered to var labelArea = $("<div>").a...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function drawYAxis() {\n paper.leonardo.vLine(plotArea.x, plotArea.y, plotArea.height);\n\n // TODO: Get rid of magic number. Base text on font size instead.\n var valueX = plotArea.x - opts.tickSize,\n valueTextX = plotArea.x - (3 * opts.tickSize);\n\n plot(scaleValues, func...
[ "0.6328172", "0.5990655", "0.59508246", "0.5946217", "0.5908815", "0.5877695", "0.58268535", "0.57933664", "0.57480985", "0.57398146", "0.57336324", "0.5724476", "0.57226807", "0.5703542", "0.56823653", "0.56811285", "0.56704915", "0.56646746", "0.56460905", "0.56331867", "0....
0.80711985
0
drawTitle is a function called by drawBarChart to draw the title for a bar chart. The function takes in three parameters: text: string representing the title to be displayed on the top of the bar chart options: object with eight properties: width, height, spacing, colour, labelColour, labelAlign, titleColour, and title...
function drawTitle(text, options, element) { // extracts needed information from options var chartWidth = options.width; var colour = options.titleColour; var size = options.titleSize; // creates the title area that the text is rendered to var title = $("<div>").attr("id", "titleArea"); $(element).appen...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function chartTitle(options) {\n var titletext = $(\"<h1></h1>\").text(options.charttitle);\n titletext.attr(\"id\", \"title\");\n $(\"#chartcontainer\").append(titletext);\n $(\"#title\").css({\n \"color\": options.titlefontcolor,\n \"font-size\" : options.titlefontsize,\n ...
[ "0.7256478", "0.66021353", "0.6508898", "0.6492384", "0.6488951", "0.64387745", "0.64301956", "0.63747346", "0.6368756", "0.62814546", "0.62808037", "0.6260691", "0.6250618", "0.6114404", "0.6091807", "0.60602045", "0.6014662", "0.5975336", "0.5951206", "0.5922305", "0.588330...
0.77159745
0
drawLegend is a function called by drawBarChart to draw the legend for a stacked bar chart. The function takes in three parameters: legend: array of arrays of length two, where the first element is a string representing the key to be displayed in the legend for that stack, and the second element is a string representin...
function drawLegend(legend, options, element) { // extracts needed information from options var chartWidth = options.width; var chartHeight = options.height; // creates the legend area that the legend keys are rendered to var legendArea = $("<div>").attr("id", "legendArea"); $(element).append(legendArea);...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "_drawLegend() {\n if (this.displayOptions.legend.position !== scada.chart.AreaPosition.NONE) {\n const layout = this._chartLayout;\n const legend = this.displayOptions.legend;\n\n let trendCnt = this.chartData.trends.length;\n let lineCnt = Math.ceil(trendCnt / le...
[ "0.70936537", "0.6717181", "0.6473795", "0.6315697", "0.62884957", "0.6273823", "0.6258947", "0.62422323", "0.6214754", "0.62035894", "0.6177152", "0.6161412", "0.6160108", "0.61598015", "0.6055169", "0.6052139", "0.6051951", "0.60513383", "0.6050245", "0.6030987", "0.6020648...
0.69450855
1
drawBarChart is the main function called by the user to create the bar chart. The function takes in three parameters: data: object with four to five mandatory properties: values: can be an array of numbers[>=0] representing the values of the bars, or an array of arrays of numbers[>=0] where each array represents a bar ...
function drawBarChart(data, options, element) { // adds default values to any options that were not specified by the user if (!("width" in options)) { options.width = 500; } if (!("height" in options)) { options.height = 300; } if (!("spacing" in options)) { options.spacing = 5; } if (!("co...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function stackedBarChart(data, options, element) {\n\n // extracts needed information from data\n var values = data.values;\n var scale = data.scale;\n var legend = data.legend;\n\n // extracts needed information from options\n var chartWidth = options.width;\n var chartHeight = options.height;\n var space...
[ "0.8280014", "0.81113636", "0.8036458", "0.8032903", "0.800979", "0.793019", "0.75704026", "0.75563854", "0.75314385", "0.74991995", "0.74809635", "0.7468579", "0.7443469", "0.7431311", "0.74003935", "0.7373022", "0.736309", "0.73491055", "0.734193", "0.73372656", "0.7329105"...
0.8142126
1
Create data if it does not exist
async function createItem(itemBody) { try { // read the item to see if it exists const { item } = await client.database(databaseId).container(containerId).item(itemBody.id).read(); console.log(`Item with id ${itemBody.id} already exists\n`); } catch (error) { // create the data...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function Create(data) {\n if (data) {\n this.setData(data);\n }\n }", "function createDataFolder(){\t\n\tif(!fs.existsSync('./data')){\n\tconsole.log('Creating data folder');\n\tfs.mkdirSync('./data');\n\t}\n}", "addNew(data) {\n\t\tlet db = this.db;\n\n\t\treturn new Promise((resol...
[ "0.6457741", "0.6352754", "0.6304419", "0.6248857", "0.61062425", "0.60740745", "0.60729754", "0.6040731", "0.59249145", "0.5893052", "0.5892524", "0.5886107", "0.5858743", "0.58276933", "0.5811416", "0.5792403", "0.57917625", "0.5773008", "0.5768242", "0.57578707", "0.574476...
0.5302253
87
Exit the app with a prompt
function exit(message) { console.log(message); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function onExitAlertOkClick() {\n app.exit();\n }", "function quit() {\n inquirer.prompt([\n {\n type: \"confirm\",\n name: \"menu\",\n message: \"Would you like to go back to the main menu?\"\n }\n ]).then(function (arg) {\n if (arg.m...
[ "0.7515867", "0.7274055", "0.69792604", "0.69223595", "0.6917811", "0.69139224", "0.6868203", "0.68517786", "0.6816754", "0.6792203", "0.6790188", "0.6758237", "0.6743373", "0.6724784", "0.66841507", "0.66613114", "0.663064", "0.661929", "0.65894586", "0.6570822", "0.6570822"...
0.61252993
65
create a new array of data
function gotData(incomingData){ let newData = []; for(let i=0;i<incomingData.length-1;i++){ let datapoint = incomingData[i]; for(let q=0;q<datapoint.timeone+1;q++){ newData.push({date:dateConverter(datapoint.date), app:"WeChat"}) } for(let j=0;j<datapoint.timetwo+1;j++){ newData.push({da...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function createNewData(data){\n var newData = [];\n for (i = 0; i < data.length; i++) {\n for (j = 0; j < data[i].devices.length; j++) {\n newData.push({\n depName: data[i].depname,\n divName: data[i].devices[j].name,\n ip: data[i].devices[j].ip,...
[ "0.69666666", "0.68432564", "0.674323", "0.66326416", "0.6569593", "0.6488327", "0.6418802", "0.6389963", "0.6368562", "0.6269338", "0.62218344", "0.61573064", "0.6144907", "0.6144907", "0.61279845", "0.61279845", "0.6121644", "0.6095158", "0.6068978", "0.6057279", "0.6048576...
0.0
-1
assign positions to the dots
function yPosition(d,i){ return Math.floor(i/100)*11+60 }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function initializeDots() {\n return [new Posn(0, 0), new Posn(0, 1), new Posn(0, 3), new Posn(0, 4), new Posn(0, 5), new Posn(0, 6),\n new Posn(0, 7), new Posn(0, 19), new Posn(0, 20), new Posn(0, 21), new Posn(0, 25), new Posn(0, 26),\n new Posn(0, 27), new Posn(0, 28), new Posn(1, 0), new Posn(1, 4), n...
[ "0.76185966", "0.7376864", "0.7035323", "0.68570447", "0.6757456", "0.6757456", "0.6757456", "0.67453253", "0.6744592", "0.6711782", "0.6709362", "0.6703391", "0.66708255", "0.6624323", "0.66171247", "0.6609534", "0.6563892", "0.6531351", "0.6477053", "0.6455736", "0.6446774"...
0.0
-1
GET TESTIMONIES FOR SINGLE USER =====================================
function getUserTestimonies(options) { const { authToken, onSuccess, onError } = options; $.ajax({ type: 'GET', url: '/api/testimonies/user', contentType: 'application/json', dataType: 'json', data: undefined, beforeSend: function (xhr) { xhr.setReques...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function getUsers() {\n let url = 'https://itrex-react-lab-files.s3.eu-central-1.amazonaws.com/react-test-api.json';\n return fetch(url)\n .then((resp) => resp.json())\n .then(mainFunc)\n .catch(err => alert('Failed to load data.'));\n }", "function getUsers() {\...
[ "0.61510074", "0.6070518", "0.6070273", "0.59467876", "0.5943548", "0.5855809", "0.5844485", "0.5841076", "0.58386934", "0.5820112", "0.5810383", "0.5761252", "0.57555485", "0.57517475", "0.5739406", "0.57357895", "0.57259816", "0.5725838", "0.5723641", "0.5709115", "0.570514...
0.6216501
0
GET ALL TESTIMONIES =========================================
function getAllTestimonies(options) { const onSuccess = options.onSuccess; const onError = options.onError; $.ajax({ type: 'GET', url: '/api/testimonies/', contentType: 'application/json', dataType: 'json', data: undefined, success: onSuccess, error: e...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "static getAllTests() {\n return [\n CalculatorTest.test01,\n CalculatorTest.test02,\n CalculatorTest.test03,\n CalculatorTest.test04,\n CalculatorTest.test05,\n CalculatorTest.test06,\n CalculatorTest.test07,\n CalculatorTest.test08,\n CalculatorTest.test09\n ];\n...
[ "0.7374177", "0.65604204", "0.65359867", "0.6376098", "0.6376098", "0.6376098", "0.6376098", "0.6376098", "0.6376098", "0.63326955", "0.62825304", "0.627329", "0.62562174", "0.6204884", "0.62035704", "0.6175357", "0.6175357", "0.6156605", "0.6142867", "0.6071675", "0.5963138"...
0.6822369
1
GET SINGLE TESTIMONY =========================================
function getTestimonyByID(options) { const { testimonyID, onSuccess } = options; $.getJSON(`/api/testimonies/${testimonyID}`, onSuccess); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "getTest() {\n return rp({\n method: 'get',\n url: this.url,\n json: true,\n });\n }", "function get_testimony($http, api_obj) {\n\treturn load_sheet($http, api_obj, \"testimony\")\n\t.then((res) => {\n\t\treturn Promise.resolve(res.data.values)\n\t})\n}", "static async fetchTestByID(req, ...
[ "0.6450216", "0.6320264", "0.58758366", "0.5730496", "0.57172054", "0.5689821", "0.5659575", "0.55676585", "0.5545814", "0.55324847", "0.5492024", "0.54679376", "0.54654896", "0.5463894", "0.54558855", "0.542995", "0.5417806", "0.5417806", "0.5417806", "0.5403187", "0.5398065...
0.60212314
2
enable submit button on album form
function enableSubmit() { $('#submit-album-btn').prop("disabled",false); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function submitClick() {\n updateDBUser(currentUser.email, newName, newCountry, pictureIndex);\n setShowForm(!showForm);\n }", "enableSubmit() {\n\t\tlet enabled = this.project.name.length > 0 && this.project.id.length > 0 && this.project.platforms.length > 0 && this.state.locationExists === false;\n\t\ti...
[ "0.661437", "0.6471868", "0.64616126", "0.6387481", "0.6316212", "0.6275799", "0.6231636", "0.6221022", "0.6196667", "0.6177707", "0.6161547", "0.6149847", "0.6129447", "0.6124014", "0.6118316", "0.6092078", "0.6081403", "0.6068091", "0.60324377", "0.6032384", "0.6017762", ...
0.7854596
0
This function draws a point if the element is a polyline or polygon Otherwise it will just stop drawing the shape cause we are done
point(event) { if (this.point != this.start) return this.start(event); if (this.pointPlugin) { return this.pointPlugin(event); } // If this function is not overwritten we just call stop this.stop(event); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "startPoly() {\n if (this.currentPath) {\n var points = this.currentPath.points;\n var len = this.currentPath.points.length;\n if (len > 2) {\n this.drawShape(this.currentPath);\n this.currentPath = new Polygon_1.Polygon();\n this....
[ "0.6698198", "0.6615977", "0.64852315", "0.6182615", "0.61352795", "0.61269295", "0.6124943", "0.6091639", "0.6051183", "0.5978315", "0.5892667", "0.5873334", "0.5834595", "0.580118", "0.5794556", "0.57808536", "0.5768684", "0.5721957", "0.5684394", "0.567504", "0.56207526", ...
0.0
-1
The stopfunction does the cleanup work
stop(event) { if (event) { // console.log('stop after update') this.update(event); } // Plugin may want to clean something // if (this.clean) { this.clean(); } // Unbind from all events off(window, 'mousemove.draw'); this.parent.off('click.draw'); // remove Refernce to Pai...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "stop() {}", "Stop() {}", "function stop() {\n\t\tif (!_stopFn) return;\n\t\t_stopFn();\n\t}", "function stop () {\n stopped = true\n }", "function stop() {\n\t\trunning = false;\n\t}", "stop() {\n this.finishAll();\n }", "function stop(){\r\n\tstopped = 1;\r\n}", "function stop() {\n ...
[ "0.78866065", "0.786397", "0.76721996", "0.75771487", "0.75568306", "0.7537683", "0.74485254", "0.7413554", "0.73702955", "0.731755", "0.7296443", "0.7275388", "0.7275388", "0.7275388", "0.7275388", "0.7275388", "0.7275388", "0.7275388", "0.7275388", "0.7275388", "0.7231601",...
0.0
-1
Updates the element while moving the cursor
update(event) { if (!event && this.lastUpdateCall) { event = this.lastUpdateCall; } this.lastUpdateCall = event; // Get the current transform matrix // it could have been changed since the start or the last update call this.m = this.el.node.getScreenCTM().inverse(); // Call the calc...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function updateCursor() {\n var start, end, x, y, i, el, cls;\n\n if (typeof cursor === 'undefined') {\n return;\n }\n\n if (cursor.getAttribute('id') !== 'cursor') {\n return;\n }\n\n start = input.selectionStart;\n end = input.selectionEnd;\n...
[ "0.6972675", "0.68886364", "0.66630423", "0.65216756", "0.6503179", "0.6451265", "0.643763", "0.6423895", "0.6360906", "0.63202333", "0.62920934", "0.6265541", "0.6239728", "0.62364495", "0.62364495", "0.62364495", "0.62364495", "0.6216527", "0.6213517", "0.6192209", "0.61805...
0.0
-1
Called from outside. Finishs a polyelement
done() { this.calc(); this.stop(); this.el.fire('drawdone'); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "finishPoly() {\n if (this.currentPath) {\n if (this.currentPath.points.length > 2) {\n this.drawShape(this.currentPath);\n this.currentPath = null;\n }\n else {\n this.currentPath.points.length = 0;\n }\n }\n ...
[ "0.6929323", "0.57591784", "0.56620955", "0.5634908", "0.56319076", "0.5442637", "0.5417457", "0.5391076", "0.53871363", "0.537748", "0.5274479", "0.5193413", "0.5183905", "0.51766956", "0.5101", "0.5100963", "0.50879025", "0.5079805", "0.50612426", "0.50605536", "0.5056796",...
0.0
-1
Called from outside. Cancels a polyelement
cancel() { // stop drawing and remove the element this.stop(); this.el.remove(); this.el.fire('drawcancel'); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function cancel() {\r\n click(getCancel());\r\n waitForElementToDisappear(getCancel());\r\n }", "function cancelout() {\n setAddResponse(null);\n setchosenmed(null);\n setExistingPrescription(null);\n }", "function cancel() {\n\t\t\tfocusedControl.fire('cancel');\n\t\t}",...
[ "0.6505635", "0.64975923", "0.6433165", "0.6433165", "0.6433165", "0.6396242", "0.63938737", "0.6274279", "0.62225056", "0.62104756", "0.6210074", "0.6172707", "0.6172707", "0.6145023", "0.6115819", "0.6088657", "0.60852784", "0.60793626", "0.60571337", "0.6052543", "0.603493...
0.6600604
0
Calculate the corrected position when using `snapToGrid`
snapToGrid(draw) { var temp = null; // An array was given. Loop through every element if (draw.length) { temp = [draw[0] % this.options.snapToGrid, draw[1] % this.options.snapToGrid]; draw[0] -= temp[0] < this.options.snapToGrid / 2 ? temp[0] : temp[0] - this.options.snapToGrid; draw[1] ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "_makeRelativeSnap() {\n let [x, y] = this._makeRelative.apply(this, arguments);\n\n let grid = this.context.getGrid();\n if (grid) {\n let roundX = round(this.scale.toStepsX(x), grid);\n let roundY = round(this.scale.toStepsY(y), grid);\n x = this.scale.toDista...
[ "0.71617174", "0.6600336", "0.6564821", "0.65517867", "0.6373837", "0.6362052", "0.6335802", "0.632046", "0.6288081", "0.6271607", "0.608728", "0.60575813", "0.6053469", "0.6051766", "0.60367453", "0.6018786", "0.6016023", "0.5982308", "0.5943089", "0.5880111", "0.5873929", ...
0.6093437
10
Draw element with mouse
draw(event, options, value) { // sort the parameters if (!(event instanceof Event || typeof event === 'string')) { options = event; event = null; } // get the old Handler or create a new one from event and options const paintHandler = this.remember('_paintHandler') || new PaintHandler(...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function click(){\n rect = leinwand.getBoundingClientRect();\n mouseX = event.clientX - rect.left;\n mouseY = event.clientY - rect.top;\n //draw();\n //context.fillStyle();\n context.fillRect(mouseX, mouseY, 40, 40);\n }", "function drawOnMouse(){\n ctx.fillRect(\n mouseX - 5,\n mouseY ...
[ "0.72090214", "0.71778446", "0.7174979", "0.71172184", "0.7073941", "0.7019194", "0.6986255", "0.6986255", "0.69264317", "0.6908139", "0.6882456", "0.6882456", "0.6875656", "0.6839987", "0.6783776", "0.67708814", "0.67556036", "0.6753547", "0.6728096", "0.6727338", "0.6724561...
0.0
-1
Add to list from map info window
function addToList(button){ let locationId = button.getAttribute('data-location-id'); console.log(locationId); $.post({ url: '/api/add_to_list', data: {location_id: locationId}, success: function(){ console.log('Add to list returned success code.'); window.location.href = "/adventu...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function showOverlays()\n{\n setAllMap(map);\n}", "function showOverlays() {\n setAllMap(map);\n}", "function addMarkers() {\r\n map = plugin.google.maps.Map.getMap(div)\r\n $.when(map.clear()).done(function() {\r\n map.clear()\r\n //get map bounds\r\n latLngBounds = map.getVisibleRe...
[ "0.681463", "0.67648983", "0.6722684", "0.6716678", "0.6696838", "0.66666", "0.6655793", "0.66214323", "0.6601839", "0.6601839", "0.6601839", "0.65690017", "0.65632594", "0.6557657", "0.6551586", "0.654298", "0.6529947", "0.65159565", "0.6501827", "0.6499274", "0.6499274", ...
0.0
-1
A function for changing a string to TitleCase
function toTitleCase(str){ return str.replace(/\w+/g, function(txt){return txt.charAt(0).toUpperCase() + txt.substr(1).toLowerCase();}); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function titlecase(str){\n return str.replace(/\\w\\S*/g, function(txt){return txt.charAt(0).toUpperCase() + txt.substr(1).toLowerCase();});\n}", "function toTitleCase(str)\n{\nreturn str.replace(/\\w\\S*/g, function(txt){ return txt.charAt(0).toUpperCase() + txt.substr(1).toLowerCase(); });\n}", "function ...
[ "0.89270747", "0.88591623", "0.8835309", "0.87953866", "0.8784959", "0.8784959", "0.8784959", "0.8784959", "0.8784959", "0.8784708", "0.8778871", "0.8773077", "0.8764918", "0.8745826", "0.8745826", "0.8745826", "0.8745826", "0.87431294", "0.8734439", "0.8726667", "0.87238", ...
0.8723899
20
figure out which transitionEnd listener to use by using all of them on a created element and see which one doesn't return undefined.
function transEventEnd(){ var tr; var elem = document.createElement('tempElement'); var transListener = { 'transition':'transitionend', 'OTransition':'oTransitionEnd', 'MozTransition':'transitionend', 'WebkitTransition':'webkitTransitionEnd' } for (...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function transitionEndEventName() {\n\t\tvar i,\n\t\t\tundefined,\n\t\t\tel = document.createElement('div'),\n\t\t\ttransitions = {\n\t\t\t\t'transition':'transitionend',\n\t\t\t\t'OTransition':'otransitionend', // oTransitionEnd in very old Opera\n\t\t\t\t'MozTransition':'transitionend',\n\t\t\t\t'WebkitTransiti...
[ "0.7094879", "0.6875296", "0.6875296", "0.68568057", "0.680716", "0.680716", "0.679403", "0.6790525", "0.67370033", "0.67370033", "0.67370033", "0.67370033", "0.67370033", "0.67370033", "0.67370033", "0.67370033", "0.67370033", "0.67370033", "0.67370033", "0.67370033", "0.673...
0.72229683
0
Send datas to content script
function Exec( name, content ) { document.dispatchEvent( new CustomEvent( name, { detail: content } ) ); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function sendDataToContentScript(data)\n{\n if(isSecure && secureTabId)\n {\n chrome.tabs.sendMessage(secureTabId, {type: \"submit_data\", data: data});\n }\n}", "function networkSend(){\nchrome.tabs.executeScript(null, {file: \"content.js\"});\n}", "function sendData(name, content) {\n localStor...
[ "0.69766515", "0.65481055", "0.63401747", "0.6099733", "0.60791963", "0.59164995", "0.5875897", "0.58477527", "0.5798767", "0.5798287", "0.5792022", "0.5773747", "0.5742457", "0.5728426", "0.5696634", "0.5670924", "0.56590897", "0.56287533", "0.5615986", "0.56008476", "0.5585...
0.0
-1
Modal save current raffle template
function ExecSaveRaffle() { let obj = { message: [ CKEDITOR.instances[ "rafflemessage" ].getData(), CKEDITOR.instances[ "puzzle-rafflemessage" ].getData() ], entmsg: [ CKEDITOR.instances[ "enteredmessage" ].getData(), CKEDITOR.instances[ "puzzle-enteredmessage" ].getData() ] }; console.log...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function openSave () {\n $('#saveTemplate').modal('show');\n }", "function openSave () {\n $('#saveTemplate').modal('show');\n }", "function SaveCustomTemplate( ) {\n\t\t\t\t//get short-codes for current elements\n\t\t\t\tvar content = oxoParser.parseColumnOptions();\n\t\t\t...
[ "0.72853845", "0.72853845", "0.676944", "0.6240794", "0.62399215", "0.6238478", "0.6156985", "0.61334217", "0.60300756", "0.59708136", "0.59708136", "0.5925894", "0.5918717", "0.5840797", "0.5808609", "0.5795438", "0.578306", "0.57444304", "0.5729284", "0.5694982", "0.5691898...
0.0
-1
TODO stream the bigger file, once the Audio DOM interface has `audioSource`
function createNodes(source) { var nodes = {}; nodes.source = source; if (context.createBiquadFilter) { nodes.filter = context.createBiquadFilter(); nodes.filter.type = "lowpass"; // 0 == LOWPASS } else { nodes.filter = context.createLowPass2Filter(); ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function AudioInputStream() {\n }", "function onchangeaudio(selectedaudio) {\n\tvar audio = selectedaudio.files;\n\tvar url = URL.createObjectURL(audio[0]); \n\taudioplayer.src = url;\n}", "function compressAndStreamWAV() {\n var voiceRequest;\n var reader = new wav.Reader();\n\n reader.on('format', func...
[ "0.63412607", "0.61945635", "0.61922216", "0.61689216", "0.61461264", "0.6101655", "0.59808075", "0.59500194", "0.58749175", "0.58475006", "0.58404183", "0.5837052", "0.5829915", "0.5818198", "0.5815721", "0.58005494", "0.57959074", "0.5786718", "0.57695216", "0.57680154", "0...
0.0
-1
break symbol Array ctor $a(): Build a new array up to the Infinitymarker on the stack. $a(arr): Convert native array to a "view" of the array. $a(len): Create a new array of length `len`
function $a(a) { if (!arguments.length) { for (var i = $j - 1; i >= 0 && $k[i] !== Infinity; i--); if (i < 0) { throw new Error('array-marker-not-found'); } a = $k.splice(i + 1, $j - 1 - i); $j = i; } else if (!(a instanceof Array)) { a = new Array(+arguments[0]); for (var i = 0, l = a.leng...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function myArray(len){\n\tvar a = [];\n\tfor(var i=0; i<len; i++){\n\t\ta[i] = {val:0};\n\t}\n\ta[len-1].val = 1;\n\treturn a;\n}", "function Array() {}", "function makeArray(l) {\n var a = new Array(l + 2);\n a[0] = a[1] = 0;\n return a;\n }", "function makeArray(l) {\n ...
[ "0.61068135", "0.6050825", "0.60073775", "0.5975154", "0.5955244", "0.5947218", "0.59442914", "0.5924219", "0.5924219", "0.5924219", "0.5924219", "0.5924219", "0.5924219", "0.5924219", "0.5924219", "0.5924219", "0.5924219", "0.5924219", "0.5924219", "0.5924219", "0.5924219", ...
0.71434546
0
dict ctor $d() : look for the Infinity marker on the stack
function $d() { var d = {}; for (var i = $j - 1; i >= 0 && $k[i] !== Infinity; i -= 2) { if ($k[i - 1] === Infinity) { throw new Error('dict-malformed-stack'); } // Unlike javascript, postscript dict keys differentiate between // numbers and the string representation of a number. var k = $k[i - 1...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function Infinity() {}", "function hb(a,b,c){G.call(this,c);this.g=a||0;this.f=void 0===b?Infinity:b}", "Identifier(path) {\n if (path.node.name !== \"Infinity\") {\n return;\n } // It's a referenced identifier\n\n\n if (path.scope.getBinding(\"Infinity\")) {\n return;\n ...
[ "0.66845036", "0.5664193", "0.56636924", "0.5641014", "0.5457742", "0.5431911", "0.5339356", "0.52993524", "0.520975", "0.5194335", "0.5194335", "0.5169613", "0.5169613", "0.5169613", "0.5169613", "0.5169613", "0.5100667", "0.50813913", "0.5071306", "0.5059214", "0.5059214", ...
0.6523777
1
string ctor s(number): create zerofilled string of numberlength s(string): make a copy of the string s(uint8[]): make a copy of the string Returns a Uint8Arraystring.
function $s(v) { var t = typeof v; if (t === 'number') { return new Uint8Array(v); } if (t !== 'string') { v = '' + v; } var s = new Uint8Array(v.length); for (var i = 0; i < v.length; i++) { s[i] = v.charCodeAt(i); } return s; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function caml_new_string (s) { return new MlString(0,s,s.length); }", "function String() {}", "function _String() {}", "function newString(str) {\n var dataLength = str.length;\n var ptr = memory_allocate(4 + (dataLength << 1));\n var dataOffset = (4 + ptr) >>> 1;\n checkMem();\n U32[ptr >>> 2...
[ "0.65512764", "0.65384656", "0.6493352", "0.6438736", "0.64310545", "0.6430638", "0.62391776", "0.62244964", "0.62244964", "0.62203056", "0.62049586", "0.62030005", "0.61719877", "0.61667883", "0.61667883", "0.61667883", "0.61667883", "0.61667883", "0.61555624", "0.61544186", ...
0.6710594
0
Primarily designed to convert uint8string to string, but will call the the toString() method on any value.
function $z(s) { if (s instanceof Uint8Array) { // Postscript treats nul-char as end of string, even if string is // longer. for (var i = 0, l = s.length; i < l && s[i]; i++); if (i < l) { return String.fromCharCode.apply(null, s.subarray(0, i)); } return String.fromCharCode.apply(null, s) } ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function uint8arrayToString(data) {\n return String.fromCharCode.apply(null, data);\n}", "function getU8str(u)\r\n{\r\n\tvar str = \"\", s;\r\n\tfor(var i=0; i < 4; i++, u >>>= 8) {\r\n\t\ts = (u & 0xff).toString(16);\r\n\t\tif (s.length < 2) s = \"0\" + s;\r\n\t\tstr += s + (i < 3 ? \",\":\"\");\r\n\t}\r\n\t...
[ "0.7569323", "0.71365", "0.7008228", "0.654101", "0.64673215", "0.63940585", "0.63940585", "0.63940585", "0.63940585", "0.63940585", "0.63940585", "0.63741857", "0.63491744", "0.63378024", "0.63378024", "0.63378024", "0.63378024", "0.63378024", "0.63378024", "0.63378024", "0....
0.0
-1
Copies source to dest and returns a view of just the copied characters
function $strcpy(dst, src) { if (typeof dst === 'string') { dst = $s(dst); } if (src instanceof Uint8Array) { for (var i = 0, l = src.length; i < l; i++) { dst[i] = src[i]; } } else { for (var i = 0, l = src.length; i < l; i++) { dst[i] = src.charCodeAt(i); } } return src.length < dst...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "copyLetterSal() {\n this.clipboard.copy(this.letterSalutation);\n }", "function _copy(src, dest) {\n\t if (dest)\n\t Object.keys(dest).forEach(function (key) { return delete dest[key]; });\n\t if (!dest)\n\t dest = {};\n\t return exports.extend(dest, src);\n\t}", "function _cop...
[ "0.59639215", "0.594906", "0.594906", "0.5914447", "0.576114", "0.57599235", "0.57286644", "0.5718695", "0.5707153", "0.5707153", "0.5697377", "0.5696367", "0.5686911", "0.5686911", "0.56570417", "0.56498295", "0.55930465", "0.55560344", "0.55492", "0.5532383", "0.55201674", ...
0.5610363
16
Copies source to dest and should (but doesn't) return a view of just the copied elements
function $arrcpy(dst, src) { for (var i = 0, l = src.length; i < l; i++) { dst[i] = src[i]; } dst.length = src.length; return dst; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function _copy(src, dest) {\n\t if (dest)\n\t Object.keys(dest).forEach(function (key) { return delete dest[key]; });\n\t if (!dest)\n\t dest = {};\n\t return exports.extend(dest, src);\n\t}", "function _copy(src, dest) {\n\t if (dest)\n\t Object.keys(dest).forEach(function (key)...
[ "0.6811945", "0.6811945", "0.6615521", "0.65988123", "0.6549684", "0.6524196", "0.6524196", "0.65083367", "0.64447826", "0.6440313", "0.637702", "0.63744634", "0.6369606", "0.6369606", "0.63603836", "0.6359246", "0.63465035", "0.62720096", "0.6262794", "0.6256337", "0.6240383...
0.0
-1
cvs operator convert a value to its string representation s : string to store into v : any value
function $cvs(s, v) { var t = typeof v; if (t == 'number' || t == 'boolean' || v === null) { v = '' + v; } else if (t !== 'string') { v = '--nostringval--'; } for (var i = 0, l = v.length; i < l; i++) { s[i] = v.charCodeAt(i); } $k[$j++] = i < s.length ? s.subarray(0, i) : s; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function caml_output_value_to_string (v, fl) {\n /* ignores flags... */\n return new MlStringFromArray (caml_output_val (v));\n}", "function getStringValue(v) {\n if (v === null) {\n return;\n }\n switch (typeof v) {\n case \"boolean\":\n return;\n case \"number\":\n ...
[ "0.6314048", "0.59774506", "0.5887817", "0.5887817", "0.5887817", "0.5887817", "0.5887817", "0.5887817", "0.5841134", "0.5794533", "0.5787345", "0.5787345", "0.5787345", "0.5787345", "0.5787345", "0.5787345", "0.5787345", "0.5787345", "0.56799525", "0.56799525", "0.56799525",...
0.77938837
0
cvrs operator convert a number to a radix string s : string to store into n : number r : radix
function $cvrs(s, n, r) { return $strcpy(s, (~~n).toString(r).toUpperCase()); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function numtoisbn10($n) {\n $n=string($n);\n $d=0;\n $f=2;\n for ($i=strlen($n)-1;$i>=0;$i--) {\n $d += $n[$i]*$f;\n $f++; \n }\n $d = 11-($d % 11);\n if ($d==11) {$d=\"X\";}\n else {$d=string($d);}\n return strcat(str_pad_left(string($n),9,\"0\"),$d);\n}", "function sc_symbol2number(s, radix) {\n return ...
[ "0.68046933", "0.6692697", "0.6611561", "0.65985525", "0.6595234", "0.6592559", "0.65682274", "0.6558951", "0.65052366", "0.64718866", "0.64718866", "0.6464963", "0.64624906", "0.6426156", "0.6413358", "0.6406859", "0.63623035", "0.63429016", "0.63429016", "0.63429016", "0.63...
0.0
-1
get operator s : source k : key
function $get(s, k) { if (s instanceof Uint8Array) { return s[k]; } if (typeof s === 'string') { return s.charCodeAt(k); } if (s instanceof Array) { return s.b[s.o + k]; } // Must be a dict object : with postscript dict objects, a number key // is differerent than its string representation. po...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "get(){return this[key]}", "get(){return this[key];}", "function key(kind, key) {\n \n}", "function op(name) {\n return operators[name] || that.missingOperator(name);\n /*\n if (operators[name]) {\n operators[name].targetData = target;\n return o...
[ "0.601953", "0.5946954", "0.59042346", "0.5863953", "0.5816787", "0.58059686", "0.5677653", "0.56373286", "0.5634495", "0.56173706", "0.5604258", "0.5596205", "0.5581456", "0.55599964", "0.55440784", "0.5497091", "0.5497091", "0.5497091", "0.54965246", "0.5475657", "0.5469109...
0.51666534
58
put operator d : dest k : key v : value
function $put(d, k, v) { if (d instanceof Uint8Array) { d[k] = v; } else if (d instanceof Array) { d.b[d.o + k] = v; } else if (typeof d == 'object') { if (k instanceof Uint8Array) { d[$z(k)] = v; } else { d[typeof k == 'number' ? '\uffff' + k : k] = v; } } else { throw 'put-not-writab...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "put(key, val){\n let address = this._hash(key)\n if(!this.data[address]) {\n this.data[address] = [] \n this.data[address].push([key,val]) \n }else{\n // check for duplicate key in the bucket\n // if yes, update the value\n for(le...
[ "0.6360237", "0.62614197", "0.604064", "0.586214", "0.5825173", "0.56724143", "0.56195545", "0.56001455", "0.558652", "0.5582887", "0.55676365", "0.55676365", "0.55676365", "0.5565727", "0.55637705", "0.55424154", "0.55296695", "0.55296695", "0.55296695", "0.5523955", "0.5495...
0.6773761
0
getinterval operator s : src o : offset l : length
function $geti(s, o, l) { if (s instanceof Uint8Array) { return s.subarray(o, o + l); } if (s instanceof Array) { var a = new Array(l); a.b = s.b; // base array a.o = s.o + o; // offset into base return a; } // Must be a string return s.substr(o, l); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function Interval(data, id, s, e) {\n\t this.id = id;\n\t this.start = data[s];\n\t this.end = data[e];\n\t this.data = data;\n\n\t if (typeof this.start != 'number' || typeof this.end != 'number') {\n\t throw new Error('start, end must be number. start: ' + this.start + ', end: ' + this.end);\n\t }\n\n\t...
[ "0.5794658", "0.5404819", "0.5384319", "0.5355979", "0.5331174", "0.53175795", "0.52867407", "0.52585286", "0.52367705", "0.521788", "0.5211399", "0.51505905", "0.5147845", "0.508107", "0.50782794", "0.50776166", "0.5066895", "0.5062996", "0.5060415", "0.505529", "0.50549877"...
0.58113116
0
putinterval operator d : dst o : offset s : src
function $puti(d, o, s) { if (d instanceof Uint8Array) { if (typeof s == 'string') { for (var i = 0, l = s.length; i < l; i++) { d[o + i] = s.charCodeAt(i); } } else { // When both d and s are the same, we want to copy // backwards, which works for the general case as well. for (var i =...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function IntervalPacker(lowerBoundToInt, upperBoundToInt, options) {\n options = options || {};\n\n this._lowerBoundToInt = lowerBoundToInt;\n this._upperBoundToInt = upperBoundToInt;\n this._minGap = options.minGap || 0;\n\n}", "function VersionedInterval(low, high, min, max, delta) {\n this.interv...
[ "0.5296643", "0.52739185", "0.5168763", "0.516556", "0.5157757", "0.5143324", "0.5133635", "0.5133635", "0.5115646", "0.50997126", "0.50734514", "0.4983099", "0.49701676", "0.487313", "0.48417455", "0.48297626", "0.4818416", "0.4813001", "0.47962177", "0.4792028", "0.4772105"...
0.70688415
0
search operator string seek search suffix match prefix true %iffound string false%ifnotfound
function $search(str, seek) { if (!(str instanceof Uint8Array)) { str = $s(str); } var ls = str.length; // Virtually all uses of search in BWIPP are for single-characters. // Optimize for that case. if (seek.length == 1) { var lk = 1; var cd = seek instanceof Uint8Array ? seek[0] : seek.charCodeAt...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function indexer(str, find) {\n return str.indexOf(find) > 0 ? str.indexOf(find) : false;\n }", "search(string, startPosition, callback) {\n if (startPosition == null) {\n startPosition = 0;\n }\n if (typeof startPosition === 'function') {\n callback = startPosition...
[ "0.65863985", "0.6482484", "0.6482484", "0.6470229", "0.6440412", "0.6329013", "0.6248321", "0.6229802", "0.62089", "0.61264765", "0.60535276", "0.6031425", "0.6010612", "0.5979645", "0.59784263", "0.5930576", "0.5928821", "0.590665", "0.58824193", "0.58573496", "0.58407843",...
0.6661214
0
The callback is omitted when forall is being used just to push onto the stack.
function $forall(o, cb) { if (o instanceof Uint8Array) { for (var i = 0, l = o.length; i < l; i++) { $k[$j++] = o[i]; if (cb && cb() == $b) break; } } else if (o instanceof Array) { // The array may be a view. for (var a = o.b, i = o.o, l = o.o + o.length; i < l; i++) { $k[$j++] = a[i]; ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function processStack() {\n\n if(stack.length === 0) return cb(null, topLevelItem);\n\n // Pop an item off the stack\n var item = stack.pop();\n\n fn.call(null, item, stack, function(err, result) {\n if(err) return cb(err);\n if(!topLevelItem && result) topLevelItem = result;\n processSt...
[ "0.594469", "0.58966196", "0.587919", "0.58005124", "0.58005124", "0.5736809", "0.5698152", "0.5619487", "0.5619487", "0.56116515", "0.5594221", "0.55885005", "0.5523995", "0.5514898", "0.5508116", "0.54764843", "0.54021704", "0.537448", "0.5369803", "0.5367029", "0.5367029",...
0.0
-1
Initialize the component This method is triggered before rendering the component
init() { this.isUpdating = false; this.errors = {}; this.copied = null; this.isLoading = false; this.tracks = []; this.einsteinCategories = []; this.tempUserName = this.user.lastName; if (!this.user.firstName) { this.user.firstName = this.use...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "initialize() {\n this.render();\n }", "init() {\n this.render();\n }", "init() {\n this.render();\n }", "init() {\n if (this.initialised) {\n return;\n }\n\n // Set initialise flag\n this.initialised = true;\n // ...
[ "0.7851538", "0.7618408", "0.7618408", "0.7561023", "0.7538713", "0.74438614", "0.744316", "0.7329309", "0.7321069", "0.7305404", "0.72738177", "0.71967775", "0.71847934", "0.7129993", "0.70764035", "0.70509446", "0.70509446", "0.70351547", "0.70351547", "0.7032474", "0.70206...
0.0
-1
Check if user requires to change his/her name
requireNameChange() { return ! this.user.name.includes(' '); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function checkName() {\n vmEditPermission.formData.role = bzUtilsSvc.textToSlug(vmEditPermission.formData.role);\n }", "function checkName() {\n vmAddPermission.formData.role = bzUtilsSvc.textToSlug(vmAddPermission.formData.role);\n }", "processChangeName() {\n let na...
[ "0.73853296", "0.72680104", "0.678207", "0.66277057", "0.6602764", "0.66016847", "0.6583449", "0.6520816", "0.6511001", "0.6492336", "0.64918935", "0.6481905", "0.6438477", "0.63564414", "0.6348563", "0.63444585", "0.6326387", "0.6317132", "0.62932485", "0.6293233", "0.627675...
0.78111297
0
Get user academy tracks
async loadTracks() { if (!Is.empty(this.user.tracks)) { this.tracks = this.user.tracks; } else { this.isLoading = true; } let response = await this.meService.tracks(); this.tracks = response.records; this.isLoading = false; this.user.up...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "getTracks() {\n let results = [];\n\n if (!this.currentArtist && !this.currentName) {\n for (let i = 0; i < this.tracks.length; ++i) {\n results.push(this.tracks[i].title);\n }\n }\n else {\n if (this.currentArtist) {\n let artistId = _getArtistId();\n\n for (let i =...
[ "0.6464878", "0.6330576", "0.6116647", "0.60962766", "0.5956806", "0.59198236", "0.58805615", "0.5837956", "0.57967854", "0.5779682", "0.5719124", "0.56757534", "0.56674504", "0.5654168", "0.56509024", "0.56487954", "0.5642476", "0.55865425", "0.55289936", "0.55172026", "0.55...
0.56493527
15
Get user einstein categories
async loadEinsteinCategories() { if (!Is.empty(this.user.einsteinCategories)) { this.einsteinCategories = this.user.einsteinCategories; } else { this.isLoading = true; } let response = await this.meService.einsteinCategories(); this.einsteinCategories = ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function disneyCategories(){\n //fetch get index for attractions\n \n byCategory()\n}", "function getCategories() {\n\trimer.category.find(function(error, value) {\n\t\tif(error) {\n\t\t\tconsole.log(error)\n\t\t}\n\t\telse {\n\t\t\tconsole.log(value)\n\t\t}\n\t})\n}", "getCategories() {\n retu...
[ "0.622045", "0.614861", "0.6053254", "0.59916574", "0.591097", "0.5861789", "0.58432126", "0.58243895", "0.57073474", "0.5629876", "0.56033707", "0.55908394", "0.5542604", "0.55351007", "0.55327827", "0.5526451", "0.5504776", "0.5440496", "0.54345465", "0.54280263", "0.542739...
0.63651174
0
no permite ingresar un vacio Funcion para validar la tarjeta de credito
function isValidCard(input){ // Variable que contiene los numeros invertidos var array=[]; // Contiene los numeros de posiciones impares y pares var newArr=[]; //Inicializa la suma en 0 var sum=0; //Se invierte los números del input y lo almacenamos en array for(var i=input.length-1;i>=0;i--){ array.push(inp...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function checkCreds() {\n checkEmail();\n return false;\n }", "function ActivaEnvioCert() {\n var valid = true;\n if (!Firmado['certificado']) {\n valid = false;\n }\n if (!Firmado['key']) {\n valid = false;\n }\n if (!$('#checkbox_acep_terms').is(':checked')) {\n...
[ "0.65685517", "0.63559", "0.6111784", "0.60449183", "0.59453946", "0.5902944", "0.58379894", "0.58261424", "0.5774132", "0.5749699", "0.57336074", "0.5672657", "0.5665698", "0.5662288", "0.5638239", "0.56190646", "0.558483", "0.55740446", "0.55656654", "0.5550954", "0.5479823...
0.0
-1
Helper method for defining associations. This method is not a part of Sequelize lifecycle. The `models/index` file will call this method automatically.
static associate(models) { // define association here expert_listing.belongsTo(models.expert, { foreignKey: 'idexpert' }) expert_listing.belongsTo(models.topic, { foreignKey: 'idTopic' }) expert_listing.belongsTo(models.customer, { foreignKey: 'idCustomer' }) expert_listing.belongsTo(model...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "static associate(models) {\n // define association here\n // This is how Sequelize knows to create \"magic methods\"\n // These are functions that can automatically pull\n // related data.\n // For example: If I have a User object\n // I can call `await user.getContacts()` to get an\n...
[ "0.7641476", "0.7507344", "0.7312871", "0.7306175", "0.7306175", "0.7306175", "0.72937477", "0.7284903", "0.7277787", "0.72586936", "0.72586936", "0.72586936", "0.72586936", "0.72586936", "0.72586936", "0.72586936", "0.72586936", "0.72586936", "0.72586936", "0.72586936", "0.7...
0.0
-1
sidenav static content example end
function SidenavComponent(docsGenService, router) { this.docsGenService = docsGenService; this.router = router; this.compAPI = null; this.compSidenavTable = { columns: ['Name', 'Type', 'Description'], rows: [], }; this.compSidenavLinksMenuTable = {...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function defaultsideBarView(){\n\tvar sidebar = document.getElementById('template5');\n\tvar aside = getSideBar();\n\thtml = sidebar.innerHTML;\n\taside.innerHTML = html;\n}", "function Sidebar() {\n return _structureBuilder.default.list().title(\"Slick's Slices\").items([// create new sub item\n _structureBui...
[ "0.66148055", "0.661355", "0.64401275", "0.64095676", "0.6394277", "0.6394157", "0.6235357", "0.6190678", "0.6186729", "0.617606", "0.61698806", "0.61446685", "0.609236", "0.6064085", "0.60437924", "0.60207605", "0.599532", "0.59694207", "0.5954343", "0.59410274", "0.59390146...
0.6399723
4
This has a complexity linear to the value of the code. The assumption is that looking up astral identifier characters is rare.
function isInAstralSet(code, set) { var pos = 0x10000; for (var i = 0; i < set.length; i += 2) { pos += set[i]; if (pos > code) { return false } pos += set[i + 1]; if (pos >= code) { return true } } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function isIdentifierChar(code, astral) {\n if (code < 48) return code === 36;\n if (code < 58) return true;\n if (code < 65) return false;\n if (code < 91) return true;\n if (code < 97) return code === 95;\n if (code < 123) return true;\n if (code <= 0xffff) return code >= 0xaa && nonASCIIidentifier.test(S...
[ "0.6759799", "0.6749166", "0.6749166", "0.6720713", "0.6720713", "0.6720713", "0.67187804", "0.67187804", "0.67187804", "0.66870975", "0.66870975", "0.66870975", "0.66870975", "0.66870975", "0.66870975", "0.66870975", "0.66870975", "0.66870975", "0.66870975", "0.66870975", "0...
0.0
-1
Test whether a given character code starts an identifier.
function isIdentifierStart(code, astral) { if (code < 65) { return code === 36 } if (code < 91) { return true } if (code < 97) { return code === 95 } if (code < 123) { return true } if (code <= 0xffff) { return code >= 0xaa && nonASCIIidentifierStart.test(String.fromCharCode(code)) } if (astral === false) {...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function isIdentifierStart(code) {\n if (code < 65) return code === 36;\n if (code < 91) return true;\n if (code < 97) return code === 95;\n if (code < 123) return true;\n if (code <= 0xffff) return code >= 0xaa && nonASCIIidentifierStart.test(String.fromCharCode(code));\n return isInAstralSet(code, astralId...
[ "0.8720698", "0.8720698", "0.8720698", "0.86982656", "0.86982656", "0.86982656", "0.86982656", "0.86982656", "0.86982656", "0.86982656", "0.86982656", "0.86982656", "0.8518157", "0.8518157", "0.8518157", "0.8511877", "0.8511877", "0.8494373", "0.82230717", "0.82230717", "0.81...
0.84857637
27
Test whether a given character is part of an identifier.
function isIdentifierChar(code, astral) { if (code < 48) { return code === 36 } if (code < 58) { return true } if (code < 65) { return false } if (code < 91) { return true } if (code < 97) { return code === 95 } if (code < 123) { return true } if (code <= 0xffff) { return code >= 0xaa && nonASCIIidentifie...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function isIdentifierChar(code) {\n\t if (code < 48) return code === 36;\n\t if (code < 58) return true;\n\t if (code < 65) return false;\n\t if (code < 91) return true;\n\t if (code < 97) return code === 95;\n\t if (code < 123) return true;\n\t if (code <= 0xffff) return code >= 0xaa && nonASCIIidentifier....
[ "0.8051218", "0.8051218", "0.8051218", "0.8051218", "0.8051218", "0.8051218", "0.8051218", "0.8051218", "0.8051218", "0.80078155", "0.80078155", "0.80078155", "0.78380007", "0.78380007", "0.78380007", "0.7782578", "0.7782578", "0.7769867", "0.77178866", "0.76648295", "0.76620...
0.77737
27
Succinct definitions of keyword token types
function kw(name, options) { if ( options === void 0 ) options = {}; options.keyword = name; return keywords$1[name] = new TokenType(name, options) }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function kw(name, options) {\n if ( options === void 0 ) options = {};\n\n options.keyword = name\n return keywordTypes[name] = new TokenType(name, options)\n}", "function kw(name, options) {\n if ( options === void 0 ) options = {};\n\n options.keyword = name\n keywordTypes[name] = tt[\"_\" + name] = new ...
[ "0.7119781", "0.71091473", "0.705262", "0.705262", "0.70280963", "0.70280963", "0.70205903", "0.7000085", "0.6955209", "0.6955209", "0.6955209", "0.6955209", "0.6955209", "0.6944097", "0.6944097", "0.6875176", "0.6791205", "0.6578073", "0.64432263", "0.6387144", "0.6342707", ...
0.70212656
14
Checks if an object has a property.
function has(obj, propName) { return hasOwnProperty.call(obj, propName) }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function hasProperty(obj, prop) {\n return obj.hasOwnProperty(prop);\n}", "function checkGivenProperty(obj,property){\n return hasOwnProperty.call(obj,property);\n}", "function hasProperty (obj, propName) {\n return obj != null && typeof obj === 'object' && (propName in obj);\n }", "function hasPro...
[ "0.8145994", "0.8020503", "0.80004036", "0.80004036", "0.80004036", "0.80004036", "0.80004036", "0.80004036", "0.80004036", "0.80004036", "0.80004036", "0.80004036", "0.80004036", "0.80004036", "0.80004036", "0.80004036", "0.80004036", "0.80004036", "0.80004036", "0.79782695", ...
0.74653804
53
The `getLineInfo` function is mostly useful when the `locations` option is off (for performance reasons) and you want to find the line/column position for a given character offset. `input` should be the code string that the offset refers into.
function getLineInfo(input, offset) { for (var line = 1, cur = 0;;) { lineBreakG.lastIndex = cur; var match = lineBreakG.exec(input); if (match && match.index < offset) { ++line; cur = match.index + match[0].length; } else { return new Position(line, offset - cur) } } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function getLineInfo(input, offset) {\n for (var line = 1, cur = 0;;) {\n var nextBreak = nextLineBreak(input, cur, offset);\n if (nextBreak < 0) { return new Position(line, offset - cur) }\n ++line;\n cur = nextBreak;\n }\n}", "function getLineInfo(input, offset) {\n for (var line = 1, cur = 0;...
[ "0.85749483", "0.85365015", "0.852915", "0.852915", "0.85204524", "0.85204524", "0.84591484", "0.84591484", "0.8451368", "0.8451368", "0.841707", "0.8349359", "0.8349359", "0.6444408", "0.6140175", "0.60476404", "0.5942379", "0.59302014", "0.59302014", "0.59302014", "0.593020...
0.85219246
13
Interpret and default an options object
function getOptions(opts) { var options = {}; for (var opt in defaultOptions) { options[opt] = opts && has(opts, opt) ? opts[opt] : defaultOptions[opt]; } if (options.ecmaVersion >= 2015) { options.ecmaVersion -= 2009; } if (options.allowReserved == null) { options.allowReserved = options.ecmaVer...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "get options() {}", "set options(value) {}", "function options(o, k, a, i) {\n o.files = o.files||[];\n if (a[i]==='-h' || a[i]==='--help') o.help = true;\n else if (a[i]==='-o' || a[i]==='--output') o.output = a[++i];\n else if (a[i]==='-i' || a[i]==='--input') o.input = a[++i];\n else if (a[i]==='-s' |...
[ "0.7570844", "0.71893245", "0.67991704", "0.6662725", "0.65952104", "0.64926785", "0.64670914", "0.6447548", "0.6391328", "0.6385957", "0.6353899", "0.6312276", "0.6303747", "0.62941635", "0.6266218", "0.6266218", "0.62437254", "0.62333316", "0.62333316", "0.6226142", "0.6225...
0.0
-1
Finish an AST node, adding `type` and `end` properties.
function finishNodeAt(node, type, pos, loc) { node.type = type; node.end = pos; if (this.options.locations) { node.loc.end = loc; } if (this.options.ranges) { node.range[1] = pos; } return node }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function finishNode(node, type) {\n node.type = type;\n node.end = lastEnd;\n if (options.locations)\n node.loc.end = lastEndLoc;\n if (options.ranges)\n node.range[1] = lastEnd;\n return node;\n ...
[ "0.7520146", "0.63963157", "0.6272652", "0.6182319", "0.6182319", "0.6182319", "0.61174476", "0.58955485", "0.5865197", "0.5640883", "0.550494", "0.541169", "0.54019", "0.53866416", "0.53593165", "0.528267", "0.5258403", "0.5217955", "0.5162242", "0.51038045", "0.5065633", ...
0.60903645
17
The main exported interface (under `self.acorn` when in the browser) is a `parse` function that takes a code string and returns an abstract syntax tree as specified by [Mozilla parser API][api]. [api]:
function parse(input, options) { return new Parser(options, input).parse() }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function Parse (code) {\n this.code = code\n}", "function acorn_parse(input, options) {\n return Parser.parse(input, options)\n}", "function Parser() {\n\n}", "function Parser() {\n}", "function Parser() {\n}", "function parseAndRun(code, state, callback) {\n const program = acorn.parse(code);\n re...
[ "0.67119986", "0.6690774", "0.65997356", "0.65765244", "0.65765244", "0.6445344", "0.6387944", "0.6341534", "0.63335156", "0.6221938", "0.6217722", "0.6207885", "0.6164724", "0.6164724", "0.6163323", "0.6155838", "0.6155838", "0.6155838", "0.6155838", "0.61416996", "0.6128019...
0.0
-1
This function tries to parse a single expression at a given offset in a string. Useful for parsing mixedlanguage formats that embed JavaScript expressions.
function parseExpressionAt(input, pos, options) { var p = new Parser(options, input, pos); p.nextToken(); return p.parseExpression() }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function parseExpressionAt(input, pos, options) {\n var p = new _state.Parser(options, input, pos);\n p.nextToken();\n return p.parseExpression();\n}", "function parseExpressionAt(input, pos, options) {\n return Parser.parseExpressionAt(input, pos, options)\n }", "function parseExpressionAt(input, pos, ...
[ "0.65490544", "0.6409869", "0.6409869", "0.6409869", "0.63582426", "0.63582426", "0.63582426", "0.63582426", "0.63582426", "0.63582426", "0.63582426", "0.6298877", "0.6298877", "0.6298877", "0.6271992", "0.62124014", "0.6052556", "0.60300666", "0.60293186", "0.57912886", "0.5...
0.6569268
1
Acorn is organized as a tokenizer and a recursivedescent parser. The `tokenizer` export provides an interface to the tokenizer.
function tokenizer(input, options) { return new Parser(options, input) }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "tokenizer(token , isEndOfInput , previousTokens , terminal , config){\n }", "function tokenizer(input, options) {\n return Parser.tokenizer(input, options)\n }", "function tokenizer(input, options) {\n return Parser.tokenizer(input, options)\n }", "function tokenizer(input, options) {\n return ...
[ "0.6870337", "0.612609", "0.612609", "0.612609", "0.6061759", "0.5991088", "0.5930039", "0.5930039", "0.5930039", "0.5930039", "0.5930039", "0.5930039", "0.5930039", "0.58479244", "0.57659376", "0.5742563", "0.57264364", "0.56815356", "0.5660489", "0.56511545", "0.5629506", ...
0.5765628
16
Currently only WebKitbased Web Inspectors, Firefox >= v31, and the Firebug extension (any Firefox version) are known to support "%c" CSS customizations. TODO: add a `localStorage` variable to explicitly enable/disable colors
function useColors() { // NB: In an Electron preload script, document will be defined but not fully // initialized. Since we know we're in Chrome, we'll just detect this case // explicitly if (typeof window !== 'undefined' && window.process && window.process.type === 'renderer') { return true; } // is ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function useColors(){ // is webkit? http://stackoverflow.com/a/16459606/376773\nreturn 'WebkitAppearance' in document.documentElement.style || // is firebug? http://stackoverflow.com/a/398120/376773\nwindow.console && (console.firebug || console.exception && console.table) || // is firefox >= v31?\n// https://de...
[ "0.6763227", "0.6297334", "0.6297334", "0.6297334", "0.62520415", "0.62520415", "0.62520415", "0.62520415", "0.62520415", "0.62520415", "0.62520415", "0.62520415", "0.62520415", "0.62520415", "0.62520415", "0.62520415", "0.62520415", "0.62520415", "0.62520415", "0.62520415", ...
0.0
-1
Colorize log arguments if enabled.
function formatArgs(args) { var useColors = this.useColors; args[0] = (useColors ? '%c' : '') + this.namespace + (useColors ? ' %c' : ' ') + args[0] + (useColors ? '%c ' : ' ') + '+' + exports.humanize(this.diff); if (!useColors) return; var c = 'color: ' + this.color; args.splice(1, 0,...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "log(...args) {\n console.log(this.getColorOn() + args.join(\" \"));\n }", "function writelnColor(){\n\t\tfor(var i=0; i<arguments.length; i=i+2)\n\t\t\tgrunt.log.write(arguments[i][arguments[i+1]]);\n\t\tgrunt.log.writeln('');\n\t}", "function formatArgs(){var args=arguments;var useColors=this.useColor...
[ "0.67609656", "0.6711765", "0.65309334", "0.65309334", "0.65309334", "0.6530865", "0.64773405", "0.6475821", "0.6474954", "0.64640945", "0.6459552", "0.64579946", "0.64556366", "0.64440036", "0.6435409", "0.64320284", "0.64305735", "0.64207786", "0.64207786", "0.64207786", "0...
0.0
-1
Invokes `console.log()` when available. Noop when `console.log` is not a "function".
function log() { // this hackery is required for IE8/9, where // the `console.log` function doesn't have 'apply' return 'object' === typeof console && console.log && Function.prototype.apply.call(console.log, console, arguments); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function log() {\n if (window.console) console.log.apply(console,arguments);\n}", "function consoleLog() {\n if (typeof(console) == 'object' && typeof(console[\"log\"]) != \"undefined\") {\n console.log.apply(console, arguments);\n }\n}", "function L() {\n if (window.console && console.log) {\n ...
[ "0.7741708", "0.77197784", "0.77089596", "0.76121753", "0.7569351", "0.7569351", "0.7534096", "0.7491283", "0.7415948", "0.73375124", "0.7332072", "0.73312855", "0.732567", "0.7314221", "0.73112816", "0.73112816", "0.73112816", "0.73112816", "0.73112816", "0.7306911", "0.7306...
0.0
-1
Add properties to a lookup table
function addToSet(set, array) { if (setPrototypeOf) { // Make 'in' and truthy checks like Boolean(set.constructor) // independent of any properties defined on Object.prototype. // Prevent prototype setters from intercepting set as a this value. setPrototypeOf(set, null); } var l = a...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "createLookupTable() {\n this.__lookupTable = (s => { let a = []; while (s-- > 0)\n a.push(null); return a; })(LookupEntityMap.LOOKUP_TABLE_SIZE);\n for (let i = 0; i < LookupEntityMap.LOOKUP_TABLE_SIZE; ++i) {\n ...
[ "0.6388783", "0.58908904", "0.58104223", "0.5642019", "0.54143965", "0.5363305", "0.5344816", "0.53297573", "0.5326513", "0.5306491", "0.52701485", "0.52366316", "0.5200222", "0.5176164", "0.51686496", "0.5157748", "0.5080467", "0.5056776", "0.5047965", "0.50112146", "0.50107...
0.0
-1
Shallow clone an object
function clone(object) { var newObject = create(null); var property = void 0; for (property in object) { if (apply(hasOwnProperty, object, [property])) { newObject[property] = object[property]; } } return newObject; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function clone(object) { return JSON.parse(JSON.stringify(object))}", "function clone(obj) {\n return JSON.parse(JSON.stringify(obj));\n }", "function clone (obj) {\n // return JSON.parse(JSON.stringify(obj))\n return Object.assign({}, obj)\n}", "function clone(obj) { \n\n return JSON.parse(JSON....
[ "0.7950295", "0.7771218", "0.7767527", "0.7745556", "0.77392215", "0.77375495", "0.7701222", "0.76927173", "0.76927173", "0.76739347", "0.76729304", "0.7664262", "0.765706", "0.765706", "0.76522565", "0.7634367", "0.76317", "0.76313007", "0.76130205", "0.76105267", "0.7586748...
0.0
-1
eslintdisable nobitwise Checks if a given DOM node contains or is another DOM node.
function containsNode(outerNode, innerNode) { if (!outerNode || !innerNode) { return false; } else if (outerNode === innerNode) { return true; } else if (isTextNode(outerNode)) { return false; } else if (isTextNode(innerNode)) { return containsNode(outerNode, innerNode.parentNode); } else if (...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function isNodeInDOM(node) {\n var ancestor = node;\n while (ancestor.parentNode) {\n ancestor = ancestor.parentNode;\n }\n // ancestor should be a document\n return !!ancestor.body;\n }", "function isElement(domNode) {\n return domNode.nodeType !== undefined;\...
[ "0.7321315", "0.70696926", "0.69971675", "0.69971675", "0.69794345", "0.68798107", "0.6824134", "0.67892087", "0.67592525", "0.6703224", "0.66813034", "0.66813034", "0.66813034", "0.66813034", "0.66813034", "0.66813034", "0.6668626", "0.6650006", "0.66424525", "0.6638982", "0...
0.0
-1
Copyright (c) 2013present, Facebook, Inc. This source code is licensed under the MIT license found in the LICENSE file in the root directory of this source tree.
function makeEmptyFunction(arg) { return function () { return arg; }; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "componentDidMount() {\n // if this is the first time the home screen is loading\n // we must initialize Facebook\n if (!window.FB) {\n window.fbAsyncInit = function() {\n window.FB.init({\n appId : '280945375708713',\n cookie : true, // enable cookies to allow the s...
[ "0.582302", "0.56352496", "0.55549705", "0.54886013", "0.5398446", "0.5384924", "0.53627056", "0.53269863", "0.5322178", "0.53158647", "0.53158647", "0.5293647", "0.5266638", "0.52168524", "0.5198115", "0.51917535", "0.5191675", "0.5155282", "0.5140739", "0.5130987", "0.51252...
0.0
-1
inlined Object.is polyfill to avoid requiring consumers ship their own
function is(x, y) { // SameValue algorithm if (x === y) { // Steps 1-5, 7-10 // Steps 6.b-6.e: +0 != -0 // Added the nonzero y check to make Flow happy, but it is redundant return x !== 0 || y !== 0 || 1 / x === 1 / y; } else { // Step 6.a: NaN == NaN return x !== x && y !== y; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function i(e){return!0===\n/*!\n * isobject <https://github.com/jonschlinkert/isobject>\n *\n * Copyright (c) 2014-2017, Jon Schlinkert.\n * Released under the MIT License.\n */\nfunction(e){return null!=e&&\"object\"==typeof e&&!1===Array.isArray(e)}(e)&&\"[object Object]\"===Object.prototype.toString.call(e)}", ...
[ "0.7044135", "0.6979357", "0.68574303", "0.6821805", "0.68029666", "0.67803156", "0.6729492", "0.67206", "0.6709456", "0.66839457", "0.6676559", "0.6676559", "0.6676559", "0.66488636", "0.6640003", "0.6640003", "0.6640003", "0.6640003", "0.6625777", "0.6623136", "0.6623136", ...
0.0
-1
Performs equality by iterating through keys on an object and returning false when any key has values which are not strictly equal between the arguments. Returns true when the values of all keys are strictly equal.
function shallowEqual(objA, objB) { if (is(objA, objB)) { return true; } if (typeof objA !== 'object' || objA === null || typeof objB !== 'object' || objB === null) { return false; } var keysA = Object.keys(objA); var keysB = Object.keys(objB); if (keysA.length !== keysB.length) { return fa...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function equalForKeys(a, b, keys) {\n if (!angular.isArray(keys) && angular.isObject(keys)) {\n keys = protoKeys(keys, [\"$$keys\", \"$$values\", \"$$equals\", \"$$validates\", \"$$new\", \"$$parent\"]);\n }\n if (!keys) {\n keys = [];\n for (var n in a) keys.push(n)...
[ "0.65748584", "0.65748584", "0.6467961", "0.6456548", "0.6434612", "0.6336349", "0.62969005", "0.62725157", "0.6241628", "0.62246656", "0.6215161", "0.6184088", "0.6158581", "0.61305773", "0.6127149", "0.60750496", "0.60350895", "0.60153687", "0.60050756", "0.5978841", "0.597...
0.0
-1
Generated by PEG.js 0.9.0.
function peg$subclass(child, parent) { function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "constructor() { super(new GeneratorParser(true)) }", "function generate (p) {\n // Type\n if (typeof p === 'string' && node.type === null) {\n node.type = p.replace(/^./, ch => ch.toUpperCase())\n return\n }\n\n // Type\n if (typeof p === 'function') {\n node.type = p\n return\...
[ "0.62169564", "0.5706019", "0.5684357", "0.5656814", "0.554739", "0.5442892", "0.54246783", "0.53784406", "0.533806", "0.53049433", "0.52785397", "0.52753025", "0.52733904", "0.52694523", "0.5256397", "0.5236033", "0.52267605", "0.52171594", "0.5213136", "0.52108103", "0.5204...
0.0
-1
Removes all keyvalue entries from the hash.
function hashClear() { this.__data__ = nativeCreate ? nativeCreate(null) : {}; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "clear() {\n var map = this._map;\n var keys = Object.keys(map);\n\n for (var i = 0; i < keys.length; i++) {\n var key = keys[i];\n map[key].clear();\n }\n }", "function clear() {\n this.keys.forEach((key) => {\n this._store[key] = undefined;\n delete this._store[key];\n });\n}", ...
[ "0.67325383", "0.66216296", "0.6511944", "0.6454195", "0.6214277", "0.6200593", "0.61385626", "0.61101323", "0.6029097", "0.5966128", "0.5934792", "0.5905935", "0.5905935", "0.5905935", "0.5903774", "0.5899288", "0.5899288", "0.5899288", "0.58634514", "0.58634514", "0.5863451...
0.0
-1
Removes all keyvalue entries from the list cache.
function listCacheClear() { this.__data__ = []; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function listCacheClear(){this.__data__=[];}", "function listCacheClear(){this.__data__=[];}", "function listCacheClear(){this.__data__=[];}", "function listCacheClear(){this.__data__=[];}", "function listCacheClear() {\n\t\t this.__data__ = [];\n\t\t this.size = 0;\n\t\t}", "function listCacheClear() ...
[ "0.7357779", "0.7357779", "0.7357779", "0.7357779", "0.7317932", "0.72645503", "0.72645503", "0.7262977", "0.72569066", "0.72569066", "0.7236393", "0.7236393", "0.7236393", "0.7236393", "0.7236393", "0.7236393", "0.7236393", "0.7236393", "0.7236393", "0.7236393", "0.7234546",...
0.0
-1
Removes all keyvalue entries from the map.
function mapCacheClear() { this.__data__ = { 'hash': new Hash, 'map': new (Map || ListCache), 'string': new Hash }; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "clear() {\n var map = this._map;\n var keys = Object.keys(map);\n\n for (var i = 0; i < keys.length; i++) {\n var key = keys[i];\n map[key].clear();\n }\n }", "clear() {\n log.map(\"Clearing the map of all the entries\");\n this._map.clear();\n }", "function multiMapRemo...
[ "0.7590112", "0.70694387", "0.6735414", "0.6652174", "0.6530006", "0.6267597", "0.62582785", "0.62582785", "0.62582785", "0.617115", "0.617115", "0.617115", "0.6166302", "0.61519635", "0.614778", "0.614778", "0.614778", "0.614778", "0.614778", "0.614778", "0.614778", "0.614...
0.0
-1
Implements a subset of Node's stream.Transform in a crossplatform manner.
function Transform() {}
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "static transform() {}", "get transform() {}", "get transform() {}", "get transform() {}", "get transform() {}", "function pipeTransforms (stream, transforms) {\n var head, rest;\n if (!Array.isArray(transforms) || !transforms.length) {\n return stream;\n }\n head = transforms[0];\n rest = transfo...
[ "0.72023124", "0.6511461", "0.6511461", "0.6511461", "0.6511461", "0.6387618", "0.6365295", "0.6328733", "0.6328733", "0.6328733", "0.6328733", "0.6131349", "0.60108596", "0.5802047", "0.58001786", "0.5791837", "0.5763781", "0.5761768", "0.5692121", "0.56904036", "0.56904036"...
0.74456626
3
v8 likes predictible objects
function Item(fun, array) { this.fun = fun; this.array = array; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function compareLike(a,b){\n var al = a.idLikesProp.length;\n var bl = b.idLikesProp.length;\n if(al > bl) return -1;\n if(bl > al) return 1;\n return 0;\n}", "function lookAround() {\n var objectDescription = \"\"\n tj.see().then(function(objects) {\n objects.forEach(function(each) {\n ...
[ "0.52765024", "0.5259989", "0.5191908", "0.5185475", "0.5126739", "0.5045062", "0.4894077", "0.4859557", "0.4840031", "0.48308602", "0.48213598", "0.48129985", "0.48068723", "0.47867215", "0.4783404", "0.47590926", "0.4750297", "0.47395125", "0.47262868", "0.47044972", "0.470...
0.0
-1
inlined Object.is polyfill to avoid requiring consumers ship their own /eslintdisable noselfcompare
function is(x, y) { // SameValue algorithm if (x === y) { // Steps 1-5, 7-10 // Steps 6.b-6.e: +0 != -0 return x !== 0 || 1 / x === 1 / y; } else { // Step 6.a: NaN == NaN return x !== x && y !== y; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function isObject$1(obj) {\n // incase of arrow function and array\n return Object(obj) === obj && String(obj) === '[object Object]' && !isFunction(obj) && !isArray(obj);\n }", "function isObject$1(obj) {\n ...
[ "0.6731362", "0.6633782", "0.6609513", "0.6599949", "0.6599775", "0.6565226", "0.6506394", "0.64681304", "0.6463561", "0.641157", "0.6370518", "0.63660806", "0.63660806", "0.63660806", "0.63660806", "0.6357975", "0.6327474", "0.6323051", "0.63226765", "0.6296809", "0.6296809"...
0.0
-1
Equivalent of `typeof` but with special handling for array and regexp.
function getPropType(propValue) { var propType = typeof propValue; if (Array.isArray(propValue)) { return 'array'; } if (propValue instanceof RegExp) { // Old webkits (at least until Android 4.0) return 'function' rather than // 'object' for typeof a RegExp. We'll normalize this here s...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function sc_typeof( x ) {\n return typeof x;\n}", "static type(arg)\n {\n const types = [\n 'array', 'boolean', 'function', 'number',\n 'null', 'object', 'regexp', 'symbol', 'string',\n 'undefined'\n ]\n\n var type = Object.prototype.toString.call(arg),\...
[ "0.6908362", "0.6774889", "0.6606997", "0.65384954", "0.64926404", "0.6489072", "0.6489072", "0.6449892", "0.6449892", "0.6428727", "0.64280385", "0.6402795", "0.6402795", "0.63939744", "0.63939744", "0.63939744", "0.63939744", "0.63939744", "0.63939744", "0.63939744", "0.639...
0.0
-1
This handles more types than `getPropType`. Only used for error messages. See `createPrimitiveTypeChecker`.
function getPreciseType(propValue) { if (typeof propValue === 'undefined' || propValue === null) { return '' + propValue; } var propType = getPropType(propValue); if (propType === 'object') { if (propValue instanceof Date) { return 'date'; } else if (propValue instanceof RegExp...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function getPropType(propValue) {\n\t\t var propType = typeof propValue;\n\t\t if (Array.isArray(propValue)) {\n\t\t return 'array';\n\t\t }\n\t\t if (propValue instanceof RegExp) {\n\t\t // Old webkits (at least until Android 4.0) return 'function' rather than\n\t\t // 'object' for type...
[ "0.68776417", "0.68541825", "0.68541825", "0.68541825", "0.68541825", "0.6853198", "0.68475336", "0.68475336", "0.68475336", "0.68475336", "0.68475336", "0.68475336", "0.68475336", "0.68475336", "0.68475336", "0.68475336", "0.68475336", "0.68475336", "0.68475336", "0.68475336",...
0.0
-1
Returns a string that is postfixed to a warning about an invalid type. For example, "undefined" or "of type array"
function getPostfixForTypeWarning(value) { var type = getPreciseType(value); switch (type) { case 'array': case 'object': return 'an ' + type; case 'boolean': case 'date': case 'regexp': return 'a ' + type; default: return type; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function _undefinedCoerce() {\n return '';\n}", "function getPostfixForTypeWarning(value) {\n var type = getPreciseType(value);\n switch (type) {\n case \"array\":\n case \"object\":\n return \"an \" + type;\n case \"boolean\":\n ...
[ "0.6599196", "0.6566137", "0.6560382", "0.6560382", "0.6560382", "0.6560382", "0.6523208", "0.6522379", "0.6506975", "0.6506975", "0.6506975", "0.6506975", "0.6506975", "0.65022165", "0.64905936", "0.6478573", "0.6478573", "0.6478573", "0.6478573", "0.6478573", "0.6478573", ...
0.0
-1
Returns class name of the object, if any.
function getClassName(propValue) { if (!propValue.constructor || !propValue.constructor.name) { return ANONYMOUS; } return propValue.constructor.name; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function getClassName(obj) {\n var funcNameRegex = /function\\s+(.+?)\\s*\\(/;\n var results = funcNameRegex.exec(obj['constructor'].toString());\n return (results && results.length > 1) ? results[1] : '';\n }", "getClassName() {\n return this.constructor\n .className;\n...
[ "0.7730571", "0.74697196", "0.74697196", "0.74258965", "0.7164231", "0.71448183", "0.7083163", "0.7080694", "0.6995368", "0.6971116", "0.6901662", "0.6883398", "0.67147285", "0.66557264", "0.6639163", "0.6611592", "0.6611592", "0.6611592", "0.6611592", "0.6600893", "0.6599787...
0.0
-1
Recomputes the plugin list using the injected plugins and plugin ordering.
function recomputePluginOrdering() { if (!eventPluginOrder) { // Wait until an `eventPluginOrder` is injected. return; } for (var pluginName in namesToPlugins) { var pluginModule = namesToPlugins[pluginName]; var pluginIndex = eventPluginOrder.indexOf(pluginName); !(pluginIndex > -1) ? invaria...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "orderPlugins() {\r\n debug('orderPlugins:before', this.pluginNames);\r\n const runLast = this._plugins\r\n .filter(p => p.requirements.has('runLast'))\r\n .map(p => p.name);\r\n for (const name of runLast) {\r\n const index = this._plugins.findIndex(p => p.name...
[ "0.7994548", "0.74701035", "0.7169167", "0.71361053", "0.71361053", "0.71361053", "0.7128741", "0.7122665", "0.71187073", "0.7117351", "0.7117351", "0.7117351", "0.71010214", "0.71010214", "0.71010214", "0.709135", "0.709135", "0.709135", "0.709135", "0.709135", "0.709135", ...
0.0
-1
Standard/simple iteration through an event's collected dispatches.
function executeDispatchesInOrder(event, simulated) { var dispatchListeners = event._dispatchListeners; var dispatchInstances = event._dispatchInstances; { validateEventDispatches(event); } if (Array.isArray(dispatchListeners)) { for (var i = 0; i < dispatchListeners.length; i++) { if (event.isP...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function forEachEventDispatch(event,cb){var dispatchListeners=event._dispatchListeners;var dispatchIDs=event._dispatchIDs;if(\"production\"!==process.env.NODE_ENV){validateEventDispatches(event);}if(Array.isArray(dispatchListeners)){for(var i=0;i<dispatchListeners.length;i++){if(event.isPropagationStopped()){break...
[ "0.63397396", "0.6318108", "0.6217002", "0.6128669", "0.61218345", "0.61218345", "0.61218345", "0.61218345", "0.61218345", "0.61218345", "0.61218345", "0.61218345", "0.61186224", "0.61186224", "0.61148316", "0.60777354", "0.60777354", "0.60777354", "0.60777354", "0.60777354", ...
0.0
-1
Given a DOM node, return the closest ReactDOMComponent or ReactDOMTextComponent instance ancestor.
function getClosestInstanceFromNode(node) { if (node[internalInstanceKey]) { return node[internalInstanceKey]; } while (!node[internalInstanceKey]) { if (node.parentNode) { node = node.parentNode; } else { // Top of the tree. This node must not be part of a React tree (or is // unmo...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function getClosestInstanceFromNode(node){if(node[internalInstanceKey]){return node[internalInstanceKey];}while(!node[internalInstanceKey]){if(node.parentNode){node=node.parentNode;}else{// Top of the tree. This node must not be part of a React tree (or is\n// unmounted, potentially).\nreturn null;}}var inst=node[...
[ "0.7370951", "0.7370951", "0.7370951", "0.7370951", "0.73246175", "0.73246175", "0.73246175", "0.73246175", "0.73246175", "0.73246175", "0.73246175", "0.73246175", "0.73246175", "0.73246175", "0.73246175", "0.73246175", "0.73246175", "0.73246175", "0.7308554", "0.7308554", "0...
0.7227235
100
Given a DOM node, return the ReactDOMComponent or ReactDOMTextComponent instance, or null if the node was not rendered by this React.
function getInstanceFromNode$1(node) { var inst = node[internalInstanceKey]; if (inst) { if (inst.tag === HostComponent || inst.tag === HostText) { return inst; } else { return null; } } return null; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function findDOMNode(node) {\n if (node instanceof HTMLElement) {\n return node;\n }\n if (node instanceof react__WEBPACK_IMPORTED_MODULE_0__.Component) {\n return react_dom__WEBPACK_IMPORTED_MODULE_1__.findDOMNode(node);\n }\n return null;\n}", "function findFirstReactDOMImpl(node) {\n\t\t // This n...
[ "0.7596669", "0.7380082", "0.73496497", "0.73496497", "0.73496497", "0.73496497", "0.73496497", "0.73496497", "0.73496497", "0.73496497", "0.73496497", "0.73496497", "0.73496497", "0.73496497", "0.73496497", "0.73496497", "0.73496497", "0.73496497", "0.73296285", "0.73296285", ...
0.0
-1
Given a ReactDOMComponent or ReactDOMTextComponent, return the corresponding DOM node.
function getNodeFromInstance$1(inst) { if (inst.tag === HostComponent || inst.tag === HostText) { // In Fiber this, is just the state node right now. We assume it will be // a host component or host text. return inst.stateNode; } // Without this first invariant, passing a non-DOM-component triggers t...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function findFirstReactDOMImpl(node) {\n\t\t // This node might be from another React instance, so we make sure not to\n\t\t // examine the node cache here\n\t\t for (; node && node.parentNode !== node; node = node.parentNode) {\n\t\t if (node.nodeType !== 1) {\n\t\t // Not a DOMElement, therefore not a...
[ "0.67850256", "0.67771465", "0.6770746", "0.67658514", "0.67658514", "0.6751226", "0.6741835", "0.6741215", "0.6741215", "0.6741215", "0.6741215", "0.6741215", "0.6741215", "0.6741215", "0.6739783", "0.6739783", "0.6739783", "0.6739783", "0.6739783", "0.6739783", "0.6732065",...
0.0
-1
Return the lowest common ancestor of A and B, or null if they are in different trees.
function getLowestCommonAncestor(instA, instB) { var depthA = 0; for (var tempA = instA; tempA; tempA = getParent(tempA)) { depthA++; } var depthB = 0; for (var tempB = instB; tempB; tempB = getParent(tempB)) { depthB++; } // If A is deeper, crawl up. while (depthA - depthB > 0) { instA = g...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function getLowestCommonAncestor(instA, instB) {\n\t !('_nativeNode' in instA) ? process.env.NODE_ENV !== 'production' ? invariant(false, 'getNodeFromInstance: Invalid argument.') : invariant(false) : void 0;\n\t !('_nativeNode' in instB) ? process.env.NODE_ENV !== 'production' ? invariant(false, 'getNodeFromIns...
[ "0.8277217", "0.8277217", "0.8277217", "0.8272759", "0.8272759", "0.8272759", "0.82544667", "0.8228844", "0.8228844", "0.8228844", "0.8228844", "0.81996197", "0.81990045", "0.8184163", "0.8184163", "0.8184163", "0.8184163", "0.8184163", "0.8184163", "0.8184163", "0.8184163", ...
0.0
-1
Return if A is an ancestor of B. Return the parent instance of the passedin instance.
function getParentInstance(inst) { return getParent(inst); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function isAncestor(instA, instB) {\n while (instB) {\n if (instA === instB || instA === instB.alternate) {\n return true;\n }\n instB = getParent(instB);\n }\n return false;\n}", "function isAncestor(instA, instB) {\n while (instB) {\n if (instA === instB || instA === instB.alternate) {\n ...
[ "0.731162", "0.731162", "0.731162", "0.731162", "0.731162", "0.731162", "0.731162", "0.731162", "0.731162", "0.73110485", "0.73110485", "0.73110485", "0.7308105", "0.7305062", "0.7305062", "0.7305062", "0.71668565", "0.7036531", "0.7036531", "0.7022194", "0.70153147", "0.70...
0.0
-1
Simulates the traversal of a twophase, capture/bubble event dispatch.
function traverseTwoPhase(inst, fn, arg) { var path = []; while (inst) { path.push(inst); inst = getParent(inst); } var i = void 0; for (i = path.length; i-- > 0;) { fn(path[i], 'captured', arg); } for (i = 0; i < path.length; i++) { fn(path[i], 'bubbled', arg); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function traverseTwoPhase(inst,fn,arg){var path=[];while(inst){path.push(inst);inst=getParent(inst);}var i;for(i=path.length;i-->0;){fn(path[i],'captured',arg);}for(i=0;i<path.length;i++){fn(path[i],'bubbled',arg);}}", "function traverseTwoPhase(inst,fn,arg){var path=[];while(inst){path.push(inst);inst=getParent...
[ "0.5877933", "0.5877933", "0.5877933", "0.5877933", "0.5877933", "0.5877933", "0.5859051", "0.5857623", "0.5857623", "0.5857623", "0.5857623", "0.56623036", "0.56271553", "0.5586392", "0.5568177", "0.5568177", "0.5561298", "0.5547649", "0.5547649", "0.5547649", "0.5547649", ...
0.0
-1
Traverses the ID hierarchy and invokes the supplied `cb` on any IDs that should would receive a `mouseEnter` or `mouseLeave` event. Does not invoke the callback on the nearest common ancestor because nothing "entered" or "left" that element.
function traverseEnterLeave(from, to, fn, argFrom, argTo) { var common = from && to ? getLowestCommonAncestor(from, to) : null; var pathFrom = []; while (true) { if (!from) { break; } if (from === common) { break; } var alternate = from.alternate; if (alternate !== null && alte...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "_handleMouseEnter() {\n this._hovered.next(this);\n }", "_elementMouseEnterHandler() {\n const that = this;\n\n if (that.clickMode === 'hover' && !that.disabled && !that.readonly) {\n that._handleMouseInteraction();\n }\n }", "_elementMouseEnterHandler() {\n ...
[ "0.5092577", "0.49209234", "0.49209234", "0.4881742", "0.48802367", "0.48802367", "0.4870479", "0.48648864", "0.4797949", "0.4775619", "0.47356582", "0.47356582", "0.47356582", "0.47356582", "0.47356582", "0.47356582", "0.47356582", "0.47356582", "0.47356582", "0.47356582", "...
0.0
-1
Some event types have a notion of different registration names for different "phases" of propagation. This finds listeners by a given phase.
function listenerAtPhase(inst, event, propagationPhase) { var registrationName = event.dispatchConfig.phasedRegistrationNames[propagationPhase]; return getListener(inst, registrationName); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function listenerAtPhase(inst, event, propagationPhase) {\n\t\t var registrationName = event.dispatchConfig.phasedRegistrationNames[propagationPhase];\n\t\t return getListener(inst, registrationName);\n\t\t}", "function listenerAtPhase(inst, event, propagationPhase) {\n\t\t var registrationName = event.dispat...
[ "0.6933187", "0.6933187", "0.6932316", "0.6932316", "0.6932316", "0.6932316", "0.6932316", "0.6932316", "0.6932316", "0.6932316", "0.6932316", "0.6932316", "0.6932316", "0.6932316", "0.6932316", "0.69260776", "0.69260776", "0.690148", "0.690148", "0.690148", "0.690148", "0....
0.0
-1
A small set of propagation patterns, each of which will accept a small amount of information, and generate a set of "dispatch ready event objects" which are sets of events that have already been annotated with a set of dispatched listener functions/ids. The API is designed this way to discourage these propagation strat...
function accumulateDirectionalDispatches(inst, phase, event) { { !inst ? warning(false, 'Dispatching inst must not be null') : void 0; } var listener = listenerAtPhase(inst, event, phase); if (listener) { event._dispatchListeners = accumulateInto(event._dispatchListeners, listener); event._dispatchI...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function accumulateDirectionalDispatches(inst,upwards,event){if(process.env.NODE_ENV!=='production'){process.env.NODE_ENV!=='production'?warning(inst,'Dispatching inst must not be null'):void 0;}var phase=upwards?PropagationPhases.bubbled:PropagationPhases.captured;var listener=listenerAtPhase(inst,event,phase);if...
[ "0.6351668", "0.6351668", "0.6248267", "0.6233495", "0.60864395", "0.60864395", "0.60864395", "0.60864395", "0.60864395", "0.5959494", "0.5959494", "0.5951498", "0.5945181", "0.5945181", "0.5928652", "0.5928652", "0.59271216", "0.59271216", "0.59271216", "0.59271216", "0.5927...
0.0
-1
Collect dispatches (must be entirely collected before dispatching see unit tests). Lazily allocate the array to conserve memory. We must loop through each event and perform the traversal for each one. We cannot perform a single traversal for the entire collection of events because each event may have a different target...
function accumulateTwoPhaseDispatchesSingle(event) { if (event && event.dispatchConfig.phasedRegistrationNames) { traverseTwoPhase(event._targetInst, accumulateDirectionalDispatches, event); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function executeDispatchesInOrder(event){var dispatchListeners=event._dispatchListeners;var dispatchInstances=event._dispatchInstances;{validateEventDispatches(event);}if(Array.isArray(dispatchListeners)){for(var i=0;i<dispatchListeners.length;i++){if(event.isPropagationStopped()){break;}// Listeners and Instances...
[ "0.6037257", "0.6037257", "0.6037257", "0.6037257", "0.6037257", "0.59030503", "0.58940506", "0.58940506", "0.58940506", "0.58940506", "0.587664", "0.5833246", "0.5833246", "0.5833246", "0.5833246", "0.5833246", "0.5833246", "0.5833246", "0.5833246", "0.5833246", "0.5790857",...
0.0
-1
Same as `accumulateTwoPhaseDispatchesSingle`, but skips over the targetID.
function accumulateTwoPhaseDispatchesSingleSkipTarget(event) { if (event && event.dispatchConfig.phasedRegistrationNames) { var targetInst = event._targetInst; var parentInst = targetInst ? getParentInstance(targetInst) : null; traverseTwoPhase(parentInst, accumulateDirectionalDispatches, event); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function accumulateTwoPhaseDispatchesSingleSkipTarget(event){if(event&&event.dispatchConfig.phasedRegistrationNames){var targetInst=event._targetInst;var parentInst=targetInst?getParentInstance(targetInst):null;traverseTwoPhase(parentInst,accumulateDirectionalDispatches,event);}}", "function accumulateTwoPhaseDi...
[ "0.7414454", "0.7414454", "0.7414454", "0.7414454", "0.7414454", "0.74034", "0.74034", "0.74034", "0.73782057", "0.73656684", "0.7320886", "0.7320886", "0.7300291", "0.7285566", "0.7285566", "0.7285566", "0.7285566", "0.7285566", "0.7285566", "0.7285566", "0.7285566", "0.72...
0.7298766
61
Accumulates without regard to direction, does not look for phased registration names. Same as `accumulateDirectDispatchesSingle` but without requiring that the `dispatchMarker` be the same as the dispatched ID.
function accumulateDispatches(inst, ignoredDirection, event) { if (inst && event && event.dispatchConfig.registrationName) { var registrationName = event.dispatchConfig.registrationName; var listener = getListener(inst, registrationName); if (listener) { event._dispatchListeners = accumulateInto(eve...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function accumulateDispatches(id, ignoredDirection, event) {\n\t if (event && event.dispatchConfig.registrationName) {\n\t var registrationName = event.dispatchConfig.registrationName;\n\t var listener = getListener(id, registrationName);\n\t if (listener) {\n\t event._dispatchListeners = accumulate...
[ "0.7467071", "0.7467071", "0.7467071", "0.7467071", "0.7467071", "0.7467071", "0.7467071", "0.7467071", "0.7467071", "0.7467071", "0.7467071", "0.7467071", "0.7467071", "0.7467071", "0.7467071", "0.7467071", "0.7467071", "0.7467071", "0.7467071", "0.7467071", "0.7467071", "...
0.0
-1
Do not uses the below two methods directly! Instead use constants exported from DOMTopLevelEventTypes in ReactDOM. (It is the only module that is allowed to access these methods.)
function unsafeCastStringToDOMTopLevelType(topLevelType) { return topLevelType; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function handleTopLevel(topLevelType,targetInst,nativeEvent,nativeEventTarget){var events=extractEvents(topLevelType,targetInst,nativeEvent,nativeEventTarget);runEventQueueInBatch(events);}", "function handleTopLevel(topLevelType,targetInst,nativeEvent,nativeEventTarget){var events=extractEvents(topLevelType,tar...
[ "0.6448155", "0.6448155", "0.6448155", "0.6334827", "0.63236046", "0.62613595", "0.6220223", "0.6149863", "0.6149863", "0.6149863", "0.6149863", "0.6149863", "0.60991025", "0.60991025", "0.6081894", "0.59577334", "0.59392864", "0.5897346", "0.5897346", "0.5897346", "0.5897346...
0.0
-1
Return whether a native keypress event is assumed to be a command. This is required because Firefox fires `keypress` events for key commands (cut, copy, selectall, etc.) even though no character is inserted.
function isKeypressCommand(nativeEvent) { return (nativeEvent.ctrlKey || nativeEvent.altKey || nativeEvent.metaKey) && // ctrlKey && altKey is equivalent to AltGr, and is not a command. !(nativeEvent.ctrlKey && nativeEvent.altKey); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function isKeypressCommand(nativeEvent) {\n\t return (\n\t (nativeEvent.ctrlKey || nativeEvent.altKey || nativeEvent.metaKey) &&\n\t // ctrlKey && altKey is equivalent to AltGr, and is not a command.\n\t !(nativeEvent.ctrlKey && nativeEvent.altKey)\n\t );\n\t}", "function isKeypressCommand(nativeEvent...
[ "0.80167186", "0.80167186", "0.80167186", "0.80167186", "0.80167186", "0.80167186", "0.80167186", "0.80084205", "0.7999546", "0.7998441", "0.7998441", "0.7998441", "0.7998441", "0.7998441", "0.7998441", "0.7998441", "0.7998441", "0.7998441", "0.7998441", "0.7998441", "0.79984...
0.0
-1