query
stringlengths
9
14.6k
document
stringlengths
8
5.39M
metadata
dict
negatives
listlengths
0
30
negative_scores
listlengths
0
30
document_score
stringlengths
5
10
document_rank
stringclasses
2 values
[ZScore, or Standard Score]( The standard score is the number of standard deviations an observation or datum is above or below the mean. Thus, a positive standard score represents a datum above the mean, while a negative standard score represents a datum below the mean. It is a dimensionless quantity obtained by subtra...
function z_score(x, mean, standard_deviation) { return (x - mean) / standard_deviation; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function z_score(x, mean, standard_deviation) {\n return (x - mean) / standard_deviation;\n }", "function z_score(x, mean, standard_deviation) {\n return (x - mean) / standard_deviation;\n }", "function z_score(x, mean, standard_deviation) {\n return (x - mean) / standard_deviation;\...
[ "0.8045769", "0.8045769", "0.8045769", "0.7637948", "0.64717096", "0.620539", "0.62049717", "0.62049717", "0.61971986", "0.6183276", "0.600813", "0.59315914", "0.5880905", "0.58112204", "0.5779417", "0.5775815", "0.573999", "0.5584162", "0.55536497", "0.55262256", "0.5520961"...
0.81552744
0
Binomial Distribution The [Binomial Distribution]( is the discrete probability distribution of the number of successes in a sequence of n independent yes/no experiments, each of which yields success with probability `probability`. Such a success/failure experiment is also called a Bernoulli experiment or Bernoulli tria...
function binomial_distribution(trials, probability) { // Check that `p` is a valid probability (0 ≤ p ≤ 1), // that `n` is an integer, strictly positive. if (probability < 0 || probability > 1 || trials <= 0 || trials % 1 !== 0) { return null; } //...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function binomial_distribution(trials, probability) {\n // Check that `p` is a valid probability (0 ≤ p ≤ 1),\n // that `n` is an integer, strictly positive.\n if (probability < 0 || probability > 1 ||\n trials <= 0 || trials % 1 !== 0) {\n return null;\n }\n\n ...
[ "0.7801708", "0.7801708", "0.7801708", "0.7734878", "0.7077777", "0.68857855", "0.68857855", "0.68857855", "0.6728233", "0.63566786", "0.6352021", "0.6249689", "0.6223364", "0.6163343", "0.6128326", "0.6020731", "0.59963745", "0.59963745", "0.59963745", "0.59829855", "0.59194...
0.7859367
0
Bernoulli Distribution The [Bernoulli distribution]( is the probability discrete distribution of a random variable which takes value 1 with success probability `p` and value 0 with failure probability `q` = 1 `p`. It can be used, for example, to represent the toss of a coin, where "1" is defined to mean "heads" and "0"...
function bernoulli_distribution(p) { // Check that `p` is a valid probability (0 ≤ p ≤ 1) if (p < 0 || p > 1 ) { return null; } return binomial_distribution(1, p); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function bernoulli(p = 0.5) {\n return (Math.random() < p ? 1 : 0);\n }", "function bernoulli_distribution(p) {\n // Check that `p` is a valid probability (0 ≤ p ≤ 1)\n if (p < 0 || p > 1 ) { return null; }\n\n return binomial_distribution(1, p);\n }", "function bernou...
[ "0.75676954", "0.7502739", "0.7502739", "0.7502739", "0.7370777", "0.65119845", "0.64299923", "0.64299923", "0.64299923", "0.61147815", "0.61087877", "0.595557", "0.59530455", "0.5894158", "0.5886218", "0.5874839", "0.5804945", "0.5745069", "0.57125133", "0.571168", "0.571168...
0.76480305
0
a [probability mass function](
function probability_mass(x, lambda) { return (Math.pow(Math.E, -lambda) * Math.pow(lambda, x)) / factorial(x); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function probability_mass(x, lambda) {\n return (Math.pow(Math.E, -lambda) * Math.pow(lambda, x)) /\n factorial(x);\n }", "function probability_mass(x, lambda) {\n return (Math.pow(Math.E, -lambda) * Math.pow(lambda, x)) /\n factorial(x);\n }", ...
[ "0.80948246", "0.80948246", "0.80948246", "0.79880655", "0.7871738", "0.7871738", "0.7871738", "0.6220527", "0.6219758", "0.62098676", "0.61918676", "0.6158225", "0.61516374", "0.6149146", "0.6147874", "0.6053186", "0.60243255", "0.5991497", "0.59789634", "0.5923075", "0.5848...
0.81708723
0
Mixin Mixin simple_statistics to a single Array instance if provided or the Array native object if not. This is an optional feature that lets you treat simple_statistics as a native feature of Javascript.
function mixin(array) { var support = !!(Object.defineProperty && Object.defineProperties); // Coverage testing will never test this error. /* istanbul ignore next */ if (!support) throw new Error('without defineProperty, simple-statistics cannot be mixed in'); // only meth...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function mixin(array) {\n var support = !!(Object.defineProperty && Object.defineProperties);\n // Coverage testing will never test this error.\n /* istanbul ignore next */\n if (!support) throw new Error('without defineProperty, simple-statistics cannot be mixed in');\n\n // onl...
[ "0.6626803", "0.6619558", "0.66140944", "0.53466064", "0.5025174", "0.48497212", "0.4741837", "0.47271678", "0.4680177", "0.45645007", "0.4552798", "0.45456162", "0.44592988", "0.44535527", "0.44369712", "0.44350877", "0.4433792", "0.44178638", "0.43898046", "0.4389371", "0.4...
0.6814841
0
Adds default settings to userspecified params Does not overwrite any settingsonly adds defaults the the user did not specify
function applyDefaults(params, defaults) { var settings = params || {}; for(var setting in defaults) { if(defaults.hasOwnProperty(setting) && !settings[setting]) { settings[setting] = defaults[setting]; } } return settings; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function applyDefaults(params, defaults) {\n var settings = params || {};\n\n for(var setting in defaults) {\n if(defaults.hasOwnProperty(setting) && !settings[setting]) {\n settings[setting] = defaults[setting];\n }\n }\n return settings;\n }", "function applyDefaults(params, defau...
[ "0.68914217", "0.6866692", "0.6866692", "0.6350524", "0.6320097", "0.6272759", "0.6226667", "0.61555415", "0.6104757", "0.59832716", "0.5901036", "0.5836795", "0.58279365", "0.5812225", "0.57439417", "0.572177", "0.57076454", "0.57049483", "0.568301", "0.5678291", "0.567385",...
0.69142306
0
Adds the optional GeoJSON properties crs and bbox if they have been specified
function addOptionals(geojson, settings){ if(settings.crs && checkCRS(settings.crs)) { geojson.crs = settings.crs; } if (settings.bbox) { geojson.bbox = settings.bbox; } if (settings.extraGlobal) { geojson.properties = {}; for (var key in settings.extraGlobal) { ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function addOptionals(geojson, settings){\n if(settings.crs && checkCRS(settings.crs)) {\n if(settings.isPostgres)\n geojson.geometry.crs = settings.crs;\n else\n geojson.crs = settings.crs;\n }\n if (settings.bbox) {\n geojson.bbox = settings.bbox;\n }\n if (settings.ex...
[ "0.744524", "0.744524", "0.72736317", "0.5963101", "0.5593575", "0.5592705", "0.5561228", "0.5529034", "0.5439567", "0.54070604", "0.5400138", "0.5400138", "0.5378513", "0.5378513", "0.5297176", "0.52769125", "0.52183384", "0.52149963", "0.5199583", "0.51818603", "0.5142611",...
0.74714434
0
Verify that the structure of CRS object is valid
function checkCRS(crs) { if (crs.type === 'name') { if (crs.properties && crs.properties.name) { return true; } else { throw new Error('Invalid CRS. Properties must contain "name" key'); } } else if (crs.type === 'link') { if (crs.properties && crs...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function checkCRS(crs) {\n if (crs.type === 'name') {\n if (crs.properties && crs.properties.name) {\n return true;\n } else {\n throw new Error('Invalid CRS. Properties must contain \"name\" key');\n }\n } else if (crs.type === 'link') {\n if (crs.properties...
[ "0.71568966", "0.71568966", "0.71568966", "0.65343463", "0.6104906", "0.58651936", "0.5775729", "0.5692466", "0.55772007", "0.5566016", "0.5565759", "0.5563942", "0.55414784", "0.5530513", "0.54909843", "0.53214985", "0.5259211", "0.5243311", "0.5240668", "0.5171134", "0.5144...
0.7157762
0
Returns the function to be used to build the properties object for each feature
function getPropFunction(params) { var func; if(!params.exclude && !params.include) { func = function(properties) { for(var attr in this) { if(this.hasOwnProperty(attr) && (geomAttrs.indexOf(attr) === -1)) { properties[attr] = this[attr]; } } ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function getPropFunction(params) {\n var func;\n\n if(!params.exclude && !params.include) {\n func = function(properties) {\n for(var attr in this) {\n if(this.hasOwnProperty(attr) && (geomAttrs.indexOf(attr) === -1)) {\n properties[attr] = this[attr];\n }\n }\...
[ "0.6777709", "0.6777709", "0.6777709", "0.58882594", "0.5818477", "0.5818477", "0.5792933", "0.57524157", "0.5730157", "0.57195514", "0.5659594", "0.5651256", "0.5603454", "0.55614376", "0.5548686", "0.55466145", "0.5523872", "0.5523847", "0.5513277", "0.5507845", "0.54976475...
0.68698025
0
IE11 only supports `Uint8ClampedArray` as of version [KB2929437](
function isUint8ClampedArraySupported() { return 'Uint8ClampedArray' in window; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function isUint8ClampedArraySupported() {\n return 'Uint8ClampedArray' in window;\n}", "function _checkIsUint8ClampedImageData(){if(\"undefined\"==typeof Uint8ClampedArray)return!1;var elem=document.createElement(\"canvas\"),ctx=elem.getContext(\"2d\");if(!ctx)return!1;var image=ctx.createImageData(1,1);retur...
[ "0.7902224", "0.7554731", "0.7372406", "0.73056304", "0.7124697", "0.69081515", "0.6531959", "0.64439684", "0.630943", "0.627158", "0.59564775", "0.58793586", "0.58793586", "0.58706254", "0.5860003", "0.58462226", "0.58462226", "0.58462226", "0.58462226", "0.58462226", "0.584...
0.77066976
1
Represents a transition between two declarations
function StyleTransition(reference, declaration, oldTransition, value) { this.declaration = declaration; this.startTime = this.endTime = (new Date()).getTime(); if (reference.function === 'piecewise-constant' && reference.transition) { this.interp = interpZoomTransitioned; } else { ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function transition (first, last) {\n\texit(first);\n\tenter(last);\n}", "function StyleTransition(declaration, oldTransition, value) {\n\n this.declaration = declaration;\n this.startTime = this.endTime = (new Date()).getTime();\n\n var type = declaration.type;\n if ((type === 'string' || type === '...
[ "0.56662095", "0.5557122", "0.5471081", "0.53376305", "0.5295495", "0.52936226", "0.52005595", "0.4976634", "0.49623576", "0.49492326", "0.4940758", "0.4926972", "0.4904595", "0.4886426", "0.4886426", "0.48054928", "0.47693312", "0.47645387", "0.47605464", "0.4758921", "0.474...
0.56724876
0
Serialize the StructArray type. This serializes the type not an instance of the type.
function serializeStructArrayType() { return { members: this.prototype.StructType.prototype.members, alignment: this.prototype.StructType.prototype.alignment, bytesPerElement: this.prototype.bytesPerElement }; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function serializeStructArrayType() {\n return {\n members: this.prototype.StructType.prototype.members,\n alignment: this.prototype.StructType.prototype.alignment,\n bytesPerElement: this.prototype.bytesPerElement\n };\n}", "function toString () {\n\t return '[StructType]'\n\t}", "...
[ "0.75701046", "0.6182118", "0.6182118", "0.61522293", "0.6074367", "0.60558623", "0.58903617", "0.56095976", "0.54327095", "0.54074365", "0.5340912", "0.5277819", "0.5219729", "0.5219729", "0.5210546", "0.5207739", "0.5170755", "0.5170755", "0.5170755", "0.5170755", "0.517075...
0.7582316
0
zorder of a point given coords and size of the data bounding box
function zOrder(x, y, minX, minY, size) { // coords are transformed into non-negative 15-bit integer range x = 32767 * (x - minX) / size; y = 32767 * (y - minY) / size; x = (x | (x << 8)) & 0x00FF00FF; x = (x | (x << 4)) & 0x0F0F0F0F; x = (x | (x << 2)) & 0x33333333; x = (x | (x << 1...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function zOrder(x, y, minX, minY, size) {\n\t // coords are transformed into non-negative 15-bit integer range\n\t x = 32767 * (x - minX) / size;\n\t y = 32767 * (y - minY) / size;\n\t\n\t x = (x | (x << 8)) & 0x00FF00FF;\n\t x = (x | (x << 4)) & 0x0F0F0F0F;\n\t x = (x | (x << 2)) & 0x33333333;\n...
[ "0.7073634", "0.7073634", "0.7073634", "0.6987392", "0.6957173", "0.6957173", "0.6957173", "0.6957173", "0.6957173", "0.6957173", "0.6957173", "0.6957173", "0.6957173", "0.6957173", "0.68929887", "0.6602", "0.6585782", "0.65384597", "0.65384597", "0.65384597", "0.65384597", ...
0.7085794
0
The position of a glyph relative to the text's anchor point.
function PositionedGlyph(codePoint, x, y, glyph) { this.codePoint = codePoint; this.x = x; this.y = y; this.glyph = glyph; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function PositionedGlyph(codePoint, x, y, glyph) {\n this.codePoint = codePoint;\n this.x = x;\n this.y = y;\n this.glyph = glyph;\n}", "getOffset(pos) {\n return pos - this.span[0];\n }", "function PosWithInfo(line,ch,outside,xRel){var pos=Pos(line,ch);pos.xRel=xRel;if(outside)po...
[ "0.68076324", "0.65039027", "0.63520294", "0.63295275", "0.6192133", "0.61397237", "0.6109211", "0.60965836", "0.6076827", "0.6049397", "0.60419005", "0.5996659", "0.592984", "0.5873032", "0.58702934", "0.58702934", "0.5841272", "0.5841272", "0.58204347", "0.57516754", "0.574...
0.669052
1
For an array of features determine what glyphs need to be loaded and apply any text preprocessing. The remaining users of text should use the `textFeatures` key returned by this function rather than accessing feature text directly.
function resolveText(features, layoutProperties, codepoints) { var textFeatures = []; for (var i = 0, fl = features.length; i < fl; i++) { var text = resolveTokens(features[i].properties, layoutProperties['text-field']); if (!text) { textFeatures[i] = null; continu...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function resolveText(features, layoutProperties, codepoints) {\n var textFeatures = [];\n\n for (var i = 0, fl = features.length; i < fl; i++) {\n var text = resolveTokens(features[i].properties, layoutProperties['text-field']);\n if (!text) {\n textFeatures[i] = null;\n c...
[ "0.726324", "0.691189", "0.6743975", "0.5722289", "0.56586426", "0.5346838", "0.5304459", "0.52120817", "0.52088034", "0.519325", "0.50049776", "0.4974772", "0.4923323", "0.49047467", "0.48982683", "0.48894408", "0.48625478", "0.48625478", "0.48451018", "0.4836598", "0.480347...
0.7231283
1
signed distance from point to polygon outline (negative if point is outside)
function pointToPolygonDist(p, polygon) { var inside = false; var minDistSq = Infinity; for (var k = 0; k < polygon.length; k++) { var ring = polygon[k]; for (var i = 0, len = ring.length, j = len - 1; i < len; j = i++) { var a = ring[i]; var b = ring[j]; ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function pointToPolygonDist(x, y, polygon) {\n\t var inside = false;\n\t var minDistSq = Infinity;\n\t\n\t for (var k = 0; k < polygon.length; k++) {\n\t var ring = polygon[k];\n\t\n\t for (var i = 0, len = ring.length, j = len - 1; i < len; j = i++) {\n\t var a = ring[i];\n\t ...
[ "0.67427737", "0.6650204", "0.64503586", "0.63965726", "0.6348454", "0.63145274", "0.61244434", "0.6109638", "0.59675914", "0.5928483", "0.588241", "0.58090556", "0.5804095", "0.57951236", "0.5743659", "0.5725426", "0.57239455", "0.5701832", "0.5664861", "0.5663607", "0.56377...
0.686068
0
Constructs a worker pool.
function WorkerPool() { this.active = {}; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "constructor() {\n this.pool = pool;\n }", "intializeWorkerPool() {\n // connect to local RabbitMQ server\n amqp.connect(`amqp://${this._hostname}`, (err, conn) => {\n if (err) {\n // can't connect, call fail callback\n this._failCallback();\n ...
[ "0.71347034", "0.711002", "0.6949841", "0.6635415", "0.6521744", "0.6376633", "0.63381296", "0.629522", "0.62715346", "0.6236538", "0.62293535", "0.62139076", "0.6201197", "0.6176974", "0.6165297", "0.6154538", "0.61457276", "0.609506", "0.6059612", "0.60232645", "0.5998622",...
0.7873045
0
checks whether a tile is a wholearea fill after clipping; if it is, there's no sense slicing it further
function isClippedSquare(tile, extent, buffer) { var features = tile.source; if (features.length !== 1) return false; var feature = features[0]; if (feature.type !== 3 || feature.geometry.length > 1) return false; var len = feature.geometry[0].length; if (len !== 5) return false; ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function IsSolidIgnoreArea (x, y, z, ignoreArea) {\r\n\tfor (var i = 0; i < areas.length; i++)\r\n\t{\r\n\t\tvar area = areas[i];\r\n\t\tif (area !== ignoreArea)\r\n\t\t{\r\n\t\t\tif (x >= area.x && x < area.x + area.xSize &&\r\n\t\t\t\ty >= area.y && y < area.y + area.ySize &&\r\n\t\t\t\tz >= area.z && z < area.z...
[ "0.65238005", "0.6437175", "0.6412631", "0.6412631", "0.63001543", "0.62030697", "0.618825", "0.6157821", "0.6108286", "0.60402346", "0.60198593", "0.5957934", "0.5909236", "0.59040594", "0.58528066", "0.58400565", "0.5828749", "0.5828432", "0.58134973", "0.57822496", "0.5765...
0.6492141
1
calculate the feature bounding box for faster clipping later
function calcBBox(feature) { var geometry = feature.geometry, min = feature.min, max = feature.max; if (feature.type === 1) { calcRingBBox(min, max, geometry); } else { for (var i = 0; i < geometry.length; i++) { calcRingBBox(min, max, geometry[i]); ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function BoundingBoxRect() { }", "function calcBBox(feature) {\n var geometry = feature.geometry,\n min = feature.min,\n max = feature.max;\n\n if (feature.type === 1) calcRingBBox(min, max, geometry);\n else for (var i = 0; i < geometry.length; i++) calcRingBBox(min, max, geometry[i]);\n\...
[ "0.7251901", "0.6832354", "0.6825189", "0.68131685", "0.6798273", "0.6680648", "0.6611025", "0.6603249", "0.6447111", "0.6447111", "0.63929594", "0.63396025", "0.6298217", "0.62449104", "0.61952496", "0.61779", "0.61076325", "0.61055946", "0.61055946", "0.60939336", "0.609393...
0.68811905
1
The base class for maprelated interface elements. The `Control` class mixes in [`Evented`](Evented) methods.
function Control() {}
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function Control() {\n PIXI.Container.call(this);\n this.enabled = this.enabled !== false;\n // assume all controls are interactive\n this.interactive = true;\n\n this.initResizeScaling();\n}", "function AbstractControlOptions() { }", "function AbstractControlOptions() { }", "function Abstract...
[ "0.649336", "0.62994045", "0.62994045", "0.6256429", "0.6231559", "0.6146163", "0.6044576", "0.6016928", "0.59954965", "0.5982516", "0.59219855", "0.58492464", "0.5734381", "0.57139146", "0.5701206", "0.5668629", "0.5651284", "0.56359", "0.56248474", "0.55742365", "0.5571356"...
0.6609865
1
Check upload document Avoid Vulnerable
function checkUploadDocumentFiles(element_id){ var element = document.getElementById(element_id); var elementspan = document.getElementById(element_id + 'div'); var ar_ext = ['pdf', 'doc', 'docx']; // array with allowed extensions // - www.coursesweb.net // get the file name and split it to separe t...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "checkIsUploaded(doc) {\n return !(doc._id in this.dataMeta.unuploadeds);\n }", "onBeforeUpload(file) {\n // Allow upload files under 10MB, and only in png/jpg/jpeg formats\n if (/pdf/i.test(file.extension)) {\n return true;\n }\n return 'Please upload pdf file';\n }", "function validateFi...
[ "0.73486304", "0.68627053", "0.6795855", "0.6501462", "0.64878446", "0.63895565", "0.6381413", "0.63684547", "0.6324012", "0.62852323", "0.62639105", "0.62407357", "0.6229999", "0.6221539", "0.6213944", "0.6209276", "0.6206763", "0.6205474", "0.6202375", "0.6200032", "0.61884...
0.6958522
1
make a postless codemark, as needed for the test
makePostlessCodemark (callback) { if (!this.goPostless) { this.codemark = this.postData[0].codemark; return callback(); } const codemarkData = this.getPostlessCodemarkData(); this.doApiRequest( { method: 'post', path: '/codemarks', data: codemarkData, token: this.currentUser.accessToken...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "makePostlessCodemark (callback) {\n\t\tthis.data = { relatedCodemarkIds: [] };\n\t\tBoundAsync.series(this, [\n\t\t\tthis.createPrerelatedCodemarks,\n\t\t\tsuper.makePostlessCodemark\n\t\t], callback);\n\t}", "makeCodemarks (callback) {\n\t\tthis.testCodemarks = [];\n\t\tthis.doingPreRelatedCodemarks = false;\n\...
[ "0.6854444", "0.6489722", "0.6449395", "0.6422328", "0.62741", "0.6242778", "0.5976231", "0.58939385", "0.58249533", "0.5758333", "0.57580614", "0.5754768", "0.56730163", "0.56730163", "0.5667436", "0.5648255", "0.5618593", "0.56167775", "0.5591226", "0.55887973", "0.5585816"...
0.6984258
0
get data to use for the postless codemark, as needed
getPostlessCodemarkData () { const data = this.codemarkFactory.getRandomCodemarkData({ codemarkType: this.codemarkType || 'comment' }); Object.assign(data, { teamId: this.team.id, providerType: RandomString.generate(8) }); return data; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "makeCodemarkData () {\n\t\tconst data = this.codemarkFactory.getRandomCodemarkData();\n\t\tObject.assign(data, {\n\t\t\tteamId: this.team.id,\n\t\t\tproviderType: RandomString.generate(8),\n\t\t\tstreamId: RandomString.generate(10),\n\t\t\tpostId: RandomString.generate(10)\n\t\t});\n\t\treturn data;\n\t}", "getP...
[ "0.68159413", "0.6774023", "0.644999", "0.6424959", "0.6227967", "0.6163167", "0.6140093", "0.6066858", "0.6022423", "0.5969113", "0.59663403", "0.59567285", "0.5861877", "0.58365554", "0.58151263", "0.57958966", "0.5781327", "0.5728971", "0.569326", "0.56830245", "0.5616644"...
0.7292181
0
Constructs a Board with a starting grid set up.
function Board () { this.grid = _makeGrid(8); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function Board () {\n this.grid = _makeGrid();\n}", "function Board () {\n this.grid = _makeGrid();\n}", "function Board() {\n this.grid = _makeGrid();\n}", "function Board(width,height){\n this.rows = height;\n this.columns = width;\n this.firstStart = true;\n}", "function createBoard() {\n ...
[ "0.78721786", "0.78721786", "0.7779183", "0.7557039", "0.7502092", "0.7299001", "0.7249228", "0.7136733", "0.71258324", "0.71064156", "0.707717", "0.7076375", "0.7062531", "0.705522", "0.705389", "0.70277065", "0.7025153", "0.70135087", "0.69942486", "0.6944653", "0.6943571",...
0.7987442
0
A partir del id del div de un usuario obtiene el id del usuario en G+ El id va precedido de user_ y si es una cadena de strings se tiene que poner un '+' delante
function getUID(id_div) { var uid = id_div.split('user_')[1]; if (! /\d+/.test(uid)) uid = '+' + uid; return uid; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function updateUser(userId) {\n document.getElementById(\n \"lUsername--hidden\" + userId\n ).value = document\n .getElementById(\"lUsername\" + userId)\n .innerText.replace(\"<br>\", \"\");\n document.getElementById(\n \"lEmail--hidden\" + userId\n ).value = document\n .getElementById(\"lEmail\...
[ "0.65318155", "0.6307491", "0.63048524", "0.62433267", "0.6242696", "0.606079", "0.5991206", "0.5951278", "0.59447396", "0.59383154", "0.5899884", "0.5858427", "0.5849171", "0.5846289", "0.5845228", "0.5837048", "0.5810839", "0.58072203", "0.57907075", "0.5754211", "0.5743982...
0.6817813
0
Elimina al usuario de G+ con id uid de la lista de usuarios mostrados, borrandolo tanto de la pantalla como de localstorage
function deleteUser(uid) { localStorage.removeItem(uid); var iduser = 'user_' + uid.replace(/\+/, ''); if ($('#' + iduser).length) $('#' + iduser).remove(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "removeUser(id) {\n const users = [...this.state.users];\n let i = users.length - 1;\n while (i >= 0) {\n if (users[i].id === id) {\n users.splice(i, 1);\n break;\n }\n i -= 1;\n }\n localStorage.setItem('users', JSON.stringify([...users]));\n this.setState({\n us...
[ "0.7045073", "0.70214766", "0.6825703", "0.67538893", "0.673824", "0.67118806", "0.6710711", "0.6691178", "0.6677778", "0.6652951", "0.65901893", "0.65701383", "0.65512836", "0.654774", "0.65327996", "0.6504636", "0.6475167", "0.64643544", "0.6462881", "0.64566493", "0.645384...
0.7387274
0
Imprime el usuario dado en el div to_add con un boton para agregarlo
function printUserToAdd(uid, uimg, uname) { var iduser = 'user_' + uid.replace(/\+/, ''); var user_wrapper = $('<div>').addClass('col-xs-6 col-md-3 user_box').attr('id', iduser); var new_user = $('<div>'); new_user.append($('<img>').attr('src', uimg).addClass( 'img-rounded img-responsive center-block')); ne...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function addUser(usr){\n let thisUsr=usr.join('-');\n if(allUsersCol[thisUsr]==undefined){\n allUsersCol[thisUsr]=getUserCol();\n }\n let el0=$('<div class=\"user-i\"></div>')\n .text(usr[0])\n .css('color',allUsersCol[thisUsr]);\n $(el0).appendTo($('#msg-disp'));\n}", ...
[ "0.6761947", "0.6609074", "0.6605487", "0.65082985", "0.64752734", "0.64599407", "0.6454655", "0.63928556", "0.63853216", "0.63752294", "0.6369399", "0.6358484", "0.6348258", "0.63429356", "0.6260307", "0.6244356", "0.622255", "0.6221176", "0.6176395", "0.61720675", "0.615580...
0.6754821
1
Handles reply when user asks for help
function handleHelpRequest(response) { var repromptText = "Which country would you like trends info for?", speechOutput = "You need to tell me which country you want trends for. " + "Or you can simply open v Trends and ask a question like, " + "get trends for the United States. " + "...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function handleQuickReplyResponse (event) {\n var senderID = event.sender.id\n var pageID = event.recipient.id\n var message = event.message\n var quickReplyPayload = message.quick_reply.payload\n\n console.log(\"[handleQuickReplyResponse] Handling 'quick reply' response (%s) from sender (%d) to page (%d) wit...
[ "0.6867947", "0.6798507", "0.674152", "0.66283363", "0.6622212", "0.65697014", "0.6568249", "0.655689", "0.6489711", "0.6352589", "0.62829334", "0.62798446", "0.62700117", "0.6269647", "0.62551534", "0.62443024", "0.6220718", "0.61838144", "0.6163863", "0.61527914", "0.613597...
0.7573728
0
Handles reply when user asks for list of available countries
function handleSupportedCountriesRequest(intent, session, response) { var repromptText = "Which country would you like trends info for?", speechOutput = "I can retrieve trend information from these countries: " + getAllCountriesText() + repromptText; response.ask(speechOutpu...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function showCountry(reply, app){\n $('#DD01 .dropdown ul').empty()\n $.each(reply.qListObject.qDataPages[0].qMatrix, function(key, value) {\n if (typeof value[0].qText !== 'undefined') {\n $('#DD01 .dropdown ul').append('<li><a data-select=\"'+ value[0].qText+'\" href=\"#\">'+ value...
[ "0.669587", "0.652118", "0.6472748", "0.6283762", "0.6165175", "0.61276543", "0.60358226", "0.6032763", "0.60095054", "0.5989455", "0.59810513", "0.5969142", "0.5945166", "0.5927113", "0.5926563", "0.5926284", "0.5863399", "0.5856783", "0.58409107", "0.5808242", "0.5800038", ...
0.71646464
0
Gets Google Trends object and reads out first five items
function getTrends(intent, session, response, inProgress) { var speech = new Speech(), reprompt = new Speech(), speechOutput, repromptOutput, countryCode, currentTrendIndex; // Continuing to read a previously started trend if(inProgress) { countryCode...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function getTrends(){\n const found = fetch(url+query+myTrendTerm+apikey)\n .then(function(response){\n return response.json();\n })\n .then(function(myJson){\n var data = myJson;\n \n //linking content to HTML\n let div11 = document.getElementById(\"grid-item1\")\n let im...
[ "0.57371676", "0.56872576", "0.5662014", "0.5651842", "0.5637324", "0.5611277", "0.55688876", "0.553645", "0.5535075", "0.54893625", "0.54861224", "0.54785746", "0.54571784", "0.54152566", "0.5411869", "0.5409046", "0.539586", "0.5369497", "0.5366682", "0.53499603", "0.531198...
0.66561794
0
Returns the country code from the intent, or returns an error
function getCountryCodeFromIntent(intent, assignDefault) { var countrySlot = intent.slots.Country; // Test for empty slot, or empty value if(!countrySlot || !countrySlot.value) { if(!assignDefault) { return { error: true }; } else { ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function getPhoneCode(country)\r\n{\r\n\treturn getCountryCallingCode(country)\r\n}", "function getPhoneCode(country)\n{\n\treturn getCountryCallingCode(country)\n}", "function get_phone_code(country_metadata) {\n\treturn country_metadata[0];\n}", "function fetchCountryCodeByRequestIP() {\n API.GetRequest...
[ "0.69733906", "0.6911571", "0.6746416", "0.6467108", "0.63948405", "0.6319468", "0.62983316", "0.6294003", "0.62359387", "0.61649597", "0.61348516", "0.590765", "0.5899401", "0.58757746", "0.5824294", "0.5807432", "0.58057106", "0.58050835", "0.5666493", "0.5656271", "0.56395...
0.76303554
0
Provides list of supported countries
function getAllCountriesText() { var countryList = ''; for (var country in COUNTRIES) { countryList += country + ", "; } return countryList; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function listOfCountries() {\n return [\n { id: \"us\", name: \"United States\" },\n { id: \"cn\", name: \"China\" },\n { id: \"fr\", name: \"France\" },\n { id: \"de\", name: \"Germany\" },\n { id: \"gb\", name: \"United Kingdom\" },\n { id: \"ru\", name: \"Russia\" },...
[ "0.7374954", "0.70905924", "0.68691045", "0.6857067", "0.6809149", "0.6672077", "0.6650853", "0.6611461", "0.6563986", "0.65569454", "0.65391415", "0.63461", "0.63267386", "0.62908435", "0.6282452", "0.6226705", "0.6207245", "0.61405224", "0.6127724", "0.61028177", "0.6083559...
0.7098352
1
Chooses which news item to read from a trend, deciding based on headline completeness and length. Returns an object with readable strings (ie, no HTML tags, encoding or incomplete sentences).
function getNewsItem(trend) { // object constructor containing all the info that Alexa will read function NewsItem (headline, snippet, medium, keyword) { this.headline = headline; this.snippet = snippet; this.medium = medium; this.keyword = keyword; } // object ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "shortInterests() {\n let interestsRaw = this.person.interests;\n\n if (interestsRaw) {\n let interestsArr = [];\n\n // Some of them do a full-on unordered list...\n if (/<ul>/.test(interestsRaw)) {\n const list = new DOMParser()....
[ "0.52515614", "0.5187715", "0.51260835", "0.50313675", "0.5028471", "0.49943274", "0.49333447", "0.49215138", "0.4921241", "0.48816046", "0.48485982", "0.48424056", "0.48109558", "0.48057076", "0.48040923", "0.4802226", "0.480204", "0.47961965", "0.47891188", "0.47763777", "0...
0.7011139
0
object constructor for new headline
function Headline(headline, index, full) { this.headline = headline; this.index = index; this.full = full; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function Headline(data){\n\tthis.text = data[0];\n\tthis.url = data[1];\n}", "constructor (title, author, text) {\n // Send what it gets to its parent object\n\t // using super funtion to add these to the article.\n\t super(title, author, text);\n }", "function heading(obj)\r\n {\r\n le...
[ "0.72908646", "0.67979866", "0.6518606", "0.6218238", "0.61291736", "0.6033707", "0.60115355", "0.599968", "0.5997386", "0.5993017", "0.5962213", "0.59245574", "0.5903884", "0.58648396", "0.58451134", "0.58301425", "0.58257097", "0.57856816", "0.5785555", "0.5784968", "0.5778...
0.74668914
0
Filters complete headlines (not ending in '...')
function filterByComplete(headline) { if(headline.full === true) { return true; } else { return false; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function filter_pipelines_text(ftext){\n $('.pipelines-container .pipeline:contains(\"'+ftext+'\")').show();\n $('.pipelines-container .pipeline:not(:contains(\"'+ftext+'\"))').hide();\n if($('.pipelines-container .pipeline:visible').length == 0){ $('.no-pipelines').show(); }\n else { $...
[ "0.569481", "0.5552683", "0.55498433", "0.54374295", "0.5139313", "0.51256114", "0.5112061", "0.5107989", "0.510418", "0.5103744", "0.50550634", "0.50338095", "0.5017269", "0.5006832", "0.49917272", "0.49773774", "0.49558213", "0.4954692", "0.49432957", "0.4931537", "0.492955...
0.6653627
0
Returns the longest headline from two different ones
function longestHeadline(arr) { var l = 0; for (var i = 0; i < arr.length; i++) { if (arr[l].headline.length < arr[i].headline.length) l = i; } return arr[l]; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function longestWord() {}", "function longestName(nameOne, nameTwo) {\n const firstName = nameOne.length;\n const secondName = nameTwo.length;\n\n if (firstName === secondName) {\n return \"Beide namen zijn even lang\";\n }\n // Mag ook als:\n // return nameOne.length === nameTwo.length ...
[ "0.6905688", "0.65591633", "0.6486316", "0.6483621", "0.6475996", "0.6409647", "0.6349532", "0.63408715", "0.6318506", "0.62928337", "0.6259063", "0.62143093", "0.6190032", "0.6155316", "0.6126053", "0.6108489", "0.60898453", "0.60781825", "0.60695916", "0.6066565", "0.601359...
0.69642514
0
Cuts a news snippet if it ends in an incomplete sentence, leaving only the last complete sentence.
function snippetCutter(snippet) { // Checks for the position of the last "..." marking incomplete last sentence var endIndex = snippet.lastIndexOf('...') - 1; // Checks for possible positions of sentence before last var exclamationPos = snippet.lastIndexOf('!', endIndex); var questionPos = snip...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function wp_html_excerpt( $str, $count, $more = null ) {\n if ( null === $more )\n $more = '';\n $str = wp_strip_all_tags( $str, true );\n $excerpt = mb_substr( $str, 0, $count );\n // remove part of an entity at the end\n $excerpt = preg_replace( '/&[^;\\s]{...
[ "0.6040431", "0.5822421", "0.5706287", "0.5705002", "0.56936705", "0.56936705", "0.56936705", "0.56936705", "0.56936705", "0.56936705", "0.56936705", "0.56936705", "0.56936705", "0.56936705", "0.56936705", "0.56936705", "0.56936705", "0.56936705", "0.56936705", "0.56936705", ...
0.68961763
0
Return if the instance is decorated.
function isDecorated(instance) { return !!instance[key]; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function isInstanceDecoratedClassElement(member) {\n return isDecoratedClassElement(member, /*isStatic*/false);\n }", "function isInstanceDecoratedClassElement(member, parent) {\n return isDecoratedClassElement(member, /*isStatic*/false, parent);\n }", "funct...
[ "0.6295488", "0.62843764", "0.62517476", "0.6093961", "0.6093961", "0.57329345", "0.57284546", "0.57260644", "0.5720828", "0.56929874", "0.5688127", "0.56804806", "0.5652838", "0.5644175", "0.56239307", "0.56239307", "0.55119455", "0.5473765", "0.54580456", "0.5452675", "0.54...
0.78458005
0
Add a decoration to the instance.
function addDecoration(instance, decoration) { if (isDecorated(instance)) { Object.assign(instance[key], decoration); } else { instance[key] = _objectSpread({}, decoration); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "addDecorator(decorator) {\n localDecorators.push(decorator);\n return api;\n }", "static line(spec) {\n return new LineDecoration(spec);\n }", "function decorateCallback(decoration, callback){\n return function(error, data){\n var updatedData = !error ? decoration(data)...
[ "0.5782101", "0.55635107", "0.54894936", "0.5488457", "0.53858835", "0.5317714", "0.5279184", "0.5241449", "0.51885945", "0.5144737", "0.51396614", "0.5125167", "0.5080716", "0.50783485", "0.50546354", "0.50169295", "0.49773428", "0.49735332", "0.49573982", "0.4926826", "0.49...
0.75273347
0
Remove the decoration from the instance.
function removeDecorations(decorated) { decorated._component = null; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "remove() {\n this._animation.removeAction(this);\n }", "removeCustomStyle() {\n\t\tthis.styleManager.removePreviewStyle();\n\t}", "unset () {\n events.remove(this._element, 'all');\n\n if (!isType.isString(this.selector)) {\n events.remove(this, 'all');\n if (this.options.styleCursor)...
[ "0.57000184", "0.56960636", "0.56678385", "0.56184614", "0.55995065", "0.5528411", "0.55082726", "0.5486181", "0.54060346", "0.53985554", "0.53501385", "0.5343585", "0.52746207", "0.5263791", "0.5260984", "0.52606183", "0.52528197", "0.52528197", "0.52528197", "0.52528197", "...
0.65610313
0
Get the fiber of the given grid element.
function getFiber(grid) { var key = Object.keys(grid).find(function (key) { return key.startsWith('__reactFiber$'); }); invariant(typeof key === 'string', 'Cannot find the __reactFiber$'); // @ts-ignore return grid[key]; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function getCurrentFiber(fiber, currentFlag) {\n if (!fiber.alternate) return fiber; // Flags.\n\n var fiberFlag = fiber.memoizedProps[FlagProp];\n var alternateFlag = fiber.alternate.memoizedProps[FlagProp]; // If the two flags are the same it should mean that\n // in at least one of the items there h...
[ "0.5502776", "0.5162213", "0.5122661", "0.5079234", "0.5049735", "0.5026109", "0.5020174", "0.4975609", "0.49409324", "0.49144375", "0.49026573", "0.49015126", "0.48878875", "0.4840065", "0.4830341", "0.48035336", "0.47807276", "0.47718692", "0.47717416", "0.47449392", "0.473...
0.72316855
0
Return the current fiber. Try to use the prop flag for the search first, if this is not possible try the RootFiber. The research on the flag is carried out because it is more performing than the second and because if the React team decides to change the functioning of the RootFiber, not all features will stop working. ...
function getCurrentFiber(fiber, currentFlag) { if (!fiber.alternate) return fiber; // Flags. var fiberFlag = fiber.memoizedProps[FlagProp]; var alternateFlag = fiber.alternate.memoizedProps[FlagProp]; // If the two flags are the same it should mean that // in at least one of the items there has been a ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function getFiber(grid) {\n var key = Object.keys(grid).find(function (key) {\n return key.startsWith('__reactFiber$');\n });\n invariant(typeof key === 'string', 'Cannot find the __reactFiber$'); // @ts-ignore\n\n return grid[key];\n }", "function get(e){return e._reactInternalFiber}", "func...
[ "0.6952538", "0.60994476", "0.5568414", "0.5568414", "0.5568414", "0.5568414", "0.5568414", "0.5568414", "0.5568414", "0.5524768", "0.5524768", "0.5524768", "0.5524768", "0.5524768", "0.5524768", "0.5524768", "0.5524768", "0.5524768", "0.5524768", "0.5524768", "0.5524768", ...
0.79464215
0
Returns the first stateNode among the descendants of the given itemComponent Fiber.
function getStateNode(itemComponentFiber) { // ItemComponent -> ItemProvider -> Item. var itemFiber = itemComponentFiber.child.child; // @ts-ignore while (!(itemFiber.stateNode instanceof HTMLElement)) { // @ts-ignore itemFiber = itemFiber.child; } return itemFiber.stateNode; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function getNodeFromInstance$1(e){if(e.tag===O||e.tag===N)\n// In Fiber this, is just the state node right now. We assume it will be\n// a host component or host text.\nreturn e.stateNode;// Without this first invariant, passing a non-DOM-component triggers the next\n// invariant for a missing parent, which is sup...
[ "0.55570674", "0.54892755", "0.5455292", "0.5455292", "0.5455292", "0.5455292", "0.5455292", "0.5455292", "0.5455292", "0.5455292", "0.5455292", "0.5455292", "0.54499006", "0.54499006", "0.54499006", "0.54499006", "0.54499006", "0.54499006", "0.54499006", "0.54499006", "0.544...
0.75353336
0
Append the child fiber in the last position among the children of the parent fiber.
function appendFiber(parent, child) { var _parent$return; if (!parent.child) { // If it has no child. parent.child = child; child.index = 0; } else { var c = parent.child; while (c.sibling) { c = c.sibling; } child.index = c.index + 1; // Inserted as last...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "static addChild (parent, child) {\n if (!parent.children) { parent.children = [] }\n\n if (child.parent != parent) {\n parent.children.push(child)\n\n if (child.parent && child.parent.children) { child.parent.children = _.without(child.parent.children, child) }\n }\n child.parent = parent\n ...
[ "0.6282135", "0.60208076", "0.6019152", "0.60119903", "0.5989355", "0.5989355", "0.59495467", "0.5932789", "0.5928048", "0.5907224", "0.58630246", "0.58569574", "0.5797636", "0.5764766", "0.5726103", "0.5726103", "0.5726103", "0.5726103", "0.5726103", "0.5726103", "0.5726103"...
0.7769337
0
Remove a child with the given key from the fiber.
function removeChild(parent, key) { var child = parent.child; var removedChild; // @ts-ignore if (hasNot(child, key)) { // @ts-ignore while (hasNot(child.sibling, key)) { // @ts-ignore child = child.sibling; } // @ts-ignore removedChild = removeSibling(child); // @...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "remove(key) {\n const foundNode = this.find(key);\n if (!foundNode) throw new Error('Key does not exist'); \n this.root = removeHelper(key, this.root);\n }", "removeNode (key) {\n const node = this.getNode(key)\n if (!node) {\n return false\n }\n\n const { _key, _children...
[ "0.6802726", "0.6706298", "0.6629142", "0.65484184", "0.65236366", "0.6513331", "0.6500788", "0.64628094", "0.6433887", "0.6369126", "0.633955", "0.6335338", "0.62496537", "0.61411613", "0.61060536", "0.6037778", "0.6016639", "0.6016024", "0.60143244", "0.6012563", "0.5953132...
0.7043196
0
Remove the first itemComponent fiber of a gridELement fiber and return it.
function removeFirstChild(gridElementFiber) { var removed = gridElementFiber.child; // @ts-ignore gridElementFiber.child = gridElementFiber.child.sibling; // @ts-ignore return removed; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "removeFirstContainer() {\n const poppedContainerId = this.renderedContainersIds.shift(0);\n const poppedContainer = get(this.renderedContainers, [\n poppedContainerId.row,\n poppedContainerId.col,\n 'container',\n ]);\n ReactDom.unmountComponentAtNode(po...
[ "0.63157976", "0.60582054", "0.5741167", "0.5672427", "0.5628109", "0.5604107", "0.5596617", "0.5590707", "0.5511059", "0.5509391", "0.55015916", "0.55005133", "0.5474858", "0.5458058", "0.5447155", "0.544459", "0.5441293", "0.5426661", "0.5413027", "0.5398858", "0.5398858", ...
0.65936005
0
Remove the first sibling from a itemComponent fiber and return it.
function removeSibling(fiber) { var removed = fiber.sibling; // @ts-ignore fiber.sibling = fiber.sibling.sibling; // @ts-ignore return removed; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function deleteFirst()\n{\n\tvar item = this.first.item;\n\n\tthis.first = this.first.next;\n\n\treturn item;\n}", "function removeFirstChild(gridElementFiber) {\n var removed = gridElementFiber.child; // @ts-ignore\n\n gridElementFiber.child = gridElementFiber.child.sibling; // @ts-ignore\n\n return re...
[ "0.7070406", "0.66425055", "0.6401532", "0.64009607", "0.6389393", "0.6280371", "0.62436706", "0.61507094", "0.6110261", "0.6104335", "0.6090805", "0.60816026", "0.6077735", "0.59833807", "0.5977289", "0.59237784", "0.5893299", "0.5890903", "0.58861834", "0.58783925", "0.5867...
0.68273765
1
Adjust the indices of the siblings of an itemComponent fiber.
function adjustIndices(itemComponentFiber) { while (itemComponentFiber.sibling) { itemComponentFiber.sibling.index = itemComponentFiber.index + 1; itemComponentFiber = itemComponentFiber.sibling; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "incrementItem() {\n const newState = (this.state.active + 1) % this.state.items.length;\n this.transitionItem(newState);\n }", "_assignChildIndexRecursively(node) {\n const children = node.getNodesList();\n for (let i = 0; i < children.length; i++) {\n children[i].index = i;\n ...
[ "0.5921048", "0.5901805", "0.5695752", "0.5394592", "0.5342268", "0.5337861", "0.53284085", "0.5323785", "0.5305406", "0.5305406", "0.5305406", "0.52988404", "0.5258112", "0.5251535", "0.52451456", "0.5220899", "0.5178878", "0.5178342", "0.5161628", "0.5158386", "0.5101754", ...
0.84670925
0
Returns if the itemComponent fiber is not the parent of the item with the given key.
function hasNot(itemComponentFiber, key) { // ItemComponent -> ItemProvider -> Item. return itemComponentFiber.child.child.key !== key; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function isParentNavItem() {\n var parentItem = service.getParentItem();\n\n if (!parentItem) {\n return false;\n } else {\n //return parentItem.state.name === 'folder'; // This is a little arbitrary. A better test would be to add the information ...
[ "0.6868308", "0.61634856", "0.61308444", "0.60382116", "0.5678502", "0.5586502", "0.5527386", "0.55002016", "0.54922223", "0.54922223", "0.5449391", "0.54096", "0.5393064", "0.53730285", "0.5371353", "0.53627235", "0.535477", "0.5351402", "0.53332436", "0.5331199", "0.5328223...
0.7599329
0
Return an array of positions of the added children. The algorithm is optimized for cases where the order of the items does not change during rerenders (about 100% of cases). The positions are in ascending order.
function getIndicesToAdd(newChildren, oldChildren) { var indicesToAdd = []; var oIndex = 0; for (var nIndex = 0; nIndex < newChildren.length; nIndex++) { // Finde the index. var index = findIndex(oldChildren, newChildren[nIndex], oIndex); if (index === -1) { // If it is not prese...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "updateChildrenPosition() {\n let pos = 0;\n for (let index = 0; index < this.cardSlots; index++) {\n const card = this.getCardAt(index);\n if (card) card[this._posPropertyName] = pos;\n pos += CardsGenerator.CARD_WIDTH + this.childMargin;\n }\n }", "functi...
[ "0.6520512", "0.649015", "0.628939", "0.6248898", "0.6083814", "0.60589194", "0.5992241", "0.5956157", "0.59502727", "0.59415674", "0.5923121", "0.59209275", "0.5917857", "0.5751681", "0.57106197", "0.5699465", "0.56938565", "0.5675702", "0.56736314", "0.5671263", "0.56385213...
0.65789557
0
Returns the index of the child in the children array, if it is not present returns 1. The research start from the given 'fromIndex'.
function findIndex(children, child, fromIndex) { fromIndex = fromIndex > children.length ? children.length : fromIndex; // If the heuristics are respected the child will be here. for (var index = fromIndex; index < children.length; index++) { if (is(child, children[index])) return index; } // If the ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function getChildIndex(DOMElement) {\r\n return Array.prototype.indexOf.call(DOMElement.parrentNode.children, DOMElement);\r\n}", "getChildIndex(child) {\n return this._children.indexOf(child)\n }", "function getIndex(item) {\r\n return Array.prototype.indexOf.call(item.parentNode.children, item)...
[ "0.65300643", "0.64742947", "0.63184583", "0.631582", "0.63150525", "0.6227279", "0.6157239", "0.6108442", "0.6095337", "0.6006297", "0.5981068", "0.5955105", "0.59489703", "0.59397775", "0.5881664", "0.58715105", "0.58016115", "0.5722578", "0.57170033", "0.57070243", "0.5694...
0.80638885
0
Fill a grid instance: Add the sizer element.
function fillGrid(grid) { var sizerElement = document.createElement('div'); // Keep the element hidden. sizerElement.style.visibility = 'hidden'; sizerElement.style.position = 'absolute'; // Add the class. sizerElement.classList.add('grid-sizer'); // Set the element. addDecoration(grid, { s...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "generateGrid() {\n this.insertBlocks();\n this.insertWeapons();\n this.insertPlayers();\n this.displayGrid();\n }", "function addGridItems(grid) {}", "draw() {\n for (let row = 0; row < this.gridSize; row++) {\n for (let col = 0; col < this.gridSize; col++) {\n this.gridContainer.ap...
[ "0.61511767", "0.6077201", "0.5963161", "0.59541947", "0.59073186", "0.58917135", "0.58655894", "0.582889", "0.5808984", "0.58049303", "0.5787894", "0.5774154", "0.57655066", "0.56921804", "0.56901336", "0.5662106", "0.5659044", "0.5649097", "0.5646721", "0.564204", "0.563998...
0.800232
0
Fill a grid element: If it is not position the style.position is setted to "relative". The CSS "containerClass" is added. It also wrap the className setter to avoid React to remove the standard class of Muuri from the grid.
function fillGridElement(gridElement, gridClass) { var position = getComputedStyle(gridElement).position; // Set the default position. if (!positions.includes(position)) { gridElement.style.position = positions[0]; } // Set the grid class. gridElement.classList.add(gridClass); // Ensure that th...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function fillGrid(grid) {\n var sizerElement = document.createElement('div'); // Keep the element hidden.\n\n sizerElement.style.visibility = 'hidden';\n sizerElement.style.position = 'absolute'; // Add the class.\n\n sizerElement.classList.add('grid-sizer'); // Set the element.\n\n addDecoration(gr...
[ "0.6330586", "0.6127936", "0.61174595", "0.61174595", "0.61174595", "0.6087607", "0.60178196", "0.60178196", "0.5999564", "0.59687066", "0.59683746", "0.5958519", "0.5958519", "0.5958519", "0.59576", "0.59576", "0.58807224", "0.58792186", "0.5852342", "0.5833367", "0.58332455...
0.7140328
0
Fill an item: Add the _component decoration. Redefine the _sortData property.
function fillItem(item) { addDecoration(item, { props: {}, data: {} }); // Change the sort data. Object.defineProperty(item, '_sortData', { get: function get() { return this.getData(); }, set: function set() {// nothing to do here. } }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "build() {\n\t\t\tif (!props.get(this).name) {\n\t\t\t\tprops.get(this).name = '';\n\t\t\t}\n\n\t\t\tconst size = props.get(this).size;\n\t\t\tconst value = props.get(this).value;\n\t\t\tconst format = props.get(this).format;\n\n\t\t\t// if( validator.isUndefined( size ) && ItemFormat.isSizeable( format ) ) {\n\t...
[ "0.5627378", "0.54981333", "0.5475573", "0.5472779", "0.5455746", "0.5451961", "0.54215735", "0.53909343", "0.53909343", "0.53909343", "0.53446233", "0.53446233", "0.53375894", "0.5307455", "0.5297363", "0.5289492", "0.5289492", "0.5276129", "0.52544826", "0.5237801", "0.5237...
0.8620391
0
Fill an Item (outer) element: style.position setted to "absolute". It also wrap the className setter to avoid React to remove the standard classes of Muuri from the item.
function fillItemElement(itemElement, itemClasses) { itemElement.style.position = 'absolute'; // Ensure that the Css item classes are not removed. var defaultSetAttribute = itemElement.setAttribute.bind(itemElement); itemElement.setAttribute = function setAttribute(attribute, value) { if (attribute ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "reposition() {\n let l = this.length;\n if (this.length < 2) return;\n\n let map = [{ x: 0, y: 0, width: this.maxWidth, height: this.maxHeight }];\n let w = 0;\n let h = 0;\n let mw = NaN;\n let mh = NaN;\n\n for (let i = 0; i < l; i++) {\n let item = this.getChild('item')[i];\n\n ...
[ "0.58461577", "0.5622088", "0.55942124", "0.5435339", "0.5425186", "0.5320855", "0.5306595", "0.52730393", "0.5268829", "0.5268829", "0.52630544", "0.5245177", "0.52422345", "0.52342385", "0.5226862", "0.5226862", "0.5219061", "0.52027255", "0.51622546", "0.51610035", "0.5154...
0.6695577
0
Accept a dependencyList and return if it has changed from the previous render.
function useReference(dependencyList) { var ref = React.useRef(dependencyList); // If it is the first call return true. if (ref.current === dependencyList) return true; // Compare the dependencyLists. var didUpdate = compare(ref.current, dependencyList); // Keep the reference of the new one. ref.curr...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "hasChanged() {\n return this.some(item => {\n var [thisChanged, childrenChanged] = item.getChanged();\n return thisChanged || childrenChanged;\n });\n }", "updateDependencyTrackers(stateChanges, propsChanges, props) {\n const hasChanged = Object.keys(\n this.depende...
[ "0.5652712", "0.5608778", "0.56039", "0.5583159", "0.5488863", "0.53963196", "0.53892773", "0.53382295", "0.5319618", "0.5319364", "0.53129524", "0.53048503", "0.53048503", "0.53048503", "0.53048503", "0.53048503", "0.53048503", "0.53048503", "0.53048503", "0.53048503", "0.53...
0.7088738
0
Like useEffect but run instantly.
function useInstantEffect(didUpdate, deps) { // Deps check. var needUpdate = useReference(deps); var cleanUpRef = React.useRef(); // Run. if (needUpdate) { if (cleanUpRef.current) cleanUpRef.current(); cleanUpRef.current = didUpdate(); } // Catch unmount. React.useEffect(function ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function useEffectOnce(effect, useEffectFn = useEffect) {\n const destroyFunc = useRef();\n const effectCalled = useRef(false);\n const renderAfterCalled = useRef(false);\n const [val, setVal] = useState(0);\n\n if (effectCalled.current) {\n renderAfterCalled.current = true;\n }\n\n useEffectFn(() => {\n...
[ "0.68943185", "0.6447759", "0.6377066", "0.6318904", "0.60683525", "0.6044717", "0.60198426", "0.6011504", "0.6003858", "0.60026", "0.60026", "0.5968653", "0.59249026", "0.58854336", "0.5740204", "0.5630232", "0.5607287", "0.55960596", "0.5579681", "0.55609804", "0.5522263", ...
0.6808142
1
Replacement for useMemo use case with empty array, it memoize only the first computed value.
function useMemoized(factory) { var valueRef = React.useRef(); if (!valueRef.current) { valueRef.current = factory(); } return valueRef.current; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function useMemoCallback(func) {\n\t var funRef = React.useRef(func);\n\t funRef.current = func;\n\t var callback = React.useCallback(function () {\n\t var _funRef$current;\n\t\n\t for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {\n\t args[_key] = arguments[_k...
[ "0.5371974", "0.5313895", "0.5287224", "0.5283476", "0.52781236", "0.5272097", "0.5263842", "0.52585953", "0.52585953", "0.5255902", "0.5255902", "0.52494866", "0.5237538", "0.5213989", "0.52090293", "0.5132279", "0.5116665", "0.5112215", "0.5108275", "0.5083011", "0.50583994...
0.556486
0
Returns a (memoized) function to rerender the component in which the hook has been called.
function useRerender() { var setState = React.useState()[1]; return useFunction(function () { setState(Object.create(null)); }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function useMemoized(factory) {\n var valueRef = React.useRef();\n\n if (!valueRef.current) {\n valueRef.current = factory();\n }\n\n return valueRef.current;\n }", "function composeRenderFunction(outer, inner) {\n return memoizer(outer)(inner);\n }", "function rerender() { setCount...
[ "0.6710046", "0.635311", "0.6319396", "0.62288314", "0.6147233", "0.6147233", "0.6032812", "0.6006441", "0.5954999", "0.594975", "0.59317106", "0.591519", "0.58951986", "0.5863826", "0.58280003", "0.58223623", "0.58182347", "0.58026713", "0.57983565", "0.578", "0.577721", "...
0.7009412
0
Filter the items with the given predicate.
function filterItems(grid, predicate) { grid.filter(function (item) { return predicate(item.getData(), item); }, { layout: false }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "filter(predicate) {\n return new IteratorWithOperators(new filter_1.FilterIterator(this.source, predicate));\n }", "filter(predicate) {\n return this.toArray().filter(predicate);\n }", "function filter(list, predicate){\n\tvar result = [];\n\tfor(var i=0;i<list.length;i++){\n\t\tvar item = li...
[ "0.7390168", "0.7362269", "0.71996695", "0.70887905", "0.6885513", "0.67666143", "0.6696028", "0.6696028", "0.6675644", "0.6675644", "0.6675644", "0.6675644", "0.6675644", "0.66663605", "0.66488206", "0.66262424", "0.6620251", "0.6581992", "0.6574055", "0.65543956", "0.651382...
0.7714179
0
Returns the Css class of the grid element.
function getGridClass(grid) { // @ts-ignore return grid._settings[gridClassName]; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function getGridClass() {\n\t\tswitch(currentDifficulty) {\n\t\t\tcase 'easy': {\n\t\t\t\treturn grids.easy;\n\t\t\t}\n\t\t\tcase 'medium': {\n\t\t\t\treturn grids.medium;\n\t\t\t}\n\t\t\tcase 'hard': {\n\t\t\t\treturn grids.hard;\n\t\t\t}\n\t\t\tdefault: return grids.medium;\n\t\t}\n\t}", "function getGetCellCl...
[ "0.70405", "0.6507833", "0.64712346", "0.64712346", "0.6273188", "0.62575", "0.6219196", "0.61695004", "0.6129716", "0.59960574", "0.59851676", "0.59851676", "0.59774065", "0.5970384", "0.5970384", "0.5926451", "0.5926451", "0.5926451", "0.5926451", "0.58256996", "0.58254635"...
0.68284285
1
Returns the items classes.
function getItemClasses(grid) { // @ts-ignore return itemClassNames.map(function (className) { return grid._settings[className]; }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function getClasses() {\n var rootClass = classes.root;\n var options = Splide.options;\n return [rootClass + \"--\" + options.type, rootClass + \"--\" + options.direction, options.drag ? rootClass + \"--draggable\" : '', options.isNavigation ? rootClass + \"--nav\" : '', STATUS_CL...
[ "0.671113", "0.6491968", "0.6386152", "0.6323786", "0.6211134", "0.62106967", "0.6158303", "0.61501193", "0.6049867", "0.6004702", "0.5942743", "0.59340245", "0.59182566", "0.59134316", "0.5884296", "0.5863212", "0.5843689", "0.5843689", "0.58072364", "0.57984585", "0.5734579...
0.77067095
0
Hide the given items.
function hideItems(grid, items) { grid.hide(items, { layout: false }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function hideListItems(totalToHide) {\n slicedArray = itemListArray.slice(totalToHide, totalItemInList);\n for(var i = 0; i < slicedArray.length; i += 1) {\n slicedArray[i].style.display = 'none';\n }\n}", "function hideUselessItems(nodes, items) {\n\t // Hide the leading separators.\n\t ...
[ "0.73850214", "0.72763926", "0.7142481", "0.70940745", "0.7019185", "0.6758092", "0.6755142", "0.674974", "0.6741066", "0.6721375", "0.6681593", "0.6651906", "0.6634811", "0.6634811", "0.6627045", "0.6621948", "0.66155237", "0.6610259", "0.6607423", "0.6594844", "0.64781636",...
0.80260855
0
Sort the items given a predicate function.
function handleFunction(grid, predicate, sortOptions) { grid.sort(function (itemA, itemB) { return predicate(itemA.getData(), itemB.getData(), itemA, itemB); }, sortOptions); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "sort(predicate) {\n if (this._multiple && this.selected) {\n this._selected.sort(predicate);\n }\n }", "sort(predicate) {\n if (this._multiple && this.selected) {\n this._selected.sort(predicate);\n }\n }", "sort(predicate) {\n if (this._multiple &...
[ "0.6561489", "0.6561489", "0.6561489", "0.6561489", "0.6510826", "0.64987457", "0.6247375", "0.59714746", "0.5922929", "0.58937776", "0.5853646", "0.584208", "0.5833496", "0.58183694", "0.57978207", "0.57706374", "0.57691157", "0.56908727", "0.56770635", "0.56634825", "0.5578...
0.69917756
0
Sort the items given a predicate string.
function handleString(grid, predicate, sortOptions) { grid.sort(predicate, sortOptions); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function sort () {\n var func, sortStatus;\n sortStatus = ctrl.tableState().sort.predicate;\n\n if (!sortStatus) {\n if (sortDefault) {\n sortStatus = sortDefault;\n } else {\n sortStatus = [];\n }\n }\n if (sortStatus.indexOf(pred...
[ "0.6410307", "0.61759615", "0.5887693", "0.5887693", "0.5887693", "0.5887693", "0.5721314", "0.5687007", "0.5593112", "0.5491826", "0.5419559", "0.537712", "0.53296083", "0.53204465", "0.530728", "0.5263386", "0.5241027", "0.5233653", "0.5226222", "0.52031475", "0.5171056", ...
0.65688664
0
Generate and returns a muuri instance with the given options.
function getInstance(options) { var el = document.createElement('div'); // The element won't be visible. el.style.display = 'none'; // Muuri (0.8.0) need an element in the DOM to be instanciated. document.body.appendChild(el); // Generate the instance. var grid = new Muuri(el, options); // Remove the...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "options() {\n this.generate();\n }", "function init(options) {\n return __awaiter(this, void 0, void 0, function () {\n var sdk;\n return __generator(this, function (_a) {\n sdk = new SDK(options);\n return [2 /*return*/, sdk.init()];\n });\n });\n }", "static create...
[ "0.5715927", "0.5360624", "0.5243042", "0.5239531", "0.5152041", "0.51513016", "0.5151153", "0.5151153", "0.5151153", "0.5147846", "0.51428825", "0.51388985", "0.5132606", "0.51277745", "0.51059145", "0.5100715", "0.5088952", "0.5078287", "0.5027775", "0.5025712", "0.50165737...
0.57082623
1
Wrap the 'dragAutoScroll' option. Allow the target element to be a ref.
function setDragAutoScroll(options) { var dragAutoScroll = options.dragAutoScroll; // Wrap the options only if it is setted. if (!dragAutoScroll || !Array.isArray(dragAutoScroll.targets)) return; dragAutoScroll.targets.forEach(function (target) { // Check if it is an object to wrap. if (isTarge...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function attachDragger(scrolldObj) {\n var attachment = false;\n var lastPosition;\n var self = $(this);\n var toScroll = scrolldObj;\n\n self.on(\"mousedown\", function (e) {\n attachment = true;\n lastPosition = e.clientX;\n });\n $(window).on(\"mousemove\", function (e) {\n ...
[ "0.61121553", "0.6085714", "0.60287446", "0.59965926", "0.59965926", "0.5926526", "0.5909094", "0.5842532", "0.58276457", "0.58066016", "0.58066016", "0.5802297", "0.5766397", "0.57636964", "0.5758154", "0.57486", "0.57486", "0.5699252", "0.5661656", "0.5647926", "0.5643413",...
0.7918122
0
Returns if the target is a valid element.
function isTargetElement(target) { return (// A DOM element. target instanceof HTMLElement || // The window. target instanceof window.constructor ); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function isElement(obj) {\r\n return !!(obj && obj.nodeType === 1);\r\n }", "function isElement(obj) {\n return !!(obj && obj.nodeType === 1);\n }", "function isElement(obj) {\n return !!(obj && obj.nodeType === 1);\n }", "function isElement(obj) {\n return !!(obj && obj.nodeType === 1);...
[ "0.67409265", "0.67116046", "0.67116046", "0.67116046", "0.67116046", "0.67116046", "0.6708444", "0.6682209", "0.6682209", "0.6679624", "0.66428787", "0.66428787", "0.66384923", "0.6626441", "0.6626441", "0.6626441", "0.6626441", "0.6625333", "0.6599983", "0.6521419", "0.6376...
0.7191479
0
Wrap the 'dragContainer' option. Allow it to be a ref.
function setDragContainer(options) { var dragContainer = options.dragContainer; // The drag container ref. var ref = { current: null }; // Define the property. Object.defineProperty(options, 'dragContainer', { get: function get() { return ref.current; }, set: function s...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "addDragableZone(container) {\n\n }", "_withDropContainer(container) {\n this._dropContainer = container;\n }", "_withDropContainer(container) {\n this._dropContainer = container;\n }", "_withDropContainer(container) {\n this._dropContainer = container;\n }", "function DragR...
[ "0.6683969", "0.6441135", "0.6441135", "0.6441135", "0.6344888", "0.6344888", "0.5964049", "0.58772767", "0.58749384", "0.58647215", "0.5825388", "0.57014984", "0.57014984", "0.5677777", "0.5657151", "0.5655236", "0.5654438", "0.5654438", "0.56370026", "0.56319016", "0.558417...
0.7782571
0
Wrap the 'dragSort' option. Allow it to be an object containing the groupId of the chosen MuuriComponents.
function setDragSort(options, globalMap) { var dragSort = options.dragSort; // Parse this options only if it is an object. if (!dragSort || _typeof(dragSort) !== 'object') return; // Check the options. invariant(typeof dragSort.groupId === 'string', 'You must provide a string as groupId'); // The group, i...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function CdkDragSortEvent() { }", "function CdkDragSortEvent() { }", "function addSortEvents() {\n query('.group')\n .bind('DOMSubtreeModified', function () {\n var sort = query(this).attr('aria-sort');\n var sortElement = query(this).find('.dx-column-indicators');\n ...
[ "0.61133707", "0.61133707", "0.58763456", "0.57542926", "0.57385534", "0.56619614", "0.5638869", "0.56125134", "0.5581337", "0.5552883", "0.5552217", "0.5489832", "0.5489832", "0.5485386", "0.5482008", "0.5466131", "0.54639244", "0.5458648", "0.54445386", "0.5427983", "0.5423...
0.7552962
0
Wrap the 'dragStartPredicate' option. To allow the drag: The global drag must be enabled. The item must be draggable.
function setDragStartPredicate(options) { var dragStartPredicate = options.dragStartPredicate; // Default predicate. var defaultStartPredicate = getDefaultStartPredicate(dragStartPredicate); // Wrap the method. options.dragStartPredicate = function (item, event) { if (!getDecoration(item.getGrid())....
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function getDefaultStartPredicate(dragStartPredicate) {\n return typeof dragStartPredicate === 'function' ? dragStartPredicate : function (item, event) {\n return Muuri.ItemDrag.defaultStartPredicate(item, event, dragStartPredicate);\n };\n }", "function dragStartProcedure() {\n return procedurePi...
[ "0.72972244", "0.65296805", "0.62520534", "0.6229417", "0.6181199", "0.61744106", "0.617236", "0.6109204", "0.6057538", "0.60285723", "0.6021664", "0.59932977", "0.591023", "0.5854373", "0.5824487", "0.58088756", "0.5776032", "0.576996", "0.576996", "0.57501143", "0.5741083",...
0.8500441
0
Given the dragStartPredicate option return the default method.
function getDefaultStartPredicate(dragStartPredicate) { return typeof dragStartPredicate === 'function' ? dragStartPredicate : function (item, event) { return Muuri.ItemDrag.defaultStartPredicate(item, event, dragStartPredicate); }; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function setDragStartPredicate(options) {\n var dragStartPredicate = options.dragStartPredicate; // Default predicate.\n\n var defaultStartPredicate = getDefaultStartPredicate(dragStartPredicate); // Wrap the method.\n\n options.dragStartPredicate = function (item, event) {\n if (!getDecoration(item....
[ "0.7389349", "0.5783647", "0.5551572", "0.5486231", "0.5481367", "0.49641255", "0.49641255", "0.49534178", "0.49213323", "0.48927653", "0.48314828", "0.48114324", "0.47533247", "0.47171244", "0.4694892", "0.4680891", "0.46660078", "0.46436438", "0.46419433", "0.45818314", "0....
0.7847306
0
The useData hook allow to set the data to the item in which the hook has been called. It also returns the setter method.
function useData(initialData, options) { var _useItemContext = useItemContext(), itemRefController = _useItemContext.itemRefController; // Check if the hook is called inside an item. invariant(itemRefController !== undefined, 'The useData hook can be used only inside an Item'); // Because of memoizati...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "set data(data) {\n this.set_data(data);\n }", "setData(data) {\n this.__data = data;\n }", "setData(data) {\n this.data = data;\n }", "function setData(data){\n\tdata && K.mix(stored_data, data);\n}", "setData(data) {\n this.data = data;\n }", "setData(data) {\n this.da...
[ "0.6824153", "0.6821262", "0.6510025", "0.6479695", "0.64760876", "0.64760876", "0.6451187", "0.634046", "0.62370604", "0.6174215", "0.6116321", "0.61106014", "0.60338116", "0.5976087", "0.58401006", "0.57791024", "0.57655567", "0.57587194", "0.57244945", "0.56930006", "0.562...
0.70642567
0
The useDrag hook rerender item (in which the hook has been called) Every time it is dragged/released. The hook returns if the item is being dragged.
function useDrag() { var _useItemContext = useItemContext(), eventController = _useItemContext.eventController; var reRender = useRerender(); // Check if the hook is called inside an item. invariant(eventController !== undefined, 'The useDrag hook can be used only inside an Item'); // Enable the e...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function useDraggable() {\n var _useItemContext = useItemContext(),\n itemRefController = _useItemContext.itemRefController; // Check if the hook is called inside an item.\n\n\n invariant(itemRefController !== undefined, 'The useData hook can be used only inside an Item');\n var setDraggable = useF...
[ "0.7199325", "0.6673784", "0.644485", "0.644485", "0.644485", "0.6429165", "0.64048404", "0.63232076", "0.63232076", "0.63232076", "0.62138796", "0.62138796", "0.61309206", "0.6102914", "0.6093666", "0.5939286", "0.58784723", "0.5813199", "0.58085006", "0.5797414", "0.5768454...
0.83951503
0
The useDraggable hook allow to decide if the item (in which the hook has been called) can be dragged or not. It returns the setter method.
function useDraggable() { var _useItemContext = useItemContext(), itemRefController = _useItemContext.itemRefController; // Check if the hook is called inside an item. invariant(itemRefController !== undefined, 'The useData hook can be used only inside an Item'); var setDraggable = useFunction(fun...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function useDrag() {\n var _useItemContext = useItemContext(),\n eventController = _useItemContext.eventController;\n\n var reRender = useRerender(); // Check if the hook is called inside an item.\n\n invariant(eventController !== undefined, 'The useDrag hook can be used only inside an Item'); // E...
[ "0.6671107", "0.66600585", "0.6577832", "0.609395", "0.60902387", "0.60902387", "0.60902387", "0.59195185", "0.57378584", "0.5697488", "0.5611185", "0.554627", "0.5458794", "0.54182404", "0.54117036", "0.5400111", "0.5400111", "0.5400111", "0.5349947", "0.53451025", "0.528716...
0.78790116
0
The useGrid hook return the data of the MuuriComponent parent of the item (in which the hook has been called).
function useGrid() { var _useItemContext = useItemContext(), eventController = _useItemContext.eventController; var gridContext = useGridContext(); var reRender = useRerender(); // Check if the hook is called inside an item. invariant(eventController !== undefined && gridContext.grid !== undef...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "getGrid () {\n return this.grid;\n }", "getGrid() {\n return this.grid;\n }", "getActiveGrid(){\n return this._activeGrid;\n }", "get owner() {\n return this._owner || this.subGrid;\n }", "function getGridInfo() {\r\n\t\t\t\tconst gridModule = grid.parentContainer._grid;\r...
[ "0.6290765", "0.6250724", "0.6156054", "0.60511917", "0.6031907", "0.59560716", "0.56645525", "0.5408083", "0.5334053", "0.5324665", "0.5285539", "0.52590233", "0.5215959", "0.516855", "0.5167969", "0.5146406", "0.5093787", "0.509078", "0.5078471", "0.5067983", "0.5043328", ...
0.6995025
0
The useRefresh hook allow to notify the MuuriComponent that the item dimensions are changed, so that it can update the layout.
function useRefresh() { var deps = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : []; var _useGridContext = useGridContext(), layoutController = _useGridContext.layoutController; var _useItemContext = useItemContext(), itemRefController = _useItemContext.itemRefControl...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "refresh() {\n this.useLayout(this.layout);\n }", "refreshOnSizeChange() {\n\t\tif (this.canvasD3Layout) {\n\t\t\tthis.canvasD3Layout.refreshOnSizeChange();\n\t\t}\n\t}", "onResize(layout, oldItem, newItem, placeholder, e, element) {\n console.log(\"rgl: onResize\");\n }", "onResizeStart(layout,...
[ "0.685447", "0.64993507", "0.6339135", "0.6152249", "0.60710967", "0.6041548", "0.60261685", "0.595519", "0.5856811", "0.58483016", "0.5783682", "0.57601243", "0.5735044", "0.57310706", "0.57119566", "0.5709158", "0.5705911", "0.5663159", "0.56616837", "0.5658483", "0.5643292...
0.73384225
0
The useShow hook allow you to know if the item is showing. The item will rerender each time its visibility change.
function useShow() { var _useItemContext = useItemContext(), eventController = _useItemContext.eventController; var reRender = useRerender(); // Check if the hook is called inside an item. invariant(eventController !== undefined, 'The useShow hook can be used only inside an Item'); // Enable the e...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function useVisibility() {\n var _useGridContext = useGridContext(),\n layoutController = _useGridContext.layoutController;\n\n var _useItemContext = useItemContext(),\n eventController = _useItemContext.eventController,\n itemRefController = _useItemContext.itemRefController; // Check i...
[ "0.7043295", "0.66925573", "0.6661834", "0.6587456", "0.64986914", "0.6447548", "0.640292", "0.6307303", "0.6290308", "0.62596196", "0.6243202", "0.6211795", "0.6199892", "0.6175944", "0.6159634", "0.6129144", "0.6103459", "0.60798234", "0.6032942", "0.60083085", "0.60032", ...
0.81959313
0
The useVisibility hook allow you to show/hide the item in which the hook has been called.
function useVisibility() { var _useGridContext = useGridContext(), layoutController = _useGridContext.layoutController; var _useItemContext = useItemContext(), eventController = _useItemContext.eventController, itemRefController = _useItemContext.itemRefController; // Check if the hook ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function useVisibility(_a) {\n\t var _b = _a === void 0 ? {} : _a, _c = _b.defaultVisible, defaultVisible = _c === void 0 ? false : _c, _d = _b.defaultFocus, defaultFocusValue = _d === void 0 ? \"first\" : _d, onVisibilityChange = _b.onVisibilityChange;\n\t var _e = React.useState({\n\t visible: defau...
[ "0.72778463", "0.6783698", "0.67218894", "0.6714016", "0.668377", "0.66655093", "0.66624534", "0.6604401", "0.65206134", "0.6435478", "0.64214027", "0.6371865", "0.634968", "0.63057244", "0.62839484", "0.6249938", "0.6247372", "0.6239581", "0.6232108", "0.6192259", "0.6188504...
0.86789805
0
Responsive style options. Get the responsive style.
function getResponsiveStyle(options) { // Check options. invariant(_typeof(options) === 'object', 'You must define options'); // Check columns. invariant(typeof options.columns === 'number' && options.columns > 0 && options.columns <= 1, 'options.columns must be a number between 0 (excluded) and 1 (include...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function getStaticStyle(options) {\n var style = getResponsiveStyle(options); // Check the options.\n\n invariant('grid' in options, 'You mast pass the grid instance to get the static style.'); // The sizer element.\n\n var sizerElement = options.grid.getSizerElement(); // Set the style in the sizer.\n\n ...
[ "0.6258262", "0.6233398", "0.60456866", "0.60456866", "0.60063577", "0.5975238", "0.5909784", "0.57935774", "0.57862544", "0.57862544", "0.57862544", "0.57833153", "0.56929976", "0.5660704", "0.55595917", "0.5520778", "0.5432386", "0.5328135", "0.53190845", "0.5307442", "0.52...
0.74030274
0
Return the handler with the given key.
function getHandler(key) { return function handler(payload) { return _defineProperty({}, key, payload); }; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function getByKey(key){\n return function (entry){\n return entry[key];\n }\n}", "function getByKey(key) {\n return function (p) {\n return p[key];\n };\n}", "function getObject(key) {\n\t\t\tvar value = localStorage.getItem(key);\n\n\t\t\treturn getStorageHandler(value);\n\t\t}", "getAffectedKeyHa...
[ "0.6511711", "0.64793235", "0.6235705", "0.60106283", "0.59161806", "0.58494395", "0.5836689", "0.57679486", "0.5712188", "0.5652265", "0.5639015", "0.5591764", "0.55752236", "0.5521478", "0.54980326", "0.5493033", "0.546885", "0.54504573", "0.5448776", "0.5442405", "0.541026...
0.76520216
0
Item HOC for hooks.
function withHooks(Component, enabledHooks) { // There must be an array of hooks to enable. invariant(Array.isArray(enabledHooks), 'An array of hooks name must be provided to wrap an item.'); // All the hooks must be valid. enabledHooks.forEach(function (hookName) { invariant(hooksNames.includes(hook...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function HookWrapper(props) {\n const hook = props.hook ? props.hook() : undefined;\n return <div hook={hook} />;\n}", "hook(hook, params) {\n if (hook in this.hooks) {\n return this.hooks[hook].bind(this)(params);\n }\n }", "function hook() {\n var comp = hook.proxy.apply(null, ...
[ "0.59722364", "0.58630925", "0.5818561", "0.57174695", "0.5632263", "0.55720425", "0.556681", "0.5565837", "0.5555932", "0.54101855", "0.5376464", "0.536778", "0.5339121", "0.53316176", "0.5331187", "0.52678627", "0.5247665", "0.51943636", "0.51912636", "0.5175807", "0.516929...
0.6229093
0
content of the right pane of the pos, containing the main functionalities. screens are contained in the PosWidget, in pos_widget.js all screens are present in the dom at all time, but only one is shown at the same time. transition between screens is made possible by the use of the screen_selector, which is responsible ...
function pos_loyalty_bg_screens(instance, module){ //module is instance.point_of_sale var QWeb = instance.web.qweb, _t = instance.web._t; var round_pr = instance.web.round_precision module.RewardProductScreenWidget = module.ScreenWidget.extend({ template:'ProductScreenWidget', start: ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function screenDisplay(data) {\r\n //get the main screen\r\n const screen = document.querySelector('#main');\r\n const screen2 = document.querySelector('#mini');\r\n\r\n if (data === \"<<\") {\r\n screen.innerText = \"\";\r\n } else if (data) {\r\n screen.innerText = data;\r\n } else {\r\n screen.in...
[ "0.55446875", "0.54884386", "0.54819757", "0.5478539", "0.547763", "0.54344654", "0.5433898", "0.53928584", "0.53158766", "0.53150356", "0.5313282", "0.5310288", "0.5285874", "0.5279879", "0.52744466", "0.526255", "0.5262397", "0.5259138", "0.5249725", "0.5244666", "0.5191341...
0.5716029
0
Creates an instance of Injector.
function Injector() { this.components = {}; this.instances = {}; this.stack = []; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "static createInjector(settings = {}) {\n return createInjector(DITest.configure(settings));\n }", "function defineInjector(options) {\n return {\n factory: options.factory, providers: options.providers || [], imports: options.imports || [],\n };\n}", "function defineInjector(options) {\n re...
[ "0.67545205", "0.6459263", "0.6459263", "0.6459263", "0.64478743", "0.6394731", "0.6145093", "0.6145093", "0.6122745", "0.6107484", "0.5959838", "0.5909256", "0.5871718", "0.5871718", "0.5871718", "0.5871718", "0.58630747", "0.58630747", "0.58630747", "0.5846148", "0.5846148"...
0.7543007
0
This is a bit awkward. If all components that were intented to be items of a grid obeyed a contract that they would accept a `style` prop and correctly assign it to the style of their toplevel element, then this would be a great pattern! `` would use React.cloneElement to provide the style props that it normally create...
function Footer ({ children, ...props }) { return (<footer className="Footer" {...props}>{children}</footer>) }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "render(){\n return(\n <div style={this.props.style}>\n <GridBody {...this.props} GridStore={this.GridStore} scrollBarWide={this.scrollBarWide}/>\n </div>\n );\n }", "function Footer() {\n\tlet context = useContext(PalettesContext);\n\n\tconst style = {\n\t\tfooter: {\n\t\t\tbackgroundC...
[ "0.61477774", "0.59107894", "0.58186615", "0.5807201", "0.5754225", "0.5750703", "0.5747211", "0.5702761", "0.568539", "0.56852627", "0.5662473", "0.5606328", "0.5588645", "0.5585215", "0.55847263", "0.55762845", "0.55719966", "0.55522627", "0.5546625", "0.5546625", "0.554659...
0.6157921
0
Adds the escaping functions from the regexp constructor, and saves references to the originals for restoration on deregister.
function register() { if (RegExp.encode !== rexpEncode) { oencode = RegExp.encode; odecode = RegExp.decode; RegExp.encode = rexpEncode; RegExp.decode = rexpDecode; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function escapeRegExp(s) {\r\n return s.replace(/([.*+?^${}()|[\\]\\/\\\\])/g, '\\\\$1');\r\n}", "function _RegExpLiteralExpressionEmitter() {\n}", "function _fnEscapeRegex ( sVal )\n\t\t{\n\t\t\tvar acEscape = [ '/', '.', '*', '+', '?', '|', '(', ')', '[', ']', '{', '}', '\\\\', '$', '^' ];\n\t\t var reRepl...
[ "0.6448883", "0.6430437", "0.634392", "0.634392", "0.6341162", "0.6336325", "0.63201797", "0.63201797", "0.63195586", "0.63126045", "0.63126045", "0.63126045", "0.63126045", "0.63126045", "0.63126045", "0.62995493", "0.62974995", "0.6274792", "0.62480193", "0.62428975", "0.62...
0.655888
0
under these two constraints: 1. voters have a certain amount of karma that they can spend on upvotes 2. voters cannot upvote too quickly, i.e., not within 5 seconds after a previous upvote In addition to the previous upvote closure, voters can recharge their karma with a recharge(number) method
function up(karma) { let karmaLeft = karma; let lastVoteMillis = 0; return { vote: function(upvote){ nowMillis = Date.now(); if( nowMillis - lastVoteMillis < 5000) return 'you are upvoting too early'; if(karmaLeft < 0) return 'not enough karma'; lastVoteMillis = nowMil...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "async mortgage(chain: DposChain, from: string, amount: BigNumber): Promise<{ err: ErrorCode, returnCode?: ErrorCode }> {\n assert(amount.gt(0), 'amount must positive');\n\n let curBlock = chain.tipBlockHeader!.number;\n let UNMORTGAGE_PERIOD = chain.globalOptions.mortgagePeriod;\n let BLOCK_INTERVAL = ...
[ "0.6227488", "0.5690552", "0.5686137", "0.56062603", "0.55939776", "0.55495757", "0.5463877", "0.5460486", "0.54344696", "0.5413816", "0.5385773", "0.5384882", "0.53657717", "0.5365165", "0.5360217", "0.53588957", "0.5344575", "0.53285843", "0.5315899", "0.5304904", "0.530448...
0.7579669
0
Alerts user, then removes scres from Async Storage and state.
resetHighscoresClicked() { Alert.alert( 'Deleting highscores', 'Are you sure you want to delete ALL highscore data?', [ {text: 'Yes', onPress: () => { try { AsyncStorage.multiRemove(['highscoreVeryEasy' ,...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "async userWipe() {\n try {\n await AsyncStorage.removeItem('userID');\n await AsyncStorage.removeItem('xAuth');\n console.log('Success logout');\n } catch (error) {\n console.log(error);\n }\n }", "function deactivateOnFailure() {\n if(storage.ClearURLsData.length === 0) {\n...
[ "0.609135", "0.5890905", "0.5676837", "0.56470674", "0.5604362", "0.55825603", "0.5573194", "0.553426", "0.55212957", "0.55141294", "0.54830736", "0.5469618", "0.5467221", "0.54666615", "0.54361635", "0.5434793", "0.54009384", "0.53923243", "0.5388993", "0.53721964", "0.53653...
0.6087131
1
set handler priority order
function SetPrecedence(element, type, regIndex) { var prec = []; for (var p = 0, pl = register[regIndex].length; p < pl; p++) { if (register[regIndex][p].Handler != null) prec[prec.length] = { Index: p, Priority: register[regIndex][p].Priority }; } // sort by priority if (prec.length > 0) prec.sort(...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function overrideHttpHandler(fn) {\n activeHandler = fn;\n }", "function handlePriorityChange(e, {value}) {\n setFormData({\n ...formData,\n priority: value\n })\n }", "on(type, handler) {\n let map = this._handlers || (this._handlers = Object.create(null))...
[ "0.5716884", "0.55526847", "0.5524674", "0.5483138", "0.54735833", "0.542017", "0.54063374", "0.5341117", "0.53394145", "0.53053856", "0.52937347", "0.52793497", "0.52037585", "0.5190373", "0.5175151", "0.51623213", "0.51467377", "0.51467377", "0.51409715", "0.5134784", "0.51...
0.5588195
1
Program node works almost like a function: it hoists all variables which can be tranformed to blockscoped let/const. It just doesn't have name and parameters. So we create an implied FunctionScope and BlockScope.
function enterProgram(node) { scopeManager.enterFunction(); hoistFunction({body: node}); scopeManager.enterBlock(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function enterProgram(node) {\n scopeManager.enterFunction();\n hoistFunction({\n body: node\n });\n scopeManager.enterBlock();\n} // FunctionDeclaration has it's name visible outside the function,", "Program(node) {\n const scope = context.getScope(),\n features = context.parserOption...
[ "0.76434034", "0.62129706", "0.6071579", "0.60428363", "0.6025686", "0.5944439", "0.5942978", "0.58694386", "0.575281", "0.5720836", "0.5711932", "0.5666161", "0.56527025", "0.56401956", "0.5614079", "0.5614079", "0.558904", "0.55395055", "0.55086917", "0.54830956", "0.547615...
0.73060626
1
FunctionDeclaration has it's name visible outside the function, so we first register it in surrounding blockscope and after that enter new FunctionScope.
function enterFunctionDeclaration(func) { if (func.id) { getScope().register( func.id.name, getScope().findFunctionScoped(func.id.name) ); } scopeManager.enterFunction(); hoistFunction({params: func.params, body: func.body}); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function enterFunctionDeclaration(func) {\n if (func.id) {\n getScope().register(func.id.name, getScope().findFunctionScoped(func.id.name));\n }\n\n scopeManager.enterFunction();\n hoistFunction({\n params: func.params,\n body: func.body\n });\n} // FunctionExpression has it's name visible only insid...
[ "0.7796894", "0.727316", "0.71002764", "0.7049144", "0.7013757", "0.69960886", "0.68409884", "0.6824655", "0.6803639", "0.67217857", "0.67084575", "0.6647382", "0.66375583", "0.66224617", "0.6619979", "0.66020507", "0.6596454", "0.6591018", "0.655785", "0.65577596", "0.652320...
0.74883085
1
Exits the implied BlockScope and FunctionScope of Program node
function leaveProgram() { scopeManager.leaveScope(); leaveFunction(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function enterProgram(node) {\n scopeManager.enterFunction();\n hoistFunction({body: node});\n scopeManager.enterBlock();\n}", "enterEndProgramStatement(ctx) {\n\t}", "function enterProgram(node) {\n scopeManager.enterFunction();\n hoistFunction({\n body: node\n });\n scopeManager.enterBlock();\n} //...
[ "0.6680189", "0.64024013", "0.63159585", "0.6098239", "0.60496247", "0.5887588", "0.58244336", "0.5813538", "0.57883334", "0.5668704", "0.5666228", "0.5649981", "0.56300515", "0.56245697", "0.56193787", "0.56124955", "0.5603458", "0.5580887", "0.5579019", "0.5570892", "0.5557...
0.7394203
0
Exits FunctionScope but first transforms all variables inside it
function leaveFunction() { transformVarsToLetOrConst(); scopeManager.leaveScope(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function ciao() {\n\t// Function scope here\n\tvar scoped\n}", "function clearLocal(){\n int_vars.local = [];\n float_vars.local = [];\n string_vars.local = [];\n boolean_vars.local = [];\n}", "function endLexicalEnvironment() {\n ts.Debug.assert(state > 0 /* Uninitialized */, \"Cannot modify th...
[ "0.5801279", "0.5709099", "0.56720674", "0.5660084", "0.55162877", "0.5512326", "0.54460454", "0.54091674", "0.5379075", "0.53124696", "0.52768946", "0.5263594", "0.521633", "0.52052426", "0.5205039", "0.5204976", "0.5189255", "0.5185846", "0.51687497", "0.51636565", "0.51514...
0.6438731
0
Does a node have body that can contain an array of statements
function hasMultiStatementBody(node) { return node.type === 'BlockStatement' || node.type === 'Program' || node.type === 'SwitchCase'; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function isExpressionArray(nodes) {\n return nodes.every(node => t.isExpression(node));\n}", "function is_block(stmt) {\n return is_tagged_list(stmt, \"block\");\n}", "function isStatement(node) {\n return CodeGenerator.Statement.hasOwnProperty(node.type);\n }", "function isStatement(node) {\n...
[ "0.6342891", "0.6104318", "0.60069335", "0.60069335", "0.60069335", "0.60069335", "0.60069335", "0.60069335", "0.60069335", "0.60069335", "0.59382755", "0.5856955", "0.584204", "0.5817319", "0.57573044", "0.5686875", "0.56704104", "0.5666058", "0.5615405", "0.55804884", "0.55...
0.7192647
0
Returns all VariableGroups of variables in current function scope, including from all the nested blockscopes (but not the nested functions).
function getFunctionVariableGroups() { return flow( map(v => v.getGroup()), uniq, compact )(getScope().getVariables()); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function getFunctionVariableGroups() {\n return (0, _fp.flow)((0, _fp.map)(function (v) {\n return v.getGroup();\n }), _fp.uniq, _fp.compact)(getScope().getVariables());\n}", "get scopes() {\n const ret = new Array();\n let curr = this.host;\n while (curr) {\n ret.unshift(cur...
[ "0.80144644", "0.6214447", "0.56638694", "0.5530993", "0.5523858", "0.54580283", "0.5251337", "0.52461296", "0.52151716", "0.5190745", "0.51902175", "0.5188061", "0.5167674", "0.5121702", "0.5115988", "0.5111176", "0.50952834", "0.5095019", "0.50816244", "0.50816244", "0.5081...
0.79599077
1
(context.canvas context, x of center, y of center, radius, number of points, fraction of radius for inset [0,1))
function starEffect(context, center_x, center_y, radius, points, inset_radius_ratio) { let lineWidth = 2 radius -= lineWidth context.save() context.beginPath() context.translate(center_x, center_y) context.moveTo(0, 0 - radius) for (let i = 0; i < points; i++) { context.rotate(Math.PI / points) c...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function drawCircle(xCenter, yCenter, r){\n var c = document.getElementById(\"canvas\");\n var ctx = c.getContext(\"2d\");\n xCenter = parseInt(xCenter);\n yCenter = parseInt(yCenter);\n r = parseInt(r);\n if(r == 0){\n r = 1;\n }\n var x = 0;\n var p = 3-2*r;\n while (x<r) {\n...
[ "0.62709177", "0.6187968", "0.61413115", "0.6134003", "0.6044887", "0.60438335", "0.60333425", "0.59874463", "0.5957882", "0.5917943", "0.59093094", "0.5878472", "0.58498603", "0.58465713", "0.58307195", "0.58300674", "0.58155656", "0.5802375", "0.57956916", "0.57898355", "0....
0.70378315
0
ATTENTION/TODO: text direction could be different on different paragraphs I.e. it should probably be a TextNode property
get textDirection() { return this._direction }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "get textDirection() { return this.viewState.heightOracle.direction; }", "get textDirection() { return this.viewState.heightOracle.direction; }", "function TTextNode() {}", "function TTextNode() {}", "function TTextNode(){}", "function TextNode(text) {\n this.text = text;\n}", "function TextNode(text...
[ "0.66774035", "0.66774035", "0.6385369", "0.6385369", "0.6329199", "0.6291277", "0.6291277", "0.6291277", "0.6291277", "0.6291277", "0.6291277", "0.62456816", "0.62456816", "0.62456816", "0.62456816", "0.6113492", "0.61074454", "0.6017438", "0.5928265", "0.5777969", "0.575572...
0.7016496
0
insert an inline node with given data at the current selection
insertInlineNode(inlineNode) { const sel = this._selection if (sel && !sel.isNull() && sel.isPropertySelection()) { return this._impl.insertInlineNode(this, inlineNode) } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function insertNodeAfterSelection(node) {\n var sel, range, html;\n if (window.getSelection) {\n sel = window.getSelection();\n if (sel.getRangeAt && sel.rangeCount) {\n range = sel.getRangeAt(0);\n range.collapse(false);\n range.insertNode(node);\n s...
[ "0.6503523", "0.6329512", "0.6112455", "0.60660124", "0.60546464", "0.60546464", "0.60546464", "0.60546464", "0.60546464", "0.60546464", "0.60546464", "0.60546464", "0.60546464", "0.60546464", "0.60229874", "0.60221165", "0.592366", "0.58407664", "0.5787669", "0.5772904", "0....
0.69730437
0
find a unique directory name
findUniqueDir(tmpDir) { const guid = uuid.v4().replace(/-/g, ''); const dirName = `${tmpDir}/${guid}`; return new Promise((resolve, reject) => { fs.stat(dirName, (err, stats) => { if (err) { resolve({dirName}); } else { findUniqueDir().then((arg) => { re...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function directory(url) {\n\t\treturn url.substring(0, url.lastIndexOf('/') + 1)\n\t} // directory(url)", "function getDirectory() {return App.DNA.Hash;}", "function getTheFileName(location){\n\tvar locations = location.split(\"/\");\n\tif(locations.length == 0){\n\t\treturn newGuid();\n\t}\n\telse{\n\t\tvar f...
[ "0.61439943", "0.60622466", "0.601226", "0.5948939", "0.5936881", "0.5875406", "0.5868999", "0.5798277", "0.579399", "0.5766354", "0.5765684", "0.57613593", "0.5758931", "0.5758931", "0.5712418", "0.571087", "0.5686884", "0.56756395", "0.5659901", "0.564842", "0.56391436", ...
0.7202307
0
onDocumentMouseDown() Used to detect mouse on elements to move
function onDocumentMouseDown() { isMouseDown = true; return false; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function onDocumentMouseDown() {\n\t\t\t\t\tisMouseDown = true;\n\t\t\t\t\treturn false;\n\t\t\t\t}", "function onDocumentMouseDown( event ) {\n\n dragged = false;\n\t\tevent.preventDefault();\n\t\traycaster.setFromCamera( mouse, camera );\n\t\tvar intersects = raycaster.intersectObjects( objects, true );...
[ "0.8051285", "0.76359963", "0.75908935", "0.7567415", "0.7330642", "0.7207117", "0.71544194", "0.70247024", "0.7022937", "0.69747704", "0.69353855", "0.69296575", "0.6797336", "0.67508894", "0.67209584", "0.6663801", "0.66497725", "0.66470486", "0.6646943", "0.6631028", "0.65...
0.8142817
0