Search is not available for this dataset
query
stringlengths
7
355k
document
stringlengths
9
341k
metadata
dict
negatives
listlengths
0
101
negative_scores
listlengths
0
101
document_score
stringlengths
3
10
document_rank
stringclasses
102 values
Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE file distributed with this work for additional information regarding copyright ownership. The ASF licenses this file to you under the Apache License, Version 2.0 (the "License"); you may not use this file e...
function _default(dom, ecModel) { var ariaModel = ecModel.getModel('aria'); if (!ariaModel.get('show')) { return; } else if (ariaModel.get('description')) { dom.setAttribute('aria-label', ariaModel.get('description')); return; } var seriesCnt = 0; ecModel.eachSeries(function (seriesModel, idx)...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "get Android() {}", "function SBRecordsetPHP_analyzePlatformSpecific()\r\n{\r\n\r\n\r\n}", "onChildAppStart () {\n\n }", "private internal function m248() {}", "private public function m246() {}", "onMessageStart() { }", "createStream () {\n\n }", "_playbackCompatibility() {\n // Detect audio pla...
[ "0.5349978", "0.48933455", "0.48501366", "0.48083982", "0.4772584", "0.474481", "0.47349635", "0.47027457", "0.46929818", "0.46929818", "0.4673667", "0.4644517", "0.46389893", "0.46253318", "0.4618249", "0.4582536", "0.45813942", "0.45742747", "0.45687214", "0.45623618", "0.4...
0.0
-1
Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE file distributed with this work for additional information regarding copyright ownership. The ASF licenses this file to you under the Apache License, Version 2.0 (the "License"); you may not use this file e...
function Scheduler(ecInstance, api, dataProcessorHandlers, visualHandlers) { this.ecInstance = ecInstance; this.api = api; this.unfinished; // Fix current processors in case that in some rear cases that // processors might be registered after echarts instance created. // Register processors incrementally for ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "get Android() {}", "function SBRecordsetPHP_analyzePlatformSpecific()\r\n{\r\n\r\n\r\n}", "onChildAppStart () {\n\n }", "private internal function m248() {}", "private public function m246() {}", "onMessageStart() { }", "createStream () {\n\n }", "_playbackCompatibility() {\n // Detect audio pla...
[ "0.53485686", "0.48948148", "0.485071", "0.48078835", "0.4771538", "0.4744391", "0.47347194", "0.47043997", "0.46918696", "0.46918696", "0.46722504", "0.4643159", "0.46377665", "0.46263066", "0.4617044", "0.45812133", "0.45800942", "0.4572664", "0.4568672", "0.4561345", "0.45...
0.0
-1
Only some legacy stage handlers (usually in echarts extensions) are pure function. To ensure that they can work normally, they should work in block mode, that is, they should not be started util the previous tasks finished. So they cause the progressive rendering disabled. We try to detect the series type, to narrow do...
function detectSeriseType(legacyFunc) { seriesType = null; try { // Assume there is no async when calling `eachSeriesByType`. legacyFunc(ecModelMock, apiMock); } catch (e) {} return seriesType; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function _default(seriesType) {\n return {\n seriesType: seriesType,\n plan: createRenderPlanner(),\n reset: function (seriesModel) {\n var data = seriesModel.getData();\n var coordSys = seriesModel.coordinateSystem;\n var pipelineContext = seriesModel.pipelineContext;\n var isLargeRe...
[ "0.5554196", "0.5554196", "0.5554196", "0.5554196", "0.5554196", "0.5554196", "0.5188415", "0.509293", "0.5009413", "0.49099848", "0.4895842", "0.47876376", "0.4774481", "0.47356772", "0.46883628", "0.46254632", "0.46091437", "0.4607717", "0.45879784", "0.45827132", "0.456863...
0.49045154
14
Mixin common methods to axis model, Inlcude methods `getFormattedLabels() => Array.` `getCategories() => Array.` `getMin(origin: boolean) => number` `getMax(origin: boolean) => number` `getNeedCrossZero() => boolean` `setRange(start: number, end: number)` `resetRange()`
function mixinAxisModelCommonMethods(Model) { zrUtil.mixin(Model, axisModelCommonMixin); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function Axis(min, max) {\n this.Min = min;\n this.Max = max;\n }", "function mixinAxisModelCommonMethods(Model) {\n\t mixin(Model, AxisModelCommonMixin);\n\t }", "function _default() {\n\n\tfunction axisX(selection, x) {\n\t\tselection.attr(\"transform\", function (d) {\n\t\t\treturn...
[ "0.6456995", "0.64222115", "0.64139944", "0.6311109", "0.62709725", "0.62081957", "0.60227144", "0.59888047", "0.5952998", "0.592759", "0.59203583", "0.58894354", "0.5867283", "0.5856101", "0.580715", "0.5805064", "0.5797678", "0.57902026", "0.57778424", "0.5771716", "0.57472...
0.6458842
5
Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE file distributed with this work for additional information regarding copyright ownership. The ASF licenses this file to you under the Apache License, Version 2.0 (the "License"); you may not use this file e...
function decode(json) { if (!json.UTF8Encoding) { return json; } var encodeScale = json.UTF8Scale; if (encodeScale == null) { encodeScale = 1024; } var features = json.features; for (var f = 0; f < features.length; f++) { var feature = features[f]; var geometry = feature.geometry; ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function getGeoJson() {\n return {\n \"type\": \"FeatureCollection\",\n \"features\": [\n {\n \"type\": \"Feature\",\n \"properties\": {},\n \"geometry\": {\n \"type\": \"LineString\",\n \"coordinates\": [\n [\n 13.25441561846926,\n ...
[ "0.6401467", "0.6251229", "0.6087593", "0.5867118", "0.5793363", "0.5769249", "0.57245433", "0.5660727", "0.5587197", "0.5554582", "0.5480767", "0.5463705", "0.54294145", "0.53844434", "0.53714746", "0.5360499", "0.5350253", "0.5340355", "0.5337533", "0.5335312", "0.53113735"...
0.6084094
8
probably be fetched by multiple times. So we cache the result. axis is created each time during a ec process, so we do not need to clear cache.
function getListCache(axis, prop) { // Because key can be funciton, and cache size always be small, we use array cache. return inner(axis)[prop] || (inner(axis)[prop] = []); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function axis_old_camera(result)\n{\n console.log(\"axis_old_camera\")\n console.log(result);\n}", "get axes() {\n if (this._axes === null) {\n let coll = new IgrAxisCollection();\n let inner = coll._innerColl;\n inner.addListener((sender, e) => {\n sw...
[ "0.55371356", "0.5492951", "0.53215224", "0.52449566", "0.52361447", "0.5234773", "0.51528275", "0.51246065", "0.5050779", "0.50349826", "0.49853832", "0.4976081", "0.4951008", "0.49115002", "0.490346", "0.49022877", "0.4896473", "0.48926905", "0.48906308", "0.4885324", "0.48...
0.44935584
98
Calculate interval for category axis ticks and labels. To get precise result, at least one of `getRotate` and `isHorizontal` should be implemented in axis.
function calculateCategoryInterval(axis) { var params = fetchAutoCategoryIntervalCalculationParams(axis); var labelFormatter = makeLabelFormatter(axis); var rotation = (params.axisRotate - params.labelRotate) / 180 * Math.PI; var ordinalScale = axis.scale; var ordinalExtent = ordinalScale.getExtent(); // Prov...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function calculateCategoryInterval(axis) {\n var params = fetchAutoCategoryIntervalCalculationParams(axis);\n var labelFormatter = makeLabelFormatter(axis);\n var rotation = (params.axisRotate - params.labelRotate) / 180 * Math.PI;\n var ordinalScale = axis.scale;\n var ordinalExtent = ordinalScale.getExtent(...
[ "0.7746507", "0.7746507", "0.7739931", "0.7715091", "0.77078474", "0.6546765", "0.64099866", "0.64099866", "0.64099866", "0.64099866", "0.62500155", "0.5976774", "0.58163536", "0.5799666", "0.57894534", "0.57893443", "0.56676996", "0.55825084", "0.5572562", "0.555126", "0.552...
0.7746507
3
It is time consuming for large category data.
function makeLabelsByCustomizedCategoryInterval(axis, categoryInterval, onlyTick) { var ordinalScale = axis.scale; var labelFormatter = makeLabelFormatter(axis); var result = []; zrUtil.each(ordinalScale.getTicks(), function (tickValue) { var rawLabel = ordinalScale.getLabel(tickValue); if (categoryInt...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function disneyCategories(){\n //fetch get index for attractions\n \n byCategory()\n}", "parseUniqueCategories(dataSet) {\n return dataSet.businesses.reduce((accum, business) => {\n business.categories.forEach((item) => {\n if (!(accum.findIndex(ele => ele.displayTitle === item[0]) + 1)) ...
[ "0.65933365", "0.6431569", "0.63838863", "0.6295054", "0.62482774", "0.61676735", "0.60887426", "0.6032884", "0.6030886", "0.60207045", "0.59903777", "0.5935371", "0.5903373", "0.5855015", "0.5827368", "0.58258593", "0.5816537", "0.5806314", "0.5792421", "0.57911104", "0.5784...
0.0
-1
Hover to change label and labelLine
function onEmphasis() { polyline.ignore = polyline.hoverIgnore; text.ignore = text.hoverIgnore; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function labelMouseOver(tag) {\n d3.selectAll('marker#' + tag)\n .select('path')\n .classed('hovered', true);\n\n d3.selectAll('.' + tag)\n .selectAll('path, text')\n .classed('hovered', true);\n }", "mouseover() {\n this.label.value = \"Reset\";\n this.label.innerHTML = ...
[ "0.7160445", "0.6749156", "0.6671658", "0.6635125", "0.66347754", "0.6629498", "0.655893", "0.6482963", "0.6458986", "0.64368105", "0.6426821", "0.63938105", "0.63766766", "0.63610965", "0.6343155", "0.63140905", "0.6271357", "0.6249969", "0.6235974", "0.62019086", "0.6192681...
0.0
-1
Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE file distributed with this work for additional information regarding copyright ownership. The ASF licenses this file to you under the Apache License, Version 2.0 (the "License"); you may not use this file e...
function _default(seriesType, actionInfos) { zrUtil.each(actionInfos, function (actionInfo) { actionInfo.update = 'updateView'; /** * @payload * @property {string} seriesName * @property {string} name */ echarts.registerAction(actionInfo, function (payload, ecModel) { var select...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "get Android() {}", "function SBRecordsetPHP_analyzePlatformSpecific()\r\n{\r\n\r\n\r\n}", "onChildAppStart () {\n\n }", "private internal function m248() {}", "private public function m246() {}", "onMessageStart() { }", "createStream () {\n\n }", "_playbackCompatibility() {\n // Detect audio pla...
[ "0.53485686", "0.48948148", "0.485071", "0.48078835", "0.4771538", "0.4744391", "0.47347194", "0.47043997", "0.46918696", "0.46918696", "0.46722504", "0.4643159", "0.46377665", "0.46263066", "0.4617044", "0.45812133", "0.45800942", "0.4572664", "0.4568672", "0.4561345", "0.45...
0.0
-1
Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE file distributed with this work for additional information regarding copyright ownership. The ASF licenses this file to you under the Apache License, Version 2.0 (the "License"); you may not use this file e...
function _default(seriesType) { return { getTargetSeries: function (ecModel) { // Pie and funnel may use diferrent scope var paletteScope = {}; var seiresModelMap = createHashMap(); ecModel.eachSeriesByType(seriesType, function (seriesModel) { seriesModel.__paletteScope = paletteSc...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function pickColor(d, data, colorIds) {\n var candidateId;\n for (var i=0; i<colorIds.length; i++) {\n candidateId = colorIds[i];\n if (isAvailableColor(d, data, candidateId)) {\n return candidateId;\n }\n }\n return -1; // no colors are available\n }", "function randomColorFro...
[ "0.643499", "0.642668", "0.63656324", "0.63511217", "0.6295097", "0.61797124", "0.6169629", "0.6081259", "0.60623425", "0.6044933", "0.6036062", "0.60214996", "0.602073", "0.60085523", "0.60078835", "0.5987677", "0.5984509", "0.5982623", "0.5945424", "0.5917955", "0.59073406"...
0.0
-1
Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE file distributed with this work for additional information regarding copyright ownership. The ASF licenses this file to you under the Apache License, Version 2.0 (the "License"); you may not use this file e...
function adjustSingleSide(list, cx, cy, r, dir, viewWidth, viewHeight) { list.sort(function (a, b) { return a.y - b.y; }); function shiftDown(start, end, delta, dir) { for (var j = start; j < end; j++) { list[j].y += delta; if (j > start && j + 1 < end && list[j + 1].y > list[j].y + list[j]....
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "get labelPosition() {\n return this.getLabelPosition();\n }", "get labelPosition() {\n return this._labelPosition;\n }", "svgLabelAlign(text, wrapBound, childNodes) {\n let bounds = new Size(wrapBound.width, childNodes.length * (text.fontSize * 1.2));\n let pos = { x: 0, y: 0 };\n ...
[ "0.6931916", "0.665873", "0.6405361", "0.62561005", "0.6243183", "0.6194407", "0.6140204", "0.6122073", "0.6120772", "0.60901755", "0.60614437", "0.58918643", "0.58845127", "0.5879064", "0.58707356", "0.58377695", "0.5821333", "0.5810859", "0.57923913", "0.5784863", "0.576521...
0.0
-1
Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE file distributed with this work for additional information regarding copyright ownership. The ASF licenses this file to you under the Apache License, Version 2.0 (the "License"); you may not use this file e...
function _default(seriesType) { return { seriesType: seriesType, reset: function (seriesModel, ecModel) { var legendModels = ecModel.findComponents({ mainType: 'legend' }); if (!legendModels || !legendModels.length) { return; } var data = seriesModel.getData(); ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "onChildAppStart () {\n\n }", "get Android() {}", "onMessageStart() { }", "_playbackCompatibility() {\n // Detect audio playback capabilities.\n\n // Detect HTML5 Audio playback.\n // http://caniuse.com/#feat=audio\n this.canUseAudio = Boolean(new Audio());\n console.log('Native HTML5 Audio pl...
[ "0.47174537", "0.4658246", "0.45285463", "0.45032862", "0.44835344", "0.44350168", "0.4382653", "0.43627265", "0.43324777", "0.4301593", "0.42541128", "0.42418656", "0.4221815", "0.42179117", "0.41816333", "0.41801563", "0.41795337", "0.417805", "0.4176735", "0.41745046", "0....
0.0
-1
Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE file distributed with this work for additional information regarding copyright ownership. The ASF licenses this file to you under the Apache License, Version 2.0 (the "License"); you may not use this file e...
function TooltipRichContent(api) { this._zr = api.getZr(); this._show = false; /** * @private */ this._hideTimeout; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "render() {\n return (\n <g className=\"chart-legend-group\"/>\n );\n }", "function Group(options) {\n // parent can be position(global level) or another group\n\n\n this.children = [];\n this.points = [];\n this.circles = [];\n\n this.state = {\n inAir: false\n };\n\n this.dPos = [0...
[ "0.580015", "0.5718398", "0.5697423", "0.5436387", "0.5426001", "0.5347102", "0.53044784", "0.5227024", "0.52139956", "0.5191827", "0.5161938", "0.5144934", "0.51263905", "0.5037152", "0.50369686", "0.5036872", "0.50325257", "0.50307554", "0.5011569", "0.49984258", "0.4982125...
0.0
-1
If a block is tsv format
function isTSVFormat(block) { // Simple method to find out if a block is tsv format var firstLine = block.slice(0, block.indexOf('\n')); if (firstLine.indexOf(ITEM_SPLITER) >= 0) { return true; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function isTSVFormat(block) {\n\t // Simple method to find out if a block is tsv format\n\t var firstLine = block.slice(0, block.indexOf('\\n'));\n\t\n\t if (firstLine.indexOf(ITEM_SPLITER) >= 0) {\n\t return true;\n\t }\n\t }", "function isTSVFormat(block){ // Simple method to find...
[ "0.8859122", "0.8845361", "0.88139796", "0.88139796", "0.87741005", "0.60407025", "0.5190595", "0.5138938", "0.50869346", "0.50047666", "0.4966861", "0.4956511", "0.49283457", "0.4926797", "0.49011958", "0.49008223", "0.48291752", "0.4825572", "0.48156893", "0.48068026", "0.4...
0.8741611
12
although it might be not accurate.
function getScales(xyMinMaxCurr, xyMinMaxOrigin) { var sizeCurr = getSize(xyMinMaxCurr); var sizeOrigin = getSize(xyMinMaxOrigin); var scales = [sizeCurr[0] / sizeOrigin[0], sizeCurr[1] / sizeOrigin[1]]; isNaN(scales[0]) && (scales[0] = 1); isNaN(scales[1]) && (scales[1] = 1); return scales; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private internal function m248() {}", "function returnsNonSmi(){ return 0.25; }", "get newLength() {\n let result = 0;\n for (let i = 0; i < this.sections.length; i += 2) {\n let ins = this.sections[i + 1];\n result += ins < 0 ? this.sections[i] : ins;\n }\n re...
[ "0.58490884", "0.5675055", "0.5659532", "0.56369245", "0.55556214", "0.5525809", "0.55252767", "0.5480208", "0.5458002", "0.54400927", "0.5436296", "0.5426854", "0.54142547", "0.5408865", "0.5396282", "0.5395298", "0.5387921", "0.53818756", "0.5363293", "0.5362013", "0.535283...
0.0
-1
Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE file distributed with this work for additional information regarding copyright ownership. The ASF licenses this file to you under the Apache License, Version 2.0 (the "License"); you may not use this file e...
function makeRectPanelClipPath(rect) { rect = normalizeRect(rect); return function (localPoints, transform) { return graphicUtil.clipPointsByRect(localPoints, rect); }; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "get Android() {}", "function SBRecordsetPHP_analyzePlatformSpecific()\r\n{\r\n\r\n\r\n}", "onChildAppStart () {\n\n }", "private internal function m248() {}", "private public function m246() {}", "onMessageStart() { }", "createStream () {\n\n }", "_playbackCompatibility() {\n // Detect audio pla...
[ "0.5349978", "0.48933455", "0.48501366", "0.48083982", "0.4772584", "0.474481", "0.47349635", "0.47027457", "0.46929818", "0.46929818", "0.4673667", "0.4644517", "0.46389893", "0.46253318", "0.4618249", "0.4582536", "0.45813942", "0.45742747", "0.45687214", "0.45623618", "0.4...
0.0
-1
Avoid that: mouse click on a elements that is over geo or graph, but roam is triggered.
function onIrrelevantElement(e, api, targetCoordSysModel) { var model = api.getComponentByElement(e.topTarget); // If model is axisModel, it works only if it is injected with coordinateSystem. var coordSys = model && model.coordinateSystem; return model && model !== targetCoordSysModel && !IRRELEVANT_EXCLUDES[mo...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function setGridToNonClickable(grid){\n grid.style.pointerEvents=\"none\";\n}", "function disableRightClick() {\n // stop zoom\n if (d3.event.button == 2) {\n console.log('No right click allowed');\n d3.event.stopImmediatePropagation();\n }\n }", "function block_user_interaction(paper) {...
[ "0.61968404", "0.6105043", "0.60895973", "0.59898186", "0.5986817", "0.5959793", "0.5935528", "0.5916358", "0.5888169", "0.58759063", "0.58450454", "0.5827085", "0.5826638", "0.5816487", "0.5810856", "0.57984626", "0.57984626", "0.5756743", "0.57469094", "0.5743923", "0.57345...
0.5562286
50
Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE file distributed with this work for additional information regarding copyright ownership. The ASF licenses this file to you under the Apache License, Version 2.0 (the "License"); you may not use this file e...
function Cartesian2D(name) { Cartesian.call(this, name); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "get Android() {}", "function SBRecordsetPHP_analyzePlatformSpecific()\r\n{\r\n\r\n\r\n}", "onChildAppStart () {\n\n }", "private internal function m248() {}", "private public function m246() {}", "onMessageStart() { }", "createStream () {\n\n }", "_playbackCompatibility() {\n // Detect audio pla...
[ "0.5349978", "0.48933455", "0.48501366", "0.48083982", "0.4772584", "0.474481", "0.47349635", "0.47027457", "0.46929818", "0.46929818", "0.4673667", "0.4644517", "0.46389893", "0.46253318", "0.4618249", "0.4582536", "0.45813942", "0.45742747", "0.45687214", "0.45623618", "0.4...
0.0
-1
Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE file distributed with this work for additional information regarding copyright ownership. The ASF licenses this file to you under the Apache License, Version 2.0 (the "License"); you may not use this file e...
function dimAxisMapper(dim) { return this._axes[dim]; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "get Center() { return [this.x1 + (0.5 * this.x2 - this.x1), this.y1 + (0.5 * this.y2 - this.y1)]; }", "get Center() { return [this.x1 + (0.5 * this.x2 - this.x1), this.y1 + (0.5 * this.y2 - this.y1)]; }", "center() {\n let x_center = 0, y_center = 0;\n const coords = this.getCoords();\n for (let...
[ "0.589108", "0.589108", "0.57303226", "0.5684142", "0.56726396", "0.561011", "0.5600579", "0.5583609", "0.55618536", "0.55525583", "0.5520512", "0.5502633", "0.54673386", "0.54541224", "0.54532754", "0.5447362", "0.5438439", "0.5435534", "0.54311943", "0.54281527", "0.5427857...
0.0
-1
Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE file distributed with this work for additional information regarding copyright ownership. The ASF licenses this file to you under the Apache License, Version 2.0 (the "License"); you may not use this file e...
function setLabel(normalStyle, hoverStyle, itemModel, color, seriesModel, dataIndex, labelPositionOutside) { var labelModel = itemModel.getModel('label'); var hoverLabelModel = itemModel.getModel('emphasis.label'); graphic.setLabelStyle(normalStyle, hoverStyle, labelModel, hoverLabelModel, { labelFetcher: ser...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "get Android() {}", "function SBRecordsetPHP_analyzePlatformSpecific()\r\n{\r\n\r\n\r\n}", "onChildAppStart () {\n\n }", "private internal function m248() {}", "private public function m246() {}", "onMessageStart() { }", "createStream () {\n\n }", "_playbackCompatibility() {\n // Detect audio pla...
[ "0.5349978", "0.48933455", "0.48501366", "0.48083982", "0.4772584", "0.474481", "0.47349635", "0.47027457", "0.46929818", "0.46929818", "0.4673667", "0.4644517", "0.46389893", "0.46253318", "0.4618249", "0.4582536", "0.45813942", "0.45742747", "0.45687214", "0.45623618", "0.4...
0.0
-1
Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE file distributed with this work for additional information regarding copyright ownership. The ASF licenses this file to you under the Apache License, Version 2.0 (the "License"); you may not use this file e...
function isPointsSame(points1, points2) { if (points1.length !== points2.length) { return; } for (var i = 0; i < points1.length; i++) { var p1 = points1[i]; var p2 = points2[i]; if (p1[0] !== p2[0] || p1[1] !== p2[1]) { return; } } return true; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "_radialCoordinates(angles, radius){\n\n return angles.map((angle) => {\n return Coordinate.polar({\n coords: [radius, angle - 90],\n isDegree: true\n });\n })\n\n }", "static polar (len, angle) {\n return new Point (Math.cos(angle)*len, Math.sin(angle)*len);\n }", "function ...
[ "0.5401542", "0.5277288", "0.52670497", "0.5204954", "0.5201989", "0.51756907", "0.5160999", "0.5063061", "0.5048604", "0.50392836", "0.5035456", "0.49938932", "0.49804178", "0.4977963", "0.49748492", "0.49673912", "0.49535117", "0.4950302", "0.49470907", "0.4945801", "0.4926...
0.0
-1
Draw smoothed line in nonmonotone, in may cause undesired curve in extreme situations. This should be used when points are nonmonotone neither in x or y dimension.
function drawNonMono(ctx, points, start, segLen, allLen, dir, smoothMin, smoothMax, smooth, smoothMonotone, connectNulls) { var prevIdx = 0; var idx = start; for (var k = 0; k < segLen; k++) { var p = points[idx]; if (idx >= allLen || idx < 0) { break; } if (isPointNull(p)) { if (co...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function drawSeriesLines(series){\n\t\t\tfunction plotLine(data, offset){\n\t\t\t\tif(data.length < 2) return;\n\t\n\t\t\t\tvar prevx = tHoz(data[0][0]),\n\t\t\t\t\tprevy = tVert(data[0][1]) + offset;\n\t\n\t\t\t\tctx.beginPath();\n\t\t\t\tctx.moveTo(prevx, prevy);\n\t\t\t\tfor(var i = 0; i < data.length - 1; ++i)...
[ "0.6029256", "0.6015774", "0.59806824", "0.5928093", "0.5922997", "0.5870417", "0.5858161", "0.5855403", "0.5854368", "0.5852314", "0.5850531", "0.5846535", "0.58302444", "0.58302444", "0.58302444", "0.58270085", "0.58270085", "0.58270085", "0.58270085", "0.58270085", "0.5827...
0.6422131
5
Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE file distributed with this work for additional information regarding copyright ownership. The ASF licenses this file to you under the Apache License, Version 2.0 (the "License"); you may not use this file e...
function _default(seriesType, defaultSymbolType, legendSymbol) { // Encoding visual for all series include which is filtered for legend drawing return { seriesType: seriesType, // For legend. performRawSeries: true, reset: function (seriesModel, ecModel, api) { var data = seriesModel.getData()...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "onChildAppStart () {\n\n }", "get Android() {}", "onMessageStart() { }", "_playbackCompatibility() {\n // Detect audio playback capabilities.\n\n // Detect HTML5 Audio playback.\n // http://caniuse.com/#feat=audio\n this.canUseAudio = Boolean(new Audio());\n console.log('Native HTML5 Audio pl...
[ "0.47163445", "0.46584114", "0.45273763", "0.45036152", "0.448429", "0.44346538", "0.43841133", "0.4362977", "0.4333602", "0.43013042", "0.42535996", "0.42417178", "0.42218232", "0.42189214", "0.41818306", "0.41804415", "0.4179575", "0.41772082", "0.41758674", "0.41746357", "...
0.0
-1
Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE file distributed with this work for additional information regarding copyright ownership. The ASF licenses this file to you under the Apache License, Version 2.0 (the "License"); you may not use this file e...
function _default(seriesType) { return { seriesType: seriesType, plan: createRenderPlanner(), reset: function (seriesModel) { var data = seriesModel.getData(); var coordSys = seriesModel.coordinateSystem; var pipelineContext = seriesModel.pipelineContext; var isLargeRender = pipeli...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function n$1(){return new Float32Array(4)}", "function r(){const r=new Float32Array(4);return r[3]=1,r}", "constructor()\n {\n this.m = new Float32Array(16);\n\n this.m[0] = this.m[5] = this.m[10] = this.m[15] = 1;\n }", "setFloat32Buffers() {\n let tempArr = []\n for(let i = 0; i <...
[ "0.7301188", "0.7209965", "0.69897056", "0.6968867", "0.6805486", "0.6755758", "0.6741204", "0.6690487", "0.66401666", "0.6595015", "0.6564376", "0.65474814", "0.653853", "0.6511759", "0.64967626", "0.64861786", "0.64791584", "0.64246136", "0.64054227", "0.63486075", "0.63478...
0.0
-1
v8 likes predictible objects
function Item(fun, array) { this.fun = fun; this.array = array; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function compareLike(a,b){\n var al = a.idLikesProp.length;\n var bl = b.idLikesProp.length;\n if(al > bl) return -1;\n if(bl > al) return 1;\n return 0;\n}", "function lookAround() {\n var objectDescription = \"\"\n tj.see().then(function(objects) {\n objects.forEach(function(each) {\n ...
[ "0.527866", "0.52612406", "0.51951283", "0.518796", "0.51302594", "0.5044646", "0.48934332", "0.4857401", "0.484017", "0.48302925", "0.482028", "0.4812441", "0.4808473", "0.47852293", "0.47828078", "0.47574478", "0.47493434", "0.4739314", "0.47239366", "0.4703992", "0.4703992...
0.0
-1
Copyright (c) 2013present, Facebook, Inc. All rights reserved. This source code is licensed under the BSDstyle license found in the LICENSE file in the root directory of this source tree. An additional grant of patent rights can be found in the PATENTS file in the same directory.
function makeEmptyFunction(arg) { return function () { return arg; }; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "componentDidMount() {\n // if this is the first time the home screen is loading\n // we must initialize Facebook\n if (!window.FB) {\n window.fbAsyncInit = function() {\n window.FB.init({\n appId : '280945375708713',\n cookie : true, // enable cookies to allow the s...
[ "0.5606324", "0.54053015", "0.5362759", "0.53557986", "0.5333446", "0.52908176", "0.52908176", "0.5233073", "0.51926816", "0.5186246", "0.5185339", "0.5152006", "0.51346844", "0.5113237", "0.50953215", "0.5080205", "0.50634295", "0.5059636", "0.5039364", "0.5006647", "0.49587...
0.0
-1
inlined Object.is polyfill to avoid requiring consumers ship their own /eslintdisable noselfcompare
function is(x, y) { // SameValue algorithm if (x === y) { // Steps 1-5, 7-10 // Steps 6.b-6.e: +0 != -0 return x !== 0 || 1 / x === 1 / y; } else { // Step 6.a: NaN == NaN return x !== x && y !== y; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function isObject$1(obj) {\n // incase of arrow function and array\n return Object(obj) === obj && String(obj) === '[object Object]' && !isFunction(obj) && !isArray(obj);\n }", "function isObject$1(obj) {\n ...
[ "0.673139", "0.6633761", "0.6610435", "0.65997535", "0.65996826", "0.6565089", "0.6506278", "0.6468222", "0.6462761", "0.64114064", "0.63700455", "0.6365079", "0.6365079", "0.6365079", "0.6365079", "0.6356776", "0.63271695", "0.6322019", "0.63218695", "0.62953717", "0.6295371...
0.0
-1
Equivalent of `typeof` but with special handling for array and regexp.
function getPropType(propValue) { var propType = typeof propValue; if (Array.isArray(propValue)) { return 'array'; } if (propValue instanceof RegExp) { // Old webkits (at least until Android 4.0) return 'function' rather than // 'object' for typeof a RegExp. We'll normalize this here s...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function sc_typeof( x ) {\n return typeof x;\n}", "static type(arg)\n {\n const types = [\n 'array', 'boolean', 'function', 'number',\n 'null', 'object', 'regexp', 'symbol', 'string',\n 'undefined'\n ]\n\n var type = Object.prototype.toString.call(arg),\...
[ "0.69097364", "0.6775297", "0.6607535", "0.65383923", "0.64938533", "0.64889115", "0.64889115", "0.64495087", "0.64495087", "0.6429092", "0.6428121", "0.6404058", "0.6404058", "0.6395446", "0.6395446", "0.6395446", "0.6395446", "0.6395446", "0.6395446", "0.6395446", "0.639544...
0.0
-1
This handles more types than `getPropType`. Only used for error messages. See `createPrimitiveTypeChecker`.
function getPreciseType(propValue) { if (typeof propValue === 'undefined' || propValue === null) { return '' + propValue; } var propType = getPropType(propValue); if (propType === 'object') { if (propValue instanceof Date) { return 'date'; } else if (propValue instanceof RegExp...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function getPropType(propValue) {\n\t\t var propType = typeof propValue;\n\t\t if (Array.isArray(propValue)) {\n\t\t return 'array';\n\t\t }\n\t\t if (propValue instanceof RegExp) {\n\t\t // Old webkits (at least until Android 4.0) return 'function' rather than\n\t\t // 'object' for type...
[ "0.68773127", "0.6853938", "0.6853938", "0.6853938", "0.6853938", "0.6852637", "0.6847169", "0.6847169", "0.6847169", "0.6847169", "0.6847169", "0.6847169", "0.6847169", "0.6847169", "0.6847169", "0.6847169", "0.6847169", "0.6847169", "0.6847169", "0.6847169", "0.6847169", ...
0.0
-1
Returns a string that is postfixed to a warning about an invalid type. For example, "undefined" or "of type array"
function getPostfixForTypeWarning(value) { var type = getPreciseType(value); switch (type) { case 'array': case 'object': return 'an ' + type; case 'boolean': case 'date': case 'regexp': return 'a ' + type; default: return type; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function _undefinedCoerce() {\n return '';\n}", "function getPostfixForTypeWarning(value) {\n var type = getPreciseType(value);\n switch (type) {\n case \"array\":\n case \"object\":\n return \"an \" + type;\n case \"boolean\":\n ...
[ "0.6599196", "0.6566137", "0.6560382", "0.6560382", "0.6560382", "0.6560382", "0.6523208", "0.6522379", "0.6506975", "0.6506975", "0.6506975", "0.6506975", "0.6506975", "0.65022165", "0.64905936", "0.6478573", "0.6478573", "0.6478573", "0.6478573", "0.6478573", "0.6478573", ...
0.0
-1
Returns class name of the object, if any.
function getClassName(propValue) { if (!propValue.constructor || !propValue.constructor.name) { return ANONYMOUS; } return propValue.constructor.name; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function getClassName(obj) {\n var funcNameRegex = /function\\s+(.+?)\\s*\\(/;\n var results = funcNameRegex.exec(obj['constructor'].toString());\n return (results && results.length > 1) ? results[1] : '';\n }", "getClassName() {\n return this.constructor\n .className;\n...
[ "0.7730571", "0.74697196", "0.74697196", "0.74258965", "0.7164231", "0.71448183", "0.7083163", "0.7080694", "0.6995368", "0.6971116", "0.6901662", "0.6883398", "0.67147285", "0.66557264", "0.6639163", "0.6611592", "0.6611592", "0.6611592", "0.6611592", "0.6600893", "0.6599787...
0.0
-1
Function to create the first processor.
function unified() { var attachers = [] var transformers = trough() var namespace = {} var frozen = false var freezeIndex = -1 /* Data management. */ processor.data = data /* Lock. */ processor.freeze = freeze /* Plug-ins. */ processor.attachers = attachers processor.use = use /* API. */ ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function DeviceProcessor() {\n\tvar builder = new processor.Chain();\n\tbuilder.Add(save_flags);\n\tbuilder.Add(strip_syslog_priority);\n\tbuilder.Add(chain1);\n\tbuilder.Add(populate_fields);\n\tbuilder.Add(restore_flags);\n\tvar chain = builder.Build();\n\treturn {\n\t\tprocess: chain.Run,\n\t}\n}", "function ...
[ "0.5809372", "0.5809372", "0.5809372", "0.5585237", "0.5585237", "0.5574443", "0.54788613", "0.540701", "0.5396681", "0.5302397", "0.5262711", "0.51745176", "0.51745176", "0.51745176", "0.51702476", "0.50886375", "0.50736797", "0.50652015", "0.5063161", "0.50562364", "0.50530...
0.5477166
11
Create a new processor based on the processor in the current scope.
function processor() { var destination = unified() var length = attachers.length var index = -1 while (++index < length) { destination.use.apply(null, attachers[index]) } destination.data(extend(true, {}, namespace)) return destination }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function unified() {\n var attachers = []\n var transformers = trough()\n var namespace = {}\n var freezeIndex = -1\n var frozen\n\n // Data management.\n processor.data = data\n\n // Lock.\n processor.freeze = freeze\n\n // Plugins.\n processor.attachers = attachers\n processor.use = use\n\n // API.\...
[ "0.6117301", "0.6117301", "0.60486126", "0.5904408", "0.5904408", "0.5904408", "0.5904408", "0.5904408", "0.58828163", "0.5800185", "0.5721235", "0.56447303", "0.5328679", "0.52514666", "0.52514666", "0.52514666", "0.5194525", "0.51114035", "0.51101834", "0.51099145", "0.5081...
0.48947236
31
Data management. Getter / setter for processorspecific informtion.
function data(key, value) { if (string(key)) { /* Set `key`. */ if (arguments.length === 2) { assertUnfrozen('data', frozen) namespace[key] = value return processor } /* Get `key`. */ return (own.call(namespace, key) && namespace[key]) || null } /* S...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "get data() {\n\t\treturn this.__data;\n\t}", "function processedSFData() {\n\t\tthis.moteid = idMote;\n\t\tthis.sensorType = sensorType;\n\t\tthis.lastTimestamp = lastTimeStamp;\n\t\tthis.lastValue = lastValue;\n\t\tthis.arrayValuesDay = valuesDay;\n\t\tthis.populationDay = populationDay;\n\t\tthis.arrayValuesWe...
[ "0.68809307", "0.68432516", "0.6731611", "0.6641427", "0.6595986", "0.6528188", "0.6495358", "0.64899683", "0.64805365", "0.64805365", "0.64805365", "0.6422238", "0.6342294", "0.63204193", "0.6317152", "0.6309514", "0.62412494", "0.62303525", "0.6220492", "0.62105477", "0.619...
0.0
-1
Plugin management. Pass it: an attacher and options, a preset, a list of presets, attachers, and arguments (list of attachers and options).
function use(value) { var settings assertUnfrozen('use', frozen) if (value === null || value === undefined) { /* Empty */ } else if (typeof value === 'function') { addPlugin.apply(null, arguments) } else if (typeof value === 'object') { if ('length' in value) { addList(va...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function registerPresets(newPresets) {\n Object.keys(newPresets).forEach(function (name) {\n return registerPreset(name, newPresets[name]);\n });\n } // All the plugins we should bundle", "function handlePlugins$1(inputs, calendar) {\n calendar.addPluginInputs(inputs); // will ...
[ "0.55730325", "0.55157", "0.54918987", "0.547899", "0.547899", "0.547899", "0.544979", "0.5436934", "0.5427202", "0.5412018", "0.5412018", "0.5381513", "0.53796583", "0.5375553", "0.5360351", "0.5357939", "0.5339359", "0.5329402", "0.53237975", "0.52955747", "0.5291243", "0...
0.52915937
24
Parse a file (in string or VFile representation) into a Unist node using the `Parser` on the processor.
function parse(doc) { var file = vfile(doc) var Parser freeze() Parser = processor.Parser assertParser('parse', Parser) if (newable(Parser)) { return new Parser(String(file), file).parse() } return Parser(String(file), file) // eslint-disable-line new-cap }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function Parser(doc, file) {\n this.file = file;\n this.offset = {};\n this.options = xtend(this.options);\n this.setOptions({});\n\n this.inList = false;\n this.inBlock = false;\n this.inLink = false;\n this.atStart = true;\n\n this.toOffset = vfileLocation(file).toOffset;\n this.unescape = unescape(thi...
[ "0.6036263", "0.59983784", "0.59361374", "0.5816456", "0.5761662", "0.5761662", "0.5761662", "0.56939125", "0.5656537", "0.5630632", "0.5630632", "0.5630632", "0.5630632", "0.5630632", "0.5630632", "0.56050044", "0.55566186", "0.53403527", "0.52543056", "0.5195248", "0.510845...
0.5760103
11
Run transforms on a Unist node representation of a file (in string or VFile representation), async.
function run(node, file, cb) { assertNode(node) freeze() if (!cb && typeof file === 'function') { cb = file file = null } if (!cb) { return new Promise(executor) } executor(null, cb) function executor(resolve, reject) { transformers.run(node, vfile(file), done...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function run(node, file, cb) {\n assertNode(node)\n freeze()\n\n if (!cb && typeof file === 'function') {\n cb = file\n file = null\n }\n\n if (!cb) {\n return new Promise(executor)\n }\n\n executor(null, cb)\n\n function executor(resolve, reject) {\n transformers.run(no...
[ "0.65098184", "0.65098184", "0.64999324", "0.62945503", "0.57289356", "0.5724962", "0.5722019", "0.56828", "0.549961", "0.549961", "0.5451992", "0.54037726", "0.53396654", "0.5319687", "0.52944106", "0.5294002", "0.52616453", "0.5174298", "0.5174298", "0.5174298", "0.5174298"...
0.648857
8
Run transforms on a Unist node representation of a file (in string or VFile representation), sync.
function runSync(node, file) { var complete = false var result run(node, file, done) assertDone('runSync', 'run', complete) return result function done(err, tree) { complete = true bail(err) result = tree } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function run(node, file, cb) {\n assertNode(node)\n freeze()\n\n if (!cb && typeof file === 'function') {\n cb = file\n file = null\n }\n\n if (!cb) {\n return new Promise(executor)\n }\n\n executor(null, cb)\n\n function executor(resolve, reject) {\n transformers.run(no...
[ "0.6458939", "0.6458939", "0.6441855", "0.6441855", "0.6441855", "0.6441855", "0.6441855", "0.6441855", "0.64324313", "0.6189576", "0.6004485", "0.6004485", "0.5857711", "0.5753894", "0.5723392", "0.56320477", "0.5556542", "0.5508055", "0.5497592", "0.5380607", "0.5358036", ...
0.5192558
29
Stringify a Unist node representation of a file (in string or VFile representation) into a string using the `Compiler` on the processor.
function stringify(node, doc) { var file = vfile(doc) var Compiler freeze() Compiler = processor.Compiler assertCompiler('stringify', Compiler) assertNode(node) if (newable(Compiler)) { return new Compiler(node, file).compile() } return Compiler(node, file) // eslint-disable...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function stringify(node, doc) {\n var file = vfile(doc)\n var Compiler\n\n freeze()\n Compiler = processor.Compiler\n assertCompiler('stringify', Compiler)\n assertNode(node)\n\n if (newable(Compiler, 'compile')) {\n return new Compiler(node, file).compile()\n }\n\n return Compiler(...
[ "0.5808315", "0.5808315", "0.5808315", "0.58024615", "0.57930595", "0.57202554", "0.55628264", "0.51197964", "0.4944126", "0.4939946", "0.49377835", "0.48916206", "0.48902163", "0.47794235", "0.4768549", "0.4749499", "0.47492388", "0.4656568", "0.46530744", "0.4642199", "0.46...
0.5798683
8
Parse a file (in string or VFile representation) into a Unist node using the `Parser` on the processor, then run transforms on that node, and compile the resulting node using the `Compiler` on the processor, and store that result on the VFile.
function process(doc, cb) { freeze() assertParser('process', processor.Parser) assertCompiler('process', processor.Compiler) if (!cb) { return new Promise(executor) } executor(null, cb) function executor(resolve, reject) { var file = vfile(doc) pipeline.run(processor, {...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function run(node, file, cb) {\n assertNode(node)\n freeze()\n\n if (!cb && typeof file === 'function') {\n cb = file\n file = null\n }\n\n if (!cb) {\n return new Promise(executor)\n }\n\n executor(null, cb)\n\n function executor(resolve, reject) {\n transformers.run(no...
[ "0.57834154", "0.57834154", "0.5767879", "0.5767879", "0.5767879", "0.5767879", "0.5767879", "0.5767879", "0.57348526", "0.5524738", "0.5524738", "0.55165803", "0.55116695", "0.54946184", "0.54631734", "0.54183316", "0.5407739", "0.5353386", "0.53467375", "0.5325736", "0.5325...
0.5542097
13
Process the given document (in string or VFile representation), sync.
function processSync(doc) { var complete = false var file freeze() assertParser('processSync', processor.Parser) assertCompiler('processSync', processor.Compiler) file = vfile(doc) process(file, done) assertDone('processSync', 'process', complete) return file function done(e...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function processSync(doc) {\n var file;\n var complete;\n\n freeze();\n assertParser('processSync', processor.Parser);\n assertCompiler('processSync', processor.Compiler);\n file = vfile(doc);\n\n process(file, done);\n\n assertDone('processSync', 'process', complete);\n\n return file\n\...
[ "0.7181027", "0.71268046", "0.70949113", "0.70949113", "0.65690374", "0.6545865", "0.65238076", "0.65238076", "0.65238076", "0.65238076", "0.65238076", "0.65238076", "0.6499528", "0.6499528", "0.58608776", "0.53824717", "0.537839", "0.5259523", "0.5124504", "0.5109611", "0.50...
0.70455825
9
Check if `func` is a constructor.
function newable(value) { return typeof value === 'function' && keys(value.prototype) }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function isConstructor(name, func) {\n return name[0] == name[0].toUpperCase();\n }", "function isCtor(constr) {\n return constr && !!constr.CONSTRUCTOR___;\n }", "function IsConstructor(o) {\n // Hacks for Safari 7 TypedArray XXXConstructor objects\n if (/Constructor/.test(Object.protot...
[ "0.78565264", "0.77827024", "0.7296092", "0.72123635", "0.7098049", "0.708506", "0.7060057", "0.7031812", "0.70308506", "0.6960493", "0.69367325", "0.6911832", "0.67534906", "0.6687986", "0.6606467", "0.6507036", "0.64318717", "0.6380909", "0.63796014", "0.625006", "0.6194024...
0.0
-1
Check if `value` is an object with keys.
function keys(value) { var key for (key in value) { return true } return false }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function isObject(value) {\n var type = typeof value;\n return !!value && (type == 'object');\n }", "function isKey(value, object) {\n if (Array.isArray(value)) {\n return false;\n }\n const type = typeof value;\n if (\n type === \"number\" ||\n type === \"boolean\" ||\n value ==...
[ "0.71962214", "0.7146194", "0.71439165", "0.71217006", "0.7090814", "0.70249754", "0.7002017", "0.69980055", "0.6948843", "0.6938903", "0.6933717", "0.6933717", "0.6933717", "0.6933717", "0.6933717", "0.6933717", "0.6933717", "0.6933717", "0.6933717", "0.6933717", "0.6933717"...
0.6882035
28
Assert a parser is available.
function assertParser(name, Parser) { if (typeof Parser !== 'function') { throw new Error('Cannot `' + name + '` without `Parser`') } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function assertParser(name, Parser) {\n if (!func(Parser)) {\n throw new Error('Cannot `' + name + '` without `Parser`');\n }\n}", "async ensureParser() {\n if (!this.parser) {\n this.parser = await ASTParser.importASTParser();\n }\n }", "function _checkParser() {\n eval(Proce...
[ "0.7156789", "0.6624209", "0.6299487", "0.5044321", "0.48598248", "0.48455465", "0.48403692", "0.48403692", "0.4722353", "0.47192177", "0.47176996", "0.47054106", "0.47054106", "0.47054106", "0.47054106", "0.47034496", "0.47034496", "0.47034496", "0.47034496", "0.4699272", "0...
0.7231419
7
Assert a compiler is available.
function assertCompiler(name, Compiler) { if (typeof Compiler !== 'function') { throw new Error('Cannot `' + name + '` without `Compiler`') } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function assertCompiler(name, Compiler) {\n if (!func(Compiler)) {\n throw new Error('Cannot `' + name + '` without `Compiler`');\n }\n}", "function startMyCompiler() {\n throw new Error('You have no compiler!');\n}", "function _isSupported() {\n _state = 1;\n if (typeof chai !== \"undefi...
[ "0.7280039", "0.6609343", "0.5701623", "0.55071414", "0.5359753", "0.5310645", "0.5287135", "0.5255695", "0.5185235", "0.51780653", "0.51780653", "0.510953", "0.50870246", "0.5071456", "0.5061714", "0.50458944", "0.50141674", "0.49524596", "0.49390462", "0.4907709", "0.490542...
0.7297869
7
Assert the processor is not frozen.
function assertUnfrozen(name, frozen) { if (frozen) { throw new Error( [ 'Cannot invoke `' + name + '` on a frozen processor.\nCreate a new ', 'processor first, by invoking it: use `processor()` instead of ', '`processor`.' ].join('') ) } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function assertUnfrozen(name, frozen) {\n if (frozen) {\n throw new Error(\n 'Cannot invoke `' + name + '` on a frozen processor.\\n' +\n 'Create a new processor first, by invoking it: ' +\n 'use `processor()` instead of `processor`.'\n );\n }\n}", "function assertUnfrozen(name, frozen) {\...
[ "0.76341915", "0.7626436", "0.7626436", "0.7626436", "0.7626436", "0.62275994", "0.6100189", "0.59010684", "0.5881789", "0.57037205", "0.57037205", "0.57037205", "0.57037205", "0.57037205", "0.57037205", "0.5658851", "0.5658851", "0.5658851", "0.5658851", "0.5658851", "0.5650...
0.752398
9
Assert `node` is a Unist node.
function assertNode(node) { if (!node || !string(node.type)) { throw new Error('Expected node, got `' + node + '`') } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function assertNode(node) {\n if (!node || !string(node.type)) {\n throw new Error('Expected node, got `' + node + '`');\n }\n}", "function assertNode(node) {\n if (!node || typeof node.type !== 'string') {\n throw new Error('Expected node, got `' + node + '`')\n }\n}", "function assertNode(node) {\n...
[ "0.62222254", "0.613726", "0.613726", "0.613726", "0.613726", "0.5832463", "0.5832463", "0.5619087", "0.5619087", "0.55799454", "0.55799454", "0.55799454", "0.52485055", "0.52275956", "0.5198362", "0.50964975", "0.50964975", "0.50964975", "0.50964975", "0.5045456", "0.5045456...
0.62290317
4
Assert that `complete` is `true`.
function assertDone(name, asyncName, complete) { if (!complete) { throw new Error( '`' + name + '` finished async. Use `' + asyncName + '` instead' ) } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function assertDone(name, asyncName, complete) {\n if (!complete) {\n throw new Error('`' + name + '` finished async. Use `' + asyncName + '` instead');\n }\n}", "isComplete() {\n return (this.title === this.titleComplete) &&\n (this.labo === this.laboComplete) &&\n (this.univ =...
[ "0.6449665", "0.6286795", "0.6109294", "0.60894686", "0.6087285", "0.6086767", "0.6079512", "0.6040161", "0.60169524", "0.59774095", "0.5938076", "0.5891999", "0.5833795", "0.5753793", "0.571018", "0.5595507", "0.55888605", "0.5581676", "0.5558898", "0.5555131", "0.55459714",...
0.64526296
7
Create a message with `reason` at `position`. When an error is passed in as `reason`, copies the stack.
function message(reason, position, origin) { var filePath = this.path; var message = new VMessage(reason, position, origin); if (filePath) { message.name = filePath + ':' + message.name; message.file = filePath; } message.fatal = false; this.messages.push(message); return message; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function message(reason, position, ruleId) {\n var filePath = this.path;\n var range = stringify(position) || '1:1';\n var location;\n var err;\n\n location = {\n start: {line: null, column: null},\n end: {line: null, column: null}\n };\n\n if (position && position.position) {\n position = position...
[ "0.6382411", "0.58289903", "0.5818149", "0.5818149", "0.5818149", "0.5815182", "0.57655555", "0.56853163", "0.568013", "0.5445974", "0.5391876", "0.52233994", "0.52169865", "0.50570893", "0.5056932", "0.5056932", "0.5033515", "0.50259006", "0.50055903", "0.48889014", "0.48580...
0.56972057
11
Fail. Creates a vmessage, associates it with the file, and throws it.
function fail() { var message = this.message.apply(this, arguments); message.fatal = true; throw message; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function fail(message) {\n throw new Error(message);\n }", "function fail(message) {\r\n\t throw new Error(message);\r\n\t}", "createFailureAtNode(node, message) {\n const sourceFile = node.getSourceFile();\n this.failures.push({\n filePath: this.fileSyst...
[ "0.6267297", "0.6253337", "0.6133076", "0.6082893", "0.59879756", "0.59879756", "0.5881531", "0.5881531", "0.5881531", "0.5881531", "0.5851264", "0.5730261", "0.571033", "0.55709696", "0.5532442", "0.5510065", "0.5510065", "0.5510065", "0.5510065", "0.5510065", "0.5498461", ...
0.5795629
15
Info. Creates a vmessage, associates it with the file, and marks the fatality as null.
function info() { var message = this.message.apply(this, arguments); message.fatal = null; return message; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function info() {\n var message = this.message.apply(this, arguments)\n\n message.fatal = null\n\n return message\n}", "function info() {\n var message = this.message.apply(this, arguments)\n\n message.fatal = null\n\n return message\n}", "function info() {\n var message = this.message.apply(this, argum...
[ "0.6556722", "0.6556722", "0.6556722", "0.6556722", "0.6526714", "0.62738734", "0.61954087", "0.61925805", "0.61925805", "0.61925805", "0.61925805", "0.61925805", "0.6155595", "0.6155595", "0.6155595", "0.61103654", "0.5857036", "0.5676465", "0.55974704", "0.54965174", "0.546...
0.64661753
9
Construct a new file.
function VFile(options) { var prop; var index; var length; if (!options) { options = {}; } else if (typeof options === 'string' || buffer(options)) { options = {contents: options}; } else if ('message' in options && 'messages' in options) { return options; } if (!(this instanceof VFile)) {...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function createFile() {\n var e = new emitter();\n\n fs.readFile('newdocument.txt', function (err) {\n if (err) throw err;\n e.emit('theProcess');\n });\n\n return e;\n}", "function createNewFile() {\n file = {\n name: 'novo-arquivo.txt',\n content: '',\n saved: ...
[ "0.6731722", "0.6548481", "0.6368479", "0.6176685", "0.6128395", "0.6071327", "0.6071191", "0.60540265", "0.6018432", "0.60004294", "0.59618294", "0.5958048", "0.59438944", "0.58876985", "0.58862257", "0.58563334", "0.5832691", "0.5804447", "0.5785801", "0.5777083", "0.575371...
0.0
-1
Get the value of the file.
function toString(encoding) { var value = this.contents || ''; return buffer(value) ? value.toString(encoding) : String(value); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function getFile(){\n\n\t\treturn this.file;\n\t}", "Get(filename)\n {\n return \"\";\n }", "getText() {\r\n return this.clone(File, \"$value\", false).get(new TextParser(), { headers: { \"binaryStringResponseBody\": \"true\" } });\r\n }", "get file () {\n return this._file\n }", "functi...
[ "0.711178", "0.68999565", "0.6691765", "0.66412055", "0.6439003", "0.64349145", "0.6405714", "0.637939", "0.6368529", "0.6368529", "0.6324943", "0.6303016", "0.6242697", "0.60756075", "0.59203756", "0.58928937", "0.58921486", "0.5867203", "0.5867203", "0.5792994", "0.5783152"...
0.0
-1
Assert that `part` is not a path (i.e., does not contain `path.sep`).
function assertPart(part, name) { if (part.indexOf(path.sep) !== -1) { throw new Error('`' + name + '` cannot be a path: did not expect `' + path.sep + '`'); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function assertPart(part, name) {\n if (part.indexOf(path.sep) !== -1) {\n throw new Error(\n '`' + name + '` cannot be a path: did not expect `' + path.sep + '`'\n )\n }\n}", "function assertPart(part, name) {\n if (part.indexOf(path.sep) !== -1) {\n throw new Error(\n '`' + name + '` cann...
[ "0.8634604", "0.8608681", "0.85808456", "0.85808456", "0.85808456", "0.83588463", "0.6666319", "0.6666319", "0.6666319", "0.6666319", "0.66645527", "0.66645527", "0.66645527", "0.66645527", "0.66645527", "0.66645527", "0.66645527", "0.66143674", "0.5684836", "0.5683896", "0.5...
0.86381245
5
Assert that `part` is not empty.
function assertNonEmpty(part, name) { if (!part) { throw new Error('`' + name + '` cannot be empty'); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function assertNonEmpty(part, name) {\n if (!part) {\n throw new Error('`' + name + '` cannot be empty')\n }\n}", "function assertNonEmpty(part, name) {\n if (!part) {\n throw new Error('`' + name + '` cannot be empty')\n }\n}", "function assertNonEmpty(part, name) {\n if (!part) {\n throw new Er...
[ "0.8208551", "0.8208551", "0.8208551", "0.8208551", "0.8099163", "0.6485353", "0.6485353", "0.6485353", "0.6485353", "0.6485353", "0.6485353", "0.6470561", "0.64697224", "0.64425254", "0.64349556", "0.64349556", "0.64349556", "0.6220875", "0.60911965", "0.57816833", "0.577190...
0.8207471
10
For Node v0.10 support. Remove this eventually.
function isSlowBuffer (obj) { return typeof obj.readFloatLE === 'function' && typeof obj.slice === 'function' && isBuffer(obj.slice(0, 0)) }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function _node_p(){\n\tvar ret = false;\n\tif( anchor.environment() == 'Node.js' ){ ret = true; }\n\treturn ret;\n }", "function node_error(err) {\r\n node.error(err, err);\r\n }", "private public function m246() {}", "function NodeFsHandler() {}", "function NodeFsHandler() {}", "static reset(...
[ "0.58632374", "0.5703871", "0.56875104", "0.55532336", "0.55532336", "0.5445521", "0.54364026", "0.53833115", "0.5353622", "0.53282815", "0.5315332", "0.5206867", "0.5199046", "0.5156871", "0.51495963", "0.512485", "0.512485", "0.512485", "0.5111965", "0.50998896", "0.509248"...
0.0
-1
Run `fns`. Last argument must be a completion handler.
function run() { var index = -1 var input = slice.call(arguments, 0, -1) var done = arguments[arguments.length - 1] if (typeof done !== 'function') { throw new Error('Expected function as last argument, not ' + done) } next.apply(null, [null].concat(input)) // Run the next `fn`, if ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function runAll(whenFn, fns, resolveIdx) {\n //var deferred = when.defer();\n return whenFn(fns)\n .then(\n function(results) {\n return results[resolveIdx];\n },\n function(err) {\n return when.reject(err);\n }\n );\n}", "function run() {\n var index = -1;\n var inp...
[ "0.68478644", "0.66488874", "0.65281355", "0.65281355", "0.6376086", "0.617489", "0.59881306", "0.5942612", "0.5926571", "0.58897847", "0.5781694", "0.57793677", "0.56860965", "0.56757015", "0.5613648", "0.5584616", "0.5568763", "0.5517414", "0.5515395", "0.5452807", "0.54372...
0.65061486
9
Run the next `fn`, if any.
function next(err) { var fn = fns[++index] var params = slice.call(arguments, 0) var values = params.slice(1) var length = input.length var pos = -1 if (err) { done(err) return } // Copy non-nully input into values. while (++pos < length) { ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function run(fn) {\n if (fn)\n fn(next);\n else\n callback(null, results);\n }", "function next(err, result) {\n if (err)\n return callback(err, results);\n results.push(result);\n if (fns.length)\n run(fns.shift());\n else\n callback(null, results);\n }", "function...
[ "0.7895341", "0.7258331", "0.6687143", "0.6568592", "0.6472725", "0.6472725", "0.6464374", "0.6464374", "0.6464374", "0.6464374", "0.6464374", "0.6464374", "0.6400427", "0.63742316", "0.6338885", "0.62767184", "0.6203823", "0.61728907", "0.61713886", "0.61713886", "0.610243",...
0.6133581
25
Add `fn` to the list.
function use(fn) { if (typeof fn !== 'function') { throw new Error('Expected `fn` to be a function, not ' + fn) } fns.push(fn) return middleware }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function addWithFunction(list, item, hashFunction) {\n if (findWithFunction(list, hashFunction) === -1) {\n list.push(item);\n }\n }", "custom(fn) {\r\n\t\treturn this.push('fn', [...arguments]);\r\n\t}", "function addToQueue(fn) {\n if (working) {\n queue.push(fn);\n }...
[ "0.69391334", "0.6699876", "0.62224996", "0.6204581", "0.6065605", "0.60541385", "0.597551", "0.5913218", "0.5810012", "0.5810012", "0.5810012", "0.5810012", "0.5810012", "0.5810012", "0.5810012", "0.57788336", "0.5764707", "0.5738819", "0.5720906", "0.57197505", "0.56740576"...
0.57356536
24
Wrap `fn`. Can be sync or async; return a promise, receive a completion handler, return new values and errors.
function wrap(fn, callback) { var invoked return wrapped function wrapped() { var params = slice.call(arguments, 0) var callback = fn.length > params.length var result if (callback) { params.push(done) } try { result = fn.apply(null, params) } catch (error) { // W...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function wrap_sync (fn) {\n return function (params) {\n var val = fn(params)\n if (val && !isPromise(val)) throw val\n return val\n }\n}", "async function thenify(fn) {\n return await new Promise(function(resolve, reject) {\n function callback(err, res) {\n if (err) return reject(err);\n ...
[ "0.75725514", "0.69479746", "0.6858928", "0.6830772", "0.6648563", "0.6574583", "0.65611124", "0.6463919", "0.6463919", "0.6435289", "0.63665336", "0.6268416", "0.6259378", "0.62556964", "0.62556964", "0.62530184", "0.6249934", "0.6212102", "0.6200447", "0.6200375", "0.618733...
0.6304468
16
Invoke `next`, only once.
function done() { if (!invoked) { invoked = true callback.apply(null, arguments) } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "next () {}", "next() {}", "next() {\n this._next();\n }", "Next() {}", "function next() {\n subject = context.stack.tail.head;\n index = 0;\n test( subject );\n }", "async next() {\n this._executing = false;\n await this._execute();\n }", "function _next() {\n...
[ "0.78337926", "0.7766705", "0.742107", "0.7365195", "0.6899227", "0.6799684", "0.6630355", "0.6603183", "0.65826726", "0.6529928", "0.6470122", "0.6434803", "0.6434803", "0.6420854", "0.6374825", "0.6374825", "0.6349096", "0.63221407", "0.631236", "0.63065857", "0.63003343", ...
0.0
-1
Invoke `done` with one value. Tracks if an error is passed, too.
function then(value) { done(null, value) }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function then(value) {\n done(null, value);\n }", "function finish (err) {\n if (!calledDone) {\n calledDone = true;\n done(err);\n }\n }", "function done() {}", "function done ( error ) {\n if (error) {\n that.error = error\n }\n if ( cb ) cb( error )\n }", "done() {}",...
[ "0.6572137", "0.64892197", "0.64739716", "0.64194715", "0.6381711", "0.6374475", "0.63663185", "0.63663185", "0.63663185", "0.63663185", "0.63663185", "0.63663185", "0.63663185", "0.63663185", "0.62876344", "0.62755406", "0.6242043", "0.6175674", "0.61732936", "0.6048527", "0...
0.66370517
8
Create a custom constructor which can be modified without affecting the original class.
function unherit(Super) { var result var key var value inherits(Of, Super) inherits(From, Of) // Clone values. result = Of.prototype for (key in result) { value = result[key] if (value && typeof value === 'object') { result[key] = 'concat' in value ? value.concat() : xtend(value) }...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function temporaryConstructor() {}", "function Constructor() {}", "function Constructor() {}", "function Constructor() {}", "constructor() {\n copy(this, create());\n }", "new() {\n let newInstance = Object.create(this);\n\n newInstance.init(...arguments);\n\n return newInstance;\n }"...
[ "0.7260429", "0.7071604", "0.7071604", "0.7071604", "0.7062483", "0.7026925", "0.6914832", "0.68617076", "0.67593026", "0.67593026", "0.6710411", "0.6710411", "0.6710411", "0.6710411", "0.6710411", "0.6710411", "0.6666424", "0.663215", "0.6617585", "0.6609436", "0.65504104", ...
0.0
-1
Constructor accepting a single argument, which itself is an `arguments` object.
function From(parameters) { return Super.apply(this, parameters) }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function C(arg) {\n this.args = arguments;\n}", "constructor(args) {\n super(args);\n }", "constructor(args) {\n super(args);\n }", "constructor(args) {\n super();\n args = args || {}\n this.CONSTRUCTOR_ID = 0x99c1d49d;\n this.SUBCLASS_OF_ID = 0xeb9987b3;\n\n this....
[ "0.6959179", "0.643698", "0.643698", "0.6311878", "0.62868017", "0.62729627", "0.6272085", "0.6236955", "0.6227004", "0.6225904", "0.62001526", "0.6163254", "0.6159827", "0.61476386", "0.6146458", "0.6134848", "0.6127441", "0.61070144", "0.6099203", "0.6095188", "0.6079402", ...
0.0
-1
Constructor accepting variadic arguments.
function Of() { if (!(this instanceof Of)) { return new From(arguments) } return Super.apply(this, arguments) }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "static create(...args /* :Array<*> */) {\n\t\treturn new this(...args)\n\t}", "construct (target, args) {\n return new target(...args)\n }", "constructor(args) {\n super();\n args = args || {}\n this.CONSTRUCTOR_ID = 0x09333afb;\n this.SUBCLASS_OF_ID = 0xf1163490;\n\n thi...
[ "0.7136816", "0.6953033", "0.692598", "0.69021624", "0.69021624", "0.6878798", "0.6776414", "0.67102474", "0.6695473", "0.66910213", "0.6659877", "0.66535336", "0.6645595", "0.6640925", "0.6639501", "0.6638436", "0.66289335", "0.66243696", "0.66028565", "0.6594345", "0.658970...
0.0
-1
Get all keys in `value`.
function keys(value) { var result = []; var key; for (key in value) { result.push(key); } return result; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function keys(value) {\n var result = []\n var key\n\n for (key in value) {\n result.push(key)\n }\n\n return result\n}", "function keys(value) {\n var key\n for (key in value) {\n return true\n }\n return false\n}", "function keys(value) {\n var key\n for (key in value) {\n return true\n ...
[ "0.836424", "0.6576043", "0.6576043", "0.6576043", "0.6576043", "0.6576043", "0.6545341", "0.65157515", "0.65157515", "0.65157515", "0.64387435", "0.6329179", "0.62270236", "0.61529833", "0.6023055", "0.59515864", "0.57830095", "0.57830095", "0.5691123", "0.56526494", "0.5624...
0.8278659
7
Construct a state `toggler`: a function which inverses `property` in context based on its current value. The by `toggler` returned function restores that value.
function factory(key, state, ctx) { return enter function enter() { var context = ctx || this var current = context[key] context[key] = !state return exit function exit() { context[key] = current } } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function toggleable_factory(prop = 'value', event = 'input') {\n return external_commonjs_vue_commonjs2_vue_root_Vue_default.a.extend({\n name: 'toggleable',\n model: {\n prop,\n event\n },\n props: {\n [prop]: {\n required: false\n }\n },\n\n data() {\n return {\...
[ "0.562566", "0.562566", "0.562566", "0.561733", "0.5212816", "0.5125243", "0.5085007", "0.5065974", "0.50450844", "0.50281835", "0.4977002", "0.49746278", "0.49360406", "0.4935533", "0.4931587", "0.49147934", "0.49135178", "0.48936903", "0.48864853", "0.48856494", "0.48709154...
0.0
-1
Factory to get the line and columnbased `position` for `offset` in the bound indices.
function offsetToPositionFactory(indices) { return offsetToPosition // Get the line and column-based `position` for `offset` in the bound indices. function offsetToPosition(offset) { var index = -1 var length = indices.length if (offset < 0) { return {} } while (++index < length) { ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function positionToOffsetFactory(indices) {\n return positionToOffset\n\n // Get the `offset` for a line and column-based `position` in the bound\n // indices.\n function positionToOffset(position) {\n var line = position && position.line\n var column = position && position.column\n\n if (!isNaN(line)...
[ "0.7075349", "0.7075349", "0.7075349", "0.69795245", "0.69795245", "0.6974238", "0.6974238", "0.68666387", "0.68666387", "0.68666387", "0.68666387", "0.68666387", "0.6756182", "0.6611567", "0.6542188", "0.64920235", "0.64521325", "0.64521325", "0.64428896", "0.6439124", "0.63...
0.7002797
5
Get the line and columnbased `position` for `offset` in the bound indices.
function offsetToPosition(offset) { var index = -1 var length = indices.length if (offset < 0) { return {} } while (++index < length) { if (indices[index] > offset) { return { line: index + 1, column: offset - (indices[index - 1] || 0) + 1, offset:...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "getLineAndColumnFromChunk(offset) {\r\n\t\t\t\tvar column, columnCompensation, compensation, lastLine, lineCount, previousLinesCompensation, ref, string;\r\n\t\t\t\tcompensation = this.getLocationDataCompensation(this.chunkOffset, this.chunkOffset + offset);\r\n\t\t\t\tif (offset === 0) {\r\n\t\t\t\t\treturn [this...
[ "0.66774505", "0.66699433", "0.6659134", "0.6659134", "0.6652503", "0.6436059", "0.6436059", "0.6436059", "0.64176875", "0.63346153", "0.63327104", "0.63327104", "0.62733066", "0.62733066", "0.62733066", "0.62727237", "0.6262357", "0.6262357", "0.6245017", "0.6240079", "0.624...
0.70611274
4
Factory to get the `offset` for a line and columnbased `position` in the bound indices.
function positionToOffsetFactory(indices) { return positionToOffset // Get the `offset` for a line and column-based `position` in the bound // indices. function positionToOffset(position) { var line = position && position.line var column = position && position.column if (!isNaN(line) && !isNaN(col...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function positionToOffsetFactory(indices) {\n return positionToOffset\n\n /* Get the `offset` for a line and column-based\n * `position` in the bound indices. */\n function positionToOffset(position) {\n var line = position && position.line\n var column = position && position.column\n\n if (!isNaN(li...
[ "0.7169871", "0.7169871", "0.6971489", "0.6589328", "0.6589328", "0.6589328", "0.6576411", "0.6576411", "0.6491785", "0.63492906", "0.63492906", "0.63492906", "0.63492906", "0.63492906", "0.6348974", "0.6269752", "0.6182241", "0.6182241", "0.6182241", "0.6182241", "0.6182241"...
0.727257
2
Get the `offset` for a line and columnbased `position` in the bound indices.
function positionToOffset(position) { var line = position && position.line var column = position && position.column if (!isNaN(line) && !isNaN(column) && line - 1 in indices) { return (indices[line - 2] || 0) + column - 1 || 0 } return -1 }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function positionToOffsetFactory(indices) {\n return positionToOffset\n\n // Get the `offset` for a line and column-based `position` in the bound\n // indices.\n function positionToOffset(position) {\n var line = position && position.line\n var column = position && position.column\n\n if (!isNaN(line)...
[ "0.6476816", "0.6476816", "0.6476816", "0.6438751", "0.6400837", "0.6370719", "0.6370719", "0.63069415", "0.61469966", "0.60152006", "0.59834266", "0.59607756", "0.59607756", "0.59607756", "0.59607756", "0.59607756", "0.59607756", "0.59607756", "0.59607756", "0.59309113", "0....
0.6808515
4
Get indices of linebreaks in `value`.
function indices(value) { var result = [] var index = value.indexOf('\n') while (index !== -1) { result.push(index + 1) index = value.indexOf('\n', index + 1) } result.push(value.length + 1) return result }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function lineCount(value) {\n var count = 0;\n for (var _i = 0, value_1 = value; _i < value_1.length; _i++) {\n var char = value_1[_i];\n if (char === '\\n') {\n count++;\n }\n }\n return count;\n}", "function computeLineStartsMap(text) {\n const result = [0];\n...
[ "0.65919644", "0.57013166", "0.5432263", "0.5342233", "0.519581", "0.51696146", "0.507851", "0.5013093", "0.49860644", "0.4964226", "0.4946536", "0.49298257", "0.49226657", "0.48780623", "0.48680732", "0.48583052", "0.48488826", "0.48488826", "0.4837607", "0.48324108", "0.483...
0.80642945
5
Factory to deescape a value, based on a list at `key` in `ctx`.
function factory(ctx, key) { return unescape; /* De-escape a string using the expression at `key` * in `ctx`. */ function unescape(value) { var prev = 0; var index = value.indexOf('\\'); var escape = ctx[key]; var queue = []; var character; while (index !== -1) { queue.push(valu...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function factory(ctx, key) {\n return unescape\n\n // De-escape a string using the expression at `key` in `ctx`.\n function unescape(value) {\n var previous = 0\n var index = value.indexOf(backslash)\n var escape = ctx[key]\n var queue = []\n var character\n\n while (index !== -1) {\n que...
[ "0.7249111", "0.536108", "0.536108", "0.536108", "0.536108", "0.536108", "0.536108", "0.5164798", "0.50071645", "0.4984438", "0.4866233", "0.47796676", "0.4667144", "0.46512026", "0.46505952", "0.46465138", "0.46465138", "0.46465138", "0.46465138", "0.46465138", "0.46465138",...
0.7325405
5
Deescape a string using the expression at `key` in `ctx`.
function unescape(value) { var prev = 0; var index = value.indexOf('\\'); var escape = ctx[key]; var queue = []; var character; while (index !== -1) { queue.push(value.slice(prev, index)); prev = index + 1; character = value.charAt(prev); /* If the following character i...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function factory(ctx, key) {\n return unescape\n\n // De-escape a string using the expression at `key` in `ctx`.\n function unescape(value) {\n var previous = 0\n var index = value.indexOf(backslash)\n var escape = ctx[key]\n var queue = []\n var character\n\n while (index !== -1) {\n que...
[ "0.7559954", "0.75268114", "0.75268114", "0.75268114", "0.75268114", "0.75268114", "0.75268114", "0.5831793", "0.55863667", "0.5573183", "0.55350876", "0.5105924", "0.50917345", "0.508984", "0.50827724", "0.50827724", "0.50827724", "0.50827724", "0.50827724", "0.50648695", "0...
0.5975752
11
Factory to create an entity decoder.
function factory(ctx) { decoder.raw = decodeRaw; return decoder; /* Normalize `position` to add an `indent`. */ function normalize(position) { var offsets = ctx.offset; var line = position.line; var result = []; while (++line) { if (!(line in offsets)) { break; } re...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function factory(ctx) {\n decoder.raw = decodeRaw\n\n return decoder\n\n // Normalize `position` to add an `indent`.\n function normalize(position) {\n var offsets = ctx.offset\n var line = position.line\n var result = []\n\n while (++line) {\n if (!(line in offsets)) {\n break\n }...
[ "0.7219088", "0.71356076", "0.71356076", "0.57152736", "0.5621252", "0.5413163", "0.5362083", "0.5326339", "0.52831817", "0.5236325", "0.5236325", "0.5236282", "0.52257466", "0.52257466", "0.52257466", "0.52257466", "0.52257466", "0.52257466", "0.51879174", "0.5145243", "0.50...
0.7159043
4
Normalize `position` to add an `indent`.
function normalize(position) { var offsets = ctx.offset; var line = position.line; var result = []; while (++line) { if (!(line in offsets)) { break; } result.push((offsets[line] || 0) + 1); } return { start: position, indent: result }; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function normalize(position) {\n var offsets = ctx.offset\n var line = position.line\n var result = []\n\n while (++line) {\n if (!(line in offsets)) {\n break\n }\n\n result.push((offsets[line] || 0) + 1)\n }\n\n return {start: position, indent: result}\n }", "function p...
[ "0.757144", "0.63089496", "0.6255081", "0.6255081", "0.6255081", "0.6255081", "0.6255081", "0.57605976", "0.5702812", "0.5702812", "0.5702812", "0.5702812", "0.5702812", "0.56591326", "0.56393504", "0.55557984", "0.54419565", "0.5432311", "0.5430044", "0.53908414", "0.5390841...
0.75367886
6
Handle a warning. See for the warnings.
function handleWarning(reason, position, code) { if (code === 3) { return; } ctx.file.message(reason, position); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function onwarn(warning) {\n if (warning.code === 'THIS_IS_UNDEFINED') return;\n console.error(warning.message);\n}", "function handleWarning(reason, position, code) {\n if (code !== 3) {\n ctx.file.message(reason, position)\n }\n }", "issueWarning(args) {\n this.emit('warning', args);\n }", ...
[ "0.7490234", "0.74281955", "0.71471065", "0.677067", "0.677067", "0.677067", "0.677067", "0.677067", "0.66602415", "0.6655821", "0.6655821", "0.6630893", "0.6614084", "0.6555695", "0.65171844", "0.6493037", "0.6445884", "0.64053947", "0.64053947", "0.64053947", "0.64053947", ...
0.752049
5
Decode `value` (at `position`) into textnodes.
function decoder(value, position, handler) { entities(value, { position: normalize(position), warning: handleWarning, text: handler, reference: handler, textContext: ctx, referenceContext: ctx }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function decoder(value, position, handler) {\n entities(value, {\n position: normalize(position),\n warning: handleWarning,\n text: handler,\n reference: handler,\n textContext: ctx,\n referenceContext: ctx\n })\n }", "function decodeRaw(value, position, options) {\n retur...
[ "0.68267065", "0.65928215", "0.65928215", "0.65928215", "0.65928215", "0.65701926", "0.6540789", "0.6540789", "0.5573472", "0.55310106", "0.5367598", "0.5367598", "0.5343417", "0.5194319", "0.5164298", "0.5152497", "0.5152097", "0.5152097", "0.5152097", "0.5152097", "0.514959...
0.6817116
6
Decode `value` (at `position`) into a string.
function decodeRaw(value, position, options) { return entities(value, xtend(options, { position: normalize(position), warning: handleWarning })); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function decodeRaw(value, position) {\n return entities(value, {\n position: normalize(position),\n warning: handleWarning\n });\n }", "function decodeRaw(value, position) {\n return entities(value, {\n position: normalize(position),\n warning: handleWarning\n });\n }", "funct...
[ "0.69702625", "0.69702625", "0.6775656", "0.6490716", "0.6472848", "0.6472848", "0.6472848", "0.6472848", "0.6472848", "0.6472848", "0.6250978", "0.6250978", "0.6115299", "0.6041289", "0.5988353", "0.5988353", "0.5988353", "0.5988353", "0.59686035", "0.59686035", "0.59686035"...
0.69098884
5
Check if the given character code, or the character code at the first character, is hexadecimal.
function hexadecimal(character) { var code = typeof character === 'string' ? character.charCodeAt(0) : character return ( (code >= 97 /* a */ && code <= 102) /* z */ || (code >= 65 /* A */ && code <= 70) /* Z */ || (code >= 48 /* A */ && code <= 57) /* Z */ ) }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function isHexDigit(code) {\n return (\n isDigit(code) || // 0 .. 9\n (code >= 0x0041 && code <= 0x0046) || // A .. F\n (code >= 0x0061 && code <= 0x0066) // a .. f\n );\n}", "function hexadecimal(character) {\n var code = typeof character === 'string' ? character.charCodeAt(0) : c...
[ "0.7581072", "0.7504311", "0.7498717", "0.7426317", "0.72044915", "0.71264887", "0.7067999", "0.70529914", "0.7017491", "0.70108026", "0.7009791", "0.70016026", "0.6995307", "0.6942766", "0.6934762", "0.69318706", "0.69261026", "0.6873151", "0.6783633", "0.6783633", "0.678363...
0.7384884
9
Check if the given character code, or the character code at the first character, is alphanumerical.
function alphanumerical(character) { return alphabetical(character) || decimal(character) }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function is_alphanum(str) {\n let curr_char\n for (let i = 0; i < str.length; i ++) {\n curr_char = str.charCodeAt(i)\n if (!(curr_char == 95 || curr_char == 46) &&\n !(curr_char > 47 && curr_char < 58) &&\n !(curr_char > 64 && curr_char < 91) &&\n !(curr_char > 96 && curr_char < 123))...
[ "0.802424", "0.7736312", "0.7566067", "0.75558513", "0.75211525", "0.7503225", "0.749414", "0.7483334", "0.744038", "0.74399394", "0.74377126", "0.7417362", "0.74167305", "0.73692375", "0.73620534", "0.73524463", "0.734858", "0.73418355", "0.73360133", "0.7333281", "0.7321902...
0.6999468
77
Check whether a node is mergeable with adjacent nodes.
function mergeable(node) { var start; var end; if (node.type !== 'text' || !node.position) { return true; } start = node.position.start; end = node.position.end; /* Only merge nodes which occupy the same size as their * `value`. */ return start.line !== end.line || end.column - start.col...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function mergeable(node) {\n var start\n var end\n\n if (node.type !== 'text' || !node.position) {\n return true\n }\n\n start = node.position.start\n end = node.position.end\n\n // Only merge nodes which occupy the same size as their `value`.\n return (\n start.line !== end.line || end.column - star...
[ "0.71366274", "0.6259624", "0.6230327", "0.62284565", "0.61179906", "0.60289866", "0.5804878", "0.57994366", "0.57488364", "0.5739582", "0.56976324", "0.56976324", "0.56863534", "0.56215096", "0.56138355", "0.55904573", "0.55699676", "0.55699676", "0.5559757", "0.5553477", "0...
0.7074309
6
Merge two text nodes: `node` into `prev`.
function mergeText(prev, node) { prev.value += node.value; return prev; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function mergeText(previous, node) {\n previous.value += node.value\n\n return previous\n}", "function mergeBlockquote(prev, node) {\n if (this.options.commonmark) {\n return node;\n }\n\n prev.children = prev.children.concat(node.children);\n\n return prev;\n}", "function mergeBlockquote(prev, node) ...
[ "0.7849193", "0.6281823", "0.6281823", "0.6281823", "0.6281823", "0.6281823", "0.6281823", "0.62302065", "0.616374", "0.60946196", "0.60043705", "0.59923655", "0.5973659", "0.5908109", "0.589838", "0.56804395", "0.56523275", "0.5615626", "0.5565107", "0.5562803", "0.55494356"...
0.8098557
5
Merge two blockquotes: `node` into `prev`, unless in CommonMark mode.
function mergeBlockquote(prev, node) { if (this.options.commonmark) { return node; } prev.children = prev.children.concat(node.children); return prev; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function mergeBlockquote(previous, node) {\n if (this.options.commonmark || this.options.gfm) {\n return node\n }\n\n previous.children = previous.children.concat(node.children)\n\n return previous\n}", "function mergeText(prev, node) {\n prev.value += node.value;\n\n return prev;\n}", "function merge...
[ "0.8367977", "0.61360675", "0.61360675", "0.61360675", "0.61360675", "0.61360675", "0.61360675", "0.5930932", "0.57893425", "0.56482565", "0.5554666", "0.54335237", "0.5431284", "0.53100824", "0.52976626", "0.52637064", "0.5200446", "0.5166874", "0.5166874", "0.5166874", "0.5...
0.85240054
5
Construct a tokenizer. This creates both `tokenizeInline` and `tokenizeBlock`.
function factory(type) { return tokenize; /* Tokenizer for a bound `type`. */ function tokenize(value, location) { var self = this; var offset = self.offset; var tokens = []; var methods = self[type + 'Methods']; var tokenizers = self[type + 'Tokenizers']; var line = location.line; va...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function tokenizer(input, options) {\n return Parser.tokenizer(input, options)\n }", "function tokenizer(input, options) {\n return Parser.tokenizer(input, options)\n }", "function tokenizer(input, options) {\n return Parser.tokenizer(input, options)\n }", "function tokenizer(input, options) {\n ...
[ "0.6647831", "0.6647831", "0.6647831", "0.6637244", "0.6637244", "0.6637244", "0.65069973", "0.65069973", "0.65069973", "0.65069973", "0.65069973", "0.65069973", "0.65069973", "0.63949126", "0.62895286", "0.61172473", "0.608667", "0.5903893", "0.58503217", "0.58113986", "0.58...
0.5797938
25
Tokenizer for a bound `type`.
function tokenize(value, location) { var self = this; var offset = self.offset; var tokens = []; var methods = self[type + 'Methods']; var tokenizers = self[type + 'Tokenizers']; var line = location.line; var column = location.column; var index; var length; var method; var na...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function factory(type) {\n return tokenize;\n\n /* Tokenizer for a bound `type`. */\n function tokenize(value, location) {\n var self = this;\n var offset = self.offset;\n var tokens = [];\n var methods = self[type + 'Methods'];\n var tokenizers = self[type + 'Tokenizers'];\n var line = locati...
[ "0.64397955", "0.64397955", "0.64397955", "0.64397955", "0.64397955", "0.63414675", "0.6329742", "0.6018946", "0.5882375", "0.57774585", "0.57694155", "0.57543147", "0.5736293", "0.5672879", "0.5641096", "0.56112975", "0.5603829", "0.5583456", "0.5562897", "0.55435354", "0.55...
0.0
-1
Update line, column, and offset based on `value`.
function updatePosition(subvalue) { var lastIndex = -1; var index = subvalue.indexOf('\n'); while (index !== -1) { line++; lastIndex = index; index = subvalue.indexOf('\n', index + 1); } if (lastIndex === -1) { column += subvalue.length; } else { ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function updatePosition(subvalue) {\n var lastIndex = -1\n var index = subvalue.indexOf('\\n')\n\n while (index !== -1) {\n line++\n lastIndex = index\n index = subvalue.indexOf('\\n', index + 1)\n }\n\n if (lastIndex === -1) {\n column += subvalue.length\n ...
[ "0.7200468", "0.6306508", "0.6006134", "0.5928402", "0.58180755", "0.5709779", "0.57011133", "0.56737566", "0.56072223", "0.5580895", "0.55691946", "0.55691946", "0.55691946", "0.55691946", "0.55691946", "0.55479944", "0.55298024", "0.5475479", "0.54641885", "0.5446471", "0.5...
0.7229146
3
Get offset. Called before the first character is eaten to retrieve the range's offsets.
function getOffset() { var indentation = []; var pos = line + 1; /* Done. Called when the last character is * eaten to retrieve the range’s offsets. */ return function () { var last = line + 1; while (pos < last) { indentation.push((offset[pos] || 0) + 1); ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function getStartOffSet() {\n var selObj = window.getSelection();\n var selRange = selObj.getRangeAt(0);\n return selRange['startOffset'];\n }", "function getOffset() {\n\t\t\treturn offset;\n\t\t}", "getOffset() {\r\n return this.builder.o...
[ "0.68109906", "0.65578", "0.63603795", "0.6280547", "0.6275719", "0.62400013", "0.6212487", "0.607922", "0.60775465", "0.6075039", "0.6062073", "0.60516286", "0.60412747", "0.60324687", "0.6024554", "0.6019764", "0.60101163", "0.60079426", "0.6006103", "0.59962153", "0.599526...
0.7644563
3
Get the current position.
function now() { var pos = {line: line, column: column}; pos.offset = self.toOffset(pos); return pos; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function getCurrentPosition() {\n return $._getCurrentPosition();\n}", "function getPos() {\n\t\treturn _this.position;\n\t}", "function getPosition() {\n return _character.getPosition();\n }", "async getPosition() {\n return this._position;\n }", "getPosition() {\n return this._las...
[ "0.8059421", "0.7960642", "0.788338", "0.7707294", "0.75241387", "0.7512489", "0.7508141", "0.73519945", "0.7219399", "0.7159119", "0.7157245", "0.7149591", "0.71272236", "0.70371795", "0.70171124", "0.7005105", "0.7005105", "0.7004674", "0.6965421", "0.6886338", "0.6807483",...
0.668909
31
Store position information for a node.
function Position(start) { this.start = start; this.end = now(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "setNodePosition(Pos, node) {\n let currrentNode = this.nodes.find(n => n === node);\n currrentNode.x = Pos.x;\n currrentNode.y = Pos.y;\n }", "savePosition() {\n this.savedX = this.x;\n this.savedY = this.y;\n }", "function savePositions () {\n var updateTheseNodes = {...
[ "0.6429364", "0.63434136", "0.63226074", "0.6272839", "0.62623346", "0.62435097", "0.61585325", "0.6147435", "0.6058061", "0.605646", "0.59816897", "0.5943724", "0.5837633", "0.581746", "0.579113", "0.57636505", "0.57392776", "0.5709215", "0.5697817", "0.5697627", "0.5697627"...
0.0
-1
Mark position and patch `node.position`.
function position() { var before = now(); return update; /* Add the position to a node. */ function update(node, indent) { var prev = node.position; var start = prev ? prev.start : before; var combined = []; var n = prev && prev.end.line; var l = before....
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function patch(node) {\n if (!node.position) {\n node.position = {}\n }\n}", "setNodePosition(Pos, node) {\n let currrentNode = this.nodes.find(n => n === node);\n currrentNode.x = Pos.x;\n currrentNode.y = Pos.y;\n }", "assignPosition(node, position) {\n // update the posit...
[ "0.7861916", "0.6788894", "0.6681636", "0.6610156", "0.6173554", "0.6161047", "0.6156374", "0.6002291", "0.5998681", "0.59891766", "0.59890425", "0.59074354", "0.5890844", "0.58887213", "0.5858468", "0.58487445", "0.58283585", "0.5807958", "0.578546", "0.5776166", "0.5738537"...
0.612533
11
Add the position to a node.
function update(node, indent) { var prev = node.position; var start = prev ? prev.start : before; var combined = []; var n = prev && prev.end.line; var l = before.line; node.position = new Position(start); /* If there was already a `position`, this * no...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function add (node, parent) {\n parent.children.push(node)\n if (parser.position) {\n parent.position = {\n start: parent.children[0].position.start,\n end: node.position.end\n }\n }\n }", "addPosition(pos) {\n this.positions += '=\"'+pos.line + ':' + pos.linePosition + '...
[ "0.65842587", "0.6516607", "0.6484519", "0.6458811", "0.63893163", "0.62335664", "0.6225618", "0.61637735", "0.61253077", "0.60475916", "0.60419756", "0.5999882", "0.59785116", "0.5964825", "0.5964825", "0.5964825", "0.5964825", "0.5964825", "0.59278154", "0.59051055", "0.590...
0.0
-1
Add `node` to `parent`s children or to `tokens`. Performs merges where possible.
function add(node, parent) { var children = parent ? parent.children : tokens; var prev = children[children.length - 1]; if ( prev && node.type === prev.type && node.type in MERGEABLE_NODES && mergeable(prev) && mergeable(node) ) { node = MERGEABL...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function add(node, parent) {\n var children = parent ? parent.children : tokens\n var previous = children[children.length - 1]\n var fn\n\n if (\n previous &&\n node.type === previous.type &&\n (node.type === 'text' || node.type === 'blockquote') &&\n mergeable(previ...
[ "0.74623704", "0.5998085", "0.57359624", "0.57040995", "0.56888145", "0.5535257", "0.5535257", "0.5535257", "0.5535257", "0.5535257", "0.55218256", "0.5493243", "0.5486552", "0.54409987", "0.54202956", "0.5411669", "0.5390074", "0.53790534", "0.53790534", "0.53790534", "0.537...
0.7812813
3
Remove `subvalue` from `value`. `subvalue` must be at the start of `value`.
function eat(subvalue) { var indent = getOffset(); var pos = position(); var current = now(); validateEat(subvalue); apply.reset = reset; reset.test = test; apply.test = test; value = value.substring(subvalue.length); updatePosition(subvalue); indent = in...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function subInputValue(val, sub)\n{\n var dataArray = '';\n var data = \"\";\n if (val == sub) return 0;\n dataArray = val.toString().split(',');\n var index = $.inArray(sub, dataArray);\n dataArray.splice(index, 1);\n return dataArray.join();\n}", "deleteVal(str) {\n\t\tvar sub...
[ "0.66989744", "0.615324", "0.6097065", "0.6078783", "0.59160215", "0.5887385", "0.5751531", "0.5706532", "0.5595195", "0.5557081", "0.5488317", "0.54675454", "0.5466561", "0.5354575", "0.5338592", "0.53191656", "0.53060836", "0.53027904", "0.5236537", "0.5217721", "0.52087337...
0.51343733
30
Add the given arguments, add `position` to the returned node, and return the node.
function apply(node, parent) { return pos(add(pos(node), parent), indent); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "assignPosition(node, position) {\n // update the position of the node\n node.position = position;\n \n // the base case\n if (node.children.length === 0)\n {\n leafNodeCounter = leafNodeCounter + 1;\n return node;\n }\n // recursive case...
[ "0.6184237", "0.5976594", "0.5897871", "0.5891385", "0.5836728", "0.5836728", "0.5836728", "0.5836728", "0.5836728", "0.5836728", "0.5797177", "0.57895225", "0.578314", "0.5762615", "0.573231", "0.5724759", "0.57198524", "0.57198524", "0.57198524", "0.57198524", "0.57198524",...
0.0
-1
Functions just like apply, but resets the content: the line and column are reversed, and the eaten value is readded. This is useful for nodes with a single type of content, such as lists and tables. See `apply` above for what parameters are expected.
function reset() { var node = apply.apply(null, arguments); line = current.line; column = current.column; value = subvalue + value; return node; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function reset() {\n var node = apply.apply(null, arguments)\n\n line = current.line\n column = current.column\n value = subvalue + value\n\n return node\n }", "_reset(line, column) {\n this.tagName = '';\n this.attributes = [];\n this.endTag = false;\n this.en...
[ "0.72795355", "0.53835183", "0.5181338", "0.518", "0.518", "0.518", "0.518", "0.518", "0.518", "0.51663584", "0.5156114", "0.5098013", "0.5072985", "0.4976196", "0.4880812", "0.48687857", "0.48530856", "0.48391765", "0.48253495", "0.4817544", "0.4776628", "0.4767747", "0....
0.71728957
4
Test the position, after eating, and reverse to a noteaten state.
function test() { var result = pos({}); line = current.line; column = current.column; value = subvalue + value; return result.position; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "backToPosition() {\n while (this.current_position != this.position) {\n this.closeDoors();\n if (this.current_position > this.position) {\n this.moveDown();\n console.log(this.current_position);\n } else if (this.current_position < this.position) {\n this.moveUp();\n }\n...
[ "0.5747144", "0.55379176", "0.55339026", "0.54902875", "0.54773253", "0.54693604", "0.5463387", "0.5449033", "0.54478693", "0.53943497", "0.5390149", "0.5382457", "0.5367056", "0.5353433", "0.53518414", "0.53282654", "0.53261423", "0.5319799", "0.5306259", "0.5305748", "0.528...
0.49256462
97
Parse the bound file.
function parse() { var self = this; var value = String(self.file); var start = {line: 1, column: 1, offset: 0}; var content = xtend(start); var node; /* Clean non-unix newlines: `\r\n` and `\r` are all * changed to `\n`. This should not affect positional * information. */ value = value.replace(EXP...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function parse(fileName) {\n\n var baseDir = path.dirname(fileName);\n\n var jsonData = parseFile(fileName);\n if (!jsonData) {\n return null;\n }\n\n jsonData = replace(baseDir, jsonData, 'segment');\n if (!jsonData) {\n return null;\n }\n\n\n if (jsonData.hasOwnProperty('seg...
[ "0.5563817", "0.54014236", "0.54014236", "0.54014236", "0.54014236", "0.54014236", "0.53815776", "0.53685594", "0.5361048", "0.53508544", "0.526773", "0.52418554", "0.52402407", "0.5168292", "0.516796", "0.51584196", "0.51400054", "0.51273656", "0.51238674", "0.51143503", "0....
0.4607834
78
Visit a single node.
function one(node, index, parents) { var result = [] var subresult if (!test || is(node, index, parents[parents.length - 1] || null)) { result = toResult(visitor(node, parents)) if (result[0] === EXIT) { return result } } if (node.children && result[0] !== SKIP) { ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "visitNode(node) { }", "visit() {\n if(this.state) this.state = Node.VISITED;\n }", "function node(){}", "function one(node, index, parent) {\n var result;\n\n index = index || (parent ? 0 : null);\n\n if (!type || node.type === type) {\n result = visitor(node, index, parent || null);\...
[ "0.7661173", "0.6445177", "0.64438576", "0.62799275", "0.61086637", "0.6075337", "0.6050634", "0.6050634", "0.60447025", "0.59705806", "0.5951017", "0.59241366", "0.59029406", "0.59029406", "0.59029406", "0.59029406", "0.58092374", "0.58092374", "0.58092374", "0.58092374", "0...
0.0
-1