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
Build an API or Chart "service" URL.
function build_url(type, api, req) { var url = 'http://' + req.headers.host + '/' + type + '/' + api._id, qs = [], key, arr_i; for (key in req.query) { if (req.query.hasOwnProperty(key)) { if (req.query[key] instanceof Array) { for (arr_i = 0; arr_i < req.query[key].length; arr_i++) { if (req.query[key][arr_i].trim() !== '') { qs.push(key + '[]=' + req.query[key][arr_i]); } } } else { if (req.query[key].trim() !== '') { qs.push(key + '=' + req.query[key]); } } } } if (qs.length > 0) { url = url + '?' + qs.join('&'); } return url; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function apiURL(service) { //Función para formar la ruta completa a la API \n return BaseApiUrl + service;\n}", "function _buildApiUrl (datasetname, configkey) {\n\t\tlet url = API_BASE;\n\t\turl += '?key=' + API_KEY;\n\t\turl += datasetname && datasetname !== null ? '&dataset=' + datasetname : '';\n\t\turl +...
[ "0.75531274", "0.67213035", "0.6637007", "0.65763724", "0.65671074", "0.6506096", "0.6498801", "0.648252", "0.64752513", "0.6385563", "0.631704", "0.6308847", "0.6290786", "0.6275289", "0.62483764", "0.62207806", "0.61919063", "0.617366", "0.611814", "0.6117147", "0.6066486",...
0.58605486
30
Group an object into it's key fields. But don't sum anything!
function group(object, callback) { var result = {}, index, key, tmp_copy; if (object instanceof Array) { for (index = 0; index < object.length; index++) { if (object[index] instanceof Object) { for (key in object[index]) { if (object[index].hasOwnProperty(key)) { if (!(object[index][key] instanceof Object)) { if (!result.hasOwnProperty(object[index][key])) { result[object[index][key]] = []; } tmp_copy = merge.object(object[index]); delete tmp_copy[key]; if (obLength(tmp_copy) === 1 && tmp_copy.hasOwnProperty('data')) { tmp_copy = tmp_copy.data; } result[object[index][key]].push(group(tmp_copy)); } } } } } } else { return object; } if (typeof callback === "function") { callback(result); } else { return result; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function groupBy(data, key) {\n return data.reduce(function (obj, value) {\n var valueKey = value[key];\n if (obj[valueKey] == null)\n obj[valueKey] = [value];\n obj[valueKey].push(value);\n return obj;\n }, {});\n}", "function sumObjectsByKey(...objs) {\n return obj...
[ "0.609624", "0.6025998", "0.5992305", "0.5885325", "0.58561426", "0.5815593", "0.5779071", "0.5719716", "0.57097185", "0.5602274", "0.5601209", "0.5598757", "0.5589193", "0.55756295", "0.5569344", "0.5563889", "0.5563889", "0.5563889", "0.5563889", "0.5563889", "0.5532758", ...
0.51201516
49
then open tab 'Verification' show amount of money and addres for transact money
function tryToOpenTab(){ if (userSignedIn === undefined) { // becouse amount depends on user account alert('Not logined!'); } else { let promise = new Promise(function(onSuccess, onReject){ openTab(event, 'verification'); console.log(contractOwner); document.getElementById('verificationAmount').value = userSignedIn.id; document.getElementById('verificationAddress').value = contractOwner; onSuccess(); }).then(() => { let blockNumberNow = 0; const onTimeout = function() { if(userSignedIn.address) { return; } web3.eth.getBlockNumber((error, result) => { blockNumberNow = result; getTransactionsOfAccount(contractOwner, blockNumberNow, blockNumberNow) .then( transactions => { for (let i = 0; i < transactions.length; i++) { let bigTransact = (transactions[i].value) / 1000000000000000000; console.log(bigTransact); if (bigTransact === userSignedIn.id) { userSignedIn.address = transactions[i].from; alert('verificated!'); //App.transaction(userSignedIn.address, userSignedIn.id); //onSuccess(userSignedIn.address); } } } ).then(success => { if (!userSignedIn.address) setTimeout(onTimeout, 10000); return success; }, error => { setTimeout(onTimeout, 10000); throw error; }); }); }; onTimeout(); }); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function printAmount() {\n document.getElementById(\"tCP\").textContent = totalCP.toLocaleString();\n document.getElementById(\"tSP\").textContent = totalSP.toLocaleString();\n document.getElementById(\"tGP\").textContent = totalGP.toLocaleString();\n document.getElementById(\"tAmt\").t...
[ "0.6744457", "0.65832037", "0.6430723", "0.6362384", "0.6317556", "0.6291843", "0.62605065", "0.62397546", "0.62343466", "0.62153286", "0.6214029", "0.62137026", "0.62005115", "0.61512655", "0.6133402", "0.61264557", "0.61217505", "0.6102533", "0.6081563", "0.6074465", "0.606...
0.57116884
94
Media query light / dark mode
function checkTheme() { darkModeToggle.addEventListener("change", () => { setTheme(); }); darkModeToggle.checked = window.matchMedia( "(prefers-color-scheme: dark)" ).matches; setTheme(darkModeToggle.checked); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function useDarkMode() {\n const [isDark, setIsDark] = React.useState(\n () => window.matchMedia && window.matchMedia(matchDark).matches\n );\n\n React.useEffect(() => {\n const matcher = window.matchMedia(matchDark);\n const onChange = ({ matches }) => setIsDark(matches);\n matcher.addListener(onCh...
[ "0.710187", "0.68144584", "0.67552125", "0.67248905", "0.664735", "0.66245514", "0.6613246", "0.65692896", "0.6524855", "0.6503753", "0.64147395", "0.6405372", "0.6398171", "0.6386009", "0.63710636", "0.63635004", "0.63094145", "0.6301467", "0.6299795", "0.62891805", "0.62587...
0.6132885
29
Warning if colors match
function updateWarning(display = false) { setupForm.querySelector("[warning-text]").innerHTML = display ? text["setup"]["warning"][game.getCurrentLang()] : ""; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function checkColors() {\n for (let i = 0; i < wireAmount; i++) {\n for (let ii = 0; ii < colorArray.length; ii++) {\n if (wireArray[i].style.stroke == colorArray[ii].color) {\n colorArray[ii].amount = colorArray[ii].amount + 1;\n ...
[ "0.69576293", "0.6907775", "0.6787271", "0.6766414", "0.6697745", "0.664589", "0.66457844", "0.6622122", "0.6591698", "0.6558046", "0.6558046", "0.6531311", "0.65045494", "0.65029716", "0.6467448", "0.64265966", "0.6385253", "0.637648", "0.6358853", "0.6352685", "0.6351398", ...
0.0
-1
Inject stylesheet for SVG coloring
function insertStylesheet(css) { const svgStyle = document.createElement("style"); svgStyle.setAttribute("id", "svgStyle"); svgStyle.innerHTML = css; document.head.appendChild(svgStyle); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function applyStyleToSVG() {\n page.evaluate(function (css) {\n //We need to apply the style to the SVG\n var defs = document.createElement(\"defs\"),\n style = document.createElement(\"style\");\n style.innerHTML = css;\n\n defs.appendChild(style);\n document.querySelector(\"svg...
[ "0.7557541", "0.62982994", "0.62784463", "0.625939", "0.61719155", "0.6044573", "0.599222", "0.599222", "0.599222", "0.599222", "0.59726524", "0.594328", "0.5938573", "0.5887238", "0.58497477", "0.5797033", "0.57859725", "0.57859725", "0.57743204", "0.576513", "0.5759397", ...
0.7069628
1
TODO this whole method can be better, look at again later
renderQuestionList() { if (!this.props.questions) { return "Uh oh, there was a problem getting the data..."; } else if (this.props.questions.length > 0){ var questionList = this.props.questions.map(function(question, index) { return <tr key={index}> <th scope="row">{index + 1}</th> {/* Sanitized in Rails */} <td dangerouslySetInnerHTML={{ __html:question.question_content}}></td> <td>{question.answer}</td> <td> <button onClick={() => {this.onEditOrDeleteClick(question.id, 'edit')}} type="button" className="btn btn-default">Edit</button> <button onClick={() => {this.onEditOrDeleteClick(question.id, 'delete')}} type="button" className="btn btn-danger">Delete</button> </td> </tr>; }, this) return questionList; } else { return "You have no questions! Add one to get started!"; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private internal function m248() {}", "protected internal function m252() {}", "private public function m246() {}", "transient private protected internal function m182() {}", "transient protected internal function m189() {}", "transient private internal function m185() {}", "static private internal fun...
[ "0.63312167", "0.61799943", "0.6147126", "0.5829979", "0.5623453", "0.56131923", "0.5490543", "0.5446895", "0.5436225", "0.52776587", "0.524525", "0.5236795", "0.52114487", "0.5151028", "0.51472616", "0.50644994", "0.50634", "0.501027", "0.5004854", "0.49083224", "0.48951128"...
0.0
-1
GnuBook() ______________________________________________________________________________ After you instantiate this object, you must supply the following bookspecific functions, before calling init(): getPageWidth() getPageHeight() getPageURI() You must also add a numLeafs property before calling init().
function GnuBook() { this.reduce = 4; this.padding = 10; this.mode = 1; //1 or 2 this.displayedLeafs = []; //this.leafsToDisplay = []; this.imgs = {}; this.prefetchedImgs = {}; //an object with numeric keys cooresponding to leafNum this.timer = null; this.animating = false; this.auto = false; this.autoTimer = null; this.flipSpeed = 'fast'; this.twoPagePopUp = null; this.leafEdgeTmp = null; this.searchResults = {}; this.firstIndex = null; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function Book(title, author, genre, numPages) {\n this.title = title\n this.author = author\n this.genre = genre\n this.numPages = numPages\n}", "function addBook(x, y, size, book) {\n\tvar bk = new MultiWidgets.BookWidget();\n\n\tif (bk.load(\"./Research\")) {\n\t\tbk.addOperator(new MultiWidgets.St...
[ "0.61242014", "0.58713675", "0.5843355", "0.58092076", "0.57605493", "0.57401794", "0.5651841", "0.56432414", "0.56054217", "0.5600922", "0.55815536", "0.55815536", "0.55815536", "0.55815536", "0.55815536", "0.5576414", "0.5575361", "0.5561301", "0.54979515", "0.54977494", "0...
0.79524344
0
var fakeDataUrl = " var fakeDataUrl = " capitalize first letter
function capitalizeFirstLetter(data){ var temp = []; try { if (typeof data == "string" || data instanceof String){ return data.charAt(0).toUpperCase() + data.slice(1); }else if (Array.isArray(data) || data instanceof Array){ for (var i=0; i<data.length; i++){ temp.push(data[i].charAt(0).toUpperCase() + data[i].slice(1)); //console.log(temp); } return temp; } }catch(e){ console.log(e); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "nameDB() {\n let hostname = window.location.host.split('.')\n let response = hostname\n\n //Set capitalize to all words\n hostname.forEach((word, index) => {\n if (index >= 1) {\n hostname[index] = word.charAt(0).toUpperCase() + word.slice(1)\n }\n })\n\n //Remove .com .org....\n...
[ "0.62561697", "0.58685875", "0.5847083", "0.58118296", "0.5771444", "0.5722285", "0.5690744", "0.5684172", "0.56829304", "0.56787646", "0.5639065", "0.563218", "0.55952674", "0.5583038", "0.5570868", "0.55639815", "0.5529501", "0.5514028", "0.54927695", "0.54923916", "0.54730...
0.0
-1
Read a page's GET URL variables and return them as an associative array.
function getUrlVars() { var urlParams; var match, pl = /\+/g, // Regex for replacing addition symbol with a space search = /([^&=]+)=?([^&]*)/g, decode = function (s) { return decodeURIComponent(s.replace(pl, " ")); }, query = window.location.search.substring(1); urlParams = {}; while (match = search.exec(query)) urlParams[decode(match[1])] = decode(match[2]); //if (urlParams.demoMode=="y") { urlParams = defaultData.ortho; } //urlParams = defaultData.ortho; return urlParams; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function getVars(){\n var loc = document.location.href;\n var getString = loc.split('?');\n if(getString[1]){\n var GET = getString[1].split('&');\n var get = {};//This object will be filled with the key-value pairs and returned.\n\n for(var i = 0, l = GET.length; i < l; i++){\n ...
[ "0.72642606", "0.71808255", "0.71296334", "0.7123701", "0.7069889", "0.70090044", "0.7006248", "0.6998314", "0.6984563", "0.6970788", "0.6970788", "0.6970788", "0.6970788", "0.6970788", "0.6970788", "0.6970788", "0.6959351", "0.6959351", "0.69530994", "0.6952574", "0.69521594...
0.0
-1
Accept a string that is formatted as an array. Convert the given string to a real array
function parseArray(rawData){ if (rawData.trim()=="[]"){ //when array is empty return []; }else{ //take everything except first and last character return rawData.substring(1, rawData.length-1).split(","); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function convertToArray(rawstring, myArray){\n\tcurrString = rawstring.substring(1)\n\tinitialIndex = rawstring.indexOf(\",\")\n\n\twhile (initialIndex!=-1){\n\t\tbeginString = currString.substring(2, initialIndex-2)\n\t\tmyArray.push(beginString)\n\t\tcurrString = currString.substring(initialIndex)\n\t\tinitialIn...
[ "0.71424407", "0.70145017", "0.69334036", "0.69070244", "0.6859887", "0.68525213", "0.6846103", "0.68169177", "0.6777474", "0.67646044", "0.6756063", "0.6756035", "0.670303", "0.67008126", "0.6647305", "0.66078925", "0.6596005", "0.65757287", "0.65524584", "0.65513957", "0.65...
0.6285943
27
convert all "string" values of an array to number
function parseNumAr(data){ var result = []; if(typeof data == 'string'){ data = [data]; } for (var i=0; i < data.length; i++){ //console.log(data[i]); result.push(parseFloat(data[i])); } return result; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function toNumberArray(stringarray) {\r\n return stringarray.map(el => +el)\r\n}", "function convertsStringToNumbers(arr) {\n    var newArr = [];\n \n    for (var i = 0; i < arr.length; i++) {\n \nvar convert = parseFloat(arr[i]);\n\nif (isFinite(convert)) { //proverava da li je sve brojiev i da nisu unde...
[ "0.793182", "0.7560851", "0.74157816", "0.73188967", "0.7253201", "0.71430045", "0.7099198", "0.7034176", "0.6935719", "0.6874437", "0.68331873", "0.683239", "0.68283504", "0.67522556", "0.67317885", "0.66806436", "0.6669989", "0.66541326", "0.66374195", "0.66336197", "0.6601...
0.65649986
22
accept a jQuery object and chart title. Display "data unavailable message" within that jQuery object
function dataUnavailable(chartFrame, chartTitle){ chartTitle = typeof chartTitle !== 'undefined' ? chartTitle : ''; chartFrame.html('<div class="data-unavailable-header" style="color:#ccc;">' +chartTitle +'</div>' +'<div class="error-msg">' +'<div>Data is currently unavailable at this time.</div>' +'<div>Please check back later</div>' +'</div>'); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function display_no_data() {\n $(\"#error-message\").show()\n $(\"#error-message\").html(\"There is no data to display in the selected dates.\");\n\n}", "function plotChart(row, col, val, pclass, title) {\r\n //return;\r\n var $obj = $newsChart.find('tbody > tr:nth-child(' + row + ') > td.nval' + col...
[ "0.59305507", "0.5876474", "0.5761086", "0.5742612", "0.57100195", "0.5625927", "0.562035", "0.562035", "0.56080574", "0.5588725", "0.5522136", "0.5522136", "0.5487216", "0.5470456", "0.5422378", "0.5390072", "0.53599054", "0.5353561", "0.5342917", "0.53107345", "0.53068966",...
0.72367615
0
method for validating URL format
function urlValidator(ip) { //TODO uncomment when not working with localhost // return ipRegex({ exact: true }).test(ip) return true; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "static valid_url(value) {\n if (!value) return false;\n\n // check for illegal characters\n if (/[^a-z0-9:/?#[\\]@!$&'()*+,;=.\\-_~%]/i.test(value)) return false;\n\n // check for hex escapes that aren't complete\n if (/%[^0-9a-f]/i.test(value)) return false;\n if (/%[0-9a-f](:?[^0-9a-f]|$)/i.tes...
[ "0.80657095", "0.7761333", "0.7730944", "0.758448", "0.7483602", "0.7477578", "0.74462664", "0.741962", "0.73875344", "0.7381135", "0.7362627", "0.7362596", "0.734717", "0.73292905", "0.73211336", "0.73017555", "0.72888887", "0.7287959", "0.72714907", "0.7259106", "0.7242865"...
0.63949865
84
Set a system wide flag so modules can find out what we are up to.
function inTransferMode(value) { if (value) { transferMode = value } else { return transferMode } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "setKiosk(flag) {\r\n this.native.setKiosk(flag);\r\n }", "function setFeatureFlagForTest(name, value) {\n }", "function initFeatureFlags() {\n\n if (typeof __VUE_OPTIONS_API__ !== 'boolean') {\n getGlobalThis().__VUE_OPTIONS_API__ = true;\n }\n\n if (typeof __VUE_PROD_DEVTOOLS__ !== 'boolean')...
[ "0.60574245", "0.5946743", "0.5916337", "0.5876696", "0.57843035", "0.5777987", "0.5777987", "0.5777987", "0.5777987", "0.5760023", "0.5760023", "0.5736648", "0.5736338", "0.57253265", "0.57041055", "0.5664938", "0.54927635", "0.54911137", "0.54911137", "0.54799485", "0.54483...
0.0
-1
postLogin calls postWalletLogin api inputs: uuid, nonce, publicKey, mfatoken outputs: wallet and asq question
function getOrderBook (contractID) { // in account post Login // console.log('this is the contractID we are passing to orderbook rest call ', contractID) return axiosInstance.get('/orderbooks', {'contractID': contractID}) }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function createLogin (ctx, accountReply, callback) {\n var username = accountReply.username + '-' + base58.encode(crypto.random(4))\n var password = base58.encode(crypto.random(24))\n var pin = accountReply.pinString\n\n var opts = {}\n if (accountReply.type === 'account:repo:co.airbitz.wallet') {\n opts.s...
[ "0.58421165", "0.58408767", "0.55175334", "0.5503293", "0.54785", "0.54473966", "0.54457223", "0.54393226", "0.54073507", "0.54067755", "0.53978926", "0.5391687", "0.5383768", "0.53740495", "0.5348146", "0.5332545", "0.5331748", "0.53281057", "0.5321934", "0.5299223", "0.5296...
0.0
-1
Could use `inherits` module, but don't want to move from single file architecture yet.
function inherits (ctor, superCtor) { ctor.super_ = superCtor; var TempCtor = function () {}; TempCtor.prototype = superCtor.prototype; ctor.prototype = new TempCtor(); ctor.prototype.constructor = ctor; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function inherit(){}", "function SuperclassBare() {}", "function SuperclassBare() {}", "function inherited() { }", "function inheritsFrom(child, parent){\nchild.prototype = Object.create(parent.prototype);\n}", "function inheritFrom(subfn,superfn) {\n\tvar r = function () {}\n\tr.prototype = superfn.prot...
[ "0.7398729", "0.7261122", "0.7261122", "0.69321644", "0.6614716", "0.6482389", "0.64594245", "0.6351272", "0.6344033", "0.6344033", "0.6322819", "0.6322819", "0.6123587", "0.61221385", "0.60969925", "0.60739726", "0.6069109", "0.60670304", "0.60664034", "0.60634947", "0.60634...
0.0
-1
CooleyTukey algorithm for FFT slightly revisited to rely on looping instead of recursion
function FFTM (x, y) { this.x = x; this.y = y; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function FFTNayuki(n) {\n \n this.n = n;\n this.levels = -1;\n\n for (var i = 0; i < 32; i++) {\n if (1 << i == n) {\n this.levels = i; // Equal to log2(n)\n }\n }\n if (this.levels == -1) {\n throw \"Length is not a power of 2\";\n }\n\n this.cosTable = new...
[ "0.6596565", "0.61714965", "0.60477644", "0.6025667", "0.5921966", "0.58883363", "0.58471066", "0.5780482", "0.5777901", "0.57056165", "0.5629252", "0.5589546", "0.557242", "0.5466943", "0.54559976", "0.5343446", "0.53264683", "0.53212196", "0.53055847", "0.5275151", "0.52675...
0.0
-1
alternative to using Object.keys for old browsers
function copyProps (src, dst) { for (var key in src) { dst[key] = src[key] } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function getKeys(obj) {\n return Object.keys(obj); // Yes it is builtin!\n }", "function Object_keys(obj) {\n\t if (Object.keys) return Object.keys(obj)\n\t else {\n\t var res = [];\n\t for (var key in obj) res.push(key);\n\t return res;\n\t }\n\t}", "function keys(obj){\n return Object....
[ "0.7382736", "0.7311627", "0.723966", "0.7199875", "0.7199875", "0.7199875", "0.7199875", "0.7199875", "0.7199875", "0.7199875", "0.7199875", "0.7199875", "0.7109948", "0.69957906", "0.69584274", "0.6930815", "0.6926222", "0.6915537", "0.6879077", "0.68776375", "0.686874", ...
0.0
-1
there will be only 2 of these for each stream
function CorkedRequest(state) { var _this = this; this.next = null; this.entry = null; this.finish = function () { onCorkedFinish(_this, state); }; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "extractStream(stream) {\n let cross_reference_length = this.w.reduce((a, b) => a + b, 0);\n // check if the data stream has a valid size\n if (stream.getLength() !== cross_reference_length * this.index.filter((v, i) => i % 2 === 1).reduce((a, b) => a + b, 0))\n throw Error(`Invalid ...
[ "0.61270493", "0.59082323", "0.5899411", "0.58675635", "0.57517487", "0.57407343", "0.5727185", "0.5727185", "0.5710692", "0.57069093", "0.5685656", "0.5685656", "0.5685656", "0.5670098", "0.5661119", "0.5633279", "0.56032485", "0.5597702", "0.5581764", "0.5571581", "0.556822...
0.0
-1
mode the stream is in. Currently this means that `null` is never accepted and undefined/nonstring values are only allowed in object mode.
function validChunk(stream, state, chunk, cb) { var er; if (chunk === null) { er = new ERR_STREAM_NULL_VALUES(); } else if (typeof chunk !== 'string' && !state.objectMode) { er = new ERR_INVALID_ARG_TYPE('chunk', ['string', 'Buffer'], chunk); } if (er) { errorOrDestroy(stream, er); process.nextTick(cb, er); return false; } return true; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "checkMode(mode) {\n if (!mode) {\n mode = this.mode\n }\n return mode;\n }", "function modeReader () {\n streamE.run(readNBytes(1), function(mode) {\n mode = (mode[0] | 0);\n debug(\"Mode is: \" + mode);\n mode_handlers[mode]();\n });\n }", "set mode(val...
[ "0.61189735", "0.61042356", "0.6014506", "0.5978489", "0.59627974", "0.59627974", "0.5933315", "0.5933315", "0.5933315", "0.59127396", "0.59127396", "0.5558553", "0.55166245", "0.54992497", "0.54863095", "0.54863095", "0.5474937", "0.5444792", "0.54384875", "0.5412984", "0.53...
0.0
-1
if we're already writing something, then just put this in the queue, and wait our turn. Otherwise, call _write If we return false, then we need a drain event, so set that flag.
function writeOrBuffer(stream, state, isBuf, chunk, encoding, cb) { if (!isBuf) { var newChunk = decodeChunk(state, chunk, encoding); if (chunk !== newChunk) { isBuf = true; encoding = 'buffer'; chunk = newChunk; } } var len = state.objectMode ? 1 : chunk.length; state.length += len; var ret = state.length < state.highWaterMark; // we must ensure that previous needDrain will not be reset to false. if (!ret) state.needDrain = true; if (state.writing || state.corked) { var last = state.lastBufferedRequest; state.lastBufferedRequest = { chunk: chunk, encoding: encoding, isBuf: isBuf, callback: cb, next: null }; if (last) { last.next = state.lastBufferedRequest; } else { state.bufferedRequest = state.lastBufferedRequest; } state.bufferedRequestCount += 1; } else { doWrite(stream, state, false, len, chunk, encoding, cb); } return ret; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function onwriteDrain(stream,state){if(state.length===0&&state.needDrain){state.needDrain=false;stream.emit('drain');}}// if there's something in the buffer waiting, then process it", "function onwriteDrain(stream,state){if(state.length===0&&state.needDrain){state.needDrain=false;stream.emit('drain');}}// if the...
[ "0.7143456", "0.7143456", "0.7143456", "0.7143456", "0.69725215", "0.6951243", "0.6888608", "0.6888608", "0.6888608", "0.6888608", "0.6888608", "0.6888608", "0.6888608", "0.6888608", "0.6888608", "0.6888608", "0.6888608", "0.6888608", "0.6888608", "0.6888608", "0.6888608", ...
0.0
-1
emit 'drain' before the write() consumer gets the 'false' return value, and has a chance to attach a 'drain' listener.
function onwriteDrain(stream, state) { if (state.length === 0 && state.needDrain) { state.needDrain = false; stream.emit('drain'); } } // if there's something in the buffer waiting, then process it
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "onDrain() {\n this.writeBuffer.splice(0, this.prevBufferLen); // 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\n this.prevBufferLen = 0;\n\n if (0 === this.writeBuffer.leng...
[ "0.78705496", "0.77941537", "0.77941537", "0.77857596", "0.77857596", "0.7778485", "0.7778485", "0.7778485", "0.7778485", "0.7757883", "0.7757357", "0.7645465", "0.76112026", "0.76072425", "0.75522053", "0.75372267", "0.75372267", "0.7521258", "0.74727637", "0.7464861", "0.74...
0.7626701
61
base64 is 4/3 + up to two characters of the original data
function byteLength (b64) { var lens = getLens(b64) var validLen = lens[0] var placeHoldersLen = lens[1] return ((validLen + placeHoldersLen) * 3 / 4) - placeHoldersLen }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "getBase64() {\n var s = this.getDump();\n\n var ch =\n \"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=\";\n var c1, c2, c3, e1, e2, e3, e4;\n var l = s.length;\n var i = 0;\n var r = \"\";\n\n do {\n c1 = s.charCodeAt(i);\n e1 = c1 >> 2;\n c2 = s.charCod...
[ "0.77057606", "0.7324507", "0.72870255", "0.7230772", "0.7183817", "0.71231633", "0.7105772", "0.7089243", "0.7062078", "0.6977857", "0.6975599", "0.6933752", "0.6899215", "0.6899215", "0.6893997", "0.6879304", "0.68740326", "0.68740326", "0.68538475", "0.68362004", "0.681601...
0.0
-1
Adapted from convertsourcemap (MIT)
function toComment(sourceMap) { // eslint-disable-next-line no-undef var base64 = btoa(unescape(encodeURIComponent(JSON.stringify(sourceMap)))); var data = 'sourceMappingURL=data:application/json;charset=utf-8;base64,' + base64; return '/*# ' + data + ' */'; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function extractSourceMap(fs, logger, file) {\n var inline = convert_source_map_1.commentRegex.test(file.text);\n var external = convert_source_map_1.mapFileCommentRegex.exec(file.text);\n if (inline) {\n var inlineSourceMap = convert_source_map_1.fromSource(file.text);\n ...
[ "0.6965976", "0.6937916", "0.67651826", "0.6441334", "0.63273764", "0.6297531", "0.6254359", "0.6210628", "0.61928856", "0.61809653", "0.6173767", "0.61589617", "0.61589617", "0.61589617", "0.6155463", "0.6095343", "0.6039304", "0.5988538", "0.5979952", "0.5978704", "0.597840...
0.0
-1
Could use `inherits` module, but don't want to move from single file architecture yet.
function inherits (ctor, superCtor) { ctor.super_ = superCtor; var TempCtor = function () {}; TempCtor.prototype = superCtor.prototype; ctor.prototype = new TempCtor(); ctor.prototype.constructor = ctor; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function inherit(){}", "function SuperclassBare() {}", "function SuperclassBare() {}", "function inherited() { }", "function inheritsFrom(child, parent){\nchild.prototype = Object.create(parent.prototype);\n}", "function inheritFrom(subfn,superfn) {\n\tvar r = function () {}\n\tr.prototype = superfn.prot...
[ "0.7401219", "0.72619385", "0.72619385", "0.6934079", "0.66181535", "0.64842397", "0.64601207", "0.63533044", "0.6344312", "0.6344312", "0.6324127", "0.6324127", "0.61254305", "0.61223876", "0.61002636", "0.6075639", "0.6069061", "0.6068982", "0.6067097", "0.6064537", "0.6064...
0.0
-1
CooleyTukey algorithm for FFT slightly revisited to rely on looping instead of recursion
function FFTM (x, y) { this.x = x; this.y = y; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function FFTNayuki(n) {\n \n this.n = n;\n this.levels = -1;\n\n for (var i = 0; i < 32; i++) {\n if (1 << i == n) {\n this.levels = i; // Equal to log2(n)\n }\n }\n if (this.levels == -1) {\n throw \"Length is not a power of 2\";\n }\n\n this.cosTable = new...
[ "0.6596565", "0.61714965", "0.60477644", "0.6025667", "0.5921966", "0.58883363", "0.58471066", "0.5780482", "0.5777901", "0.57056165", "0.5629252", "0.5589546", "0.557242", "0.5466943", "0.54559976", "0.5343446", "0.53264683", "0.53212196", "0.53055847", "0.5275151", "0.52675...
0.0
-1
Could use `inherits` module, but don't want to move from single file architecture yet.
function inherits (ctor, superCtor) { ctor.super_ = superCtor; var TempCtor = function () {}; TempCtor.prototype = superCtor.prototype; ctor.prototype = new TempCtor(); ctor.prototype.constructor = ctor; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function inherit(){}", "function SuperclassBare() {}", "function SuperclassBare() {}", "function inherited() { }", "function inheritsFrom(child, parent){\nchild.prototype = Object.create(parent.prototype);\n}", "function inheritFrom(subfn,superfn) {\n\tvar r = function () {}\n\tr.prototype = superfn.prot...
[ "0.73977566", "0.72600657", "0.72600657", "0.69314426", "0.66141313", "0.64813936", "0.64593697", "0.63513047", "0.6343339", "0.6343339", "0.6322658", "0.6322658", "0.6122129", "0.6120975", "0.6094837", "0.6072585", "0.60704786", "0.606606", "0.6066017", "0.6063663", "0.60636...
0.0
-1
CooleyTukey algorithm for FFT slightly revisited to rely on looping instead of recursion
function FFTM (x, y) { this.x = x; this.y = y; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function FFTNayuki(n) {\n \n this.n = n;\n this.levels = -1;\n\n for (var i = 0; i < 32; i++) {\n if (1 << i == n) {\n this.levels = i; // Equal to log2(n)\n }\n }\n if (this.levels == -1) {\n throw \"Length is not a power of 2\";\n }\n\n this.cosTable = new...
[ "0.65965456", "0.61721987", "0.60486144", "0.6026577", "0.5922448", "0.5888932", "0.58482796", "0.5780942", "0.577901", "0.5706382", "0.5629209", "0.55900085", "0.5572849", "0.5467393", "0.5457597", "0.53435135", "0.5327273", "0.5321109", "0.53066593", "0.5276428", "0.5269115...
0.0
-1
alternative to using Object.keys for old browsers
function copyProps (src, dst) { for (var key in src) { dst[key] = src[key] } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function getKeys(obj) {\n return Object.keys(obj); // Yes it is builtin!\n }", "function Object_keys(obj) {\n\t if (Object.keys) return Object.keys(obj)\n\t else {\n\t var res = [];\n\t for (var key in obj) res.push(key);\n\t return res;\n\t }\n\t}", "function keys(obj){\n return Object....
[ "0.7382736", "0.7311627", "0.723966", "0.7199875", "0.7199875", "0.7199875", "0.7199875", "0.7199875", "0.7199875", "0.7199875", "0.7199875", "0.7199875", "0.7109948", "0.69957906", "0.69584274", "0.6930815", "0.6926222", "0.6915537", "0.6879077", "0.68776375", "0.686874", ...
0.0
-1
Copyright Joyent, Inc. and other Node contributors. Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. NOTE: These type checking functions intentionally don't use `instanceof` because it is fragile and can be easily faked with `Object.create()`.
function isArray(arg) { if (Array.isArray) { return Array.isArray(arg); } return objectToString(arg) === '[object Array]'; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function t(e){return!!e.constructor&&'function'==typeof e.constructor.isBuffer&&e.constructor.isBuffer(e)}", "function n(e){return!!e.constructor&&\"function\"==typeof e.constructor.isBuffer&&e.constructor.isBuffer(e)}", "function t(n){return!!n.constructor&&typeof n.constructor.isBuffer==\"function\"&&n.const...
[ "0.6310498", "0.62241507", "0.62193394", "0.62193394", "0.62193394", "0.6153942", "0.6149915", "0.60841656", "0.60841656", "0.60841656", "0.60841656", "0.60841656", "0.60841656", "0.60841656", "0.60841656", "0.60841656", "0.6049013", "0.6019559", "0.59801257", "0.59801257", "...
0.0
-1
changes to the function body.
function howMuchToRead(n, state) { if (n <= 0 || state.length === 0 && state.ended) return 0; if (state.objectMode) return 1; if (n !== n) { // Only flow one buffer at a time if (state.flowing && state.length) return state.buffer.head.data.length;else return state.length; } // If we're asking for more than the current hwm, then raise the hwm. if (n > state.highWaterMark) state.highWaterMark = computeNewHighWaterMark(n); if (n <= state.length) return n; // Don't have enough if (!state.ended) { state.needReadable = true; return 0; } return state.length; } // you can override either this method, or the async _read(n) below.
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function funcionPorDefinicion(){\n //Body\n }", "function updateFunction() {\n \tupdatePreview();\n \tupdateHTMLCode();\n }", "function update()\n{\n\n}", "function update() {}", "function update() {\n \n}", "function updateroster() {\n\n}", "update()\n {\n \n }", "updateBodi...
[ "0.59476674", "0.571112", "0.5705222", "0.55671674", "0.5533744", "0.55332184", "0.552779", "0.552636", "0.55096877", "0.55064136", "0.54921454", "0.54918206", "0.5490372", "0.5468623", "0.5458237", "0.5458237", "0.5458237", "0.5458237", "0.5458237", "0.5458237", "0.5458237",...
0.0
-1
another read() call => stack overflow. This way, it might trigger a nextTick recursion warning, but that's not so bad.
function emitReadable(stream) { var state = stream._readableState; debug('emitReadable', state.needReadable, state.emittedReadable); state.needReadable = false; if (!state.emittedReadable) { debug('emitReadable', state.flowing); state.emittedReadable = true; process.nextTick(emitReadable_, stream); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "_read () {}", "_read () {}", "_read () {}", "function maybeReadMore(stream,state){if(!state.readingMore){state.readingMore=true;processNextTick(maybeReadMore_,stream,state)}}", "function maybeReadMore(stream,state){if(!state.readingMore){state.readingMore=true;processNextTick(maybeReadMore_,stream,state);}...
[ "0.6267203", "0.6267203", "0.6267203", "0.624545", "0.62022877", "0.62022877", "0.61982125", "0.6193532", "0.6193532", "0.6187085", "0.6111562", "0.6013765", "0.60011816", "0.5998191", "0.59899956", "0.59841233", "0.59582365", "0.59582365", "0.5945071", "0.59411323", "0.59213...
0.0
-1
and called read() to consume some data. that may have triggered in turn another _read(n) call, in which case reading = true if it's in progress. However, if we're not ended, or reading, and the length < hwm, then go ahead and try to read some more preemptively.
function maybeReadMore(stream, state) { if (!state.readingMore) { state.readingMore = true; process.nextTick(maybeReadMore_, stream, state); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function maybeReadMore(stream,state){if(!state.readingMore){state.readingMore=true;processNextTick(maybeReadMore_,stream,state)}}", "function maybeReadMore(stream,state){if(!state.readingMore){state.readingMore=true;processNextTick(maybeReadMore_,stream,state);}}", "function maybeReadMore(stream,state){if(!sta...
[ "0.70706564", "0.7041525", "0.7041525", "0.6816472", "0.6786889", "0.6749987", "0.6749987", "0.6725101", "0.671691", "0.6694657", "0.6694448", "0.6622471", "0.6567824", "0.6545125", "0.6545125", "0.6545125", "0.6545125", "0.6545125", "0.6545125", "0.6545125", "0.6545125", "...
0.0
-1
however, don't suppress the throwing behavior for this.
function onerror(er) { debug('onerror', er); unpipe(); dest.removeListener('error', onerror); if (EElistenerCount(dest, 'error') === 0) errorOrDestroy(dest, er); } // Make sure our error handler is attached before userland ones.
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function thrower(){throw new Error(\"this should not happen!\")}", "function noOp(err) { if (err) { throw err; } }", "function Exception() {\n return;\n}", "function m(a){throw a;}", "unsafelyUnwrap() {\n throw new Error('Tried to `unsafelyUnwrap an Err`');\n }", "function sc_raise(obj) {\n ...
[ "0.710816", "0.68392336", "0.65349793", "0.64005846", "0.6325798", "0.6283193", "0.6281055", "0.61871666", "0.61843", "0.6136359", "0.61258864", "0.6123705", "0.61198807", "0.6103578", "0.60899734", "0.6082334", "0.60815483", "0.60296893", "0.60278106", "0.59636575", "0.59496...
0.0
-1
Both close and finish should trigger unpipe, but only once.
function onclose() { dest.removeListener('finish', onfinish); unpipe(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function onclose() {\n\t dest.removeListener('finish', onfinish);\n\t unpipe();\n\t }", "function onclose() {\n\t dest.removeListener('finish', onfinish);\n\t unpipe();\n\t }", "function onclose() {\n\t dest.removeListener('finish', onfinish);\n\t unpipe();\n\t }", "function onclose() {\...
[ "0.7979085", "0.7979085", "0.7979085", "0.7979085", "0.7979085", "0.7979085", "0.7979085", "0.7979085", "0.7979085", "0.7979085", "0.7979085", "0.7979085", "0.7979085", "0.7979085", "0.7979085", "0.7979085", "0.7979085", "0.7979085", "0.7979085", "0.7979085", "0.7979085", "...
0.0
-1
Pluck off n bytes from an array of buffers. Length is the combined lengths of all the buffers in the list. This function is designed to be inlinable, so please take care when making changes to the function body.
function fromList(n, state) { // nothing buffered if (state.length === 0) return null; var ret; if (state.objectMode) ret = state.buffer.shift();else if (!n || n >= state.length) { // read it all, truncate the list if (state.decoder) ret = state.buffer.join('');else if (state.buffer.length === 1) ret = state.buffer.first();else ret = state.buffer.concat(state.length); state.buffer.clear(); } else { // read part of list ret = state.buffer.consume(n, state.decoder); } return ret; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function copyFromBuffer(n, list) {\n var ret = Buffer.allocUnsafe(n);\n var p = list.head;\n var c = 1;\n p.data.copy(ret);\n n -= p.data.length;\n\n while (p = p.next) {\n var buf = p.data;\n var nb = n > buf.length ? buf.length : n;\n buf.copy(ret, ret.length - n, 0, nb);\n n -= nb;\n\n if (...
[ "0.656338", "0.65619653", "0.65619653", "0.65619653", "0.65619653", "0.65619653", "0.65619653", "0.65619653", "0.65619653", "0.65619653", "0.65619653", "0.65619653", "0.65619653", "0.65619653", "0.65619653", "0.65619653", "0.65619653", "0.65619653", "0.65619653", "0.65619653", ...
0.0
-1
undocumented cb() API, needed for core, not for public API
function destroy(err, cb) { var _this = this; var readableDestroyed = this._readableState && this._readableState.destroyed; var writableDestroyed = this._writableState && this._writableState.destroyed; if (readableDestroyed || writableDestroyed) { if (cb) { cb(err); } else if (err && (!this._writableState || !this._writableState.errorEmitted)) { pna.nextTick(emitErrorNT, this, err); } return this; } // we set destroyed to true before firing error callbacks in order // to make it re-entrance safe in case destroy() is called within callbacks if (this._readableState) { this._readableState.destroyed = true; } // if this is a duplex stream mark the writable part as destroyed as well if (this._writableState) { this._writableState.destroyed = true; } this._destroy(err || null, function (err) { if (!cb && err) { pna.nextTick(emitErrorNT, _this, err); if (_this._writableState) { _this._writableState.errorEmitted = true; } } else if (cb) { cb(err); } }); return this; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function callback() {}", "function callback() {}", "function callback() {}", "function callback() {}", "function callback() {}", "function callback(){}", "function cb () {\n\t\tcallback();\n\t}", "function callback(cb){\n\n cb(1);\n}", "function callbackDriver() {\n cb();\n }", "function _...
[ "0.7930102", "0.7930102", "0.7930102", "0.7930102", "0.7930102", "0.7879179", "0.77457297", "0.7326767", "0.7235456", "0.71511483", "0.71451867", "0.71451867", "0.71291524", "0.7034352", "0.7026779", "0.7000611", "0.69736856", "0.6935611", "0.69217", "0.68071514", "0.68071514...
0.0
-1
Could use `inherits` module, but don't want to move from single file architecture yet.
function inherits (ctor, superCtor) { ctor.super_ = superCtor; var TempCtor = function () {}; TempCtor.prototype = superCtor.prototype; ctor.prototype = new TempCtor(); ctor.prototype.constructor = ctor; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function inherit(){}", "function SuperclassBare() {}", "function SuperclassBare() {}", "function inherited() { }", "function inheritsFrom(child, parent){\nchild.prototype = Object.create(parent.prototype);\n}", "function inheritFrom(subfn,superfn) {\n\tvar r = function () {}\n\tr.prototype = superfn.prot...
[ "0.7401219", "0.72619385", "0.72619385", "0.6934079", "0.66181535", "0.64842397", "0.64601207", "0.63533044", "0.6344312", "0.6344312", "0.6324127", "0.6324127", "0.61254305", "0.61223876", "0.61002636", "0.6075639", "0.6069061", "0.6068982", "0.6067097", "0.6064537", "0.6064...
0.0
-1
CooleyTukey algorithm for FFT slightly revisited to rely on looping instead of recursion
function FFTM (x, y) { this.x = x; this.y = y; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function FFTNayuki(n) {\n \n this.n = n;\n this.levels = -1;\n\n for (var i = 0; i < 32; i++) {\n if (1 << i == n) {\n this.levels = i; // Equal to log2(n)\n }\n }\n if (this.levels == -1) {\n throw \"Length is not a power of 2\";\n }\n\n this.cosTable = new...
[ "0.65954375", "0.6168972", "0.6044958", "0.6022759", "0.591924", "0.58853126", "0.5843347", "0.577806", "0.57772064", "0.5703021", "0.562801", "0.55890924", "0.5570078", "0.5464318", "0.54534", "0.5339202", "0.5326124", "0.5318228", "0.53027326", "0.52718914", "0.52644837", ...
0.0
-1
undocumented cb() API, needed for core, not for public API
function destroy(err, cb) { var _this = this; var readableDestroyed = this._readableState && this._readableState.destroyed; var writableDestroyed = this._writableState && this._writableState.destroyed; if (readableDestroyed || writableDestroyed) { if (cb) { cb(err); } else if (err) { if (!this._writableState) { process.nextTick(emitErrorNT, this, err); } else if (!this._writableState.errorEmitted) { this._writableState.errorEmitted = true; process.nextTick(emitErrorNT, this, err); } } return this; } // we set destroyed to true before firing error callbacks in order // to make it re-entrance safe in case destroy() is called within callbacks if (this._readableState) { this._readableState.destroyed = true; } // if this is a duplex stream mark the writable part as destroyed as well if (this._writableState) { this._writableState.destroyed = true; } this._destroy(err || null, function (err) { if (!cb && err) { if (!_this._writableState) { process.nextTick(emitErrorAndCloseNT, _this, err); } else if (!_this._writableState.errorEmitted) { _this._writableState.errorEmitted = true; process.nextTick(emitErrorAndCloseNT, _this, err); } else { process.nextTick(emitCloseNT, _this); } } else if (cb) { process.nextTick(emitCloseNT, _this); cb(err); } else { process.nextTick(emitCloseNT, _this); } }); return this; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function callback() {}", "function callback() {}", "function callback() {}", "function callback() {}", "function callback() {}", "function callback(){}", "function cb () {\n\t\tcallback();\n\t}", "function callback(cb){\n\n cb(1);\n}", "function callbackDriver() {\n cb();\n }", "function _...
[ "0.7930874", "0.7930874", "0.7930874", "0.7930874", "0.7930874", "0.78796494", "0.77466697", "0.7327448", "0.7236962", "0.71516067", "0.7146164", "0.7146164", "0.7129454", "0.7034478", "0.7028233", "0.70006466", "0.6974503", "0.6935015", "0.69227105", "0.6806313", "0.6806313"...
0.0
-1
CONCATENATED MODULE: ./node_modules/vuestyleloader/lib/listToStyles.js Translates the list format produced by cssloader into something easier to manipulate.
function listToStyles (parentId, list) { var styles = [] var newStyles = {} for (var i = 0; i < list.length; i++) { var item = list[i] var id = item[0] var css = item[1] var media = item[2] var sourceMap = item[3] var part = { id: parentId + ':' + i, css: css, media: media, sourceMap: sourceMap } if (!newStyles[id]) { styles.push(newStyles[id] = { id: id, parts: [part] }) } else { newStyles[id].parts.push(part) } } return styles }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function listToStyles (parentId, list) {\n var styles = []\n var newStyles = {}\n for (var i = 0; i < list.length; i++) {\n var item = list[i]\n var id = item[0]\n var css = item[1]\n var media = item[2]\n var sourceMap = item[3]\n var part = {\n id...
[ "0.6930742" ]
0.0
-1
there will be only 2 of these for each stream
function CorkedRequest(state) { var _this = this; this.next = null; this.entry = null; this.finish = function () { onCorkedFinish(_this, state); }; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "extractStream(stream) {\n let cross_reference_length = this.w.reduce((a, b) => a + b, 0);\n // check if the data stream has a valid size\n if (stream.getLength() !== cross_reference_length * this.index.filter((v, i) => i % 2 === 1).reduce((a, b) => a + b, 0))\n throw Error(`Invalid ...
[ "0.61270493", "0.59082323", "0.5899411", "0.58675635", "0.57517487", "0.57407343", "0.5727185", "0.5727185", "0.5710692", "0.57069093", "0.5685656", "0.5685656", "0.5685656", "0.5670098", "0.5661119", "0.5633279", "0.56032485", "0.5597702", "0.5581764", "0.5571581", "0.556822...
0.0
-1
mode the stream is in. Currently this means that `null` is never accepted and undefined/nonstring values are only allowed in object mode.
function validChunk(stream, state, chunk, cb) { var er; if (chunk === null) { er = new ERR_STREAM_NULL_VALUES(); } else if (typeof chunk !== 'string' && !state.objectMode) { er = new ERR_INVALID_ARG_TYPE('chunk', ['string', 'Buffer'], chunk); } if (er) { errorOrDestroy(stream, er); process.nextTick(cb, er); return false; } return true; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "checkMode(mode) {\n if (!mode) {\n mode = this.mode\n }\n return mode;\n }", "function modeReader () {\n streamE.run(readNBytes(1), function(mode) {\n mode = (mode[0] | 0);\n debug(\"Mode is: \" + mode);\n mode_handlers[mode]();\n });\n }", "set mode(val...
[ "0.6119529", "0.6105581", "0.6013626", "0.5979946", "0.5963877", "0.5963877", "0.5934751", "0.5934751", "0.5934751", "0.5914122", "0.5914122", "0.556006", "0.55160844", "0.550072", "0.54877335", "0.54877335", "0.5475969", "0.54464287", "0.54393584", "0.5414652", "0.5339807", ...
0.0
-1
if we're already writing something, then just put this in the queue, and wait our turn. Otherwise, call _write If we return false, then we need a drain event, so set that flag.
function writeOrBuffer(stream, state, isBuf, chunk, encoding, cb) { if (!isBuf) { var newChunk = decodeChunk(state, chunk, encoding); if (chunk !== newChunk) { isBuf = true; encoding = 'buffer'; chunk = newChunk; } } var len = state.objectMode ? 1 : chunk.length; state.length += len; var ret = state.length < state.highWaterMark; // we must ensure that previous needDrain will not be reset to false. if (!ret) state.needDrain = true; if (state.writing || state.corked) { var last = state.lastBufferedRequest; state.lastBufferedRequest = { chunk: chunk, encoding: encoding, isBuf: isBuf, callback: cb, next: null }; if (last) { last.next = state.lastBufferedRequest; } else { state.bufferedRequest = state.lastBufferedRequest; } state.bufferedRequestCount += 1; } else { doWrite(stream, state, false, len, chunk, encoding, cb); } return ret; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function onwriteDrain(stream,state){if(state.length===0&&state.needDrain){state.needDrain=false;stream.emit('drain');}}// if there's something in the buffer waiting, then process it", "function onwriteDrain(stream,state){if(state.length===0&&state.needDrain){state.needDrain=false;stream.emit('drain');}}// if the...
[ "0.71454906", "0.71454906", "0.71454906", "0.71454906", "0.6974588", "0.69533527", "0.6890944", "0.6890944", "0.6890944", "0.6890944", "0.6890944", "0.6890944", "0.6890944", "0.6890944", "0.6890944", "0.6890944", "0.6890944", "0.6890944", "0.6890944", "0.6890944", "0.6890944"...
0.0
-1
emit 'drain' before the write() consumer gets the 'false' return value, and has a chance to attach a 'drain' listener.
function onwriteDrain(stream, state) { if (state.length === 0 && state.needDrain) { state.needDrain = false; stream.emit('drain'); } } // if there's something in the buffer waiting, then process it
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "onDrain() {\n this.writeBuffer.splice(0, this.prevBufferLen); // 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\n this.prevBufferLen = 0;\n\n if (0 === this.writeBuffer.leng...
[ "0.78705496", "0.77941537", "0.77941537", "0.77857596", "0.77857596", "0.7778485", "0.7778485", "0.7778485", "0.7778485", "0.7757883", "0.7757357", "0.7645465", "0.76112026", "0.76072425", "0.75522053", "0.75372267", "0.75372267", "0.7521258", "0.74727637", "0.7464861", "0.74...
0.7626701
69
Do not cache `Buffer.isEncoding` when checking encoding names as some modules monkeypatch it to support additional encodings
function normalizeEncoding(enc) { var nenc = _normalizeEncoding(enc); if (typeof nenc !== 'string' && (Buffer.isEncoding === isEncoding || !isEncoding(enc))) throw new Error('Unknown encoding: ' + enc); return nenc || enc; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function detectUTF8(txt) {\n if(txt) return txt.match(/([\\xC2-\\xDF][\\x80-\\xBF]|\\xE0[\\xA0-\\xBF][\\x80-\\xBF]|[\\xE1-\\xEF][\\x80-\\xBF][\\x80-\\xBF]|\\xF0[\\x90-\\xBF][\\x80-\\xBF][\\x80-\\xBF]|[\\xF1-\\xF7][\\x80-\\xBF][\\x80-\\xBF][\\x80-\\xBF]|\\xF8[\\x88-\\xBF][\\x80-\\xBF][\\x80-\\xBF][\\x80-\\xBF]|[...
[ "0.66366535", "0.65744627", "0.6534928", "0.64787394", "0.6463427", "0.6265117", "0.6263352", "0.62615985", "0.62555206", "0.6209522", "0.6144942", "0.6139519", "0.6107364", "0.6107364", "0.6107364", "0.6107364", "0.6107364", "0.6107364", "0.6107364", "0.6107364", "0.6107364"...
0.0
-1
Checks the type of a UTF8 byte, whether it's ASCII, a leading byte, or a continuation byte. If an invalid byte is detected, 2 is returned.
function utf8CheckByte(byte) { if (byte <= 0x7F) return 0;else if (byte >> 5 === 0x06) return 2;else if (byte >> 4 === 0x0E) return 3;else if (byte >> 3 === 0x1E) return 4; return byte >> 6 === 0x02 ? -1 : -2; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function utf8CheckByte(_byte) {\n if (_byte <= 0x7F) return 0;else if (_byte >> 5 === 0x06) return 2;else if (_byte >> 4 === 0x0E) return 3;else if (_byte >> 3 === 0x1E) return 4;\n return _byte >> 6 === 0x02 ? -1 : -2;\n} // Checks at most 3 bytes at the end of a Buffer in order to detect an", "function $lrG1...
[ "0.8007489", "0.79415", "0.78971726", "0.7816282", "0.7816282", "0.7779545", "0.77691144", "0.77562493", "0.77562493", "0.77562493", "0.77562493", "0.77562493", "0.77562493", "0.77562493", "0.77562493", "0.77562493", "0.77562493", "0.77562493", "0.77562493", "0.77562493", "0....
0.0
-1
Checks at most 3 bytes at the end of a Buffer in order to detect an incomplete multibyte UTF8 character. The total number of bytes (2, 3, or 4) needed to complete the UTF8 character (if applicable) are returned.
function utf8CheckIncomplete(self, buf, i) { var j = buf.length - 1; if (j < i) return 0; var nb = utf8CheckByte(buf[j]); if (nb >= 0) { if (nb > 0) self.lastNeed = nb - 1; return nb; } if (--j < i || nb === -2) return 0; nb = utf8CheckByte(buf[j]); if (nb >= 0) { if (nb > 0) self.lastNeed = nb - 2; return nb; } if (--j < i || nb === -2) return 0; nb = utf8CheckByte(buf[j]); if (nb >= 0) { if (nb > 0) { if (nb === 2) nb = 0;else self.lastNeed = nb - 3; } return nb; } return 0; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function utf8CheckIncomplete(self,buf,i){var j=buf.length-1;if(j<i)return 0;var nb=utf8CheckByte(buf[j]);if(nb>=0){if(nb>0)self.lastNeed=nb-1;return nb;}if(--j<i||nb===-2)return 0;nb=utf8CheckByte(buf[j]);if(nb>=0){if(nb>0)self.lastNeed=nb-2;return nb;}if(--j<i||nb===-2)return 0;nb=utf8CheckByte(buf[j]);if(nb>=0){...
[ "0.8212151", "0.8212151", "0.8134717", "0.8134717", "0.8054464", "0.8054464", "0.80306613", "0.80113757", "0.7847875", "0.78438944", "0.777723", "0.7750532", "0.7750532", "0.7750532", "0.7750532", "0.7750532", "0.7750532", "0.7750532", "0.7750532", "0.7750532", "0.7750532", ...
0.0
-1
Validates as many continuation bytes for a multibyte UTF8 character as needed or are available. If we see a noncontinuation byte where we expect one, we "replace" the validated continuation bytes we've seen so far with a single UTF8 replacement character ('\ufffd'), to match v8's UTF8 decoding behavior. The continuation byte check is included three times in the case where all of the continuation bytes for a character exist in the same buffer. It is also done this way as a slight performance increase instead of using a loop.
function utf8CheckExtraBytes(self, buf, p) { if ((buf[0] & 0xC0) !== 0x80) { self.lastNeed = 0; return '\ufffd'; } if (self.lastNeed > 1 && buf.length > 1) { if ((buf[1] & 0xC0) !== 0x80) { self.lastNeed = 1; return '\ufffd'; } if (self.lastNeed > 2 && buf.length > 2) { if ((buf[2] & 0xC0) !== 0x80) { self.lastNeed = 2; return '\ufffd'; } } } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function utf8CheckIncomplete(self,buf,i){var j=buf.length-1;if(j<i)return 0;var nb=utf8CheckByte(buf[j]);if(nb>=0){if(nb>0)self.lastNeed=nb-1;return nb;}if(--j<i||nb===-2)return 0;nb=utf8CheckByte(buf[j]);if(nb>=0){if(nb>0)self.lastNeed=nb-2;return nb;}if(--j<i||nb===-2)return 0;nb=utf8CheckByte(buf[j]);if(nb>=0){...
[ "0.7938579", "0.7938579", "0.74668145", "0.73105484", "0.73105484", "0.71157146", "0.6709958", "0.6589228", "0.6558177", "0.6545155", "0.64822084", "0.6435955", "0.638523", "0.6273487", "0.5986966", "0.5986966", "0.5986966", "0.5986966", "0.5986966", "0.5986966", "0.5986966",...
0.0
-1
Attempts to complete a multibyte UTF8 character using bytes from a Buffer.
function utf8FillLast(buf) { var p = this.lastTotal - this.lastNeed; var r = utf8CheckExtraBytes(this, buf, p); if (r !== undefined) return r; if (this.lastNeed <= buf.length) { buf.copy(this.lastChar, p, 0, this.lastNeed); return this.lastChar.toString(this.encoding, 0, this.lastTotal); } buf.copy(this.lastChar, p, 0, buf.length); this.lastNeed -= buf.length; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function utf8CheckExtraBytes(self,buf,p){if((buf[0]&0xC0)!==0x80){self.lastNeed=0;return '\\ufffd';}if(self.lastNeed>1&&buf.length>1){if((buf[1]&0xC0)!==0x80){self.lastNeed=1;return '\\ufffd';}if(self.lastNeed>2&&buf.length>2){if((buf[2]&0xC0)!==0x80){self.lastNeed=2;return '\\ufffd';}}}}// Attempts to complete a ...
[ "0.71276367", "0.70124817", "0.6781994", "0.67014897", "0.6564168", "0.6473516", "0.6473516", "0.6347521", "0.634379", "0.634379", "0.6313653", "0.6169375", "0.6169375", "0.6169375", "0.6169375", "0.6169375", "0.6169375", "0.6169375", "0.6169375", "0.6169375", "0.6169375", ...
0.0
-1
Returns all complete UTF8 characters in a Buffer. If the Buffer ended on a partial character, the character's bytes are buffered until the required number of bytes are available.
function utf8Text(buf, i) { var total = utf8CheckIncomplete(this, buf, i); if (!this.lastNeed) return buf.toString('utf8', i); this.lastTotal = total; var end = buf.length - (total - this.lastNeed); buf.copy(this.lastChar, 0, end); return buf.toString('utf8', i, end); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[]
[]
0.0
-1
For UTF8, a replacement character is added when ending on a partial character.
function utf8End(buf) { var r = buf && buf.length ? this.write(buf) : ''; if (this.lastNeed) return r + '\ufffd'; return r; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function utf8Text(buf,i){var total=utf8CheckIncomplete(this,buf,i);if(!this.lastNeed)return buf.toString('utf8',i);this.lastTotal=total;var end=buf.length-(total-this.lastNeed);buf.copy(this.lastChar,0,end);return buf.toString('utf8',i,end);}// For UTF-8, a replacement character is added when ending on a partial",...
[ "0.667488", "0.667488", "0.6232652", "0.622234", "0.6221108", "0.6221108", "0.58355445", "0.5805599", "0.5805599", "0.5803045", "0.5803045", "0.5803045", "0.5803045", "0.5803045", "0.5803045", "0.5803045", "0.5699923", "0.56926215", "0.56926215", "0.56629807", "0.5638852", ...
0.0
-1
UTF16LE typically needs two bytes per character, but even if we have an even number of bytes available, we need to check if we end on a leading/high surrogate. In that case, we need to wait for the next two bytes in order to decode the last character properly.
function utf16Text(buf, i) { if ((buf.length - i) % 2 === 0) { var r = buf.toString('utf16le', i); if (r) { var c = r.charCodeAt(r.length - 1); if (c >= 0xD800 && c <= 0xDBFF) { this.lastNeed = 2; this.lastTotal = 4; this.lastChar[0] = buf[buf.length - 2]; this.lastChar[1] = buf[buf.length - 1]; return r.slice(0, -1); } } return r; } this.lastNeed = 1; this.lastTotal = 2; this.lastChar[0] = buf[buf.length - 1]; return buf.toString('utf16le', i, buf.length - 1); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function isUTF16 (data) {\n var i = 0\n var len = data && data.length\n var pos = null\n var b1, b2, next, prev\n\n if (len < 2) {\n if (data[0] > 0xFF) {\n return false\n }\n } else {\n b1 = data[0]\n b2 = data[1]\n if (b1 === 0xFF && // BOM (little-endian)\n ...
[ "0.6965733", "0.6921093", "0.6921093", "0.6816889", "0.674768", "0.674768", "0.6736693", "0.6736693", "0.6727127", "0.6641879" ]
0.0
-1
For UTF16LE we do not explicitly append special replacement characters if we end on a partial character, we simply let v8 handle that.
function utf16End(buf) { var r = buf && buf.length ? this.write(buf) : ''; if (this.lastNeed) { var end = this.lastTotal - this.lastNeed; return r + this.lastChar.toString('utf16le', 0, end); } return r; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function $lrG1$var$utf16Text(buf, i) {\n if ((buf.length - i) % 2 === 0) {\n var r = buf.toString('utf16le', i);\n\n if (r) {\n var c = r.charCodeAt(r.length - 1);\n\n if (c >= 0xD800 && c <= 0xDBFF) {\n this.lastNeed = 2;\n this.lastTotal = 4;\n this.lastChar[0] = buf[buf.len...
[ "0.61745626", "0.61719906", "0.61677617", "0.6157869", "0.6157869", "0.6081929", "0.6043509", "0.58793575", "0.58793575", "0.5811206", "0.5811206", "0.5811206", "0.5811206", "0.5811206", "0.5811206", "0.5811206", "0.5790016", "0.5790016", "0.5742851", "0.570861", "0.5700932",...
0.0
-1
Pass bytes on through for singlebyte encodings (e.g. ascii, latin1, hex)
function simpleWrite(buf) { return buf.toString(this.encoding); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function utf8CheckExtraBytes(self,buf,p){if((buf[0]&0xC0)!==0x80){self.lastNeed=0;return\"\\uFFFD\";}if(self.lastNeed>1&&buf.length>1){if((buf[1]&0xC0)!==0x80){self.lastNeed=1;return\"\\uFFFD\";}if(self.lastNeed>2&&buf.length>2){if((buf[2]&0xC0)!==0x80){self.lastNeed=2;return\"\\uFFFD\";}}}}// Attempts to complete...
[ "0.6347982", "0.6319343", "0.62030256", "0.6178372", "0.6119618", "0.6044089", "0.5956979", "0.5949303", "0.59141946", "0.59141946", "0.59141946", "0.58995837", "0.5895085", "0.5891917", "0.5869272", "0.5869272", "0.5869272", "0.5869272", "0.5787296", "0.576836", "0.57242066"...
0.0
-1
Could use `inherits` module, but don't want to move from single file architecture yet.
function inherits (ctor, superCtor) { ctor.super_ = superCtor; var TempCtor = function () {}; TempCtor.prototype = superCtor.prototype; ctor.prototype = new TempCtor(); ctor.prototype.constructor = ctor; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function inherit(){}", "function SuperclassBare() {}", "function SuperclassBare() {}", "function inherited() { }", "function inheritsFrom(child, parent){\nchild.prototype = Object.create(parent.prototype);\n}", "function inheritFrom(subfn,superfn) {\n\tvar r = function () {}\n\tr.prototype = superfn.prot...
[ "0.7398729", "0.7261122", "0.7261122", "0.69321644", "0.6614716", "0.6482389", "0.64594245", "0.6351272", "0.6344033", "0.6344033", "0.6322819", "0.6322819", "0.6123587", "0.61221385", "0.60969925", "0.60739726", "0.6069109", "0.60670304", "0.60664034", "0.60634947", "0.60634...
0.0
-1
CooleyTukey algorithm for FFT slightly revisited to rely on looping instead of recursion
function FFTM (x, y) { this.x = x; this.y = y; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function FFTNayuki(n) {\n \n this.n = n;\n this.levels = -1;\n\n for (var i = 0; i < 32; i++) {\n if (1 << i == n) {\n this.levels = i; // Equal to log2(n)\n }\n }\n if (this.levels == -1) {\n throw \"Length is not a power of 2\";\n }\n\n this.cosTable = new...
[ "0.6596565", "0.61714965", "0.60477644", "0.6025667", "0.5921966", "0.58883363", "0.58471066", "0.5780482", "0.5777901", "0.57056165", "0.5629252", "0.5589546", "0.557242", "0.5466943", "0.54559976", "0.5343446", "0.53264683", "0.53212196", "0.53055847", "0.5275151", "0.52675...
0.0
-1
alternative to using Object.keys for old browsers
function copyProps (src, dst) { for (var key in src) { dst[key] = src[key] } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function getKeys(obj) {\n return Object.keys(obj); // Yes it is builtin!\n }", "function Object_keys(obj) {\n\t if (Object.keys) return Object.keys(obj)\n\t else {\n\t var res = [];\n\t for (var key in obj) res.push(key);\n\t return res;\n\t }\n\t}", "function keys(obj){\n return Object....
[ "0.7382736", "0.7311627", "0.723966", "0.7199875", "0.7199875", "0.7199875", "0.7199875", "0.7199875", "0.7199875", "0.7199875", "0.7199875", "0.7199875", "0.7109948", "0.69957906", "0.69584274", "0.6930815", "0.6926222", "0.6915537", "0.6879077", "0.68776375", "0.686874", ...
0.0
-1
undocumented cb() API, needed for core, not for public API
function destroy(err, cb) { var _this = this; var readableDestroyed = this._readableState && this._readableState.destroyed; var writableDestroyed = this._writableState && this._writableState.destroyed; if (readableDestroyed || writableDestroyed) { if (cb) { cb(err); } else if (err) { if (!this._writableState) { process.nextTick(emitErrorNT, this, err); } else if (!this._writableState.errorEmitted) { this._writableState.errorEmitted = true; process.nextTick(emitErrorNT, this, err); } } return this; } // we set destroyed to true before firing error callbacks in order // to make it re-entrance safe in case destroy() is called within callbacks if (this._readableState) { this._readableState.destroyed = true; } // if this is a duplex stream mark the writable part as destroyed as well if (this._writableState) { this._writableState.destroyed = true; } this._destroy(err || null, function (err) { if (!cb && err) { if (!_this._writableState) { process.nextTick(emitErrorAndCloseNT, _this, err); } else if (!_this._writableState.errorEmitted) { _this._writableState.errorEmitted = true; process.nextTick(emitErrorAndCloseNT, _this, err); } else { process.nextTick(emitCloseNT, _this); } } else if (cb) { process.nextTick(emitCloseNT, _this); cb(err); } else { process.nextTick(emitCloseNT, _this); } }); return this; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function callback() {}", "function callback() {}", "function callback() {}", "function callback() {}", "function callback() {}", "function callback(){}", "function cb () {\n\t\tcallback();\n\t}", "function callback(cb){\n\n cb(1);\n}", "function callbackDriver() {\n cb();\n }", "function _...
[ "0.7929359", "0.7929359", "0.7929359", "0.7929359", "0.7929359", "0.78780985", "0.774444", "0.7325545", "0.72348475", "0.7150749", "0.714458", "0.714458", "0.7128243", "0.70339185", "0.7026711", "0.70005727", "0.6974018", "0.69349253", "0.69214183", "0.680627", "0.680627", ...
0.0
-1
Swap bits across the left and right words
function exchangeLR(offset, mask) { var t = ((this._lBlock >>> offset) ^ this._rBlock) & mask; this._rBlock ^= t; this._lBlock ^= t << offset; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "SWAP_R(r1){\n let half_1 = r1 & HALF_ADDRESS_MASK;\n let half_2 = r1 >> HALF_ADDRESS;\n let result = (half_1 << (HALF_ADDRESS - 1)) | half_2;\n this.zero_flag = result === 0;\n this.subtraction_flag = false;\n this.half_carry_flag = false;\n this.carry_flag = false;\n return re...
[ "0.6249045", "0.6114734", "0.60637045", "0.60086673", "0.6003548", "0.59728557", "0.595161", "0.58789766", "0.5828829", "0.5791633", "0.5760751", "0.5759487", "0.5757263", "0.5757263", "0.574216", "0.5737053", "0.57149094", "0.57011247", "0.569603", "0.5693619", "0.5688268", ...
0.0
-1
if it's past the high water mark, we can push in some more. Also, if we have no data yet, we can stand some more bytes. This is to work around cases where hwm=0, such as the repl. Also, if the push() triggered a readable event, and the user called read(largeNumber) such that needReadable was set, then we ought to push more, so that another 'readable' event will be triggered.
function needMoreData(state) { return !state.ended && (state.needReadable || state.length < state.highWaterMark || state.length === 0); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function push(){if(pushes>PUSHCOUNT)return;if(pushes++===PUSHCOUNT){console.error(\" push(EOF)\");return r.push(null)}console.error(\" push #%d\",pushes);r.push(new Buffer(PUSHSIZE))&&setTimeout(push)}", "tryPush() {\n\t\t// Get the total length of what would be pushed.\n\t\tconst amountToPush = Math.min(thi...
[ "0.6566164", "0.6406769", "0.6392576", "0.6380779", "0.6350606", "0.6350606", "0.62419623", "0.62129945", "0.61704314", "0.61647177", "0.61647177", "0.61647177", "0.61647177", "0.61647177", "0.61647177", "0.61647177", "0.61647177", "0.61647177", "0.61647177", "0.61647177", "0...
0.0
-1
This function is designed to be inlinable, so please take care when making changes to the function body.
function howMuchToRead(n, state) { if (n <= 0 || state.length === 0 && state.ended) return 0; if (state.objectMode) return 1; if (n !== n) { // Only flow one buffer at a time if (state.flowing && state.length) return state.buffer.head.data.length;else return state.length; } // If we're asking for more than the current hwm, then raise the hwm. if (n > state.highWaterMark) state.highWaterMark = computeNewHighWaterMark(n); if (n <= state.length) return n; // Don't have enough if (!state.ended) { state.needReadable = true; return 0; } return state.length; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private internal function m248() {}", "private public function m246() {}", "protected internal function m252() {}", "transient protected internal function m189() {}", "transient private protected internal function m182() {}", "transient private internal function m185() {}", "transient final protected i...
[ "0.6834725", "0.6709401", "0.6685449", "0.6601311", "0.6529556", "0.63083076", "0.630547", "0.62607104", "0.62105167", "0.6123427", "0.60723734", "0.59892076", "0.5983364", "0.59116167", "0.58993673", "0.58827627", "0.58819175", "0.57529277", "0.5732892", "0.5720398", "0.5714...
0.0
-1
Don't emit readable right away in sync mode, because this can trigger another read() call => stack overflow. This way, it might trigger a nextTick recursion warning, but that's not so bad.
function emitReadable(stream) { var state = stream._readableState; state.needReadable = false; if (!state.emittedReadable) { debug('emitReadable', state.flowing); state.emittedReadable = true; if (state.sync) pna.nextTick(emitReadable_, stream);else emitReadable_(stream); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function emitReadable(stream){var state=stream._readableState;state.needReadable=false;if(!state.emittedReadable){debug(\"emitReadable\",state.flowing);state.emittedReadable=true;if(state.sync)processNextTick(emitReadable_,stream);else emitReadable_(stream)}}", "function emitReadable(stream){var state=stream._re...
[ "0.7172872", "0.71162724", "0.71162724", "0.69792116", "0.69335407", "0.6921606", "0.6902265", "0.68966615", "0.6883772", "0.6873843", "0.6873843", "0.6873843", "0.6873843", "0.6873843", "0.6873843", "0.6873843", "0.6873843", "0.6873843", "0.6873843", "0.6873843", "0.6873843"...
0.0
-1
at this point, the user has presumably seen the 'readable' event, and called read() to consume some data. that may have triggered in turn another _read(n) call, in which case reading = true if it's in progress. However, if we're not ended, or reading, and the length < hwm, then go ahead and try to read some more preemptively.
function maybeReadMore(stream, state) { if (!state.readingMore) { state.readingMore = true; pna.nextTick(maybeReadMore_, stream, state); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "_read() {\r\n\t\tthis._readingPaused = false\r\n\t\tsetImmediate(this._onReadable.bind(this))\r\n\t}", "_onReadable() {\r\n\t\t// Read all the data until one of two conditions is met\r\n\t\t// 1. there is nothing left to read on the socket\r\n\t\t// 2. reading is paused because the consumer is slow\r\n\t\twhile ...
[ "0.73015", "0.6975333", "0.67700106", "0.6745473", "0.6745473", "0.6741676", "0.6741676", "0.67209065", "0.6688621", "0.6662293", "0.6654743", "0.66190994", "0.6565681", "0.65000814", "0.64993453", "0.64993453", "0.64837223", "0.64671636", "0.6465028", "0.6382726", "0.6380752...
0.0
-1
if the dest has an error, then stop piping into it. however, don't suppress the throwing behavior for this.
function onerror(er) { debug('onerror', er); unpipe(); dest.removeListener('error', onerror); if (EElistenerCount(dest, 'error') === 0) dest.emit('error', er); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function onerror(er){debug(\"onerror\",er);unpipe();dest.removeListener(\"error\",onerror);if(EElistenerCount(dest,\"error\")===0)dest.emit(\"error\",er)}", "function onerror(er){debug('onerror',er);unpipe();dest.removeListener('error',onerror);if(EElistenerCount(dest,'error')===0)dest.emit('error',er);}// Make ...
[ "0.76043177", "0.72085834", "0.72085834", "0.72085834", "0.7148598", "0.7148598", "0.714277", "0.712524", "0.712524", "0.712524", "0.712524", "0.712524", "0.712524", "0.712524", "0.712524", "0.712524", "0.712524", "0.712524", "0.712524", "0.712524", "0.712524", "0.712524", ...
0.0
-1
Both close and finish should trigger unpipe, but only once.
function onclose() { dest.removeListener('finish', onfinish); unpipe(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function onclose() {\n\t dest.removeListener('finish', onfinish);\n\t unpipe();\n\t }", "function onclose() {\n\t dest.removeListener('finish', onfinish);\n\t unpipe();\n\t }", "function onclose() {\n\t dest.removeListener('finish', onfinish);\n\t unpipe();\n\t }", "function onclose() {\...
[ "0.7979133", "0.7979133", "0.7979133", "0.7979133", "0.7979133", "0.7979133", "0.7979133", "0.7979133", "0.7979133", "0.7979133", "0.7979133", "0.7979133", "0.7979133", "0.7979133", "0.7979133", "0.7979133", "0.7979133", "0.7979133", "0.7979133", "0.7979133", "0.7979133", "...
0.0
-1
Pluck off n bytes from an array of buffers. Length is the combined lengths of all the buffers in the list. This function is designed to be inlinable, so please take care when making changes to the function body.
function fromList(n, state) { // nothing buffered if (state.length === 0) return null; var ret; if (state.objectMode) ret = state.buffer.shift();else if (!n || n >= state.length) { // read it all, truncate the list if (state.decoder) ret = state.buffer.join('');else if (state.buffer.length === 1) ret = state.buffer.head.data;else ret = state.buffer.concat(state.length); state.buffer.clear(); } else { // read part of list ret = fromListPartial(n, state.buffer, state.decoder); } return ret; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function copyFromBuffer(n, list) {\n var ret = Buffer.allocUnsafe(n);\n var p = list.head;\n var c = 1;\n p.data.copy(ret);\n n -= p.data.length;\n\n while (p = p.next) {\n var buf = p.data;\n var nb = n > buf.length ? buf.length : n;\n buf.copy(ret, ret.length - n, 0, nb);\n n -= nb;\n\n if (...
[ "0.656273", "0.6561303", "0.6561303", "0.6561303", "0.6561303", "0.6561303", "0.6561303", "0.6561303", "0.6561303", "0.6561303", "0.6561303", "0.6561303", "0.6561303", "0.6561303", "0.6561303", "0.6561303", "0.6561303", "0.6561303", "0.6561303", "0.6561303", "0.6561303", "0...
0.0
-1
Extracts only enough buffered data to satisfy the amount requested. This function is designed to be inlinable, so please take care when making changes to the function body.
function fromListPartial(n, list, hasStrings) { var ret; if (n < list.head.data.length) { // slice is the same for buffers and strings ret = list.head.data.slice(0, n); list.head.data = list.head.data.slice(n); } else if (n === list.head.data.length) { // first chunk is a perfect match ret = list.shift(); } else { // result spans more than one buffer ret = hasStrings ? copyFromBufferString(n, list) : copyFromBuffer(n, list); } return ret; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function _sliceBuffer(amount) {\n var newBuffer = _itemsWaitingToBeRendered.slice(amount, _itemsWaitingToBeRendered.length);\n var returnedObjArray = _itemsWaitingToBeRendered.slice(0, amount);\n _itemsWaitingToBeRendered = newBuffer;\n return returnedObjArray;\n }", "async readWait(length...
[ "0.62108356", "0.6177074", "0.58673865", "0.58045495", "0.5689378", "0.55543333", "0.5505669", "0.5505669", "0.55015665", "0.55015665", "0.5497372", "0.54881173", "0.5456298", "0.5452116", "0.5447954", "0.5447954", "0.5425875", "0.5420935", "0.5420935", "0.5420935", "0.542093...
0.0
-1
Copies a specified amount of characters from the list of buffered data chunks. This function is designed to be inlinable, so please take care when making changes to the function body.
function copyFromBufferString(n, list) { var p = list.head; var c = 1; var ret = p.data; n -= ret.length; while (p = p.next) { var str = p.data; var nb = n > str.length ? str.length : n; if (nb === str.length) ret += str;else ret += str.slice(0, n); n -= nb; if (n === 0) { if (nb === str.length) { ++c; if (p.next) list.head = p.next;else list.head = list.tail = null; } else { list.head = p; p.data = str.slice(nb); } break; } ++c; } list.length -= c; return ret; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function copyFromBufferString(n,list){var p=list.head;var c=1;var ret=p.data;n-=ret.length;while(p=p.next){var str=p.data;var nb=n>str.length?str.length:n;if(nb===str.length)ret+=str;else ret+=str.slice(0,n);n-=nb;if(n===0){if(nb===str.length){++c;if(p.next)list.head=p.next;else list.head=list.tail=null;}else{list...
[ "0.75634474", "0.75634474", "0.75634474", "0.75146735", "0.75051266", "0.6852791", "0.6747564", "0.6714847" ]
0.0
-1
Copies a specified amount of bytes from the list of buffered data chunks. This function is designed to be inlinable, so please take care when making changes to the function body.
function copyFromBuffer(n, list) { var ret = Buffer.allocUnsafe(n); var p = list.head; var c = 1; p.data.copy(ret); n -= p.data.length; while (p = p.next) { var buf = p.data; var nb = n > buf.length ? buf.length : n; buf.copy(ret, ret.length - n, 0, nb); n -= nb; if (n === 0) { if (nb === buf.length) { ++c; if (p.next) list.head = p.next;else list.head = list.tail = null; } else { list.head = p; p.data = buf.slice(nb); } break; } ++c; } list.length -= c; return ret; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function copyFromBufferString(n,list){var p=list.head;var c=1;var ret=p.data;n-=ret.length;while(p=p.next){var str=p.data;var nb=n>str.length?str.length:n;if(nb===str.length)ret+=str;else ret+=str.slice(0,n);n-=nb;if(n===0){if(nb===str.length){++c;if(p.next)list.head=p.next;else list.head=list.tail=null;}else{list...
[ "0.7123923", "0.7123923", "0.7123923", "0.689632", "0.6871288", "0.63428336", "0.6314875", "0.6311417" ]
0.0
-1
The Buffer constructor returns instances of `Uint8Array` that have their prototype changed to `Buffer.prototype`. Furthermore, `Buffer` is a subclass of `Uint8Array`, so the returned instances will have all the node `Buffer` methods and the `Uint8Array` methods. Square bracket notation works as expected it returns a single octet. The `Uint8Array` prototype remains unmodified.
function Buffer (arg, encodingOrOffset, length) { if (!Buffer.TYPED_ARRAY_SUPPORT && !(this instanceof Buffer)) { return new Buffer(arg, encodingOrOffset, length) } // Common case. if (typeof arg === 'number') { if (typeof encodingOrOffset === 'string') { throw new Error( 'If encoding is specified then the first argument must be a string' ) } return allocUnsafe(this, arg) } return from(this, arg, encodingOrOffset, length) }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function BufferToArrayBuffer () {\n return (new Buffer(this)).buffer\n}", "function BufferToArrayBuffer () {\n return (new Buffer(this)).buffer\n}", "function BufferToArrayBuffer () {\n return (new Buffer(this)).buffer\n}", "function BufferToArrayBuffer () {\n return (new Buffer(this)).buffer\n}", "toB...
[ "0.7353736", "0.7353736", "0.7353736", "0.7353736", "0.6973817", "0.68946433", "0.68946433", "0.68478596", "0.68478596", "0.68478596", "0.68478596", "0.68478596", "0.68478596", "0.68478596", "0.6837678", "0.6837678", "0.6837678", "0.6837678", "0.6837678", "0.6837678", "0.6837...
0.0
-1
Finds either the first index of `val` in `buffer` at offset >= `byteOffset`, OR the last index of `val` in `buffer` at offset <= `byteOffset`. Arguments: buffer a Buffer to search val a string, Buffer, or number byteOffset an index into `buffer`; will be clamped to an int32 encoding an optional encoding, relevant is val is a string dir true for indexOf, false for lastIndexOf
function bidirectionalIndexOf (buffer, val, byteOffset, encoding, dir) { // Empty buffer means no match if (buffer.length === 0) return -1 // Normalize byteOffset if (typeof byteOffset === 'string') { encoding = byteOffset byteOffset = 0 } else if (byteOffset > 0x7fffffff) { byteOffset = 0x7fffffff } else if (byteOffset < -0x80000000) { byteOffset = -0x80000000 } byteOffset = +byteOffset // Coerce to Number. if (isNaN(byteOffset)) { // byteOffset: it it's undefined, null, NaN, "foo", etc, search whole buffer byteOffset = dir ? 0 : (buffer.length - 1) } // Normalize byteOffset: negative offsets start from the end of the buffer if (byteOffset < 0) byteOffset = buffer.length + byteOffset if (byteOffset >= buffer.length) { if (dir) return -1 else byteOffset = buffer.length - 1 } else if (byteOffset < 0) { if (dir) byteOffset = 0 else return -1 } // Normalize val if (typeof val === 'string') { val = Buffer.from(val, encoding) } // Finally, search either indexOf (if dir is true) or lastIndexOf if (Buffer.isBuffer(val)) { // Special case: looking for empty string/buffer always fails if (val.length === 0) { return -1 } return arrayIndexOf(buffer, val, byteOffset, encoding, dir) } else if (typeof val === 'number') { val = val & 0xFF // Search for a byte value [0-255] if (Buffer.TYPED_ARRAY_SUPPORT && typeof Uint8Array.prototype.indexOf === 'function') { if (dir) { return Uint8Array.prototype.indexOf.call(buffer, val, byteOffset) } else { return Uint8Array.prototype.lastIndexOf.call(buffer, val, byteOffset) } } return arrayIndexOf(buffer, [ val ], byteOffset, encoding, dir) } throw new TypeError('val must be string, number or Buffer') }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function bidirectionalIndexOf(buffer,val,byteOffset,encoding,dir){// Empty buffer means no match\n if(buffer.length===0)return -1;// Normalize byteOffset\n if(typeof byteOffset==='string'){encoding=byteOffset;byteOffset=0;}else if(byteOffset>0x7fffffff){byteOffset=0x7fffffff;}else if(byteOffset<-0x80000000){byte...
[ "0.82823086", "0.8254614", "0.8254614", "0.82530254", "0.82530254", "0.82530254", "0.82530254", "0.82530254", "0.82530254", "0.82530254", "0.82530254", "0.824807", "0.8245907", "0.8244159", "0.8244159", "0.82278013", "0.82197213", "0.8218354", "0.8218354", "0.8218354", "0.821...
0.0
-1
Need to make sure that buffer isn't trying to write out of bounds.
function checkOffset (offset, ext, length) { if ((offset % 1) !== 0 || offset < 0) throw new RangeError('offset is not uint') if (offset + ext > length) throw new RangeError('Trying to access beyond buffer length') }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function writeBuffer(buffer, pos, src) {\n src.copy(buffer, pos)\n return src.length\n}", "function writeBuffer(buffer, pos, src) {\n src.copy(buffer, pos)\n return src.length\n}", "ensure(n) {\n let minsize = this.pos + n;\n if (minsize > this.capacity) {\n let cap = this.capacity * 2;\n w...
[ "0.6669716", "0.6669716", "0.6633025", "0.65209574", "0.6381274", "0.6276594", "0.6256719", "0.62328744", "0.62328744", "0.6104318", "0.6034488", "0.60188454", "0.5979925", "0.59604335", "0.59518254", "0.59518254", "0.59518254", "0.59518254", "0.59518254", "0.59518254", "0.59...
0.0
-1
prototype class for hash functions
function Hash (blockSize, finalSize) { this._block = Buffer.alloc(blockSize) this._finalSize = finalSize this._blockSize = blockSize this._len = 0 }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function Hash() {}", "function Hash() {}", "function Hash() {\r\n}", "function Hashers() {\n}", "GetHashCode() {\n\n }", "_generateHash() {\n\n }", "hash() {\n return this.is()\n }", "function Hasher()\n{\n this.truckHash = {};\n}", "calculateHash(){\n return SHA256(this.index + this.pr...
[ "0.8444925", "0.8444925", "0.8012337", "0.7593274", "0.7441991", "0.7378374", "0.73555523", "0.7269683", "0.71957415", "0.718947", "0.7186965", "0.71654564", "0.7144473", "0.71247315", "0.70964617", "0.7088249", "0.70709276", "0.7060434", "0.70601094", "0.7054379", "0.702781"...
0.0
-1
Could use `inherits` module, but don't want to move from single file architecture yet.
function inherits (ctor, superCtor) { ctor.super_ = superCtor; var TempCtor = function () {}; TempCtor.prototype = superCtor.prototype; ctor.prototype = new TempCtor(); ctor.prototype.constructor = ctor; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function inherit(){}", "function SuperclassBare() {}", "function SuperclassBare() {}", "function inherited() { }", "function inheritsFrom(child, parent){\nchild.prototype = Object.create(parent.prototype);\n}", "function inheritFrom(subfn,superfn) {\n\tvar r = function () {}\n\tr.prototype = superfn.prot...
[ "0.73977566", "0.72600657", "0.72600657", "0.69314426", "0.66141313", "0.64813936", "0.64593697", "0.63513047", "0.6343339", "0.6343339", "0.6322658", "0.6322658", "0.6122129", "0.6120975", "0.6094837", "0.6072585", "0.60704786", "0.606606", "0.6066017", "0.6063663", "0.60636...
0.0
-1
CooleyTukey algorithm for FFT slightly revisited to rely on looping instead of recursion
function FFTM (x, y) { this.x = x; this.y = y; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function FFTNayuki(n) {\n \n this.n = n;\n this.levels = -1;\n\n for (var i = 0; i < 32; i++) {\n if (1 << i == n) {\n this.levels = i; // Equal to log2(n)\n }\n }\n if (this.levels == -1) {\n throw \"Length is not a power of 2\";\n }\n\n this.cosTable = new...
[ "0.65965456", "0.61721987", "0.60486144", "0.6026577", "0.5922448", "0.5888932", "0.58482796", "0.5780942", "0.577901", "0.5706382", "0.5629209", "0.55900085", "0.5572849", "0.5467393", "0.5457597", "0.53435135", "0.5327273", "0.5321109", "0.53066593", "0.5276428", "0.5269115...
0.0
-1
changes to the function body.
function howMuchToRead(n, state) { if (n <= 0 || state.length === 0 && state.ended) return 0; if (state.objectMode) return 1; if (n !== n) { // Only flow one buffer at a time if (state.flowing && state.length) return state.buffer.head.data.length;else return state.length; } // If we're asking for more than the current hwm, then raise the hwm. if (n > state.highWaterMark) state.highWaterMark = computeNewHighWaterMark(n); if (n <= state.length) return n; // Don't have enough if (!state.ended) { state.needReadable = true; return 0; } return state.length; } // you can override either this method, or the async _read(n) below.
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function funcionPorDefinicion(){\n //Body\n }", "function updateFunction() {\n \tupdatePreview();\n \tupdateHTMLCode();\n }", "function update()\n{\n\n}", "function update() {}", "function update() {\n \n}", "function updateroster() {\n\n}", "update()\n {\n \n }", "updateBodi...
[ "0.59476674", "0.571112", "0.5705222", "0.55671674", "0.5533744", "0.55332184", "0.552779", "0.552636", "0.55096877", "0.55064136", "0.54921454", "0.54918206", "0.5490372", "0.5468623", "0.5458237", "0.5458237", "0.5458237", "0.5458237", "0.5458237", "0.5458237", "0.5458237",...
0.0
-1
another read() call => stack overflow. This way, it might trigger a nextTick recursion warning, but that's not so bad.
function emitReadable(stream) { var state = stream._readableState; debug('emitReadable', state.needReadable, state.emittedReadable); state.needReadable = false; if (!state.emittedReadable) { debug('emitReadable', state.flowing); state.emittedReadable = true; process.nextTick(emitReadable_, stream); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "_read () {}", "_read () {}", "_read () {}", "function maybeReadMore(stream,state){if(!state.readingMore){state.readingMore=true;processNextTick(maybeReadMore_,stream,state)}}", "function maybeReadMore(stream,state){if(!state.readingMore){state.readingMore=true;processNextTick(maybeReadMore_,stream,state);}...
[ "0.6265203", "0.6265203", "0.6265203", "0.6244408", "0.6201165", "0.6201165", "0.61972976", "0.6191486", "0.6191486", "0.61867595", "0.6110473", "0.60130596", "0.60005563", "0.59954906", "0.5987951", "0.59835035", "0.59570974", "0.59570974", "0.5944369", "0.5939657", "0.59207...
0.0
-1
and called read() to consume some data. that may have triggered in turn another _read(n) call, in which case reading = true if it's in progress. However, if we're not ended, or reading, and the length < hwm, then go ahead and try to read some more preemptively.
function maybeReadMore(stream, state) { if (!state.readingMore) { state.readingMore = true; process.nextTick(maybeReadMore_, stream, state); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function maybeReadMore(stream,state){if(!state.readingMore){state.readingMore=true;processNextTick(maybeReadMore_,stream,state)}}", "function maybeReadMore(stream,state){if(!state.readingMore){state.readingMore=true;processNextTick(maybeReadMore_,stream,state);}}", "function maybeReadMore(stream,state){if(!sta...
[ "0.7070489", "0.70413435", "0.70413435", "0.6816485", "0.67867476", "0.6750647", "0.6750647", "0.6724124", "0.6717587", "0.6695122", "0.66936404", "0.66233546", "0.65678835", "0.6545222", "0.6545222", "0.6545222", "0.6545222", "0.6545222", "0.6545222", "0.6545222", "0.6545222...
0.0
-1
however, don't suppress the throwing behavior for this.
function onerror(er) { debug('onerror', er); unpipe(); dest.removeListener('error', onerror); if (EElistenerCount(dest, 'error') === 0) errorOrDestroy(dest, er); } // Make sure our error handler is attached before userland ones.
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function thrower(){throw new Error(\"this should not happen!\")}", "function noOp(err) { if (err) { throw err; } }", "function Exception() {\n return;\n}", "function m(a){throw a;}", "unsafelyUnwrap() {\n throw new Error('Tried to `unsafelyUnwrap an Err`');\n }", "function sc_raise(obj) {\n ...
[ "0.71059024", "0.6838337", "0.6533699", "0.63986665", "0.6326424", "0.62824893", "0.6280775", "0.6185583", "0.6184031", "0.61336714", "0.6123854", "0.61223495", "0.61180544", "0.61040217", "0.60873425", "0.6080475", "0.6079729", "0.60277677", "0.6026571", "0.5962616", "0.5947...
0.0
-1
Both close and finish should trigger unpipe, but only once.
function onclose() { dest.removeListener('finish', onfinish); unpipe(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function onclose() {\n\t dest.removeListener('finish', onfinish);\n\t unpipe();\n\t }", "function onclose() {\n\t dest.removeListener('finish', onfinish);\n\t unpipe();\n\t }", "function onclose() {\n\t dest.removeListener('finish', onfinish);\n\t unpipe();\n\t }", "function onclose() {\...
[ "0.7979133", "0.7979133", "0.7979133", "0.7979133", "0.7979133", "0.7979133", "0.7979133", "0.7979133", "0.7979133", "0.7979133", "0.7979133", "0.7979133", "0.7979133", "0.7979133", "0.7979133", "0.7979133", "0.7979133", "0.7979133", "0.7979133", "0.7979133", "0.7979133", "...
0.0
-1
Pluck off n bytes from an array of buffers. Length is the combined lengths of all the buffers in the list. This function is designed to be inlinable, so please take care when making changes to the function body.
function fromList(n, state) { // nothing buffered if (state.length === 0) return null; var ret; if (state.objectMode) ret = state.buffer.shift();else if (!n || n >= state.length) { // read it all, truncate the list if (state.decoder) ret = state.buffer.join('');else if (state.buffer.length === 1) ret = state.buffer.first();else ret = state.buffer.concat(state.length); state.buffer.clear(); } else { // read part of list ret = state.buffer.consume(n, state.decoder); } return ret; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function copyFromBuffer(n, list) {\n var ret = Buffer.allocUnsafe(n);\n var p = list.head;\n var c = 1;\n p.data.copy(ret);\n n -= p.data.length;\n\n while (p = p.next) {\n var buf = p.data;\n var nb = n > buf.length ? buf.length : n;\n buf.copy(ret, ret.length - n, 0, nb);\n n -= nb;\n\n if (...
[ "0.65643716", "0.65629953", "0.65629953", "0.65629953", "0.65629953", "0.65629953", "0.65629953", "0.65629953", "0.65629953", "0.65629953", "0.65629953", "0.65629953", "0.65629953", "0.65629953", "0.65629953", "0.65629953", "0.65629953", "0.65629953", "0.65629953", "0.65629953"...
0.0
-1
Could use `inherits` module, but don't want to move from single file architecture yet.
function inherits (ctor, superCtor) { ctor.super_ = superCtor; var TempCtor = function () {}; TempCtor.prototype = superCtor.prototype; ctor.prototype = new TempCtor(); ctor.prototype.constructor = ctor; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function inherit(){}", "function SuperclassBare() {}", "function SuperclassBare() {}", "function inherited() { }", "function inheritsFrom(child, parent){\nchild.prototype = Object.create(parent.prototype);\n}", "function inheritFrom(subfn,superfn) {\n\tvar r = function () {}\n\tr.prototype = superfn.prot...
[ "0.73977566", "0.72600657", "0.72600657", "0.69314426", "0.66141313", "0.64813936", "0.64593697", "0.63513047", "0.6343339", "0.6343339", "0.6322658", "0.6322658", "0.6122129", "0.6120975", "0.6094837", "0.6072585", "0.60704786", "0.606606", "0.6066017", "0.6063663", "0.60636...
0.0
-1
CooleyTukey algorithm for FFT slightly revisited to rely on looping instead of recursion
function FFTM (x, y) { this.x = x; this.y = y; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function FFTNayuki(n) {\n \n this.n = n;\n this.levels = -1;\n\n for (var i = 0; i < 32; i++) {\n if (1 << i == n) {\n this.levels = i; // Equal to log2(n)\n }\n }\n if (this.levels == -1) {\n throw \"Length is not a power of 2\";\n }\n\n this.cosTable = new...
[ "0.65965456", "0.61721987", "0.60486144", "0.6026577", "0.5922448", "0.5888932", "0.58482796", "0.5780942", "0.577901", "0.5706382", "0.5629209", "0.55900085", "0.5572849", "0.5467393", "0.5457597", "0.53435135", "0.5327273", "0.5321109", "0.53066593", "0.5276428", "0.5269115...
0.0
-1
oldstyle streams. Note that the pipe method (the only relevant part of this class) is overridden in the Readable class.
function Stream() { EE.call(this); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function pipe(stream) {\n var cache, scope = this;\n if(stream) {\n // add to the pipeline\n this.fuse(stream);\n // ensure return values are also added to the pipeline\n cache = stream.pipe;\n stream.pipe = function(/* dest */) {\n // restore cached method when called\n this.pipe = cach...
[ "0.7391046", "0.7193911", "0.69003284", "0.6535079", "0.6492158", "0.64121234", "0.6312585", "0.6289099", "0.6283648", "0.6283648", "0.6233074", "0.62132454", "0.61965346", "0.6182556", "0.6182556", "0.6139443", "0.6126965", "0.61033857", "0.61033857", "0.60855305", "0.604665...
0.0
-1
don't leave dangling pipes when there are errors.
function onerror(er) { cleanup(); if (EE.listenerCount(this, 'error') === 0) { throw er; // Unhandled stream error in pipe. } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function brokenPipe() {\n throw Error('artoo.asyncStore: broken pipe.');\n }", "function onerror(error) {\n cleanup();\n if (!hasListeners(this, 'error'))\n throw error; // Unhandled stream error in pipe.\n }", "function onerror(er){debug(\"onerror\",er);unpipe();dest.removeListener(\"e...
[ "0.69866925", "0.6516497", "0.6399389", "0.6383316", "0.63701004", "0.63701004", "0.63701004", "0.63701004", "0.63701004", "0.6333437", "0.6292604", "0.6285128", "0.6285128", "0.6274714", "0.6233449", "0.62333864", "0.6221305", "0.62146306", "0.62146306", "0.62146306", "0.621...
0.0
-1
remove all the event listeners that were added.
function cleanup() { source.removeListener('data', ondata); dest.removeListener('drain', ondrain); source.removeListener('end', onend); source.removeListener('close', onclose); source.removeListener('error', onerror); dest.removeListener('error', onerror); source.removeListener('end', cleanup); source.removeListener('close', cleanup); dest.removeListener('close', cleanup); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "removeListeners() {}", "removeListeners() {}", "removeListeners() {}", "function removeEventListeners(){\n _.forEach(unlistenCallbacks, function(unlisten){\n unlisten();\n });\n unlistenCallbacks = [];\n }", "_clearListeners() {\n for (let liste...
[ "0.8521039", "0.8521039", "0.8521039", "0.8423259", "0.8304111", "0.8296624", "0.8282094", "0.8274838", "0.82720345", "0.8261525", "0.81342524", "0.8060971", "0.8031993", "0.7983937", "0.7970812", "0.7962308", "0.7867754", "0.78554255", "0.7834158", "0.77878404", "0.77458024"...
0.0
-1
It seems a linked list but it is not there will be only 2 of these for each stream
function CorkedRequest(state) { var _this = this; this.next = null; this.entry = null; this.finish = function () { onCorkedFinish(_this, state); }; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "isStream(){\n return this.iterators.length > 0 && this.iterators[0].streamer && Util.isStreamer(this.iterators[0].streamer);\n }", "prnt() {\n console.log(this.size);\n let current = this.head;\n while (current != null) {\n console.log(current);\n current = current.next;\n ...
[ "0.605692", "0.59729457", "0.597176", "0.5895379", "0.58486176", "0.5808137", "0.5805232", "0.5791895", "0.57809144", "0.57451934", "0.57422143", "0.572386", "0.5713271", "0.571229", "0.56939656", "0.56749034", "0.56629366", "0.56554013", "0.5648486", "0.5644814", "0.56200445...
0.0
-1
Checks that a usersupplied chunk is valid, especially for the particular mode the stream is in. Currently this means that `null` is never accepted and undefined/nonstring values are only allowed in object mode.
function validChunk(stream, state, chunk, cb) { var valid = true; var er = false; if (chunk === null) { er = new TypeError('May not write null values to stream'); } else if (typeof chunk !== 'string' && chunk !== undefined && !state.objectMode) { er = new TypeError('Invalid non-string/buffer chunk'); } if (er) { stream.emit('error', er); pna.nextTick(cb, er); valid = false; } return valid; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function validChunk(stream,state,chunk,cb){var valid=true;var er=false;if(chunk===null){er=new TypeError(\"May not write null values to stream\")}else if(typeof chunk!==\"string\"&&chunk!==undefined&&!state.objectMode){er=new TypeError(\"Invalid non-string/buffer chunk\")}if(er){stream.emit(\"error\",er);processNe...
[ "0.80096054", "0.7968847", "0.795917", "0.79461217", "0.79094326", "0.7904343", "0.78482634", "0.7832999", "0.7832999", "0.78115803", "0.7805349", "0.78041327", "0.78041327", "0.7804074", "0.7804074", "0.7795851", "0.7795851", "0.7795851", "0.7795851", "0.7795851", "0.7793008...
0.0
-1
if we're already writing something, then just put this in the queue, and wait our turn. Otherwise, call _write If we return false, then we need a drain event, so set that flag.
function writeOrBuffer(stream, state, isBuf, chunk, encoding, cb) { if (!isBuf) { var newChunk = decodeChunk(state, chunk, encoding); if (chunk !== newChunk) { isBuf = true; encoding = 'buffer'; chunk = newChunk; } } var len = state.objectMode ? 1 : chunk.length; state.length += len; var ret = state.length < state.highWaterMark; // we must ensure that previous needDrain will not be reset to false. if (!ret) state.needDrain = true; if (state.writing || state.corked) { var last = state.lastBufferedRequest; state.lastBufferedRequest = { chunk: chunk, encoding: encoding, isBuf: isBuf, callback: cb, next: null }; if (last) { last.next = state.lastBufferedRequest; } else { state.bufferedRequest = state.lastBufferedRequest; } state.bufferedRequestCount += 1; } else { doWrite(stream, state, false, len, chunk, encoding, cb); } return ret; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function onwriteDrain(stream,state){if(state.length===0&&state.needDrain){state.needDrain=false;stream.emit('drain');}}// if there's something in the buffer waiting, then process it", "function onwriteDrain(stream,state){if(state.length===0&&state.needDrain){state.needDrain=false;stream.emit('drain');}}// if the...
[ "0.7143456", "0.7143456", "0.7143456", "0.7143456", "0.69725215", "0.6951243", "0.6888608", "0.6888608", "0.6888608", "0.6888608", "0.6888608", "0.6888608", "0.6888608", "0.6888608", "0.6888608", "0.6888608", "0.6888608", "0.6888608", "0.6888608", "0.6888608", "0.6888608", ...
0.0
-1
Must force callback to be called on nextTick, so that we don't emit 'drain' before the write() consumer gets the 'false' return value, and has a chance to attach a 'drain' listener.
function onwriteDrain(stream, state) { if (state.length === 0 && state.needDrain) { state.needDrain = false; stream.emit('drain'); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function onwriteDrain(stream,state){if(state.length===0&&state.needDrain){state.needDrain=false;stream.emit(\"drain\")}}", "onDrain() {\n this.writeBuffer.splice(0, this.prevBufferLen); // setting prevBufferLen = 0 is very important\n // for example, when upgrading, upgrade packet is sent over,\n // and...
[ "0.68650264", "0.68421555", "0.68393165", "0.68393165", "0.68393165", "0.68393165", "0.6818041", "0.6766339", "0.6766339", "0.67564493", "0.6719794", "0.6719794", "0.6719794", "0.6719794", "0.6719794", "0.6719794", "0.6719794", "0.6719794", "0.6719794", "0.6719794", "0.671979...
0.0
-1
if there's something in the buffer waiting, then process it
function clearBuffer(stream, state) { state.bufferProcessing = true; var entry = state.bufferedRequest; if (stream._writev && entry && entry.next) { // Fast case, write everything using _writev() var l = state.bufferedRequestCount; var buffer = new Array(l); var holder = state.corkedRequestsFree; holder.entry = entry; var count = 0; var allBuffers = true; while (entry) { buffer[count] = entry; if (!entry.isBuf) allBuffers = false; entry = entry.next; count += 1; } buffer.allBuffers = allBuffers; doWrite(stream, state, true, state.length, buffer, '', holder.finish); // doWrite is almost always async, defer these to save a bit of time // as the hot path ends with doWrite state.pendingcb++; state.lastBufferedRequest = null; if (holder.next) { state.corkedRequestsFree = holder.next; holder.next = null; } else { state.corkedRequestsFree = new CorkedRequest(state); } state.bufferedRequestCount = 0; } else { // Slow case, write chunks one-by-one while (entry) { var chunk = entry.chunk; var encoding = entry.encoding; var cb = entry.callback; var len = state.objectMode ? 1 : chunk.length; doWrite(stream, state, false, len, chunk, encoding, cb); entry = entry.next; state.bufferedRequestCount--; // if we didn't call the onwrite immediately, then // it means that we need to wait until it does. // also, that means that the chunk and cb are currently // being processed, so move the buffer counter past them. if (state.writing) { break; } } if (entry === null) state.lastBufferedRequest = null; } state.bufferedRequest = entry; state.bufferProcessing = false; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "processBuffer () {\n this.ready = true\n this._triggerBuffer()\n this.queue.waterfall(() => this.buffer.guardian)\n }", "function drainBuffer(cb) {\n if (!state.buffer.length)\n return cb()\n var done = multicb()\n var wait = false\n state.buffer.forEach(function(entry) {\n if (ha...
[ "0.6990183", "0.64056754", "0.6362058", "0.62108177", "0.6021966", "0.5951879", "0.59409624", "0.59409624", "0.59409624", "0.59409624", "0.59036124", "0.58677757", "0.58271325", "0.58195007", "0.58168125", "0.58045375", "0.57909423", "0.57630336", "0.57630336", "0.57630336", ...
0.0
-1
v8 likes predictible objects
function Item(fun, array) { this.fun = fun; this.array = array; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function compareLike(a,b){\n var al = a.idLikesProp.length;\n var bl = b.idLikesProp.length;\n if(al > bl) return -1;\n if(bl > al) return 1;\n return 0;\n}", "function lookAround() {\n var objectDescription = \"\"\n tj.see().then(function(objects) {\n objects.forEach(function(each) {\n ...
[ "0.527866", "0.52612406", "0.51951283", "0.518796", "0.51302594", "0.5044646", "0.48934332", "0.4857401", "0.484017", "0.48302925", "0.482028", "0.4812441", "0.4808473", "0.47852293", "0.47828078", "0.47574478", "0.47493434", "0.4739314", "0.47239366", "0.4703992", "0.4703992...
0.0
-1
Represent num in a wNAF form
function getNAF(num, w, bits) { var naf = new Array(Math.max(num.bitLength(), bits) + 1); naf.fill(0); var ws = 1 << (w + 1); var k = num.clone(); for (var i = 0; i < naf.length; i++) { var z; var mod = k.andln(ws - 1); if (k.isOdd()) { if (mod > (ws >> 1) - 1) z = (ws >> 1) - mod; else z = mod; k.isubn(z); } else { z = 0; } naf[i] = z; k.iushrn(1); } return naf; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function toUnformattedNF()\n{\n\treturn (this.num);\n}", "function getNAF(num,w){var naf=[];var ws=1<<w+1;var k=num.clone();while(k.cmpn(1)>=0){var z;if(k.isOdd()){var mod=k.andln(ws-1);if(mod>(ws>>1)-1)z=(ws>>1)-mod;else z=mod;k.isubn(z);}else{z=0;}naf.push(z);// Optimization, shift by word if possible\nvar shi...
[ "0.6765914", "0.64303064", "0.64303064", "0.6332739", "0.6330919", "0.62930375", "0.6287292", "0.6284914", "0.6284914", "0.6283662", "0.627307", "0.627307", "0.627307", "0.627307", "0.627307", "0.6270584", "0.6270584", "0.62674284", "0.6263132", "0.6263132", "0.6263132", "0...
0.60998714
93
Represent k1, k2 in a Joint Sparse Form
function getJSF(k1, k2) { var jsf = [ [], [] ]; k1 = k1.clone(); k2 = k2.clone(); var d1 = 0; var d2 = 0; while (k1.cmpn(-d1) > 0 || k2.cmpn(-d2) > 0) { // First phase var m14 = (k1.andln(3) + d1) & 3; var m24 = (k2.andln(3) + d2) & 3; if (m14 === 3) m14 = -1; if (m24 === 3) m24 = -1; var u1; if ((m14 & 1) === 0) { u1 = 0; } else { var m8 = (k1.andln(7) + d1) & 7; if ((m8 === 3 || m8 === 5) && m24 === 2) u1 = -m14; else u1 = m14; } jsf[0].push(u1); var u2; if ((m24 & 1) === 0) { u2 = 0; } else { var m8 = (k2.andln(7) + d2) & 7; if ((m8 === 3 || m8 === 5) && m14 === 2) u2 = -m24; else u2 = m24; } jsf[1].push(u2); // Second phase if (2 * d1 === u1 + 1) d1 = 1 - d1; if (2 * d2 === u2 + 1) d2 = 1 - d2; k1.iushrn(1); k2.iushrn(1); } return jsf; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function K(a,b){this.g=[];this.H=a;this.G=b||null;this.f=this.a=!1;this.c=void 0;this.u=this.K=this.m=!1;this.j=0;this.b=null;this.o=0}", "function K(){this.i=0,this.j=0,this.S=new Array}", "function k(m1, m2){\r\n return do_(\r\n bind(\"x\", m1),\r\n bind(\"xs\", m2),\r\n ...
[ "0.5769692", "0.5731908", "0.53482056", "0.52648157", "0.5132514", "0.51150286", "0.5110443", "0.50927955", "0.50731033", "0.50641257", "0.50608915", "0.5059641", "0.5027422", "0.50183904", "0.5014289", "0.49767065", "0.49767065", "0.49767065", "0.49522403", "0.4840789", "0.4...
0.0
-1
CONCATENATED MODULE: ./node_modules/vueloader/lib/runtime/componentNormalizer.js / globals __VUE_SSR_CONTEXT__ IMPORTANT: Do NOT use ES2015 features in this file (except for modules). This module is a runtime utility for cleaner component module output and will be included in the final webpack user bundle.
function normalizeComponent ( scriptExports, render, staticRenderFns, functionalTemplate, injectStyles, scopeId, moduleIdentifier, /* server only */ shadowMode /* vue-cli only */ ) { // Vue.extend constructor export interop var options = typeof scriptExports === 'function' ? scriptExports.options : scriptExports // render functions if (render) { options.render = render options.staticRenderFns = staticRenderFns options._compiled = true } // functional template if (functionalTemplate) { options.functional = true } // scopedId if (scopeId) { options._scopeId = 'data-v-' + scopeId } var hook if (moduleIdentifier) { // server build hook = function (context) { // 2.3 injection context = context || // cached call (this.$vnode && this.$vnode.ssrContext) || // stateful (this.parent && this.parent.$vnode && this.parent.$vnode.ssrContext) // functional // 2.2 with runInNewContext: true if (!context && typeof __VUE_SSR_CONTEXT__ !== 'undefined') { context = __VUE_SSR_CONTEXT__ } // inject component styles if (injectStyles) { injectStyles.call(this, context) } // register component module identifier for async chunk inferrence if (context && context._registeredComponents) { context._registeredComponents.add(moduleIdentifier) } } // used by ssr in case component is cached and beforeCreate // never gets called options._ssrRegister = hook } else if (injectStyles) { hook = shadowMode ? function () { injectStyles.call( this, (options.functional ? this.parent : this).$root.$options.shadowRoot ) } : injectStyles } if (hook) { if (options.functional) { // for template-only hot-reload because in that case the render fn doesn't // go through the normalizer options._injectStyles = hook // register for functional component in vue file var originalRender = options.render options.render = function renderWithStyleInjection (h, context) { hook.call(context) return originalRender(h, context) } } else { // inject component registration as beforeCreate hook var existing = options.beforeCreate options.beforeCreate = existing ? [].concat(existing, hook) : [hook] } } return { exports: scriptExports, options: options } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function __vue_normalize__(a,b,c,d,e){var f=(\"function\"==typeof c?c.options:c)||{};// For security concerns, we use only base name in production mode.\nreturn f.__file=\"/Users/hadefication/Packages/vue-chartisan/src/components/Pie.vue\",f.render||(f.render=a.render,f.staticRenderFns=a.staticRenderFns,f._compile...
[ "0.67436", "0.6494977", "0.6494977", "0.6494977", "0.6494977", "0.6494977", "0.6494977", "0.6494977", "0.6494977", "0.6494977", "0.6494977", "0.6494977", "0.6494977", "0.6494977", "0.6494977", "0.6494977", "0.6494977", "0.6494977", "0.6494977", "0.6494977", "0.6494977", "0....
0.0
-1
! vuex v3.4.0 (c) 2020 Evan You
function r(t){var e=Number(t.version.split(".")[0]);if(e>=2)t.mixin({beforeCreate:r});else{var n=t.prototype._init;t.prototype._init=function(t){void 0===t&&(t={}),t.init=t.init?[r].concat(t.init):r,n.call(this,t)}}function r(){var t=this.$options;t.store?this.$store="function"===typeof t.store?t.store():t.store:t.parent&&t.parent.$store&&(this.$store=t.parent.$store)}}
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "getFieldVuex() {\n return store.getters.dataField;\n }", "getProfileVuex() {\n return store.getters.dataProfile;\n }", "function vuexInit(){var options=this.$options;// store injection\n\tif(options.store){this.$store=options.store;}else if(options.parent&&options.parent.$store){this.$store=options.par...
[ "0.677089", "0.6697306", "0.666029", "0.6330228", "0.6307708", "0.62462986", "0.62462986", "0.62462986", "0.6237768", "0.62359226", "0.6132646", "0.61251813", "0.6067375", "0.60568154", "0.60568154", "0.60568154", "0.60568154", "0.60568154", "0.60501724", "0.604128", "0.60273...
0.0
-1
result should equal = [1, 2, 4, 5, 6, 8, 9, 10, 100, 483, 840] This file is seeminly overly complicated, due to me wanting to time the entire sorting time versus time each call to quickSort
function sortViaQuickSort(items) { console.time('quickSort'); quickSort(items, 0, items.length - 1); console.timeEnd('quickSort'); return items; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function quickSort() {}", "function quickSort(arr) {\n\n}", "function quickSort(arr) {\n\n}", "function quickSort(array) {\n \n}", "function fastQuickSort(arr, compareFn = (a, b) => a - b) {\n if (arr.length <= 1) {\n // No sorting needed, fixes #118\n return arr;\n }\n const stack ...
[ "0.78932965", "0.71273994", "0.71273994", "0.70671755", "0.6786492", "0.6724848", "0.6703613", "0.6668479", "0.6665548", "0.6646602", "0.66133875", "0.6605456", "0.65424746", "0.651011", "0.65093505", "0.6492623", "0.64903367", "0.6453515", "0.64473075", "0.64438266", "0.6435...
0.7000457
4
Write the font list to console
function listFonts () { asciify.getFonts(function (err, fonts) { if (err) { return console.error(err); } var padSize = ('' + fonts.length).length; fonts.forEach(function (font, index) { console.log(pad(padSize, index+1, '0') + ': ' + font); }); }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function listFonts()\n{\n\tvar all_items = dom.library.items;\n\t\n\t\n\t\n\t// ----------------------------------------------------------------------------\n\t// Find embedded fonts\n\t\n\t\n\t\n\tfl.outputPanel.trace(\"\");\n\tfl.outputPanel.trace(\"\");\n\tfl.outputPanel.trace(\"Embedded fonts\");\n\tfl.outputP...
[ "0.6297762", "0.6203963", "0.6191316", "0.6162986", "0.61116916", "0.6106843", "0.6098715", "0.6084012", "0.6020266", "0.5924539", "0.5892548", "0.58653396", "0.58136976", "0.58115643", "0.57844603", "0.5727393", "0.5725591", "0.56826437", "0.56826437", "0.5669104", "0.565631...
0.7600052
0