Search is not available for this dataset
query
stringlengths
7
355k
document
stringlengths
9
341k
metadata
dict
negatives
listlengths
0
101
negative_scores
listlengths
0
101
document_score
stringlengths
3
10
document_rank
stringclasses
102 values
Function called to read a selected file.
readSelectedFile() { var fileReader = new FileReader(); var objFile = document.getElementById("fileInput").files[0]; if (!objFile) { alert("OBJ file not set!"); return; } fileReader.readAsText(objFile); fileReader.onloadend = function() { // alert(fileReader.result); var customObj = new CustomOBJ(shader, fileReader.result); _inputHandler.scene.addGeometry(customObj); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function readFile(evt){\n\tvar files = evt.target.files;//Retrieve the files\n\tif (!files.length){//If there is no file\n\t\talert(\"NO FILE SELECTED! NOOOOOOOOOOO!\\n(select a file next time)\");\n\t\treturn;\n\t}\n\t\n\tvar file = files[0];//get the first of the selected files\n\tvar reader = new FileReader();/...
[ "0.7307276", "0.72197986", "0.71588254", "0.71148825", "0.6770334", "0.6712162", "0.65847474", "0.6491801", "0.6486233", "0.64474523", "0.64361787", "0.6424571", "0.63902324", "0.6305965", "0.6283209", "0.62754637", "0.62336105", "0.62295175", "0.6210619", "0.618147", "0.6171...
0.6013231
32
Function to calculate data from POST request
function calculateNum(firstNumber, operator, secondNumber) { if (operator === '+') { //.toFixed to round to 1 decimal point result = (firstNumber + secondNumber).toFixed(1); } else if (operator === '-') { result = (firstNumber - secondNumber).toFixed(1); } else if (operator === '*') { result = (firstNumber * secondNumber).toFixed(1); } else if (operator === '/') { result = (firstNumber / secondNumber).toFixed(1); } return result; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function PostCalc(data){\r\n $.ajax({\r\n type: \"POST\",\r\n url: \"https://stormy-lowlands-53016.herokuapp.com/quoteform\",\r\n contentType: \"application/json\",\r\n data: data,\r\n dataType: \"json\",\r\n success: function(res, status){\r\n if (status != ...
[ "0.69649553", "0.6146883", "0.6086589", "0.58769006", "0.58691067", "0.5860629", "0.5857744", "0.5754083", "0.57466686", "0.5737391", "0.57179224", "0.56892616", "0.5679746", "0.56786704", "0.5670388", "0.56685823", "0.56661713", "0.5662497", "0.56557065", "0.5636636", "0.560...
0.0
-1
O(n) n: size of Queue
deQueue() { if (!this.En_stack.length) { throw new Error('Queue is empty') } while (this.En_stack.length != 1) { this.De_stack.push(this.En_stack.pop()) } let x = this.En_stack.pop() while (this.De_stack.length != 0) { this.En_stack.push(this.De_stack.pop()) } return x }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function getSize(){\n return queue.length;\n }", "size(){\n return this.queue.length;\n }", "queueSize() {\n return this.queue.length\n }", "size() {\n return this.queue.size();\n }", "TotalItemsInQueue(){\n return this._length;\n }", "get size() {\n return this._...
[ "0.73047346", "0.68975836", "0.6850611", "0.67753685", "0.67177117", "0.67029214", "0.6701284", "0.66809857", "0.6664896", "0.6664896", "0.6573936", "0.656145", "0.65551335", "0.65366787", "0.6456364", "0.6452665", "0.6430783", "0.63523483", "0.6328634", "0.63236105", "0.6281...
0.0
-1
TODO: Add cell blinking here NOTE: Mb. to implement blinking just draw blinking romb on top of the cell ?
draw(ctx, x, y, cell_width, cell_height) { for (let h = 0; h < this.height; h++) { // each odd line is 1 cell shorter for (let w = 0; w < this.width - (h & 1); w++) { let index = (h * this.width - (~~(h / 2))) + w; if (this.cells[index].playerId != 0) { this.playersCells[this.cells[index].playerId].add(index); } // NOTE: It can probably be a static method this.cells[index].draw(ctx, x + w * cell_width + ((h % 2) * cell_width / 2), y + h * cell_height - (h * (cell_height / 2)), cell_width, cell_height ); } } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function blink(cell) {\n setTimeout(function() {\n cell.style.color = \"red\";\n }, 150);\n setTimeout(function() {\n cell.style.color = \"\";\n }, 650);\n setTimeout(function() {\n cell.style.color = \"red\";\n }, 1150);\n setTimeout(function() {\n cell.style.color = \"\";\n }, 1650);\n}", ...
[ "0.776315", "0.776315", "0.70141566", "0.652586", "0.6525523", "0.64824927", "0.6404919", "0.63628644", "0.63618344", "0.63287187", "0.63277745", "0.6284515", "0.62171656", "0.6211982", "0.6193682", "0.61887103", "0.61699414", "0.61637944", "0.6159809", "0.6157624", "0.613197...
0.0
-1
Adding a zero if the number is less than 10
function zeroLeft(num) { return num <= 10 ? `0${num}` : num }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function addZero(number) {\n if (number<10) {\n return '0' + number;\n }\n return number\n }", "function addZero(num) {\n if (num < 10) {\n return `0${num}`\n } else {\n return num;\n }\n }", "function addZero(num) {\n if (num < 10) {\n return `0${num}`;\n } else {...
[ "0.770386", "0.7475157", "0.74721533", "0.7466644", "0.74605685", "0.7413686", "0.7412882", "0.7394637", "0.73832804", "0.7357868", "0.73475516", "0.7332866", "0.73273766", "0.72686684", "0.723557", "0.7235376", "0.7228067", "0.7202425", "0.7189479", "0.71804345", "0.71731997...
0.65663683
97
value is of the form path.to.json.category
sortNestedItems(value) { let isAsc = true; if (value === this.state.sorting.sortOn) isAsc = !this.state.sorting.sortAsc; const nested = value.split("."); function compare(a, b) { let x = a; let y = b; // find the correct leaf in the json to compare for (let i = 0; i < nested.length; i++) { x = x[nested[i]]; y = y[nested[i]]; } if (typeof x === "string") { x = x.toLowerCase(); } if (typeof y === "string") { y = y.toLowerCase(); } return (x < y ? -1 : x > y ? 1 : 0) * (isAsc ? 1 : -1) } this.setState({ items: this.state.data.sort(compare), sorting: { sortOn: value, sortAsc: isAsc } }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "getShortValue(category, value){\n for(let jsonCategory of json.jsonArray){\n if(jsonCategory.key === category){\n for(let item of jsonCategory.value){\n if(item.value === value){\n return item.key;\n }\n }\...
[ "0.64768255", "0.5988071", "0.5664285", "0.5654446", "0.5547312", "0.5484582", "0.54593056", "0.54411334", "0.54411334", "0.54411334", "0.54411334", "0.5439875", "0.54299915", "0.5400216", "0.5386971", "0.53820866", "0.53815806", "0.5352957", "0.5350109", "0.5346274", "0.5344...
0.0
-1
Shape_From_File is a versatile standalone Shape that imports all its arrays' data from an .obj 3D model file.
constructor( filename ) { super( "position", "normal", "texture_coord" ); // Begin downloading the mesh. Once that completes, return // control to our parse_into_mesh function. this.load_file( filename ); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function loadObj(name, file)\n{\n let obj_info = ObjectPool[name].ObjectInfo;\n if (obj_info == null) return null;\n\n if (file == null)\n {\n obj_info.positions = [];\n obj_info.indices = [];\n obj_info.textureCoordinates = [];\n obj_info.textureIndices = [];\n obj_i...
[ "0.6393649", "0.61995274", "0.6167601", "0.5961024", "0.57780874", "0.55918825", "0.55484647", "0.5497059", "0.54948187", "0.5462454", "0.5462454", "0.54529166", "0.5452153", "0.53980356", "0.5369112", "0.52676165", "0.5253596", "0.5246909", "0.5221981", "0.5215817", "0.52011...
0.5545399
7
Subclasses of Shader each store and manage a complete GPU program.
material() { // Materials here are minimal, without any settings. return {shader: this} }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function Shader()\n {\n var program_;\n var uniforms_;\n var attributes_;\n var samplerSlots_;\n }", "function initShaders() { \n \n Shader = (function() {\n \n var UNIFORM_SETTER = {};\n\n // Return the number of elements fo...
[ "0.6544732", "0.6399144", "0.6263623", "0.62421227", "0.6204842", "0.6131438", "0.6087413", "0.60684246", "0.6066637", "0.6058251", "0.59889334", "0.5921972", "0.5906805", "0.5886842", "0.58757406", "0.5850916", "0.5822142", "0.58117604", "0.5801057", "0.579585", "0.57882357"...
0.0
-1
Define how to synchronize our JavaScript's variables to the GPU's:
update_GPU(g_state, model_transform, material, gpu = this.g_addrs, gl = this.gl) { const proj_camera = g_state.projection_transform.times(g_state.camera_transform); // Send our matrices to the shader programs: gl.uniformMatrix4fv(gpu.model_transform_loc, false, Mat.flatten_2D_to_1D(model_transform.transposed())); gl.uniformMatrix4fv(gpu.projection_camera_transform_loc, false, Mat.flatten_2D_to_1D(proj_camera.transposed())); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "update_GPU( context, gpu_addresses, graphics_state, model_transform, material ) // Define how to synchronize our JavaScript's variables to the GPU's:\n { const [ P, C, M ] = [ graphics_state.projection_transform, graphics_state.camera_inverse, model_transform ],\n PCM = P.times( C ).ti...
[ "0.61219585", "0.58250374", "0.57887506", "0.56426656", "0.5623802", "0.5604926", "0.5595574", "0.55708754", "0.55489856", "0.5495018", "0.54928696", "0.5488662", "0.5426509", "0.5426509", "0.5426509", "0.54008", "0.53613967", "0.53613967", "0.53613967", "0.53613967", "0.5335...
0.0
-1
Write a function `printNStop5(num)` that will print all the numbers from 0 to `num 1`. It should stop printing and end the first time it encounters a number that is multiple of 5, , except 0 (otherwise we wouldn't see anything). Examples: > printNStop5(5) 0 1 2 3 4 > printNStop5(15) 0 1 2 3 4
function printNStop5(num) { // your code here... }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function highFive(num){ //print numbers less than 6 and if equals to 5 then print High Five!\n for(var i=0; i<num; i++){\n if(i == 5){// if num equals to 5, log below\n console.log(\"High Five!\");\n }\n else{//print i\n console.log(i);\n }\n }\n}", "functi...
[ "0.67742056", "0.65540546", "0.65039474", "0.6465406", "0.64429015", "0.63577163", "0.63577163", "0.6232831", "0.6222594", "0.6050855", "0.59807324", "0.5877286", "0.5867348", "0.58585066", "0.5811957", "0.5754944", "0.5745096", "0.5730267", "0.572765", "0.56863695", "0.56450...
0.7633555
0
Watch on Property Changes
parseDurationProp(newValue) { this.innerDuration = newValue ? newValue : "2000ms"; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "willWatchProperty(property) {\n this.beginObservingContentKey(property);\n }", "function notifyProperty(changes) {\n $.each(changes._watchers, function() {\n notifyCall(this);\n });\n }", "function watchPropsOn(el) {\n return new Proxy(el, {\n get(target, propKey, receiver) ...
[ "0.75753605", "0.7223749", "0.70258075", "0.67753965", "0.66732794", "0.66078603", "0.65001184", "0.65001184", "0.65001184", "0.65001184", "0.65001184", "0.65001184", "0.6481428", "0.6481428", "0.6481428", "0.6481428", "0.6481428", "0.6470637", "0.6470637", "0.6454544", "0.64...
0.0
-1
Event Definitions Listen to Event Definitions Method Definitions Method initialize
async init() { return await this._init(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "initializeEvents () {\n }", "initialize() {\n this.listenTo(this.owner, {\n [converter_1.Converter.EVENT_BEGIN]: this.onBegin,\n [converter_1.Converter.EVENT_CREATE_DECLARATION]: this.onDeclaration,\n [converter_1.Converter.EVENT_CREATE_SIGNATURE]: this.onDeclaration,\n ...
[ "0.77356625", "0.7563767", "0.7501507", "0.7449922", "0.74475837", "0.73630655", "0.7348723", "0.73107284", "0.730282", "0.71919733", "0.7097074", "0.703736", "0.7037233", "0.70316494", "0.69632155", "0.69270724", "0.6921078", "0.6875554", "0.6866332", "0.6851667", "0.6843116...
0.0
-1
set up dark mode toggle
function setDarkMode(on) { if (on) { darkModeToggleInput.checked = true document.documentElement.classList.add('dark') localStorage.theme = 'dark' document.getElementById('sun-icon').classList.add('hidden') document.getElementById('moon-icon').classList.remove('hidden') } else { darkModeToggleInput.checked = false document.documentElement.classList.remove('dark') localStorage.theme = 'light' document.getElementById('moon-icon').classList.add('hidden') document.getElementById('sun-icon').classList.remove('hidden') } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function toggle_dark_mode(){\n\t\t\tif($('body').attr('dark') === \"true\" || $('html').attr('dark') === \"true\"){\n\t\t\t\t$panel.go_dark('yt');\n\t\t\t}else{\n\t\t\t\t$panel.go_light('yt');\n\t\t\t}\n\n\t\t\tif(!mode_obs_attached){\n\t\t\t\t$utils.create_observer('body', toggle_dark_mode, [true, false, true, fa...
[ "0.84616953", "0.8129085", "0.8016781", "0.79827464", "0.7975249", "0.7968222", "0.7950376", "0.78114796", "0.7756468", "0.7754838", "0.77537996", "0.77292204", "0.7726408", "0.77197534", "0.77127844", "0.76787525", "0.7653037", "0.7635363", "0.7607333", "0.759638", "0.759104...
0.8071145
2
Read file sync sugar.
function rfs(file) { return fs.readFileSync(path.join(__dirname, file), 'utf-8').replace(/\r\n/g, '\n'); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function readSync(description, options) {\n var file = vfile$7(description);\n file.contents = fs$a.readFileSync(path$9.resolve(file.cwd, file.path), options);\n return file\n}", "read() {\n return fs.readFileSync(this.filepath).toString();\n }", "function read(file) {\n var complete = fs.readFileSyn...
[ "0.69490594", "0.6896892", "0.6763963", "0.67485386", "0.6700614", "0.6627718", "0.6594735", "0.6521301", "0.6518725", "0.6417753", "0.6417016", "0.64024264", "0.6371319", "0.63607115", "0.6340001", "0.62707806", "0.627049", "0.6213427", "0.61922956", "0.6188252", "0.61847955...
0.0
-1
get the schema from the input schema property
getSchema (input, build) { var parent = this.model.visual; // allow to specify the schema as an entry of // visuals object in the dashboard schema if (parent && parent !== this.model && isString(input)) { var schema = parent.getVisualSchema(input); if (schema) input = schema; } if (isString(input)) { return this.json(input).then(response => build(response.data)).catch(err => { warn(`Could not reach ${input}: ${err}`, err); }); } else return build(input); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "schema() {\n return this.field.schema;\n }", "get schema() {\r\n return this.i.schema;\r\n }", "get schema() {\n return this.config.schema;\n }", "get schemaInst(){\n let schemaInst = this.schemas.findOne({ \"jsonObject.properties.type.default\": { $eq: this.type } }).jsonObject;\n ...
[ "0.7211741", "0.711485", "0.69107157", "0.66971755", "0.6697095", "0.6539067", "0.65277135", "0.6463078", "0.632423", "0.63088834", "0.6304039", "0.6233824", "0.61852", "0.61667234", "0.60908985", "0.6089416", "0.6078091", "0.6016687", "0.6012065", "0.60017973", "0.59301436",...
0.61835736
13
build the visual component has the schema available
build () {}
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "create () {\n const self = this\n\n self.applyPlugins('before-create', self)\n\n self.applyPluginsAsyncWaterfall('schema', self.options.schema, function(err, value) {\n if (err) {\n console.error('get schema failed ', err)\n return\n }\n\n ...
[ "0.62277085", "0.6182751", "0.61573255", "0.60511625", "0.5991677", "0.5982153", "0.59122914", "0.5869149", "0.57165706", "0.56984925", "0.5617634", "0.56127393", "0.55971694", "0.5591458", "0.5529375", "0.55229986", "0.55040324", "0.55036443", "0.5486724", "0.54828155", "0.5...
0.0
-1
Create a rule instance.
function createRule(name, decl, options) { if (name === void 0) { name = 'unnamed'; } var jss = options.jss; var declCopy = cloneStyle(decl); var rule = jss.plugins.onCreateRule(name, declCopy, options); if (rule) return rule; // It is an at-rule and it has no instance. if (name[0] === '@') { false ? 0 : void 0; } return null; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "static makeRule(options) {\n return new Rule(options.name, options.severity, options.selector ? Selector.parse(options.selector) : null, Rule.makePattern(options.pattern), options.lint || options.message, options.applies);\n }", "create(context) {\n freezeDeeply(context.opt...
[ "0.68356055", "0.6653184", "0.65755916", "0.64988756", "0.6485865", "0.6473794", "0.64504606", "0.64504606", "0.64504606", "0.64504606", "0.64504606", "0.64504606", "0.64504606", "0.64504606", "0.64504606", "0.64504606", "0.64504606", "0.64504606", "0.64504606", "0.64504606", ...
0.5770457
52
Converts a Rule to CSS string.
function toCss(selector, style, options) { if (options === void 0) { options = {}; } var result = ''; if (!style) return result; var _options = options, _options$indent = _options.indent, indent = _options$indent === void 0 ? 0 : _options$indent; var fallbacks = style.fallbacks; if (selector) indent++; // Apply fallbacks first. if (fallbacks) { // Array syntax {fallbacks: [{prop: value}]} if (Array.isArray(fallbacks)) { for (var index = 0; index < fallbacks.length; index++) { var fallback = fallbacks[index]; for (var prop in fallback) { var value = fallback[prop]; if (value != null) { if (result) result += '\n'; result += "" + indentStr(prop + ": " + toCssValue(value) + ";", indent); } } } } else { // Object syntax {fallbacks: {prop: value}} for (var _prop in fallbacks) { var _value = fallbacks[_prop]; if (_value != null) { if (result) result += '\n'; result += "" + indentStr(_prop + ": " + toCssValue(_value) + ";", indent); } } } } for (var _prop2 in style) { var _value2 = style[_prop2]; if (_value2 != null && _prop2 !== 'fallbacks') { if (result) result += '\n'; result += "" + indentStr(_prop2 + ": " + toCssValue(_value2) + ";", indent); } } // Allow empty style in this case, because properties will be added dynamically. if (!result && !options.allowEmpty) return result; // When rule is being stringified before selector was defined. if (!selector) return result; indent--; if (result) result = "\n" + result + "\n"; return indentStr(selector + " {" + result, indent) + indentStr('}', indent); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function toCSSDeclaration(prop, val) {\n var props = toCSSProps(prop);\n for (var i = 0, ii = props.length; i < ii; ++i) {\n props[i] += \": \"+val+\";\";\n }\n return props.join(\"\");\n }", "toString(): string {\n if (Array.isArray(this.style)) {\n let str = ''\n for (let index =...
[ "0.6156099", "0.6117747", "0.5704", "0.5685539", "0.5682971", "0.564685", "0.5641924", "0.5641924", "0.5641924", "0.5641924", "0.56171066", "0.5599794", "0.5595651", "0.552418", "0.552418", "0.552418", "0.552418", "0.55205595", "0.5513249", "0.5513249", "0.5513249", "0.5513...
0.56349224
31
Rules registry for access by .get() method. It contains the same rule registered by name and by selector. Original styles object. Used to ensure correct rules order.
function RuleList(options) { this.map = {}; this.raw = {}; this.index = []; this.counter = 0; this.options = void 0; this.classes = void 0; this.keyframes = void 0; this.options = options; this.classes = options.classes; this.keyframes = options.keyframes; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function matchStyleRules(ref) {\n var styleRules = ref.styleRules;\n var styleGroupName = ref.styleGroupName;\n var styleGroupPrefix = ref.styleGroupPrefix;\n\n var rule = styleRules.find(function (rule) { return styleGroupName === (styleGroupPrefix + \"_\" + (rule.id)); });\n va...
[ "0.6677653", "0.6382181", "0.62757814", "0.62757814", "0.62614083", "0.61745703", "0.61649346", "0.61246026", "0.6083649", "0.6043284", "0.6000803", "0.5933182", "0.59179467", "0.59179467", "0.5895582", "0.5849347", "0.5840084", "0.581443", "0.5791769", "0.5746269", "0.572126...
0.0
-1
Find attached sheet with an index higher than the passed one.
function findHigherSheet(registry, options) { for (var i = 0; i < registry.length; i++) { var sheet = registry[i]; if (sheet.attached && sheet.options.index > options.index && sheet.options.insertionPoint === options.insertionPoint) { return sheet; } } return null; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function findHigherSheet(registry, options) {\n for (var i = 0; i < registry.length; i++) {\n var sheet = registry[i];\n if (sheet.attached && sheet.options.index > options.index && sheet.options.insertionPoint === options.insertionPoint) {\n return sheet;\n }\n }\n return null;\n }...
[ "0.7568327", "0.7539894", "0.7499265", "0.7499265", "0.74848413", "0.74848413", "0.74848413", "0.74848413", "0.74848413", "0.74848413", "0.74848413", "0.74848413", "0.74848413", "0.74848413", "0.74848413", "0.74848413", "0.74848413", "0.74848413", "0.74848413", "0.74848413", ...
0.747529
63
Find attached sheet with the highest index.
function findHighestSheet(registry, options) { for (var i = registry.length - 1; i >= 0; i--) { var sheet = registry[i]; if (sheet.attached && sheet.options.insertionPoint === options.insertionPoint) { return sheet; } } return null; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function findHighestSheet(registry, options) {\n for (var i = registry.length - 1; i >= 0; i--) {\n var sheet = registry[i];\n if (sheet.attached && sheet.options.insertionPoint === options.insertionPoint) {\n return sheet;\n }\n }\n return null;\n }", "function findHighestSheet(r...
[ "0.77357453", "0.7704632", "0.7696885", "0.7696885", "0.7669926", "0.7669926", "0.7669926", "0.7669926", "0.7669926", "0.7669926", "0.7669926", "0.7669926", "0.7669926", "0.7669926", "0.7669926", "0.7669926", "0.7669926", "0.7669926", "0.7669926", "0.7669926", "0.7669926", ...
0.76521736
63
Find a comment with "jss" inside.
function findCommentNode(text) { var head = getHead(); for (var i = 0; i < head.childNodes.length; i++) { var node = head.childNodes[i]; if (node.nodeType === 8 && node.nodeValue.trim() === text) { return node; } } return null; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "IsInComment (ss, nn)\r\n { let ii=-1, bb=0;\r\n do { ii=ss.indexOf(\"{\",ii+1); bb++; }\r\n while ((ii>=0)&&(ii<nn));\r\n ii=-1;\r\n do { ii=ss.indexOf(\"}\",ii+1); bb--; }\r\n while ((ii>=0)&&(ii<nn));\r\n return(bb);\r\n }", "function findCommentNode(text) {\n var head = ...
[ "0.6377393", "0.6230793", "0.61737394", "0.61737394", "0.61737394", "0.61737394", "0.61737394", "0.61737394", "0.61737394", "0.61737394", "0.61737394", "0.61737394", "0.61737394", "0.61737394", "0.61737394", "0.61737394", "0.61737394", "0.61737394", "0.61737394", "0.61737394", ...
0.61005807
64
Find a node before which we can insert the sheet.
function findPrevNode(options) { var registry$1 = registry.registry; if (registry$1.length > 0) { // Try to insert before the next higher sheet. var sheet = findHigherSheet(registry$1, options); if (sheet && sheet.renderer) { return { parent: sheet.renderer.element.parentNode, node: sheet.renderer.element }; } // Otherwise insert after the last attached. sheet = findHighestSheet(registry$1, options); if (sheet && sheet.renderer) { return { parent: sheet.renderer.element.parentNode, node: sheet.renderer.element.nextSibling }; } } // Try to find a comment placeholder if registry is empty. var insertionPoint = options.insertionPoint; if (insertionPoint && typeof insertionPoint === 'string') { var comment = findCommentNode(insertionPoint); if (comment) { return { parent: comment.parentNode, node: comment.nextSibling }; } // If user specifies an insertion point and it can't be found in the document - // bad specificity issues may appear. false ? 0 : void 0; } return false; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function findPrevNode(options) {\n var registry = sheets.registry;\n\n if (registry.length > 0) {\n // Try to insert before the next higher sheet.\n var sheet = findHigherSheet(registry, options);\n\n if (sheet && sheet.renderer) {\n return {\n parent: sheet.renderer.element.pa...
[ "0.7421259", "0.74022955", "0.7398367", "0.7398367", "0.7362382", "0.7362382", "0.7362382", "0.7362382", "0.7362382", "0.7362382", "0.7362382", "0.7362382", "0.7362382", "0.7362382", "0.7362382", "0.7362382", "0.7362382", "0.7362382", "0.7362382", "0.7362382", "0.7362382", ...
0.7114585
23
Insert style element into the DOM.
function insertStyle(style, options) { var insertionPoint = options.insertionPoint; var nextNode = findPrevNode(options); if (nextNode !== false && nextNode.parent) { nextNode.parent.insertBefore(style, nextNode.node); return; } // Works with iframes and any node types. if (insertionPoint && typeof insertionPoint.nodeType === 'number') { // https://stackoverflow.com/questions/41328728/force-casting-in-flow var insertionPointElement = insertionPoint; var parentNode = insertionPointElement.parentNode; if (parentNode) parentNode.insertBefore(style, insertionPointElement.nextSibling);else false ? 0 : void 0; return; } getHead().appendChild(style); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function insertStyle(style) {\n var a=document.createElement(\"style\");\n a.innerHTML=style;\n document.head.appendChild(a);\n}", "function insertStyle(style, options) {\n var insertionPoint = options.insertionPoint;\n var nextNode = findPrevNode(options);\n\n if (nextNode !== false && nextNode.pare...
[ "0.7943686", "0.7706128", "0.7683789", "0.7653549", "0.7653549", "0.76448977", "0.76448977", "0.76448977", "0.76448977", "0.76448977", "0.76448977", "0.76448977", "0.76448977", "0.76448977", "0.76448977", "0.76448977", "0.76448977", "0.76448977", "0.76448977", "0.76448977", "...
0.7644424
23
HTMLStyleElement needs fixing Will be empty if link: true option is not set, because it is only for use together with insertRule API.
function DomRenderer(sheet) { this.getPropertyValue = getPropertyValue; this.setProperty = setProperty; this.removeProperty = removeProperty; this.setSelector = setSelector; this.element = void 0; this.sheet = void 0; this.hasInsertedRules = false; this.cssRules = []; // There is no sheet when the renderer is used from a standalone StyleRule. if (sheet) registry.add(sheet); this.sheet = sheet; var _ref = this.sheet ? this.sheet.options : {}, media = _ref.media, meta = _ref.meta, element = _ref.element; this.element = element || createStyle(); this.element.setAttribute('data-jss', ''); if (media) this.element.setAttribute('media', media); if (meta) this.element.setAttribute('data-meta', meta); var nonce = getNonce(); if (nonce) this.element.setAttribute('nonce', nonce); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function refuseStyle(refStyle) {\n var selectedTag = getSelectedNode(); // the selected node\n\n // if the selected node have attribute of \"style\" and it have unwanted style\n if (selectedTag && selectedTag.is(\"[style]\...
[ "0.611398", "0.5965531", "0.5965531", "0.59208196", "0.59049255", "0.59049255", "0.59049255", "0.59049255", "0.58954066", "0.5891549", "0.57965904", "0.57965904", "0.57965904", "0.5789427", "0.5789427", "0.577838", "0.5775719", "0.5775719", "0.5775719", "0.5708784", "0.569079...
0.0
-1
Extracts a styles object with only props that contain function values.
function getDynamicStyles(styles) { var to = null; for (var key in styles) { var value = styles[key]; var type = typeof value; if (type === 'function') { if (!to) to = {}; to[key] = value; } else if (type === 'object' && value !== null && !Array.isArray(value)) { var extracted = getDynamicStyles(value); if (extracted) { if (!to) to = {}; to[key] = extracted; } } } return to; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function extractStyleParts() {\n var args = [];\n for (var _i = 0; _i < arguments.length; _i++) {\n args[_i] = arguments[_i];\n }\n var classes = [];\n var objects = [];\n var stylesheet = _Stylesheet__WEBPACK_IMPORTED_MODULE_0__.Stylesheet.getInstance();\n function _processArgs(argsLis...
[ "0.62761724", "0.62761724", "0.62759346", "0.6259358", "0.6161896", "0.6100022", "0.60847485", "0.60318816", "0.6022034", "0.6021987", "0.6020295", "0.6004265", "0.6004265", "0.6004265", "0.6004265", "0.6004265", "0.6004265", "0.6004265", "0.6004265", "0.6004265", "0.6004265"...
0.6068873
32
Returns a function which generates unique class names based on counters. When new generator function is created, rule counter is reset. We need to reset the rule counter for SSR for each request. It's inspired by
function createGenerateClassName() { var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {}; var _options$disableGloba = options.disableGlobal, disableGlobal = _options$disableGloba === void 0 ? false : _options$disableGloba, _options$productionPr = options.productionPrefix, productionPrefix = _options$productionPr === void 0 ? 'jss' : _options$productionPr, _options$seed = options.seed, seed = _options$seed === void 0 ? '' : _options$seed; var seedPrefix = seed === '' ? '' : "".concat(seed, "-"); var ruleCounter = 0; var getNextCounterId = function getNextCounterId() { ruleCounter += 1; if (false) {} return ruleCounter; }; return function (rule, styleSheet) { var name = styleSheet.options.name; // Is a global static MUI style? if (name && name.indexOf('Mui') === 0 && !styleSheet.options.link && !disableGlobal) { // We can use a shorthand class name, we never use the keys to style the components. if (pseudoClasses.indexOf(rule.key) !== -1) { return "Mui-".concat(rule.key); } var prefix = "".concat(seedPrefix).concat(name, "-").concat(rule.key); if (!styleSheet.options.theme[nested] || seed !== '') { return prefix; } return "".concat(prefix, "-").concat(getNextCounterId()); } if (true) { return "".concat(seedPrefix).concat(productionPrefix).concat(getNextCounterId()); } var suffix = "".concat(rule.key, "-").concat(getNextCounterId()); // Help with debuggability. if (styleSheet.options.classNamePrefix) { return "".concat(seedPrefix).concat(styleSheet.options.classNamePrefix, "-").concat(suffix); } return "".concat(seedPrefix).concat(suffix); }; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function createGenerateClassName() {\n\t var ruleCounter = 0;\n\n\t if (process.env.NODE_ENV === 'production' && typeof window !== 'undefined') {\n\t generatorCounter += 1;\n\n\t if (generatorCounter > 2) {\n\t // eslint-disable-next-line no-console\n\t console.error(['Material-UI: we have detect...
[ "0.7918563", "0.698373", "0.69209784", "0.68974537", "0.68974537", "0.68974537", "0.6842054", "0.68130314", "0.67980975", "0.67830986", "0.67830986", "0.67830986", "0.67830986", "0.67830986", "0.67830986", "0.6740682", "0.6700402", "0.6678807", "0.6598167", "0.6598167", "0.65...
0.6474656
25
Get a function to be used for $ref replacement.
function getReplaceRef(container, sheet) { return function (match, key) { var rule = container.getRule(key) || sheet && sheet.getRule(key); if (rule) { rule = rule; return rule.selector; } false ? 0 : void 0; return key; }; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function fnref(name){\n return mkdat(\"fnref\", name);\n }", "function createRef() {\n var func = function setRef(node) {\n func.current = node;\n };\n return func;\n}", "function composeRef() {\n for (\n var _len = arguments.length, refs = new Array(_len), _key = 0;\n ...
[ "0.6649858", "0.64558005", "0.61212206", "0.60655695", "0.60655695", "0.60599333", "0.59819967", "0.5978643", "0.5965357", "0.5952257", "0.5899973", "0.5899973", "0.5899973", "0.5899973", "0.5899973", "0.5899973", "0.5899973", "0.5899973", "0.5899973", "0.5899973", "0.5899973...
0.58362913
45
Clones the object and adds a camel cased property version.
function addCamelCasedVersion(obj) { var regExp = /(-[a-z])/g; var replace = function replace(str) { return str[1].toUpperCase(); }; var newObj = {}; for (var _key in obj) { newObj[_key] = obj[_key]; newObj[_key.replace(regExp, replace)] = obj[_key]; } return newObj; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function addCamelCasedVersion(obj) {\n var regExp = /(-[a-z])/g;\n var replace = function replace(str) {\n return str[1].toUpperCase();\n };\n var newObj = {};\n for (var key in obj) {\n newObj[key] = obj[key];\n newObj[key.replace(regExp, replace)] = obj[key];\n }\n return newO...
[ "0.7017152", "0.69527656", "0.69527656", "0.68966556", "0.68778366", "0.68753433", "0.68753433", "0.68753433", "0.68753433", "0.68753433", "0.68753433", "0.68753433", "0.68753433", "0.68753433", "0.68753433", "0.68753433", "0.68753433", "0.68753433", "0.68753433", "0.68753433",...
0.67541724
62
Recursive deep style passing function
function iterate(prop, value, options) { if (value == null) return value; if (Array.isArray(value)) { for (var i = 0; i < value.length; i++) { value[i] = iterate(prop, value[i], options); } } else if (typeof value === 'object') { if (prop === 'fallbacks') { for (var innerProp in value) { value[innerProp] = iterate(innerProp, value[innerProp], options); } } else { for (var _innerProp in value) { value[_innerProp] = iterate(prop + "-" + _innerProp, value[_innerProp], options); } } // eslint-disable-next-line no-restricted-globals } else if (typeof value === 'number' && isNaN(value) === false) { var unit = options[prop] || units[prop]; // Add the unit if available, except for the special case of 0px. if (unit && !(value === 0 && unit === px)) { return typeof unit === 'function' ? unit(value).toString() : "" + value + unit; } return value.toString(); } return value; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function recursiveFn(source, target, key) {\n if (isArray(source) || isObject$1(source)) {\n target = isPrimitive(target) ? isObject$1(source) ? {} : [] : target;\n for (var _key in source) ...
[ "0.6342486", "0.6328443", "0.62809575", "0.62358916", "0.6228957", "0.6204224", "0.6190323", "0.61421525", "0.6098036", "0.6086267", "0.6039732", "0.60050124", "0.60030663", "0.5989291", "0.59862334", "0.5977684", "0.59629154", "0.5935189", "0.59237915", "0.5901334", "0.58781...
0.0
-1
Add unit to numeric values.
function defaultUnit(options) { if (options === void 0) { options = {}; } var camelCasedOptions = addCamelCasedVersion(options); function onProcessStyle(style, rule) { if (rule.type !== 'style') return style; for (var prop in style) { style[prop] = iterate(prop, style[prop], camelCasedOptions); } return style; } function onChangeValue(value, prop) { return iterate(prop, value, camelCasedOptions); } return { onProcessStyle: onProcessStyle, onChangeValue: onChangeValue }; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function unit(i, units) {\n\t if ((typeof i === \"string\") && (!i.match(/^[\\-0-9\\.]+$/))) {\n\t return i;\n\t } else {\n\t return \"\" + i + units;\n\t }\n\t }", "function unit(i, units) {\n if ((typeof i === \"string\") && (!i.match(/^[\\-0-9\\.]+$/))) {\n return i;\n } else {\...
[ "0.6622079", "0.65806407", "0.65806407", "0.65793705", "0.65624154", "0.65624154", "0.61946905", "0.60811275", "0.60735935", "0.60721624", "0.60721624", "0.60721624", "0.6060846", "0.6051657", "0.6045234", "0.60335", "0.6028815", "0.5936279", "0.59199363", "0.58140886", "0.58...
0.0
-1
CONCATENATED MODULE: ./node_modules/jsspluginvendorprefixer/dist/jsspluginvendorprefixer.esm.js Add vendor prefix to a property name when needed.
function jssVendorPrefixer() { function onProcessRule(rule) { if (rule.type === 'keyframes') { var atRule = rule; atRule.at = supportedKeyframes(atRule.at); } } function prefixStyle(style) { for (var prop in style) { var value = style[prop]; if (prop === 'fallbacks' && Array.isArray(value)) { style[prop] = value.map(prefixStyle); continue; } var changeProp = false; var supportedProp = supportedProperty(prop); if (supportedProp && supportedProp !== prop) changeProp = true; var changeValue = false; var supportedValue$1 = supportedValue(supportedProp, toCssValue(value)); if (supportedValue$1 && supportedValue$1 !== value) changeValue = true; if (changeProp || changeValue) { if (changeProp) delete style[prop]; style[supportedProp || prop] = supportedValue$1 || value; } } return style; } function onProcessStyle(style, rule) { if (rule.type !== 'style') return style; return prefixStyle(style); } function onChangeValue(value, prop) { return supportedValue(prop, toCssValue(value)) || value; } return { onProcessRule: onProcessRule, onProcessStyle: onProcessStyle, onChangeValue: onChangeValue }; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function vendorPropName(name){// shortcut for names that are not vendor prefixed\nif(name in emptyStyle){return name;}// check for vendor prefixed names\nvar capName=name.charAt(0).toUpperCase()+name.slice(1),i=cssPrefixes.length;while(i--){name=cssPrefixes[i]+capName;if(name in emptyStyle){return name;}}}", "fu...
[ "0.6922334", "0.6854269", "0.68164325", "0.68155736", "0.6778338", "0.67690337", "0.67321265", "0.66789436", "0.667647", "0.667647", "0.667647", "0.667647", "0.667647", "0.667647", "0.667647", "0.667647", "0.667647", "0.667647", "0.66751426", "0.66624236", "0.66624236", "0....
0.0
-1
CONCATENATED MODULE: ./node_modules/jsspluginpropssort/dist/jsspluginpropssort.esm.js Sort props by length.
function jssPropsSort() { var sort = function sort(prop0, prop1) { if (prop0.length === prop1.length) { return prop0 > prop1 ? 1 : -1; } return prop0.length - prop1.length; }; return { onProcessStyle: function onProcessStyle(style, rule) { if (rule.type !== 'style') return style; var newStyle = {}; var props = Object.keys(style).sort(sort); for (var i = 0; i < props.length; i++) { newStyle[props[i]] = style[props[i]]; } return newStyle; } }; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function jssPropsSort() {\n var sort = function sort1(prop0, prop1) {\n if (prop0.length === prop1.length) return prop0 > prop1 ? 1 : -1;\n return prop0.length - prop1.length;\n };\n return {\n onProcessStyle: function onProcessStyle(style, rule) {\n if (rule.type !== 'styl...
[ "0.68015325", "0.67337644", "0.6611086", "0.6611086", "0.6611086", "0.6611086", "0.6611086", "0.6611086", "0.6611086", "0.6611086", "0.6611086", "0.6611086", "0.6611086", "0.6611086", "0.6611086", "0.6611086", "0.6611086", "0.6611086", "0.6611086", "0.6611086", "0.6611086", ...
0.67087615
25
Use the same logic as Bootstrap: and materialcomponentsweb
function getContrastText(background) { var contrastText = (0,colorManipulator/* getContrastRatio */.mi)(background, dark.text.primary) >= contrastThreshold ? dark.text.primary : light.text.primary; if (false) { var contrast; } return contrastText; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "upgradeElements () {\n componentHandler.upgradeElements(this.$('[class*=\"mdl-js-\"]'))\n }", "setupComponents() {\n\t\tthis.contactBar = new ContactBar();\n\t\tthis.contactBar.setup();\n\n\t\tthis.modal = new Modal();\n\t\tthis.modal.setup();\n\n\t\tthis.accordion = new Accordion();\n\t\tthis.accordion.setu...
[ "0.64387685", "0.5597523", "0.55940104", "0.55410993", "0.5496329", "0.54490805", "0.5419573", "0.54158866", "0.53836006", "0.53553027", "0.5334785", "0.5324598", "0.5324069", "0.53102636", "0.5305343", "0.5300293", "0.5291188", "0.5291188", "0.5291188", "0.5291188", "0.52623...
0.0
-1
It should to be noted that this function isn't equivalent to `texttransform: capitalize`. A strict capitalization should uppercase the first letter of each word a the sentence. We only handle the first word.
function capitalize(string) { if (typeof string !== 'string') { throw new Error( false ? 0 : (0,_material_ui_utils__WEBPACK_IMPORTED_MODULE_0__/* .default */ .Z)(7)); } return string.charAt(0).toUpperCase() + string.slice(1); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function sentenceCapitalizer1(text) {\n text = text.toLowerCase();\n let output = \"\";\n text.split(\" \").forEach( sentence => {\n output += sentence.slice(0, 1).toUpperCase();\n output += sentence.slice(1, sentence.length)+\" \";\n } );\n return output.trim();\n}", "function capit...
[ "0.78461677", "0.76351416", "0.76207817", "0.7620256", "0.7617055", "0.7614242", "0.76056707", "0.75864565", "0.7550391", "0.75190324", "0.75184196", "0.75137913", "0.7512628", "0.750188", "0.74994266", "0.747962", "0.7467241", "0.74620074", "0.7441867", "0.74398106", "0.7439...
0.0
-1
TODO v5: consider to make it private
function setRef(ref, value) { if (typeof ref === 'function') { ref(value); } else if (ref) { ref.current = value; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private public function m246() {}", "private internal function m248() {}", "transient private protected internal function m182() {}", "protected internal function m252() {}", "transient private internal function m185() {}", "transient protected internal function m189() {}", "transient final protected i...
[ "0.69828594", "0.68293136", "0.66447395", "0.6604393", "0.63777304", "0.63569075", "0.6242749", "0.6213562", "0.6094962", "0.60823613", "0.6030378", "0.5978219", "0.5968729", "0.59292036", "0.5928409", "0.59108067", "0.58212715", "0.5781679", "0.5753366", "0.5691014", "0.5653...
0.0
-1
If at any point a user clicks with a pointing device, ensure that we change the modality away from keyboard. This avoids the situation where a user presses a key on an already focused element, and then clicks on a different element, focusing it with a pointing device, while we still think we're in keyboard modality.
function handlePointerDown() { hadKeyboardEvent = false; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function onPointerDown(e) {\n if (hadKeyboardEvent === true) {\n removeAllFocusVisibleAttributes();\n }\n\n hadKeyboardEvent = false;\n }", "function handlePointerDown() {\n hadKeyboardEvent = false;\n}", "function handlePointerDown() {\n hadKeyboardEvent = false;\n }", "function FocusT...
[ "0.66897947", "0.636832", "0.63288844", "0.62409866", "0.62024987", "0.62024987", "0.62024987", "0.62024987", "0.62024987", "0.62024987", "0.6198776", "0.61885154", "0.61869276", "0.61869276", "0.61869276", "0.61869276", "0.6174619", "0.6149254", "0.6142503", "0.61019945", "0...
0.6366642
15
Should be called if a blur event is fired on a focusvisible element
function handleBlurVisible() { // To detect a tab/window switch, we look for a blur event followed // rapidly by a visibility change. // If we don't see a visibility change within 100ms, it's probably a // regular focus change. hadFocusVisibleRecently = true; window.clearTimeout(hadFocusVisibleRecentlyTimeout); hadFocusVisibleRecentlyTimeout = window.setTimeout(function () { hadFocusVisibleRecently = false; }, 100); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function handleBlurVisible() {\n // To detect a tab/window switch, we look for a blur event followed\n // rapidly by a visibility change.\n // If we don't see a visibility change within 100ms, it's probably a\n // regular focus change.\n hadFocusVisibleRecently = true;\n window.clearTimeout(hadFo...
[ "0.7986653", "0.797042", "0.797042", "0.797042", "0.796655", "0.78525454", "0.7629099", "0.7611382", "0.75502914", "0.75204337", "0.74019915", "0.7359951", "0.73509157", "0.7330408", "0.7330408", "0.7330408", "0.72779465", "0.7272837", "0.72561824", "0.72271365", "0.72271365"...
0.7981439
14
Initialize a new `Emitter`.
function Emitter(obj) { if (obj) return mixin(obj); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function Emitter() {\n this.events = {};\n}", "constructor() {\n this.eventEmitter = new Emitter();\n }", "function Emitter() {\n\t\tthis.listeners = {};\n\t\tthis.singleListener = {};\n\t}", "function Emitter() {\r\n this.events = {};\r\n}", "function Emitter() {\r\n\t\tthis.callbacks = {};\r\n\...
[ "0.7571564", "0.7560046", "0.75450575", "0.7514628", "0.7456722", "0.74460644", "0.7429575", "0.7429575", "0.7429575", "0.7429575", "0.7405929", "0.7387901", "0.7187168", "0.710413", "0.7097545", "0.7092573", "0.7062321", "0.7041538", "0.6998895", "0.696564", "0.68401015", ...
0.0
-1
IEEE754 conversions based on
function packIEEE754(value, mLen, nBytes) { var buffer = new Array(nBytes); var eLen = nBytes * 8 - mLen - 1; var eMax = (1 << eLen) - 1; var eBias = eMax >> 1; var rt = mLen === 23 ? pow(2, -24) - pow(2, -77) : 0; var i = 0; var s = value < 0 || value === 0 && 1 / value < 0 ? 1 : 0; var e, m, c; value = abs(value); // eslint-disable-next-line no-self-compare if (value != value || value === Infinity) { // eslint-disable-next-line no-self-compare m = value != value ? 1 : 0; e = eMax; } else { e = floor(log(value) / LN2); if (value * (c = pow(2, -e)) < 1) { e--; c *= 2; } if (e + eBias >= 1) { value += rt / c; } else { value += rt * pow(2, 1 - eBias); } if (value * c >= 2) { e++; c /= 2; } if (e + eBias >= eMax) { m = 0; e = eMax; } else if (e + eBias >= 1) { m = (value * c - 1) * pow(2, mLen); e = e + eBias; } else { m = value * pow(2, eBias - 1) * pow(2, mLen); e = 0; } } for (; mLen >= 8; buffer[i++] = m & 255, m /= 256, mLen -= 8); e = e << mLen | m; eLen += mLen; for (; eLen > 0; buffer[i++] = e & 255, e /= 256, eLen -= 8); buffer[--i] |= s * 128; return buffer; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function toIEEE754(v, ebits, fbits) {\n \n var bias = (1 << (ebits - 1)) - 1;\n \n // Compute sign, exponent, fraction\n var s, e, f;\n if (isNaN(v)) {\n e = (1 << bias) - 1; f = 1; s = 0;\n }\n else if (v === Infinity || v === -Infinity) {\n e = (1 << bias) - 1; f = 0; s = (v < 0) ...
[ "0.71729136", "0.64189947", "0.64161617", "0.63956785", "0.627264", "0.6167346", "0.61665237", "0.6147051", "0.6145078", "0.61065197", "0.60478586", "0.60118717", "0.60041714", "0.5982775", "0.5982775", "0.5982775", "0.5982775", "0.5982775", "0.5982775", "0.5982775", "0.59827...
0.0
-1
Currently only WebKitbased Web Inspectors, Firefox >= v31, and the Firebug extension (any Firefox version) are known to support "%c" CSS customizations. TODO: add a `localStorage` variable to explicitly enable/disable colors eslintdisablenextline complexity
function useColors() { // NB: In an Electron preload script, document will be defined but not fully // initialized. Since we know we're in Chrome, we'll just detect this case // explicitly if (typeof window !== 'undefined' && window.process && (window.process.type === 'renderer' || window.process.__nwjs)) { return true; } // Internet Explorer and Edge do not support colors. if (typeof navigator !== 'undefined' && navigator.userAgent && navigator.userAgent.toLowerCase().match(/(edge|trident)\/(\d+)/)) { return false; } // Is webkit? http://stackoverflow.com/a/16459606/376773 // document is undefined in react-native: https://github.com/facebook/react-native/pull/1632 return typeof document !== 'undefined' && document.documentElement && document.documentElement.style && document.documentElement.style.WebkitAppearance || // Is firebug? http://stackoverflow.com/a/398120/376773 typeof window !== 'undefined' && window.console && (window.console.firebug || window.console.exception && window.console.table) || // Is firefox >= v31? // https://developer.mozilla.org/en-US/docs/Tools/Web_Console#Styling_messages typeof navigator !== 'undefined' && navigator.userAgent && navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/) && parseInt(RegExp.$1, 10) >= 31 || // Double check webkit in userAgent just in case we are in a worker typeof navigator !== 'undefined' && navigator.userAgent && navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function formatBrowserArgs(args, config) {\n args[0] = (config.useColors ? '%c' : '') + config.namespace;\n\n if (!config.useColors) {\n return;\n }\n\n var c = 'color: ' + config.color; // The final \"%c\" is somewhat tricky, because there could be other\n // arguments passed either before or after the %c...
[ "0.60772026", "0.6058366", "0.6044316", "0.5864998", "0.58472097", "0.58373964", "0.5758509", "0.5737241", "0.5725176", "0.5662743", "0.5642719", "0.5620752", "0.55817246", "0.5533216", "0.5497694", "0.5481922", "0.5472681", "0.5458244", "0.545638", "0.54380435", "0.54221475"...
0.0
-1
Colorize log arguments if enabled.
function formatArgs(args) { args[0] = (this.useColors ? '%c' : '') + this.namespace + (this.useColors ? ' %c' : ' ') + args[0] + (this.useColors ? '%c ' : ' ') + '+' + module.exports.humanize(this.diff); if (!this.useColors) { return; } const c = 'color: ' + this.color; args.splice(1, 0, c, 'color: inherit'); // The final "%c" is somewhat tricky, because there could be other // arguments passed either before or after the %c, so we need to // figure out the correct index to insert the CSS into let index = 0; let lastC = 0; args[0].replace(/%[a-zA-Z%]/g, match => { if (match === '%%') { return; } index++; if (match === '%c') { // We only are interested in the *last* %c // (the user may have provided their own) lastC = index; } }); args.splice(lastC, 0, c); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "log(...args) {\n console.log(this.getColorOn() + args.join(\" \"));\n }", "function writelnColor(){\n\t\tfor(var i=0; i<arguments.length; i=i+2)\n\t\t\tgrunt.log.write(arguments[i][arguments[i+1]]);\n\t\tgrunt.log.writeln('');\n\t}", "debug(...args) {\n console.debug(this.getColorOn() + args.join(...
[ "0.6760166", "0.6711751", "0.65307504", "0.65290976", "0.65290976", "0.65290976", "0.6475225", "0.64737195", "0.64728016", "0.6462169", "0.645757", "0.6455942", "0.6453729", "0.64420164", "0.64335275", "0.64298606", "0.642863", "0.6418752", "0.6418752", "0.6418752", "0.641875...
0.0
-1
This is the common logic for both the Node.js and web browser implementations of `debug()`.
function setup(env) { createDebug.debug = createDebug; createDebug.default = createDebug; createDebug.coerce = coerce; createDebug.disable = disable; createDebug.enable = enable; createDebug.enabled = enabled; createDebug.humanize = __webpack_require__(4695); createDebug.destroy = destroy; Object.keys(env).forEach(key => { createDebug[key] = env[key]; }); /** * The currently active debug mode names, and names to skip. */ createDebug.names = []; createDebug.skips = []; /** * Map of special "%n" handling functions, for the debug "format" argument. * * Valid key names are a single, lower or upper-case letter, i.e. "n" and "N". */ createDebug.formatters = {}; /** * Selects a color for a debug namespace * @param {String} namespace The namespace string for the for the debug instance to be colored * @return {Number|String} An ANSI color code for the given namespace * @api private */ function selectColor(namespace) { let hash = 0; for (let i = 0; i < namespace.length; i++) { hash = (hash << 5) - hash + namespace.charCodeAt(i); hash |= 0; // Convert to 32bit integer } return createDebug.colors[Math.abs(hash) % createDebug.colors.length]; } createDebug.selectColor = selectColor; /** * Create a debugger with the given `namespace`. * * @param {String} namespace * @return {Function} * @api public */ function createDebug(namespace) { let prevTime; let enableOverride = null; function debug(...args) { // Disabled? if (!debug.enabled) { return; } const self = debug; // Set `diff` timestamp const curr = Number(new Date()); const ms = curr - (prevTime || curr); self.diff = ms; self.prev = prevTime; self.curr = curr; prevTime = curr; args[0] = createDebug.coerce(args[0]); if (typeof args[0] !== 'string') { // Anything else let's inspect with %O args.unshift('%O'); } // Apply any `formatters` transformations let index = 0; args[0] = args[0].replace(/%([a-zA-Z%])/g, (match, format) => { // If we encounter an escaped % then don't increase the array index if (match === '%%') { return '%'; } index++; const formatter = createDebug.formatters[format]; if (typeof formatter === 'function') { const val = args[index]; match = formatter.call(self, val); // Now we need to remove `args[index]` since it's inlined in the `format` args.splice(index, 1); index--; } return match; }); // Apply env-specific formatting (colors, etc.) createDebug.formatArgs.call(self, args); const logFn = self.log || createDebug.log; logFn.apply(self, args); } debug.namespace = namespace; debug.useColors = createDebug.useColors(); debug.color = createDebug.selectColor(namespace); debug.extend = extend; debug.destroy = createDebug.destroy; // XXX Temporary. Will be removed in the next major release. Object.defineProperty(debug, 'enabled', { enumerable: true, configurable: false, get: () => enableOverride === null ? createDebug.enabled(namespace) : enableOverride, set: v => { enableOverride = v; } }); // Env-specific initialization logic for debug instances if (typeof createDebug.init === 'function') { createDebug.init(debug); } return debug; } function extend(namespace, delimiter) { const newDebug = createDebug(this.namespace + (typeof delimiter === 'undefined' ? ':' : delimiter) + namespace); newDebug.log = this.log; return newDebug; } /** * Enables a debug mode by namespaces. This can include modes * separated by a colon and wildcards. * * @param {String} namespaces * @api public */ function enable(namespaces) { createDebug.save(namespaces); createDebug.names = []; createDebug.skips = []; let i; const split = (typeof namespaces === 'string' ? namespaces : '').split(/[\s,]+/); const len = split.length; for (i = 0; i < len; i++) { if (!split[i]) { // ignore empty strings continue; } namespaces = split[i].replace(/\*/g, '.*?'); if (namespaces[0] === '-') { createDebug.skips.push(new RegExp('^' + namespaces.substr(1) + '$')); } else { createDebug.names.push(new RegExp('^' + namespaces + '$')); } } } /** * Disable debug output. * * @return {String} namespaces * @api public */ function disable() { const namespaces = [...createDebug.names.map(toNamespace), ...createDebug.skips.map(toNamespace).map(namespace => '-' + namespace)].join(','); createDebug.enable(''); return namespaces; } /** * Returns true if the given mode name is enabled, false otherwise. * * @param {String} name * @return {Boolean} * @api public */ function enabled(name) { if (name[name.length - 1] === '*') { return true; } let i; let len; for (i = 0, len = createDebug.skips.length; i < len; i++) { if (createDebug.skips[i].test(name)) { return false; } } for (i = 0, len = createDebug.names.length; i < len; i++) { if (createDebug.names[i].test(name)) { return true; } } return false; } /** * Convert regexp to namespace * * @param {RegExp} regxep * @return {String} namespace * @api private */ function toNamespace(regexp) { return regexp.toString().substring(2, regexp.toString().length - 2).replace(/\.\*\?$/, '*'); } /** * Coerce `val`. * * @param {Mixed} val * @return {Mixed} * @api private */ function coerce(val) { if (val instanceof Error) { return val.stack || val.message; } return val; } /** * XXX DO NOT USE. This is a temporary stub function. * XXX It WILL be removed in the next major release. */ function destroy() { console.warn('Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.'); } createDebug.enable(createDebug.load()); return createDebug; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "debug() {}", "function debugMessage() {\n if (debug) console.debug(arguments);\n}", "function devDebug(){\n\n}", "function myDebug(){\n if(window.console) console.info(arguments);\n}", "function debug(v){return false;}", "function debug () {\n if (Retsly.debug) console.log.apply(console, arguments);...
[ "0.76526976", "0.74100566", "0.731867", "0.7225102", "0.72153175", "0.71614915", "0.70852363", "0.7064815", "0.70552844", "0.7047338", "0.69518334", "0.6936694", "0.68824756", "0.68757594", "0.68717974", "0.68690306", "0.68218535", "0.68172204", "0.6785604", "0.6782167", "0.6...
0.0
-1
XXX DO NOT USE. This is a temporary stub function. XXX It WILL be removed in the next major release.
function destroy() { console.warn('Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.'); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private internal function m248() {}", "private public function m246() {}", "transient private protected internal function m182() {}", "protected internal function m252() {}", "transient protected internal function m189() {}", "static final private internal function m106() {}", "transient private intern...
[ "0.6736127", "0.6577326", "0.6402469", "0.6298072", "0.6195974", "0.61782235", "0.61271334", "0.6046024", "0.5913906", "0.58889645", "0.5857231", "0.58215857", "0.58211464", "0.5772944", "0.57199204", "0.56736195", "0.5656994", "0.5571444", "0.55414695", "0.54445404", "0.5437...
0.0
-1
Initializes transport to use and starts probe.
open() { let transport; if (this.opts.rememberUpgrade && Socket.priorWebsocketSuccess && this.transports.indexOf("websocket") !== -1) { transport = "websocket"; } else if (0 === this.transports.length) { // Emit error on next tick so it can be listened to setTimeout(() => { this.emit("error", "No transports available"); }, 0); return; } else { transport = this.transports[0]; } this.readyState = "opening"; // Retry with the next transport if the transport is disabled (jsonp: false) try { transport = this.createTransport(transport); } catch (e) { debug("error while creating transport: %s", e); this.transports.shift(); this.open(); return; } transport.open(); this.setTransport(transport); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "start (callback) {\n if (!this.modules.transport) {\n return callback(new Error('no transports were present'))\n }\n\n let ws\n let transports = this.modules.transport\n\n transports = Array.isArray(transports) ? transports : [transports]\n\n // so that we can have webrtc-star addrs without ...
[ "0.62547445", "0.6221821", "0.61335695", "0.61335695", "0.6115516", "0.59811634", "0.579289", "0.5669699", "0.5632312", "0.5584776", "0.55815303", "0.55815303", "0.55589825", "0.55224377", "0.5513868", "0.5512871", "0.5506423", "0.54871136", "0.54670316", "0.5455401", "0.5443...
0.0
-1
Sets the current transport. Disables the existing one (if any).
setTransport(transport) { debug("setting transport %s", transport.name); if (this.transport) { debug("clearing existing transport %s", this.transport.name); this.transport.removeAllListeners(); } // set up transport this.transport = transport; // set up transport listeners transport.on("drain", this.onDrain.bind(this)).on("packet", this.onPacket.bind(this)).on("error", this.onError.bind(this)).on("close", () => { this.onClose("transport close"); }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "setTransport(transport) {\n debug$3(\"setting transport %s\", transport.name);\n const self = this;\n\n if (this.transport) {\n debug$3(\"clearing existing transport %s\", this.transport.name);\n this.transport.removeAllListeners();\n }\n\n // set up transport\n this.tra...
[ "0.67459184", "0.6706888", "0.6706888", "0.6572428", "0.64738613", "0.6465157", "0.5838586", "0.56495196", "0.5562277", "0.5529616", "0.5461857", "0.5448869", "0.5448636", "0.5423519", "0.540358", "0.53743124", "0.5348146", "0.53134495", "0.5308269", "0.52647144", "0.52348036...
0.682649
0
Called when connection is deemed open.
onOpen() { debug("socket open"); this.readyState = "open"; Socket.priorWebsocketSuccess = "websocket" === this.transport.name; this.emit("open"); this.flush(); // we check for `readyState` in case an `open` // listener already closed the socket if ("open" === this.readyState && this.opts.upgrade && this.transport.pause) { debug("starting upgrade probes"); let i = 0; const l = this.upgrades.length; for (; i < l; i++) { this.probe(this.upgrades[i]); } } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "connect () {\n if (this._readyState === this.READY_STATE.CLOSING) {\n this._nextReadyState = this.READY_STATE.OPEN\n return\n }\n\n this._nextReadyState = null\n if (this._readyState === this.READY_STATE.CLOSED) {\n this._doOpen()\n }\n }", "onOpen() {\n this.readyState = \"...
[ "0.66600823", "0.66312057", "0.656462", "0.65445435", "0.6495058", "0.6492395", "0.6488508", "0.6488508", "0.64872915", "0.6442891", "0.63960105", "0.63951576", "0.63951576", "0.6377987", "0.6375862", "0.6371359", "0.6371359", "0.6371359", "0.6341471", "0.6336445", "0.631182"...
0.6305185
21
Sets and resets ping timeout timer based on server pings.
resetPingTimeout() { clearTimeout(this.pingTimeoutTimer); this.pingTimeoutTimer = setTimeout(() => { this.onClose("ping timeout"); }, this.pingInterval + this.pingTimeout); if (this.opts.autoUnref) { this.pingTimeoutTimer.unref(); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "resetPingTimeout() {\n clearTimeout(this.pingTimeoutTimer);\n this.pingTimeoutTimer = setTimeout(() => {\n this.onClose(\"ping timeout\");\n }, this.pingInterval + this.pingTimeout);\n }", "resetPingTimeout() {\n clearTimeout(this.pingTimeoutTimer);\n this.pingTimeoutTimer = setTim...
[ "0.78815746", "0.78076965", "0.78076965", "0.770182", "0.770182", "0.63214767", "0.62413937", "0.6154825", "0.59722215", "0.59722215", "0.5878971", "0.58640546", "0.5824339", "0.5806684", "0.57668924", "0.5742948", "0.5728771", "0.571936", "0.56895703", "0.56488776", "0.56377...
0.76362985
5
Called on `drain` event
onDrain() { this.writeBuffer.splice(0, this.prevBufferLen); // setting prevBufferLen = 0 is very important // for example, when upgrading, upgrade packet is sent over, // and a nonzero prevBufferLen could cause problems on `drain` this.prevBufferLen = 0; if (0 === this.writeBuffer.length) { this.emit("drain"); } else { this.flush(); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "onDrain() {\n this.writeBuffer.splice(0, this.prevBufferLen);\n // setting prevBufferLen = 0 is very important\n // for example, when upgrading, upgrade packet is sent over,\n // and a nonzero prevBufferLen could cause problems on `drain`\n this.prevBufferLen = 0;\n if (0 ...
[ "0.8247324", "0.8247324", "0.8173619", "0.8173619", "0.81596136", "0.77630365", "0.75937366", "0.75937366", "0.75937366", "0.75937366", "0.7451056", "0.74041635", "0.7384224", "0.7368941", "0.73628247", "0.73325115", "0.7316264", "0.7316264", "0.7316264", "0.7316264", "0.7316...
0.8281806
0
Called upon transport error
onError(err) { debug("socket error %j", err); Socket.priorWebsocketSuccess = false; this.emit("error", err); this.onClose("transport error", err); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function transportError(err) {\n this.emit('error', err, this.transport);\n }", "onTransportError() {\n if (this.status === _UAStatus.STATUS_USER_CLOSED) {\n return;\n }\n this.status = _UAStatus.STATUS_NOT_READY;\n }", "function forwardError (err) {\n\t clientReques...
[ "0.81600857", "0.75285035", "0.70201033", "0.68795127", "0.6867015", "0.6867015", "0.6867015", "0.6864234", "0.68166274", "0.68166274", "0.68166274", "0.68166274", "0.68166274", "0.68098766", "0.68098766", "0.6764993", "0.6764993", "0.6764993", "0.67597204", "0.6747688", "0.6...
0.67468596
22
Called upon transport close.
onClose(reason, desc) { if ("opening" === this.readyState || "open" === this.readyState || "closing" === this.readyState) { debug('socket close with reason: "%s"', reason); // clear timers clearTimeout(this.pingIntervalTimer); clearTimeout(this.pingTimeoutTimer); // stop event from firing again for transport this.transport.removeAllListeners("close"); // ensure transport won't stay open this.transport.close(); // ignore further transport communication this.transport.removeAllListeners(); if (typeof removeEventListener === "function") { removeEventListener("offline", this.offlineEventListener, false); } // set ready state this.readyState = "closed"; // clear session id this.id = null; // emit close event this.emit("close", reason, desc); // clean buffers after, so users can still // grab the buffers on `close` event this.writeBuffer = []; this.prevBufferLen = 0; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function closed () {\n delete self.transports[transportName]\n callback()\n }", "doClose() {\n const self = this;\n\n function close() {\n debug(\"writing close packet\");\n self.write([{ type: \"close\" }]);\n }\n\n if (\"open\" === this.readyState) {\n debu...
[ "0.84708756", "0.78021735", "0.7763885", "0.7763885", "0.77553374", "0.774528", "0.74054694", "0.7300703", "0.7067258", "0.7045535", "0.701875", "0.6964324", "0.687647", "0.68182486", "0.6804835", "0.6774911", "0.67689997", "0.67571044", "0.67571044", "0.6755574", "0.6740346"...
0.0
-1
this is an int
function clone(obj) { const o = {}; for (let i in obj) { if (obj.hasOwnProperty(i)) { o[i] = obj[i]; } } return o; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "get intValue() {}", "integer() {\n this.int = true;\n return this;\n }", "get valueInteger () {\r\n\t\treturn this.__valueInteger;\r\n\t}", "function o2ws_get_int() { return o2ws_get_int32(); }", "get valueInteger() {\n\t\treturn this.__valueInteger;\n\t}", "integer(txt){ \n var l...
[ "0.7386892", "0.67763585", "0.66849697", "0.6615927", "0.6587982", "0.6415983", "0.63550144", "0.63370776", "0.6284858", "0.62382734", "0.6212422", "0.6195806", "0.61783713", "0.6172717", "0.6172663", "0.61693823", "0.61388636", "0.61206925", "0.6090448", "0.6080745", "0.6067...
0.0
-1
Called with a decoded packet.
onPacket(packet) { this.emit("packet", packet); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "ondecoded(packet) {\n super.emit(\"packet\", packet);\n }", "ondecoded(packet) {\n super.emit(\"packet\", packet);\n }", "ondecoded(packet) {\n super.emit(\"packet\", packet);\n }", "ondecoded(packet) {\n this.emitReserved(\"packet\", packet);\n }", "ondecoded(pa...
[ "0.83742833", "0.83576876", "0.83576876", "0.8198985", "0.8152154", "0.7907196", "0.61136425", "0.6030843", "0.6030843", "0.5997337", "0.58481246", "0.5774652", "0.5508943", "0.5468239", "0.54551244", "0.5429483", "0.5420767", "0.53866976", "0.53487724", "0.53168094", "0.5245...
0.5908655
12
Polling transport polymorphic constructor. Decides on xhr vs jsonp based on feature detection.
function polling(opts) { let xhr; let xd = false; let xs = false; const jsonp = false !== opts.jsonp; if (typeof location !== "undefined") { const isSSL = "https:" === location.protocol; let port = location.port; // some user agents have empty `location.port` if (!port) { port = isSSL ? 443 : 80; } xd = opts.hostname !== location.hostname || port !== opts.port; xs = opts.secure !== isSSL; } opts.xdomain = xd; opts.xscheme = xs; xhr = new XMLHttpRequest(opts); if ("open" in xhr && !opts.forceJSONP) { return new XHR(opts); } else { if (!jsonp) throw new Error("JSONP disabled"); return new JSONP(opts); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function LongPollingTransport() {\n var _super = new org.cometd.LongPollingTransport();\n var that = org.cometd.Transport.derive(_super);\n\n that.xhrSend = function (packet) {\n return $.ajax({\n url: packet.url,\n async: packet.sync !== true,\n type: \"POST\",\n contentT...
[ "0.7308519", "0.7286786", "0.72286385", "0.72286385", "0.7202566", "0.7158869", "0.7158869", "0.7158869", "0.6479727", "0.64629453", "0.6436861", "0.6436861", "0.64278656", "0.64278656", "0.64278656", "0.6380751", "0.6380751", "0.6380751", "0.6380751", "0.6380751", "0.6377234...
0.6249667
26
JSONP only supports binary as base64 encoded strings
get supportsBinary() { return false; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function o(e){return\"/*# sourceMappingURL=data:application/json;charset=utf-8;base64,\"+btoa(unescape(encodeURIComponent(JSON.stringify(e))))+\" */\"}", "function n(e){return\"/*# sourceMappingURL=data:application/json;charset=utf-8;base64,\"+btoa(unescape(encodeURIComponent(JSON.stringify(e))))+\" */\"}", "b...
[ "0.625282", "0.62268007", "0.61209893", "0.606337", "0.5965628", "0.5958167", "0.5920079", "0.59061635", "0.5901631", "0.5882821", "0.5868579", "0.58586603", "0.58502734", "0.5822688", "0.57557434", "0.5703836", "0.5702308", "0.5700207", "0.569903", "0.56937516", "0.5677663",...
0.0
-1
Starts a poll cycle.
doPoll() { const script = document.createElement("script"); if (this.script) { this.script.parentNode.removeChild(this.script); this.script = null; } script.async = true; script.src = this.uri(); script.onerror = e => { this.onError("jsonp poll error", e); }; const insertAt = document.getElementsByTagName("script")[0]; if (insertAt) { insertAt.parentNode.insertBefore(script, insertAt); } else { (document.head || document.body).appendChild(script); } this.script = script; const isUAgecko = "undefined" !== typeof navigator && /gecko/i.test(navigator.userAgent); if (isUAgecko) { setTimeout(function () { const iframe = document.createElement("iframe"); document.body.appendChild(iframe); document.body.removeChild(iframe); }, 100); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "start() {\n // handle old polls\n if (this.pollHandle) {\n clearInterval(this.pollHandle);\n this.pollHandle = 0;\n }\n // start polling\n this.pollHandle = setInterval(this.poll, this.pollFrequency);\n }", "function startPolling() {\t\t\n\t\t// Don't a...
[ "0.76123863", "0.71895", "0.6874135", "0.6874135", "0.68717766", "0.66515064", "0.6592384", "0.6528441", "0.6434245", "0.6176149", "0.61074203", "0.61061406", "0.60509974", "0.6016126", "0.58066636", "0.58064574", "0.57810533", "0.5771464", "0.5704371", "0.5701902", "0.567942...
0.0
-1
Starts a poll cycle.
doPoll() { debug("xhr poll"); const req = this.request(); req.on("data", this.onData.bind(this)); req.on("error", err => { this.onError("xhr poll error", err); }); this.pollXhr = req; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "start() {\n // handle old polls\n if (this.pollHandle) {\n clearInterval(this.pollHandle);\n this.pollHandle = 0;\n }\n // start polling\n this.pollHandle = setInterval(this.poll, this.pollFrequency);\n }", "function startPolling() {\t\t\n\t\t// Don't a...
[ "0.76123863", "0.71895", "0.6874135", "0.6874135", "0.68717766", "0.66515064", "0.6592384", "0.6528441", "0.6434245", "0.6176149", "0.61074203", "0.61061406", "0.60509974", "0.6016126", "0.58066636", "0.58064574", "0.57810533", "0.5771464", "0.5704371", "0.5701902", "0.567942...
0.0
-1
Creates the XHR object and sends the request.
create() { const opts = pick(this.opts, "agent", "enablesXDR", "pfx", "key", "passphrase", "cert", "ca", "ciphers", "rejectUnauthorized", "autoUnref"); opts.xdomain = !!this.opts.xd; opts.xscheme = !!this.opts.xs; const xhr = this.xhr = new XMLHttpRequest(opts); try { debug("xhr open %s: %s", this.method, this.uri); xhr.open(this.method, this.uri, this.async); try { if (this.opts.extraHeaders) { xhr.setDisableHeaderCheck && xhr.setDisableHeaderCheck(true); for (let i in this.opts.extraHeaders) { if (this.opts.extraHeaders.hasOwnProperty(i)) { xhr.setRequestHeader(i, this.opts.extraHeaders[i]); } } } } catch (e) {} if ("POST" === this.method) { try { xhr.setRequestHeader("Content-type", "text/plain;charset=UTF-8"); } catch (e) {} } try { xhr.setRequestHeader("Accept", "*/*"); } catch (e) {} // ie6 check if ("withCredentials" in xhr) { xhr.withCredentials = this.opts.withCredentials; } if (this.opts.requestTimeout) { xhr.timeout = this.opts.requestTimeout; } if (this.hasXDR()) { xhr.onload = () => { this.onLoad(); }; xhr.onerror = () => { this.onError(xhr.responseText); }; } else { xhr.onreadystatechange = () => { if (4 !== xhr.readyState) return; if (200 === xhr.status || 1223 === xhr.status) { this.onLoad(); } else { // make sure the `error` event handler that's user-set // does not throw in the same tick and gets caught here setTimeout(() => { this.onError(typeof xhr.status === "number" ? xhr.status : 0); }, 0); } }; } debug("xhr data %s", this.data); xhr.send(this.data); } catch (e) { // Need to defer since .create() is called directly from the constructor // and thus the 'error' event can only be only bound *after* this exception // occurs. Therefore, also, we cannot throw here at all. setTimeout(() => { this.onError(e); }, 0); return; } if (typeof document !== "undefined") { this.index = Request.requestsCount++; Request.requests[this.index] = this; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "create() {\n const opts = (0, util_js_1.pick)(this.opts, \"agent\", \"pfx\", \"key\", \"passphrase\", \"cert\", \"ca\", \"ciphers\", \"rejectUnauthorized\", \"autoUnref\");\n opts.xdomain = !!this.opts.xd;\n opts.xscheme = !!this.opts.xs;\n const xhr = (this.xhr = new xmlhttprequest_js_...
[ "0.7162275", "0.7077175", "0.69760513", "0.69760513", "0.6852933", "0.6830658", "0.66991496", "0.668577", "0.66575855", "0.6622561", "0.65485585", "0.65437675", "0.6529103", "0.6523386", "0.64866996", "0.6481637", "0.6469967", "0.6469967", "0.6460935", "0.644697", "0.644549",...
0.7026445
2
Called upon successful response.
onSuccess() { this.emit("success"); this.cleanup(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function successHandler() {\n if (response.get_statusCode() == 200)\n onSuccess(response.get_body());\n else\n onError(response.get_body());\n }", "function handleSuccess( response ) {\n\t\t return( response.data.responseObject);\n\t\t }", ...
[ "0.74693984", "0.70926416", "0.69739425", "0.6914346", "0.6857608", "0.6819196", "0.6815287", "0.6815287", "0.67661136", "0.67661136", "0.67661136", "0.67448944", "0.67448944", "0.67448944", "0.6742008", "0.6737797", "0.6642669", "0.6600003", "0.6488967", "0.6475226", "0.6475...
0.0
-1
Called if we have data.
onData(data) { this.emit("data", data); this.onSuccess(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "setObjectDataLoaded() {\n this.hasDataLoaded.object = true\n if(this.hasDataLoaded.record === true) {\n this.handleWireDataLoaded();\n }\n }", "_doFetch() {\n\t\tthis.emit(\"needs_data\", this);\n\t}", "get hasData(){ return this._rawARData !== null }", "function requestDat...
[ "0.6899146", "0.6470858", "0.6272037", "0.6118044", "0.6094376", "0.6074078", "0.5948876", "0.5943965", "0.5921367", "0.58853835", "0.58749", "0.58749", "0.5873513", "0.58547103", "0.58515847", "0.5835468", "0.581973", "0.58135194", "0.58068866", "0.57939297", "0.5779331", ...
0.55478173
44
Check if it has XDomainRequest.
hasXDR() { return typeof XDomainRequest !== "undefined" && !this.xs && this.enablesXDR; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "hasXDR() {\n return typeof XDomainRequest !== \"undefined\" && !this.xs && this.enablesXDR;\n }", "function _valid_request(domain, root_domain){\n if (root_domain in _white_list){\n var domains = _white_list[root_domain];\n for (var i=0; i < domains.length; i++){\n if (domain....
[ "0.7625714", "0.60022146", "0.5885047", "0.57688653", "0.5668544", "0.56456864", "0.5582068", "0.54925877", "0.53818", "0.53818", "0.53818", "0.53818", "0.53818", "0.53818", "0.53818", "0.53818", "0.53818", "0.53818", "0.53818", "0.53818", "0.53818", "0.53818", "0.53818",...
0.7613765
3
Opens the socket (triggers polling). We write a PING message to determine when the transport is open.
doOpen() { this.poll(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "open() {\n let transport;\n if (this.opts.rememberUpgrade &&\n Socket.priorWebsocketSuccess &&\n this.transports.indexOf(\"websocket\") !== -1) {\n transport = \"websocket\";\n }\n else if (0 === this.transports.length) {\n // Emit error on ne...
[ "0.7640673", "0.7634848", "0.76204854", "0.76161873", "0.7608673", "0.7608673", "0.7334414", "0.73018736", "0.73018736", "0.7239802", "0.71913844", "0.71823084", "0.6942761", "0.69084346", "0.6855785", "0.67066973", "0.67041504", "0.6685705", "0.66050684", "0.65992165", "0.65...
0.6620185
20
Overloads onData to detect payloads.
onData(data) { debug("polling got data %s", data); const callback = packet => { // if its the first message we consider the transport open if ("opening" === this.readyState && packet.type === "open") { this.onOpen(); } // if its a close packet, we close the ongoing requests if ("close" === packet.type) { this.onClose(); return false; } // otherwise bypass onData and handle the message this.onPacket(packet); }; // decode payload parser.decodePayload(data, this.socket.binaryType).forEach(callback); // if an event did not trigger closing if ("closed" !== this.readyState) { // if we got data we're not polling this.polling = false; this.emit("pollComplete"); if ("open" === this.readyState) { this.poll(); } else { debug('ignoring poll - transport state "%s"', this.readyState); } } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "onData(data) {\n const callback = packet => {\n // if its the first message we consider the transport open\n if (\"opening\" === this.readyState && packet.type === \"open\") {\n this.onOpen();\n }\n // if its a close packet, we close the ongoing req...
[ "0.697258", "0.67780143", "0.67780143", "0.6709862", "0.67050457", "0.6701381", "0.6509037", "0.6490938", "0.64888304", "0.6423922", "0.64085513", "0.6369954", "0.63236326", "0.63236326", "0.63236326", "0.63065654", "0.6194526", "0.60783505", "0.6056878", "0.60295606", "0.589...
0.65636563
6
For polling, send a close packet.
doClose() { const close = () => { debug("writing close packet"); this.write([{ type: "close" }]); }; if ("open" === this.readyState) { debug("transport open - closing"); close(); } else { // in case we're trying to close while // handshaking is in progress (GH-164) debug("transport not open - deferring close"); this.once("open", close); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "doClose() {\n const self = this;\n\n function close() {\n debug(\"writing close packet\");\n self.write([{ type: \"close\" }]);\n }\n\n if (\"open\" === this.readyState) {\n debug(\"transport open - closing\");\n close();\n } else {\n // in case we're trying to close while\n...
[ "0.77094585", "0.77094585", "0.7688598", "0.7667976", "0.70320964", "0.6886", "0.6818271", "0.6818271", "0.68078834", "0.68016535", "0.6762174", "0.67345065", "0.6728473", "0.6640385", "0.66342425", "0.66342425", "0.6624417", "0.66060144", "0.6605341", "0.6602532", "0.6602532...
0.77702695
0
Generates uri for connection.
uri() { let query = this.query || {}; const schema = this.opts.secure ? "https" : "http"; let port = ""; // cache busting is forced if (false !== this.opts.timestampRequests) { query[this.opts.timestampParam] = yeast(); } if (!this.supportsBinary && !query.sid) { query.b64 = 1; } query = parseqs.encode(query); // avoid port if default for schema if (this.opts.port && ("https" === schema && Number(this.opts.port) !== 443 || "http" === schema && Number(this.opts.port) !== 80)) { port = ":" + this.opts.port; } // prepend ? to query if (query.length) { query = "?" + query; } const ipv6 = this.opts.hostname.indexOf(":") !== -1; return schema + "://" + (ipv6 ? "[" + this.opts.hostname + "]" : this.opts.hostname) + port + this.opts.path + query; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function gen_url (connection, collection) {\n\tvar config = connections.connections[connection];\n\tvar url = config.URI;\n\n\turl += '/' + config.orgName + '/' + config.appName + '/' + collection + '?';\n\n\treturn url;\n}", "uri() {\n let query = this.query || {};\n const schema = this.opts.secur...
[ "0.7223226", "0.7173111", "0.7164633", "0.6994125", "0.6994125", "0.698464", "0.6882258", "0.6877759", "0.6788025", "0.6628015", "0.6628015", "0.6620066", "0.6599762", "0.6552466", "0.6522966", "0.6422189", "0.63868827", "0.6358184", "0.62283826", "0.61361", "0.6063683", "0...
0.6565206
13
Adds event listeners to the socket
addEventListeners() { this.ws.onopen = () => { if (this.opts.autoUnref) { this.ws._socket.unref(); } this.onOpen(); }; this.ws.onclose = this.onClose.bind(this); this.ws.onmessage = ev => this.onData(ev.data); this.ws.onerror = e => this.onError("websocket error", e); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "_addEventListeners () {\n this._socket.on(ConnectionSocket.EVENT_ESTABLISHED, this._handleConnectionEstablished.bind(this))\n this._socket.on(ConnectionSocket.EVENT_CLOSED, this._handleConnnectionClosed.bind(this))\n this._socket.on(ConnectionSocket.EVENT_PEER_CONNECTED, this._handlePeerConnected.bind(thi...
[ "0.75131446", "0.7479154", "0.74326223", "0.74268484", "0.74268484", "0.73286813", "0.7311246", "0.71748644", "0.7126428", "0.70855176", "0.7031225", "0.69963765", "0.69505674", "0.69198656", "0.68633825", "0.68372756", "0.68357515", "0.68356156", "0.6687739", "0.6685014", "0...
0.7204242
7
Generates uri for connection.
uri() { let query = this.query || {}; const schema = this.opts.secure ? "wss" : "ws"; let port = ""; // avoid port if default for schema if (this.opts.port && ("wss" === schema && Number(this.opts.port) !== 443 || "ws" === schema && Number(this.opts.port) !== 80)) { port = ":" + this.opts.port; } // append timestamp to URI if (this.opts.timestampRequests) { query[this.opts.timestampParam] = yeast(); } // communicate binary support capabilities if (!this.supportsBinary) { query.b64 = 1; } query = parseqs.encode(query); // prepend ? to query if (query.length) { query = "?" + query; } const ipv6 = this.opts.hostname.indexOf(":") !== -1; return schema + "://" + (ipv6 ? "[" + this.opts.hostname + "]" : this.opts.hostname) + port + this.opts.path + query; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function gen_url (connection, collection) {\n\tvar config = connections.connections[connection];\n\tvar url = config.URI;\n\n\turl += '/' + config.orgName + '/' + config.appName + '/' + collection + '?';\n\n\treturn url;\n}", "uri() {\n let query = this.query || {};\n const schema = this.opts.secur...
[ "0.7223226", "0.7173111", "0.7164633", "0.6994125", "0.6994125", "0.698464", "0.6882258", "0.6788025", "0.6628015", "0.6628015", "0.6620066", "0.6599762", "0.6565206", "0.6552466", "0.6522966", "0.6422189", "0.63868827", "0.6358184", "0.62283826", "0.61361", "0.6063683", "0...
0.6877759
7
Copyright 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. Mostly taken from ReactPropTypes.
function createChainableTypeChecker(validate) { function checkType(isRequired, props, propName, componentName, location, propFullName) { var componentNameSafe = componentName || '<<anonymous>>'; var propFullNameSafe = propFullName || propName; if (props[propName] == null) { if (isRequired) { return new Error('Required ' + location + ' `' + propFullNameSafe + '` was not specified ' + ('in `' + componentNameSafe + '`.')); } return null; } for (var _len = arguments.length, args = Array(_len > 6 ? _len - 6 : 0), _key = 6; _key < _len; _key++) { args[_key - 6] = arguments[_key]; } return validate.apply(undefined, [props, propName, componentNameSafe, location, propFullNameSafe].concat(args)); } var chainedCheckType = checkType.bind(null, false); chainedCheckType.isRequired = checkType.bind(null, true); return chainedCheckType; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "static get propTypes() {\n return {\n config: React.PropTypes.object,\n test: React.PropTypes.string,\n };\n }", "function isReactPropTypes(path) {\n return (\n (path.node.object.type === 'MemberExpression' &&\n path.node.object.object &&\n path.node.object.object.name ==...
[ "0.69605863", "0.67468566", "0.6628833", "0.6464124", "0.6229379", "0.6206012", "0.6206012", "0.6206012", "0.6206012", "0.6206012", "0.6206012", "0.6206012", "0.6206012", "0.6206012", "0.6206012", "0.60928804", "0.60928804", "0.60928804", "0.60928804", "0.60928804", "0.609288...
0.0
-1
Expose a method for transforming tokens into the path function.
function tokensToFunction(tokens, options) { // Compile all the tokens into regexps. var matches = new Array(tokens.length); // Compile all the patterns before compilation. for (var i = 0; i < tokens.length; i++) { if (typeof tokens[i] === 'object') { matches[i] = new RegExp('^(?:' + tokens[i].pattern + ')$', flags(options)); } } return function (obj, opts) { var path = ''; var data = obj || {}; var options = opts || {}; var encode = options.pretty ? encodeURIComponentPretty : encodeURIComponent; for (var i = 0; i < tokens.length; i++) { var token = tokens[i]; if (typeof token === 'string') { path += token; continue; } var value = data[token.name]; var segment; if (value == null) { if (token.optional) { // Prepend partial segment prefixes. if (token.partial) { path += token.prefix; } continue; } else { throw new TypeError('Expected "' + token.name + '" to be defined'); } } if (isarray(value)) { if (!token.repeat) { throw new TypeError('Expected "' + token.name + '" to not repeat, but received `' + JSON.stringify(value) + '`'); } if (value.length === 0) { if (token.optional) { continue; } else { throw new TypeError('Expected "' + token.name + '" to not be empty'); } } for (var j = 0; j < value.length; j++) { segment = encode(value[j]); if (!matches[i].test(segment)) { throw new TypeError('Expected all "' + token.name + '" to match "' + token.pattern + '", but received `' + JSON.stringify(segment) + '`'); } path += (j === 0 ? token.prefix : token.delimiter) + segment; } continue; } segment = token.asterisk ? encodeAsterisk(value) : encode(value); if (!matches[i].test(segment)) { throw new TypeError('Expected "' + token.name + '" to match "' + token.pattern + '", but received "' + segment + '"'); } path += token.prefix + segment; } return path; }; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function tokensToFunction (tokens) {\n // Compile all the tokens into regexps.\n const matches = new Array(tokens.length)\n\n // Compile all the patterns before compilation.\n for (let i = 0; i < tokens.length; i++) {\n if (typeof tokens[i] === 'object') {\n matches[i] = new RegExp('^...
[ "0.6186804", "0.6011498", "0.5988314", "0.59863955", "0.59863955", "0.59863955", "0.59863955", "0.59863955", "0.59863955", "0.59597945", "0.59597945", "0.59597945", "0.59597945", "0.59597945", "0.59275687", "0.5921299", "0.5902797", "0.5896205", "0.5896205", "0.5896205", "0.5...
0.0
-1
Try/catch helper to minimize deoptimizations. Returns a completion record like context.tryEntries[i].completion. This interface could have been (and was previously) designed to take a closure to be invoked without arguments, but in all the cases we care about we already have an existing method we want to call, so there's no need to create a new function object. We can even get away with assuming the method takes exactly one argument, since that happens to be true in every case, so we don't have to touch the arguments object. The only additional allocation required is the completion record, which has a stable shape and so hopefully should be cheap to allocate.
function tryCatch(fn, obj, arg) { try { return { type: "normal", arg: fn.call(obj, arg) }; } catch (err) { return { type: "throw", arg: err }; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function tryCatch(fn, obj, arg) { // 59\n try { // 60\n return { type: \"normal\", arg: fn.call(obj, arg) }; ...
[ "0.5071653", "0.5061426", "0.48501745", "0.479296", "0.479296", "0.479296", "0.479296", "0.479296", "0.47842094", "0.47842094", "0.4706789", "0.4688443", "0.4669041", "0.46566677", "0.46566677", "0.46566677", "0.46548957", "0.46371785", "0.46227673", "0.4615054", "0.4615054",...
0.0
-1
Dummy constructor functions that we use as the .constructor and .constructor.prototype properties for functions that return Generator objects. For full spec compliance, you may wish to configure your minifier not to mangle the names of these two functions.
function Generator() {}
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function tempCtor() {}", "function temporaryConstructor() {}", "function TempCtor() {}", "function TempCtor() {}", "function TempCtor() {}", "function TempCtor() {}", "function TempCtor() {}", "function TempCtor() {}", "function HelperConstructor() {}", "function DummyClass() {\r\n // ...
[ "0.72171277", "0.7024035", "0.6951186", "0.6951186", "0.6951186", "0.6951186", "0.6951186", "0.6951186", "0.6759808", "0.6600548", "0.6570523", "0.6570523", "0.6570523", "0.6484547", "0.6442678", "0.6399644", "0.639223", "0.63782364", "0.63782364", "0.6336881", "0.6275807", ...
0.0
-1
Helper for defining the .next, .throw, and .return methods of the Iterator interface in terms of a single ._invoke method.
function defineIteratorMethods(prototype) { ["next", "throw", "return"].forEach(function (method) { define(prototype, method, function (arg) { return this._invoke(method, arg); }); }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function defineIteratorMethods(prototype){[\"next\",\"throw\",\"return\"].forEach(function(method){prototype[method]=function(arg){return this._invoke(method,arg);};});}", "function defineIteratorMethods(prototype){[\"next\",\"throw\",\"return\"].forEach(function(method){prototype[method]=function(arg){return th...
[ "0.7480683", "0.7480683", "0.7480683", "0.7480683", "0.7480683", "0.7480683", "0.7178389", "0.6994433", "0.6994433", "0.6972576", "0.6966516", "0.6966516", "0.6966516", "0.6966516", "0.6966516", "0.6966516", "0.6966516", "0.6966516", "0.6966516", "0.6966516", "0.6966516", "...
0.0
-1
Starts trying to reconnect if reconnection is enabled and we have not started reconnecting yet
maybeReconnectOnOpen() { // Only try to reconnect if it's the first time we're connecting if (!this._reconnecting && this._reconnection && this.backoff.attempts === 0) { // keeps reconnection from firing twice for the same reconnection loop this.reconnect(); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "attemptReconnect(resetAndReconnect = true) {\n ConnectionManager.reconnect(resetAndReconnect);\n }", "function reconnect() {\n\n\tconsole.log(\"Reconnect called\");\n\t// Make sure there is not another reconnect attempt in progress (and that we are really not connected)\n\tif(active911.timer_controller.exist...
[ "0.78976095", "0.7827285", "0.77504957", "0.7675659", "0.766561", "0.766561", "0.766561", "0.76577926", "0.7627878", "0.75349", "0.75091213", "0.74362236", "0.73924994", "0.73695177", "0.7339763", "0.7310562", "0.7304469", "0.7269702", "0.7234667", "0.70140994", "0.70027554",...
0.78232354
2
Called upon transport open.
onopen() { debug("open"); // clear old subs this.cleanup(); // mark as open this._readyState = "open"; this.emitReserved("open"); // add new subs const socket = this.engine; this.subs.push(on_1.on(socket, "ping", this.onping.bind(this)), on_1.on(socket, "data", this.ondata.bind(this)), on_1.on(socket, "error", this.onerror.bind(this)), on_1.on(socket, "close", this.onclose.bind(this)), on_1.on(this.decoder, "decoded", this.ondecoded.bind(this))); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "onopen() {\n debug(\"transport is open - connecting\");\n if (typeof this.auth == \"function\") {\n this.auth((data) => {\n this.packet({ type: dist.PacketType.CONNECT, data });\n });\n }\n else {\n this.packet({ type: dist...
[ "0.7343769", "0.7301768", "0.7301768", "0.72755814", "0.69748294", "0.6871645", "0.67919064", "0.6669136", "0.6636399", "0.6636399", "0.6511857", "0.6488991", "0.6443836", "0.64396596", "0.64396596", "0.64012074", "0.6347581", "0.63349086", "0.6322032", "0.6322032", "0.625814...
0.60273004
32
Called upon a ping.
onping() { this.emitReserved("ping"); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "onping() {\n this.emitReserved(\"ping\");\n }", "onping() {\n this.emitReserved(\"ping\");\n }", "ping(){\n\t\tLogger.debug(`Message with ping request being responded to by pong...`);\n\t\tthis.send('pong', Global.mac);\n\t}", "onping() {\n super.emit(\"ping\");\n }", "onping(...
[ "0.776418", "0.776418", "0.7735137", "0.7547586", "0.7547586", "0.74601215", "0.74397814", "0.74303377", "0.74279314", "0.7378363", "0.73283696", "0.717668", "0.7074319", "0.7053587", "0.69453806", "0.6942994", "0.68753606", "0.6821996", "0.6817834", "0.68038607", "0.6657586"...
0.7597325
3
Called when parser fully decodes a packet.
ondecoded(packet) { this.emitReserved("packet", packet); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "ondecoded(packet) {\n super.emit(\"packet\", packet);\n }", "ondecoded(packet) {\n super.emit(\"packet\", packet);\n }", "ondecoded(packet) {\n super.emit(\"packet\", packet);\n }", "ondecoded(packet) {\n this.emitReserved(\"packet\", packet);\n }", "ondecoded(pa...
[ "0.73792654", "0.73680985", "0.73680985", "0.72189546", "0.7212638", "0.55667466", "0.547574", "0.53708714", "0.527848", "0.52459073", "0.52459073", "0.5207613", "0.51701874", "0.51682156", "0.5150683", "0.51230115", "0.5122873", "0.5114787", "0.51105845", "0.5079545", "0.507...
0.7171507
5
Called upon socket error.
onerror(err) { debug("error", err); this.emitReserved("error", err); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function onSocketError(err) {\n let data = _data.get(this);\n\n data.error = err;\n\n _data.set(this, data);\n}", "function error(err, socket) {\n socket.emit(\"err\", err);\n console.log(new Error(err));\n}", "function socketError () {\n\t this.destroy();\n\t}", "function socketError () {\n\t this.de...
[ "0.78520536", "0.7548801", "0.7517081", "0.7517081", "0.7487335", "0.7466298", "0.74459034", "0.74459034", "0.74459034", "0.7421493", "0.7313251", "0.72387755", "0.72054595", "0.7200901", "0.71788555", "0.71788555", "0.71626854", "0.7107387", "0.7104195", "0.70971036", "0.708...
0.0
-1
Called upon a socket close.
_destroy(socket) { const nsps = Object.keys(this.nsps); for (const nsp of nsps) { const socket = this.nsps[nsp]; if (socket.active) { debug("socket %s is still active, skipping close", nsp); return; } } this._close(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "onClose() {\n this._closeSocket(constants_1.ERRORS.SocketClosed);\n }", "disconnect() { socket_close(this) }", "function onclose () {\n\t onerror('socket closed');\n\t }", "function onclose () {\n\t onerror('socket closed');\n\t }", "function onclose () {\n\t onerror('socket closed');\...
[ "0.823854", "0.8168456", "0.8166392", "0.8166392", "0.8166392", "0.8166392", "0.8166392", "0.80692065", "0.8069015", "0.8069015", "0.8069015", "0.8069015", "0.8069015", "0.8069015", "0.8069015", "0.8069015", "0.80582476", "0.8039217", "0.8039217", "0.8021011", "0.800893", "...
0.0
-1
Clean up transport subscriptions and packet buffer.
cleanup() { debug("cleanup"); this.subs.forEach(subDestroy => subDestroy()); this.subs.length = 0; this.decoder.destroy(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "cleanup() {\n this.subs.forEach((subDestroy) => subDestroy());\n this.subs.length = 0;\n this.decoder.destroy();\n }", "cleanup() {\n debug(\"cleanup\");\n this.subs.forEach((subDestroy) => subDestroy());\n this.subs.length = 0;\n this.decoder.destroy();\n }...
[ "0.7355705", "0.73198074", "0.73198074", "0.71959114", "0.7179587", "0.70700294", "0.7043185", "0.70044434", "0.6980398", "0.6980398", "0.6980398", "0.6980398", "0.6980398", "0.69799715", "0.69799715", "0.69799715", "0.69799715", "0.69799715", "0.69799715", "0.69799715", "0.6...
0.7227625
3
Close the current socket.
_close() { debug("disconnect"); this.skipReconnect = true; this._reconnecting = false; if ("opening" === this._readyState) { // `onclose` will not fire because // an open event never happened this.cleanup(); } this.backoff.reset(); this._readyState = "closed"; if (this.engine) this.engine.close(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "close() {\n if (this.socket) this.socket.destroy();\n }", "close (socket) {\r\n if (socket.target) {\r\n socket.target.close();\r\n }\r\n socket.close();\r\n this._sockets[socket.id] = null;\r\n }", "socketClose() {\n console.log('sock close');\n\n GlobalVars.reset();\...
[ "0.81200373", "0.7721045", "0.77195907", "0.7671094", "0.7618793", "0.7451911", "0.7407919", "0.7257038", "0.7208258", "0.70691717", "0.70691717", "0.70691717", "0.7035647", "0.7035647", "0.6994768", "0.6994768", "0.6962962", "0.6955681", "0.6955681", "0.69285816", "0.6918680...
0.0
-1
Called upon engine close.
onclose(reason) { debug("onclose"); this.cleanup(); this.backoff.reset(); this._readyState = "closed"; this.emitReserved("close", reason); if (this._reconnection && !this.skipReconnect) { this.reconnect(); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "_close() {\n this.skipReconnect = true;\n this._reconnecting = false;\n this.onclose(\"forced close\");\n if (this.engine)\n this.engine.close();\n }", "onClose() {\n\t\t}", "_close() {\n debug(\"disconnect\");\n this.skipReconnect = true;\n this._...
[ "0.7245429", "0.71433264", "0.7057358", "0.68012583", "0.68012583", "0.6720794", "0.6646946", "0.6622437", "0.6598121", "0.6595858", "0.65648824", "0.6460574", "0.64204776", "0.6418652", "0.6418652", "0.6412957", "0.6403186", "0.63874286", "0.6387089", "0.63693917", "0.636633...
0.0
-1
Called upon successful reconnect.
onreconnect() { const attempt = this.backoff.attempts; this._reconnecting = false; this.backoff.reset(); this.emitReserved("reconnect", attempt); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "async _reconnect() {\n await this._waitBackgroundConnect();\n await this._connect();\n }", "reconnect() {\n this.connectionManager.reconnect();\n }", "function onReconnect() {\n emitHello();\n $log.log(\"monitor is reconnected\");\n }", "reconnect() {\n ...
[ "0.7635908", "0.7592526", "0.75271463", "0.74548393", "0.740412", "0.7370118", "0.7364767", "0.7364767", "0.73642075", "0.72689104", "0.7248326", "0.7234352", "0.7226426", "0.7206959", "0.71837294", "0.7111254", "0.7067534", "0.7058101", "0.6999292", "0.6984575", "0.6908057",...
0.7363662
9
Subscribe to open, close and packet events
subEvents() { if (this.subs) return; const io = this.io; this.subs = [on_1.on(io, "open", this.onopen.bind(this)), on_1.on(io, "packet", this.onpacket.bind(this)), on_1.on(io, "error", this.onerror.bind(this)), on_1.on(io, "close", this.onclose.bind(this))]; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "subEvents() {\n if (this.subs)\n return;\n const io = this.io;\n this.subs = [\n on(io, \"open\", this.onopen.bind(this)),\n on(io, \"packet\", this.onpacket.bind(this)),\n on(io, \"error\", this.onerror.bind(this)),\n on(io, \"close\", th...
[ "0.73237157", "0.7254929", "0.72468", "0.7221486", "0.718474", "0.71351457", "0.71309495", "0.71125484", "0.7076456", "0.6761499", "0.6736577", "0.6460867", "0.6313735", "0.6308095", "0.6271258", "0.6154106", "0.61204135", "0.60877234", "0.6078979", "0.60705215", "0.59825456"...
0.70583206
9
Whether the Socket will try to reconnect when its Manager connects or reconnects
get active() { return !!this.subs; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "maybeReconnectOnOpen() {\n // Only try to reconnect if it's the first time we're connecting\n if (!this._reconnecting && this._reconnection && this.backoff.attempts === 0) {\n // keeps reconnection from firing twice for the same reconnection loop\n this.reconnect();\n }\n }", "maybeReconnectO...
[ "0.7151596", "0.70292515", "0.70292515", "0.70292515", "0.702447", "0.70179117", "0.69970465", "0.6790252", "0.6711622", "0.6711497", "0.66968596", "0.66409576", "0.66295606", "0.6627513", "0.6609298", "0.65415686", "0.6524716", "0.65166223", "0.6496915", "0.63725656", "0.636...
0.0
-1
Sends a `message` event.
send(...args) { args.unshift("message"); this.emit.apply(this, args); return this; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function SendMessage(message)\n{\n client.sendEvent(new Message(JSON.stringify(message))); //, printResultFor(\"send\"));\n}", "sendMessage(message) {\n self.socket.emit('message', message);\n }", "sendMessage(message) {\n this.socket.emit('message', message);\n }", "function sendMessage(message) ...
[ "0.7677966", "0.75148445", "0.73375595", "0.7331411", "0.7328179", "0.7297612", "0.7280864", "0.7263806", "0.7254172", "0.72407025", "0.7212112", "0.71970236", "0.71746325", "0.71495134", "0.7113005", "0.7102047", "0.70754313", "0.7006708", "0.6990754", "0.6917797", "0.690915...
0.0
-1
Override `emit`. If the event is in `events`, it's emitted normally.
emit(ev, ...args) { if (RESERVED_EVENTS.hasOwnProperty(ev)) { throw new Error('"' + ev + '" is a reserved event name'); } args.unshift(ev); const packet = { type: socket_io_parser_1.PacketType.EVENT, data: args }; packet.options = {}; packet.options.compress = this.flags.compress !== false; // event ack callback if ("function" === typeof args[args.length - 1]) { debug("emitting packet with ack id %d", this.ids); this.acks[this.ids] = args.pop(); packet.id = this.ids++; } const isTransportWritable = this.io.engine && this.io.engine.transport && this.io.engine.transport.writable; const discardPacket = this.flags.volatile && (!isTransportWritable || !this.connected); if (discardPacket) { debug("discard packet as the transport is not currently writable"); } else if (this.connected) { this.packet(packet); } else { this.sendBuffer.push(packet); } this.flags = {}; return this; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function emit(self, eventName) { self.emit(eventName); }", "emit() {\n if (this.active) {\n super.emit.apply(this, arguments);\n } else {\n this.emits.push(arguments);\n }\n }", "emit(...args) {\n this._event_dispatcher.$emit(...args);\n }", "emitEvent(type, event) {\n this.emi...
[ "0.71419877", "0.6873362", "0.6856954", "0.6856177", "0.68205065", "0.6762024", "0.6637402", "0.6626966", "0.66229755", "0.6615304", "0.6503729", "0.6473271", "0.6472541", "0.64717585", "0.6436068", "0.6431107", "0.63417286", "0.633171", "0.62871623", "0.6185921", "0.618311",...
0.63463193
16
Called upon engine `open`.
onopen() { debug("transport is open - connecting"); if (typeof this.auth == "function") { this.auth(data => { this.packet({ type: socket_io_parser_1.PacketType.CONNECT, data }); }); } else { this.packet({ type: socket_io_parser_1.PacketType.CONNECT, data: this.auth }); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "onOpen() {\n\t\t}", "onOpen() { }", "open () {\n super.open();\n }", "open() {\n this._open();\n }", "function onOpen(e)\n{\n init();\n}", "_onOpen(doc) {\r\n if (doc.languageId !== 'python') {\r\n return;\r\n }\r\n let params = { processId: process.pid...
[ "0.7267958", "0.68602115", "0.6464908", "0.62442505", "0.6236251", "0.6223333", "0.62199444", "0.62199444", "0.6161312", "0.61048317", "0.6081943", "0.60552484", "0.60498405", "0.6049197", "0.600314", "0.600314", "0.5987324", "0.5987324", "0.5966099", "0.594745", "0.59190387"...
0.0
-1
Called upon engine or manager `error`.
onerror(err) { if (!this.connected) { this.emitReserved("connect_error", err); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "error(error) {\n this.__processEvent('error', error);\n }", "error(error) {}", "onerror(err) {\n debug(\"error\", err);\n super.emit(\"error\", err);\n }", "onerror(err) {\n debug(\"error\", err);\n super.emit(\"error\", err);\n }", "onerror(err) {\n d...
[ "0.7346488", "0.6861143", "0.6852798", "0.6785682", "0.6785682", "0.67207766", "0.67157733", "0.66260445", "0.66077554", "0.6580212", "0.6576525", "0.65751517", "0.65744984", "0.6573179", "0.6557817", "0.65537924", "0.65387547", "0.65302175", "0.64988047", "0.6496039", "0.649...
0.0
-1
Called upon engine `close`.
onclose(reason) { debug("close (%s)", reason); this.connected = false; this.disconnected = true; delete this.id; this.emitReserved("disconnect", reason); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "_close() {\n this.skipReconnect = true;\n this._reconnecting = false;\n this.onclose(\"forced close\");\n if (this.engine)\n this.engine.close();\n }", "_close() {\n debug(\"disconnect\");\n this.skipReconnect = true;\n this._reconnecting = false;\n ...
[ "0.7500916", "0.7228282", "0.7206464", "0.71972764", "0.71972764", "0.7087051", "0.67953855", "0.672078", "0.6709728", "0.6709728", "0.6626636", "0.66029567", "0.6586244", "0.656277", "0.6556234", "0.6552788", "0.6535173", "0.65098417", "0.650257", "0.6472451", "0.6454491", ...
0.0
-1
Called with socket packet.
onpacket(packet) { const sameNamespace = packet.nsp === this.nsp; if (!sameNamespace) return; switch (packet.type) { case socket_io_parser_1.PacketType.CONNECT: if (packet.data && packet.data.sid) { const id = packet.data.sid; this.onconnect(id); } else { this.emitReserved("connect_error", new Error("It seems you are trying to reach a Socket.IO server in v2.x with a v3.x client, but they are not compatible (more information here: https://socket.io/docs/v3/migrating-from-2-x-to-3-0/)")); } break; case socket_io_parser_1.PacketType.EVENT: this.onevent(packet); break; case socket_io_parser_1.PacketType.BINARY_EVENT: this.onevent(packet); break; case socket_io_parser_1.PacketType.ACK: this.onack(packet); break; case socket_io_parser_1.PacketType.BINARY_ACK: this.onack(packet); break; case socket_io_parser_1.PacketType.DISCONNECT: this.ondisconnect(); break; case socket_io_parser_1.PacketType.CONNECT_ERROR: const err = new Error(packet.data.message); // @ts-ignore err.data = packet.data.data; this.emitReserved("connect_error", err); break; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "onPacket(packet) {\n this.emit(\"packet\", packet);\n }", "onPacket(packet) {\n this.emit(\"packet\", packet);\n }", "onPacket(packet) {\n this.emit(\"packet\", packet);\n }", "onPacket(packet) {\n this.emit(\"packet\", packet);\n }", "onPacket(packet) {\n super.emit(\"packet\", ...
[ "0.7551261", "0.74785894", "0.74785894", "0.74785894", "0.74427253", "0.7349582", "0.73271525", "0.729503", "0.729503", "0.7290821", "0.72262466", "0.72262466", "0.71575254", "0.6818126", "0.67296445", "0.67188483", "0.66421485", "0.66095036", "0.63366735", "0.6272093", "0.62...
0.6698802
16
Called upon a server event.
onevent(packet) { const args = packet.data || []; debug("emitting event %j", args); if (null != packet.id) { debug("attaching ack callback to event"); args.push(this.ack(packet.id)); } if (this.connected) { this.emitEvent(args); } else { this.receiveBuffer.push(Object.freeze(args)); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function HttpSentEvent() { }", "function HttpSentEvent() { }", "function HttpSentEvent() { }", "ServerCallback() {\n\n }", "function handleServerRequest()\n{\n\t//send data to the div or html element for notifications\n}", "function onEvent(event){\n\n switch(event.type){\n\n case 'CONNECTED':\n ...
[ "0.7054478", "0.7054478", "0.7054478", "0.6991791", "0.69816613", "0.69636124", "0.69308937", "0.69308937", "0.68481964", "0.65922594", "0.659124", "0.6563248", "0.6563248", "0.6563248", "0.64499706", "0.6417641", "0.63800436", "0.63800436", "0.63251776", "0.63251776", "0.628...
0.0
-1
Produces an ack callback to emit with an event.
ack(id) { const self = this; let sent = false; return function (...args) { // prevent double callbacks if (sent) return; sent = true; debug("sending ack %j", args); self.packet({ type: socket_io_parser_1.PacketType.ACK, id: id, data: args }); }; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "ack(id) {\n const self = this;\n let sent = false;\n return function (...args) {\n // prevent double callbacks\n if (sent)\n return;\n sent = true;\n debug(\"sending ack %j\", args);\n self.packet({\n type: so...
[ "0.6723864", "0.6723864", "0.6637715", "0.63410074", "0.6321067", "0.62284005", "0.6210286", "0.61519814", "0.61519814", "0.5999861", "0.5871506", "0.57802236", "0.5758691", "0.57207406", "0.57207406", "0.56145823", "0.5605704", "0.55522174", "0.55365825", "0.54450524", "0.53...
0.6820758
0
Called upon a server acknowlegement.
onack(packet) { const ack = this.acks[packet.id]; if ("function" === typeof ack) { debug("calling ack %s with %j", packet.id, packet.data); ack.apply(this, packet.data); delete this.acks[packet.id]; } else { debug("bad ack %s", packet.id); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function ack() {\n Twibble.sendMessage();\n }", "function onHelloAck() {\n disconnected.value = false;\n self.disconnected = disconnected.value;\n $log.log('(Hello:ack) monitor is connected');\n }", "onack(packet) {\n const ack = this.acks[packet.id];\...
[ "0.6818837", "0.6449511", "0.63143164", "0.62949145", "0.6186926", "0.6186926", "0.61520237", "0.61520237", "0.61520237", "0.6060652", "0.6014214", "0.6014214", "0.60119325", "0.5985348", "0.5880019", "0.58117795", "0.5749443", "0.56953895", "0.5670078", "0.56513417", "0.5648...
0.62665045
4
Called upon server connect.
onconnect(id) { debug("socket connected with id %s", id); this.id = id; this.connected = true; this.disconnected = false; this.emitBuffered(); this.emitReserved("connect"); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function onConnect() {\n\t\tconsole.log(\"@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@connect\");\n\t}", "function onConnect() {\n // Once a connection has been made, make a subscription and send a message.\n console.log(\"onConnect\");\n client.subscribe(SUBSCRIBER);\n }", "...
[ "0.72508335", "0.7236416", "0.72278905", "0.72005546", "0.7177443", "0.7077179", "0.7065388", "0.7045901", "0.7017169", "0.7001419", "0.7001419", "0.7001419", "0.6943829", "0.69241816", "0.6924022", "0.6920274", "0.6913959", "0.6897356", "0.68920887", "0.6889454", "0.687537",...
0.65961933
45
Emit buffered events (received and emitted).
emitBuffered() { this.receiveBuffer.forEach(args => this.emitEvent(args)); this.receiveBuffer = []; this.sendBuffer.forEach(packet => this.packet(packet)); this.sendBuffer = []; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "emitBuffered() {\n this.receiveBuffer.forEach((args) => this.emitEvent(args));\n this.receiveBuffer = [];\n this.sendBuffer.forEach((packet) => {\n this.notifyOutgoingListeners(packet);\n this.packet(packet);\n });\n this.sendBuffer = [];\n }", "emitBuf...
[ "0.81823784", "0.8137464", "0.8137464", "0.8026419", "0.7090655", "0.6554891", "0.64418477", "0.62802976", "0.6275241", "0.6170106", "0.60873294", "0.5932964", "0.5926397", "0.5884234", "0.5846472", "0.5810155", "0.578966", "0.578966", "0.57637584", "0.5746689", "0.5746689", ...
0.8205933
0
Called upon server disconnect.
ondisconnect() { debug("server disconnect (%s)", this.nsp); this.destroy(); this.onclose("io server disconnect"); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "ondisconnect() {\n debug(\"server disconnect (%s)\", this.nsp);\n this.destroy();\n this.onclose(\"io server disconnect\");\n }", "ondisconnect() {\n debug(\"server disconnect (%s)\", this.nsp);\n this.destroy();\n this.onclose(\"io server disconnect\");\n }", "o...
[ "0.82543766", "0.82543766", "0.81796277", "0.79097027", "0.78504634", "0.7839723", "0.7777871", "0.77664375", "0.7764524", "0.7764524", "0.7764524", "0.7764524", "0.7650259", "0.7625111", "0.7618517", "0.7608362", "0.75884503", "0.7566464", "0.7566464", "0.7566464", "0.751219...
0.8121433
3
Called upon forced client/server side disconnections, this method ensures the manager stops tracking us and that reconnections don't get triggered for this.
destroy() { if (this.subs) { // clean subscriptions to avoid reconnections this.subs.forEach(subDestroy => subDestroy()); this.subs = undefined; } this.io["_destroy"](this); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "async disconnect() {\n if (this._updateInvalidatedAccessories) { // Should come first, as other operations might take some time.\n clearInterval(this._updateInvalidatedAccessories);\n this._updateStatuses = undefined;\n }\n\n if (this._db) {\n this._db.close();...
[ "0.7214315", "0.71876174", "0.71756774", "0.71052796", "0.7000674", "0.68662506", "0.67221314", "0.6720398", "0.66435707", "0.6555484", "0.6555079", "0.6551591", "0.6523721", "0.65167284", "0.65046006", "0.65046006", "0.64748776", "0.6474865", "0.6471373", "0.6470799", "0.644...
0.0
-1
Disconnects the socket manually.
disconnect() { if (this.connected) { debug("performing disconnect (%s)", this.nsp); this.packet({ type: socket_io_parser_1.PacketType.DISCONNECT }); } // remove socket from pool this.destroy(); if (this.connected) { // fire events this.onclose("io client disconnect"); } return this; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "disconnect() { socket_close(this) }", "disconnect() {\n if (this.proto == 'tcp') {\n this._api.disconnect(this.socketId);\n }\n }", "disconnect() {\n\t\tthis.debug('disconnect');\n\t\tif(!this._socket) return;\n\n\t\tif(this._reconnectTimer) {\n\t\t\tclearTimeout(this._reconnectTimer);\n\t\t\tthis....
[ "0.827323", "0.81174034", "0.79788846", "0.7726539", "0.75119656", "0.7423343", "0.73787034", "0.7378272", "0.7330927", "0.7217453", "0.72004706", "0.7185145", "0.7185145", "0.7185145", "0.7185145", "0.7184539", "0.71643335", "0.71437883", "0.71360177", "0.7108773", "0.705256...
0.70985806
20
Sets the compress flag.
compress(compress) { this.flags.compress = compress; return this; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "compress(compress) {\n this.flags.compress = compress;\n return this;\n }", "compress(compress) {\n this.flags.compress = compress;\n return this;\n }", "compress(compress) {\n this.flags.compress = compress;\n return this;\n }", "compress(compress) {\...
[ "0.7773767", "0.7638622", "0.7638622", "0.7638622", "0.6975546", "0.65287226", "0.6496418", "0.62764674", "0.59876275", "0.58504254", "0.5814126", "0.5755006", "0.57215875", "0.57215875", "0.56853396", "0.5651306", "0.56130254", "0.55274165", "0.548731", "0.5386694", "0.53726...
0.76612735
1
Sets a modifier for a subsequent event emission that the event message will be dropped when this socket is not ready to send messages.
get volatile() { this.flags.volatile = true; return this; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "_onWrite () {\n this._decrementSendingMessageCounter()\n }", "function booDJ(e) {\n\tsocket.emit('boo', {\n\t});\n}", "function notWritting() {\n socket.emit('notWritting', pseudo);\n}", "off() { \n socket.emit('DIGITAL', { index: this.index, method: 'off' });\n }", "get modifier () {\n\t\tr...
[ "0.53213316", "0.51675457", "0.5094644", "0.49930617", "0.49484786", "0.49484786", "0.4909046", "0.49018613", "0.4829934", "0.4804517", "0.4799589", "0.479008", "0.47875354", "0.47875354", "0.47791758", "0.47742686", "0.4771477", "0.47521865", "0.47467953", "0.47467953", "0.4...
0.0
-1