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
Sends an verification code using SMS to the user's device.
sendVerificationCode(key, phoneNumber) { return this.context.enrollService .CustomAction(core.Ticket.None(), this.context.getUser(), new core.Credential(core.Credential.OneTimePassword, { key: core.Base64Url.fromBytes(key), phoneNumber, }), Cu...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function sendSMS(paymentDetails){\n\n var content = 'ING AeroCash Online Service PassCode: '+ paymentDetails.authorizationCode +'. Thank you for using our services!';\n telerivet.sendSMS(paymentDetails.phoneNumber,content);\n}", "function sendToken() {\n authy.request_sms(self.authyId, true, functio...
[ "0.7167281", "0.70086503", "0.6902638", "0.68737775", "0.6819225", "0.67227834", "0.66910434", "0.6456991", "0.64354074", "0.6428313", "0.63730043", "0.632496", "0.63056946", "0.63027996", "0.62658465", "0.62169075", "0.62051165", "0.6195609", "0.6192689", "0.61006784", "0.60...
0.7548719
0
Enrolls OneTime Password using a software TOTP (e.g. DigitalPersona app, Google Authenticator etc.)
enrollSoftwareOtp(code, key, phoneNumber) { return super._enroll(new core.Credential(core.Credential.OneTimePassword, { otp: code, key: core.Base64Url.fromBytes(key), phoneNumber, })); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "enrollHardwareOtp(code, serialNumber, counter, timer) {\r\n return super._enroll(new core.Credential(core.Credential.OneTimePassword, {\r\n otp: code,\r\n serialNumber,\r\n counter,\r\n timer,\r\n }));\r\n }", "function getS...
[ "0.70727044", "0.69648784", "0.6890942", "0.6368424", "0.6272874", "0.62677807", "0.612269", "0.6069222", "0.6006847", "0.59125787", "0.59007627", "0.5881933", "0.5876755", "0.58587545", "0.5834278", "0.58073455", "0.5797249", "0.57941014", "0.57868415", "0.57867837", "0.5785...
0.7176811
0
Enrolls a hardware TOTP token.
enrollHardwareOtp(code, serialNumber, counter, timer) { return super._enroll(new core.Credential(core.Credential.OneTimePassword, { otp: code, serialNumber, counter, timer, })); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "enrollSoftwareOtp(code, key, phoneNumber) {\r\n return super._enroll(new core.Credential(core.Credential.OneTimePassword, {\r\n otp: code,\r\n key: core.Base64Url.fromBytes(key),\r\n phoneNumber,\r\n }));\r\n }", "async enable({ user, otp ...
[ "0.6445089", "0.61731625", "0.5418577", "0.53568256", "0.5279295", "0.51721925", "0.49931127", "0.49810264", "0.49411055", "0.49299237", "0.49132732", "0.48463517", "0.48383614", "0.48319194", "0.48162666", "0.48003772", "0.47978055", "0.47826052", "0.47491243", "0.47428843", ...
0.696504
0
Deletes the OTP enrollment.
unenroll() { return super._unenroll(new core.Credential(core.Credential.OneTimePassword)); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function deleteAppointment() {\n\n transition(\"DELETING\", true)\n \n // Async call to initiate cancel appointment\n props.cancelInterview(props.id).then((response) => {\n\n transition(\"EMPTY\")\n }).catch((err) => {\n\n transition(\"ERROR_DELETE\", true);\n });\n }", "function d...
[ "0.56998193", "0.55058664", "0.54238164", "0.54198825", "0.53948873", "0.5390036", "0.5364509", "0.5361929", "0.5301362", "0.5261914", "0.52365124", "0.52301675", "0.52276355", "0.5211099", "0.5143707", "0.5138583", "0.51152533", "0.51128465", "0.5103507", "0.50946665", "0.50...
0.4892587
51
Reads a password change availability.
canEnroll() { return super._canEnroll(core.Credential.Password); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "async isPasswordChangeValid() {\n const { t, currentPwdHash, generateAlert } = this.props;\n const currentPasswordHash = await getPasswordHash(this.state.currentPassword);\n if (!isEqual(currentPwdHash, currentPasswordHash)) {\n return generateAlert('error', t('incorrectPassword'), ...
[ "0.56188035", "0.5375233", "0.512637", "0.5114918", "0.5039944", "0.5023661", "0.50127596", "0.49741626", "0.49528572", "0.49355197", "0.4931166", "0.49235383", "0.48810044", "0.48370692", "0.48333716", "0.48313305", "0.48186272", "0.4804211", "0.4784191", "0.47471914", "0.46...
0.43273488
98
Creates a new strong password with good complexity properties.
randomize() { return this.context.enrollService.CustomAction(new core.Ticket(this.context.securityOfficer || ""), this.context.getUser(), new core.Credential(core.Credential.Password), CustomAction$1.PasswordRandomization); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function createPassword() {\n var lowercaseCharacters = [\"abcdefghijklmnopqrstuvwxyz\"];\n var uppercaseCharacters = [\"ABCDEFGHIJKLMNOPQRSTUVWXYZ\"];\n var numberCharacters = [\"0123456789\"];\n var specialCharacters = [\"!#$%&'()*+,-./:;<=>?@[]^_`{}|~\"];\n\n var availableCharacters = [];\n var generatedP...
[ "0.663657", "0.6289247", "0.62200457", "0.6070982", "0.60490406", "0.6018704", "0.59949243", "0.59193116", "0.5879344", "0.58774215", "0.5792763", "0.57856023", "0.5785039", "0.5739423", "0.5730904", "0.5725095", "0.57220507", "0.57121503", "0.57106745", "0.5701144", "0.57006...
0.0
-1
Reads a PIN enrollment availability.
canEnroll() { return super._canEnroll(core.Credential.PIN); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function read(pinId){\n return b.analogRead(pinId);\n}", "function waitUntilDeviceAvailable() {\n return startSessionRequest.getAvailability(presentationUrl).then(\n function(availability) {\n console.log('availability ' + availability.value + '\\n');\n if (availability.value) {\n return stringif...
[ "0.54182404", "0.5073045", "0.5063493", "0.5023587", "0.48960653", "0.4890775", "0.48647082", "0.48153755", "0.47238743", "0.4698638", "0.46557668", "0.45922583", "0.4520212", "0.4519714", "0.45078215", "0.44778994", "0.44696352", "0.44196627", "0.44191915", "0.43807507", "0....
0.51624036
1
Deletes the PIN enrollment.
unenroll() { return super._unenroll(new core.Credential(core.Credential.PIN)); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function deletePin(pin) {\n // Update and display delete-confirmation modal\n $('#delMsg').html(`Are you sure you want to delete ${$(pin).data('caption')}?`);\n $('#confirmDelBtn').unbind('click');\n $('#confirmDelBtn').click(() => performDelete($(pin).data('url')));\n $('#modalConfirmDelete').modal('open');\...
[ "0.576299", "0.5743967", "0.5600883", "0.5600883", "0.5600883", "0.55955976", "0.55955976", "0.5540361", "0.5477491", "0.5369713", "0.53096664", "0.5289466", "0.5272828", "0.52599835", "0.5250938", "0.5237317", "0.5237317", "0.5210611", "0.52064294", "0.5172155", "0.5168468",...
0.5930679
0
Reads enrolled Security Questions.
getEnrolledQuestions() { return this.context.enrollService .GetEnrollmentData(this.context.getUser(), core.Credential.SecurityQuestions) .then(data => JSON.parse(core.Utf8.fromBase64Url(data)) .map(item => core.Question.fromJson(item))); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "async function readQuestions (request, response, next) {\n try {\n const questions = await Question.readQuestions({}, {})\n const nqs = questions.map(el => {\n const { responses, ...q } = el\n const { response } = responses.filter(\n rs => rs.email === request.user.email\n )[0]\n\n ...
[ "0.60739493", "0.6032695", "0.59118134", "0.58418584", "0.5819012", "0.5794705", "0.576573", "0.5584747", "0.5569448", "0.5565946", "0.5524641", "0.55162114", "0.55139726", "0.5512756", "0.54336923", "0.5421989", "0.54081464", "0.53444767", "0.53163683", "0.5309463", "0.53036...
0.71839
0
Reads a Security Questions enrollment availability.
canEnroll() { return super._canEnroll(core.Credential.SecurityQuestions); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "getEnrolledQuestions() {\r\n return this.context.enrollService\r\n .GetEnrollmentData(this.context.getUser(), core.Credential.SecurityQuestions)\r\n .then(data => JSON.parse(core.Utf8.fromBase64Url(data))\r\n .map(item => core.Question.fromJson(item)));\r\n ...
[ "0.598915", "0.5207461", "0.5014938", "0.49891666", "0.49444115", "0.48987788", "0.48716578", "0.48028514", "0.4785955", "0.47579998", "0.47553355", "0.47354552", "0.47239673", "0.47234645", "0.4709504", "0.46901017", "0.46897614", "0.46640238", "0.46546125", "0.4653707", "0....
0.4679316
17
Deletes the Security Question enrollment.
unenroll() { return super._unenroll(new core.Credential(core.Credential.SecurityQuestions)); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function deleteQuestion(req, res) {\n try {\n var _a = req.params, qUuid = _a.qUuid, uuid = _a.uuid; // qUuid: question uuid; uuid: survey uuid\n var allSurveys = new surveys_1.Surveys();\n var surveyToUpdate = new surveys_1.Survey(allSurveys.surveys[allSurveys.findSurveyIndex(uuid)]);\n ...
[ "0.60535115", "0.60405296", "0.5977923", "0.5964776", "0.5919035", "0.5818916", "0.5816503", "0.58033067", "0.57674104", "0.5754371", "0.5740325", "0.5739659", "0.56854093", "0.5669975", "0.564442", "0.5554736", "0.55314803", "0.5476225", "0.54444355", "0.54224324", "0.535032...
0.5618067
15
Reads a U2F enrollment availability.
canEnroll() { return super._canEnroll(core.Credential.U2F); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "async function getAvailability () {\n // Query backend api to find current availability of rental properties\n const response = await fetch('https://tafelberg-api.samtx.dev/availability');\n const data = await response.json();\n return data\n}", "get availability() {\n\t\treturn this.__availability;\...
[ "0.5668368", "0.5599286", "0.5459342", "0.5044356", "0.49633574", "0.4855977", "0.48401573", "0.4826315", "0.48169723", "0.48103333", "0.48061156", "0.47724077", "0.46573636", "0.45541087", "0.4517712", "0.44555828", "0.44538257", "0.44311452", "0.44308224", "0.4408628", "0.4...
0.40598297
59
Enrolls a U2F token.
enroll() { const version = "U2F_V2"; const appId = this.appId; const timestamp = Math.round(new Date().getTime() / (U2FEnroll.TIME_WINDOW * 1000)); const challenge = core.Base64Url.fromUtf16(timestamp.toString()); const registerRequests = [{ version, appI...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "canEnroll() {\r\n return super._canEnroll(core.Credential.U2F);\r\n }", "function sendToken2Device (unlockToken) {\n\n}", "token(payload, done) {\n User().setToken(payload, done)\n }", "function resendToken() {\n as.btn.loading($btn, $btn.data('loading-text'));\n\n $.post(\"/two-f...
[ "0.5768884", "0.5061473", "0.48645803", "0.48430073", "0.47292468", "0.46593717", "0.4639552", "0.46320617", "0.46272188", "0.4615885", "0.459557", "0.45824334", "0.45794103", "0.4570551", "0.45569798", "0.4556841", "0.45317742", "0.45125467", "0.4511507", "0.45081487", "0.45...
0.61271244
0
Deletes the U2F enrollment.
unenroll() { return super._unenroll(new core.Credential(core.Credential.U2F)); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function deleteIndustry(req, res) {\n industry.update({_id: req.body.industryId}, {$set: {deleted: true}}, function(err) {\n if (err) {\n res.json({code: Constant.ERROR_CODE, message: Constant.INTERNAL_ERROR});\n } else {\n res.json({code: Constant.SUCCESS_CODE, data: req.bod...
[ "0.5819654", "0.56252295", "0.551675", "0.5412616", "0.53569293", "0.5352312", "0.52148485", "0.51838464", "0.5165887", "0.5152895", "0.5144702", "0.51421016", "0.5131611", "0.51259303", "0.51201904", "0.51164454", "0.51028085", "0.5101864", "0.5098582", "0.5088193", "0.50758...
0.6040046
0
Responsively hides children based on the selected implementation.
function Hidden(props) { var implementation = props.implementation, other = (0, _objectWithoutProperties2.default)(props, ["implementation"]); if (implementation === 'js') { return _react.default.createElement(_HiddenJs.default, other); } return _react.default.createElement(_HiddenCss.default, other...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "hide_children() { \n for (var key of this.keys) {\n try { this.elements[key].hide(); }\n catch (e) {}\n }\n }", "hide() {\n for (var dependent of this.get_dependents()) {\n try { dependent.hide(); }\n catch (e) {}\n }\n }", "onBefore...
[ "0.66626465", "0.6585707", "0.6387812", "0.63113993", "0.61922467", "0.6186334", "0.61831445", "0.6138197", "0.60841817", "0.5995125", "0.5949698", "0.59408057", "0.5903793", "0.5884331", "0.58832425", "0.5878608", "0.58614683", "0.58575124", "0.58541834", "0.58382565", "0.58...
0.53760517
98
Holds the input reference
function Input(props, context) { var _this; (0, _classCallCheck2.default)(this, Input); _this = (0, _possibleConstructorReturn2.default)(this, (0, _getPrototypeOf2.default)(Input).call(this, props, context)); _this.isControlled = null; _this.input = null; _this.state = { focused: false ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "get reference () {\r\n\t\treturn this._reference;\r\n\t}", "get reference () {\n\t\treturn this._reference;\n\t}", "get reference () {\n\t\treturn this._reference;\n\t}", "get reference() {\n\t\treturn this.__reference;\n\t}", "function getReference(){\n\t\treturn this.reference;\n\t}", "constructor(prop...
[ "0.6395139", "0.63187045", "0.63187045", "0.6247464", "0.6100792", "0.5969763", "0.5903848", "0.5902234", "0.58974904", "0.58820456", "0.58820456", "0.58727574", "0.5857957", "0.5849261", "0.5796489", "0.5790949", "0.5785729", "0.57839835", "0.57194424", "0.57194424", "0.5701...
0.0
-1
Corresponds to 10 frames at 60 Hz.
function Textarea(props) { var _this; (0, _classCallCheck2.default)(this, Textarea); _this = (0, _possibleConstructorReturn2.default)(this, (0, _getPrototypeOf2.default)(Textarea).call(this)); _this.isControlled = null; _this.shadowRef = null; _this.singlelineShadowRef = null; _this.inputRe...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function frames(minute, number) {\n \n let fps = minute * number * 60;\n console.log(\"For \" + minute + \" minutes \" + \" and number \" + number + \"the FPS IS \" + fps);\n return fps;\n }", "function getFramesPerInterval() {\n\treturn getInterval()*fps/1000;\n}", "function frames(minutes, fps) {\n\tre...
[ "0.6103795", "0.59715074", "0.5915254", "0.5814745", "0.5804779", "0.5801663", "0.57936746", "0.57763106", "0.57533616", "0.5648147", "0.5620144", "0.55341524", "0.55192506", "0.55135554", "0.54928243", "0.5470606", "0.53943837", "0.53702813", "0.53668153", "0.5347084", "0.53...
0.0
-1
Translate the node so he can't be seen on the screen. Later, we gonna translate back the node to his original location with `translate3d(0, 0, 0)`.`
function getTranslateValue(props, node) { var direction = props.direction; var rect = node.getBoundingClientRect(); var transform; if (node.fakeTransform) { transform = node.fakeTransform; } else { var computedStyle = (0, _ownerWindow.default)(node).getComputedStyle(node); transform = computedSty...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function translateNode() {\n var shift = [\n '-webkit-transform: translate3d(' + move.shiftX + 'px,' + move.shiftY + 'px,0)'\n ].join(';');\n\n $letter[0].setAttribute('style', shift);\n }", "function translateUp() {\n console.log('translate up triggered');\n var m = new ...
[ "0.72414666", "0.7008316", "0.70029145", "0.68926954", "0.66292775", "0.6626129", "0.6568359", "0.65600437", "0.6531439", "0.64705074", "0.646161", "0.6461257", "0.64410436", "0.63245434", "0.62225294", "0.6178666", "0.6178666", "0.61626714", "0.6140581", "0.6074261", "0.6071...
0.0
-1
Exported for test purposes.
function reset() { nodeThatClaimedTheSwipe = null; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private public function m246() {}", "private internal function m248() {}", "transient private protected internal function m182() {}", "transient protected internal function m189() {}", "transient private internal function m185() {}", "static transient final private internal function m43() {}", "static ...
[ "0.709873", "0.6826393", "0.6734548", "0.65948", "0.6539365", "0.64787847", "0.6432612", "0.6423974", "0.6405733", "0.6352501", "0.6186126", "0.61713326", "0.6169758", "0.6167037", "0.61595154", "0.6111748", "0.60788107", "0.60628295", "0.59556884", "0.5897385", "0.58781725",...
0.0
-1
We are not using the React state in order to avoid unnecessary rerender.
function MuiThemeProvider(props, context) { var _this; (0, _classCallCheck2.default)(this, MuiThemeProvider); _this = (0, _possibleConstructorReturn2.default)(this, (0, _getPrototypeOf2.default)(MuiThemeProvider).call(this)); // Get the outer theme from the context, can be null _this.broadcast = (0, _...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "componentWillMount(){\n this.setState({ React: false })\n}", "forceUpdateHandler(){\n this.setState({ reRender: true})\n }", "componentWillUpdate() {\n if (this.state.loading) {\n this.setState({loading: false});\n }\n }", "componentWillUnmount() {\n // this.setState({\n...
[ "0.69568026", "0.66020304", "0.6366943", "0.63446283", "0.627127", "0.62434834", "0.6235727", "0.6223213", "0.6216041", "0.6210316", "0.6193969", "0.6193949", "0.618628", "0.6179633", "0.6176686", "0.6176686", "0.6176686", "0.6176686", "0.6176686", "0.6176686", "0.6176686", ...
0.0
-1
When new generator function is created, rule counter is reset. We need to reset the rule counter for SSR for each request. It's inspired by
function createGenerateClassName() { var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {}; var _options$dangerouslyU = options.dangerouslyUseGlobalCSS, dangerouslyUseGlobalCSS = _options$dangerouslyU === void 0 ? false : _options$dangerouslyU, _options$productionPr = opti...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function apply_counter_DocGenerator() {\n\t//----Debugging------------------------------------------\n\t// The following alert-Command is useful for debugging \n\t//alert(\"docgenerator.js:741 apply_counter(\"+this.aIndexNT+\",\"+this.aFoundNonterms[this.aIndexNT]+\")-Call\")\n\t//----Create Object/Instance of Doc...
[ "0.61329985", "0.59263325", "0.5732253", "0.5695969", "0.56755126", "0.5632857", "0.5566586", "0.5559064", "0.55577195", "0.55269486", "0.5481033", "0.54663384", "0.54560184", "0.54526234", "0.545052", "0.54110694", "0.53924906", "0.53924906", "0.53924906", "0.53924906", "0.5...
0.0
-1
3kb. Support for the jssexpand plugin.
function arrayMerge(destination, source) { return source; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function jsmin(input,level,callback,sleep){var a=b='',theLookahead=EOF=-1;var LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz';var DIGITS='0123456789',ALNUM=LETTERS+DIGITS+'_$\\\\';var cb=callback;var slp=sleep?sleep:50;var kbStep=10;function isAlphanum(c){return c!=EOF&&(ALNUM.indexOf(c)>-1||c.charC...
[ "0.5693042", "0.56452864", "0.5603044", "0.5507222", "0.5434183", "0.54249126", "0.54203904", "0.53993446", "0.5387056", "0.5336157", "0.5266502", "0.52206725", "0.52186984", "0.5195725", "0.5195725", "0.5195725", "0.51949745", "0.5190634", "0.5189627", "0.51729983", "0.51581...
0.0
-1
Subset of jsspresetdefault with only the plugins the MaterialUI components are using.
function jssPreset() { return { plugins: [(0, _jssGlobal.default)(), (0, _jssNested.default)(), (0, _jssCamelCase.default)(), (0, _jssDefaultUnit.default)(), (0, _jssVendorPrefixer.default)(), (0, _jssPropsSort.default)()] }; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function jssPreset() {\n return {\n plugins: [(0, _jssGlobal2.default)(), (0, _jssNested2.default)(), (0, _jssCamelCase2.default)(), (0, _jssDefaultUnit2.default)(), (0, _jssVendorPrefixer2.default)(), (0, _jssPropsSort2.default)()]\n };\n}", "function jssPreset() {\n return {\n plugins: [(0, _jssGlobal...
[ "0.77265215", "0.77265215", "0.7655089", "0.76499647", "0.76499647", "0.76499647", "0.762883", "0.762883", "0.762883", "0.762883", "0.762883", "0.762883", "0.762883", "0.762883", "0.762883", "0.762883", "0.762883", "0.762883", "0.762883", "0.762883", "0.7549128", "0.7549128...
0.771523
11
Browser specific loadImplementation. Always uses `window.Promise` To register a custom implementation, must register with `Promise` option.
function loadImplementation(){ if(typeof window.Promise === 'undefined'){ throw new Error("any-promise browser requires a polyfill or explicit registration"+ " e.g: require('any-promise/register/bluebird')") } return { Promise: window.Promise, implementation: 'window.Promise' } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function loadImplementation(){\n\t if(typeof window.Promise === 'undefined'){\n\t throw new Error(\"any-promise browser requires a polyfill or explicit registration\"+\n\t \" e.g: require('any-promise/register/bluebird')\")\n\t }\n\t return {\n\t Promise: window.Promise,\n\t implementation: 'windo...
[ "0.80488354", "0.6215", "0.6149851", "0.61371934", "0.6094464", "0.6045607", "0.60276216", "0.59551305", "0.58622473", "0.5743008", "0.572867", "0.5669752", "0.56424445", "0.56280166", "0.56173736", "0.5613153", "0.56013685", "0.55214167", "0.5511287", "0.547201", "0.5447491"...
0.8074237
8
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.74004674", "0.7262109", "0.7262109", "0.69340223", "0.6617433", "0.64840496", "0.64603734", "0.6353968", "0.634614", "0.634614", "0.6324044", "0.6324044", "0.61247706", "0.6122276", "0.60979056", "0.6075115", "0.6071776", "0.6067711", "0.60672724", "0.60655904", "0.6065590...
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
subscribe to changes and return the subscriptionId
function subscribe (listener) { if (typeof listener !== 'function') { throw new Error('listener must be a function.') } var currentId = id; listeners[currentId] = listener; id += 1; return currentId }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "subscribe() {\n this.subscriptionID = this.client.subscribe(this.channel, this.onNewData)\n this.currencyCollection.subscribe(this.render)\n this.currencyCollection.subscribe(this.drawInitialSparkLine)\n this.currencyCollection.subscribeToSparkLineEvent(this.drawSparkLine)\n }", "subscribe() {}", ...
[ "0.6641326", "0.6635745", "0.64890236", "0.6437929", "0.642824", "0.63137895", "0.63137895", "0.62982935", "0.62857014", "0.6252985", "0.6250129", "0.62315315", "0.6223317", "0.6194608", "0.61927825", "0.61647266", "0.615456", "0.61284876", "0.6120684", "0.6092464", "0.609231...
0.62882036
31
remove subscription by removing the listener function
function unsubscribe (id) { delete listeners[id]; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "unsubscribe(listener){\n let index = this.listeners.indexOf(listener);\n if( index >= 0 )\n this.listeners.splice(index, 1);\n }", "function unsubscribe(listener) {\r\n var index = subscribers.indexOf(listener);\r\n if (index > -1) {\r\n subscr...
[ "0.8023039", "0.7983304", "0.7705905", "0.7669491", "0.7669491", "0.7669491", "0.75934756", "0.7578771", "0.7574939", "0.7527306", "0.7527306", "0.752031", "0.7503462", "0.7503462", "0.7503462", "0.7503462", "0.7503462", "0.7503462", "0.7503462", "0.7503462", "0.7503462", "...
0.7624179
6
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.74004674", "0.7262109", "0.7262109", "0.69340223", "0.6617433", "0.64840496", "0.64603734", "0.6353968", "0.634614", "0.634614", "0.6324044", "0.6324044", "0.61247706", "0.6122276", "0.60979056", "0.6075115", "0.6071776", "0.6067711", "0.60672724", "0.60655904", "0.6065590...
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
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 ...
{ "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.6264917", "0.6264917", "0.6264917", "0.6243562", "0.62003636", "0.62003636", "0.61961967", "0.6191259", "0.6191259", "0.6185972", "0.6109528", "0.60122085", "0.5999864", "0.5995116", "0.5987345", "0.5983116", "0.5957374", "0.5957374", "0.594361", "0.5939109", "0.5919772", ...
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.70706356", "0.7041535", "0.7041535", "0.68165714", "0.67870575", "0.6750657", "0.6750657", "0.67267895", "0.6717587", "0.66951096", "0.6694948", "0.66231465", "0.65680957", "0.6545505", "0.6545505", "0.6545505", "0.6545505", "0.6545505", "0.6545505", "0.6545505", "0.654550...
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.79776317", "0.79776317", "0.79776317", "0.79776317", "0.79776317", "0.79776317", "0.79776317", "0.79776317", "0.79776317", "0.79776317", "0.79776317", "0.79776317", "0.79776317", "0.79776317", "0.79776317", "0.79776317", "0.79776317", "0.79776317", "0.79776317", "0.79776317"...
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 = ...
{ "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.65640014", "0.65625536", "0.65625536", "0.65625536", "0.65625536", "0.65625536", "0.65625536", "0.65625536", "0.65625536", "0.65625536", "0.65625536", "0.65625536", "0.65625536", "0.65625536", "0.65625536", "0.65625536", "0.65625536", "0.65625536", "0.65625536", "0.65625536"...
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.n...
{ "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.6118386", "0.6104275", "0.6013856", "0.5979055", "0.59630054", "0.59630054", "0.5934173", "0.5934173", "0.5934173", "0.59132546", "0.59132546", "0.5559817", "0.55166334", "0.5500577", "0.5487619", "0.5487619", "0.5476152", "0.5445956", "0.543895", "0.5413423", "0.53392494"...
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 += ...
{ "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.71422184", "0.71422184", "0.71422184", "0.71422184", "0.69713527", "0.69501936", "0.68877584", "0.68877584", "0.68877584", "0.68877584", "0.68877584", "0.68877584", "0.68877584", "0.68877584", "0.68877584", "0.68877584", "0.68877584", "0.68877584", "0.68877584", "0.68877584"...
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.7871349", "0.7794817", "0.7794817", "0.77862823", "0.77862823", "0.77790916", "0.77790916", "0.77790916", "0.77790916", "0.7758485", "0.7758383", "0.764584", "0.76114964", "0.7607617", "0.7553042", "0.7538073", "0.7538073", "0.75220335", "0.74735856", "0.74658275", "0.7465...
0.76271594
68
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 (!...
{ "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
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...
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
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;...
{ "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
90
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 =...
{ "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
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.74004674", "0.7262109", "0.7262109", "0.69340223", "0.6617433", "0.64840496", "0.64603734", "0.6353968", "0.634614", "0.634614", "0.6324044", "0.6324044", "0.61247706", "0.6122276", "0.60979056", "0.6075115", "0.6071776", "0.6067711", "0.60672724", "0.60655904", "0.6065590...
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
Constructor to create a storage for our `EE` objects. An `Events` instance is a plain object whose properties are event names.
function Events() {}
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function EventEmitter() {\n // Initialise required storage variables\n this._events = {};\n}", "function EventEmitter() {\n // Initialise required storage variables\n this._events = {};\n}", "function Eventify() {\n this.events = {};\n }", "function allEventsStore() {\n return {\n allEvents: [],\...
[ "0.6521578", "0.6521578", "0.63203484", "0.62790275", "0.62457407", "0.6222756", "0.6214015", "0.6194036", "0.6135046", "0.6127672", "0.6095979", "0.60912174", "0.6077552", "0.6077301", "0.6077301", "0.6060287", "0.6053536", "0.6051363", "0.6051363", "0.6051363", "0.6051363",...
0.0
-1
Minimal `EventEmitter` interface that is molded against the Node.js `EventEmitter` interface.
function EventEmitter() { this._events = new Events(); this._eventsCount = 0; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function EventEmitter() {} // Shortcuts to improve speed and size", "function EventEmitter() {}", "function EventEmitter() {}", "function EventEmitter() {}", "function EventEmitter() {}", "function EventEmitter() {}", "function EventEmitter() {}", "function EventEmitter() {}", "function EventEmitte...
[ "0.84403914", "0.8384602", "0.8384602", "0.8384602", "0.8384602", "0.8384602", "0.8384602", "0.8384602", "0.8384602", "0.8384602", "0.8384602", "0.8384602", "0.8384602", "0.8384602", "0.8384602", "0.8384602", "0.8384602", "0.8384602", "0.8384602", "0.8384602", "0.8384602", ...
0.0
-1
inlined Object.is polyfill to avoid requiring consumers ship their own
function is(x, y) { // SameValue algorithm if (x === y) { // Steps 1-5, 7-10 // Steps 6.b-6.e: +0 != -0 // Added the nonzero y check to make Flow happy, but it is redundant return x !== 0 || y !== 0 || 1 / x === 1 / y; } else { // Step 6.a: NaN == NaN return x !== x && y !== y; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function i(e){return!0===\n/*!\n * isobject <https://github.com/jonschlinkert/isobject>\n *\n * Copyright (c) 2014-2017, Jon Schlinkert.\n * Released under the MIT License.\n */\nfunction(e){return null!=e&&\"object\"==typeof e&&!1===Array.isArray(e)}(e)&&\"[object Object]\"===Object.prototype.toString.call(e)}", ...
[ "0.7044135", "0.6979357", "0.68574303", "0.6821805", "0.68029666", "0.67803156", "0.6729492", "0.67206", "0.6709456", "0.66839457", "0.6676559", "0.6676559", "0.6676559", "0.66488636", "0.6640003", "0.6640003", "0.6640003", "0.6640003", "0.6625777", "0.6623136", "0.6623136", ...
0.0
-1
Performs equality by iterating through keys on an object and returning false when any key has values which are not strictly equal between the arguments. Returns true when the values of all keys are strictly equal.
function shallowEqual(objA, objB) { if (is(objA, objB)) { return true; } if (typeof objA !== 'object' || objA === null || typeof objB !== 'object' || objB === null) { return false; } var keysA = Object.keys(objA); var keysB = Object.keys(objB); if (keysA.length !== keysB.length) { return fa...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function equalForKeys(a, b, keys) {\n if (!angular.isArray(keys) && angular.isObject(keys)) {\n keys = protoKeys(keys, [\"$$keys\", \"$$values\", \"$$equals\", \"$$validates\", \"$$new\", \"$$parent\"]);\n }\n if (!keys) {\n keys = [];\n for (var n in a) keys.push(n)...
[ "0.6574492", "0.6574492", "0.64693266", "0.6455874", "0.6435488", "0.6335597", "0.6296864", "0.62726045", "0.62410694", "0.6223985", "0.6214672", "0.61837506", "0.61583257", "0.61299884", "0.6128878", "0.60735047", "0.60351413", "0.60156983", "0.60051894", "0.5978312", "0.597...
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 ...
{ "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.6264917", "0.6264917", "0.6264917", "0.6243562", "0.62003636", "0.62003636", "0.61961967", "0.6191259", "0.6191259", "0.6185972", "0.6109528", "0.60122085", "0.5999864", "0.5995116", "0.5987345", "0.5983116", "0.5957374", "0.5957374", "0.594361", "0.5939109", "0.5919772", ...
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.70706356", "0.7041535", "0.7041535", "0.68165714", "0.67870575", "0.6750657", "0.6750657", "0.67267895", "0.6717587", "0.66951096", "0.6694948", "0.66231465", "0.65680957", "0.6545505", "0.6545505", "0.6545505", "0.6545505", "0.6545505", "0.6545505", "0.6545505", "0.654550...
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.79776317", "0.79776317", "0.79776317", "0.79776317", "0.79776317", "0.79776317", "0.79776317", "0.79776317", "0.79776317", "0.79776317", "0.79776317", "0.79776317", "0.79776317", "0.79776317", "0.79776317", "0.79776317", "0.79776317", "0.79776317", "0.79776317", "0.79776317"...
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 = ...
{ "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.65640014", "0.65625536", "0.65625536", "0.65625536", "0.65625536", "0.65625536", "0.65625536", "0.65625536", "0.65625536", "0.65625536", "0.65625536", "0.65625536", "0.65625536", "0.65625536", "0.65625536", "0.65625536", "0.65625536", "0.65625536", "0.65625536", "0.65625536"...
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.n...
{ "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.6118386", "0.6104275", "0.6013856", "0.5979055", "0.59630054", "0.59630054", "0.5934173", "0.5934173", "0.5934173", "0.59132546", "0.59132546", "0.5559817", "0.55166334", "0.5500577", "0.5487619", "0.5487619", "0.5476152", "0.5445956", "0.543895", "0.5413423", "0.53392494"...
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 += ...
{ "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.71422184", "0.71422184", "0.71422184", "0.71422184", "0.69713527", "0.69501936", "0.68877584", "0.68877584", "0.68877584", "0.68877584", "0.68877584", "0.68877584", "0.68877584", "0.68877584", "0.68877584", "0.68877584", "0.68877584", "0.68877584", "0.68877584", "0.68877584"...
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.7871349", "0.7794817", "0.7794817", "0.77862823", "0.77862823", "0.77790916", "0.77790916", "0.77790916", "0.77790916", "0.7758485", "0.7758383", "0.764584", "0.76114964", "0.7607617", "0.7553042", "0.7538073", "0.7538073", "0.75220335", "0.74735856", "0.74658275", "0.7465...
0.76271594
71
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 (!...
{ "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
Clones the object and adds a camel cased property version.
function addCamelCasedVersion(obj) { var regExp = /(-[a-z])/g; var replace = function replace(str) { return str[1].toUpperCase(); }; var newObj = {}; for (var key in obj) { newObj[key] = obj[key]; newObj[key.replace(regExp, replace)] = obj[key]; } return newObj; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function addCamelCasedVersion(obj) {\n var regExp = /(-[a-z])/g;\n var replace = function replace(str) {\n return str[1].toUpperCase();\n };\n var newObj = {};\n for (var key in obj) {\n newObj[key] = obj[key];\n newObj[key.replace(regExp, replace)] = obj[key];\n }\n return newO...
[ "0.7017152", "0.69527656", "0.69527656", "0.68966556", "0.68778366", "0.6828914", "0.67541724", "0.67541724", "0.67541724", "0.67541724", "0.67541724", "0.67541724", "0.67541724", "0.67541724", "0.67541724", "0.67541724", "0.67541724", "0.67541724", "0.67541724", "0.67541724", ...
0.68753433
32
Add unit to numeric values.
function defaultUnit() { var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {}; var camelCasedOptions = addCamelCasedVersion(options); function onProcessStyle(style, rule) { if (rule.type !== 'style') return style; for (var prop in style) { style[prop] = iterate(pro...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function unit(i, units) {\n\t if ((typeof i === \"string\") && (!i.match(/^[\\-0-9\\.]+$/))) {\n\t return i;\n\t } else {\n\t return \"\" + i + units;\n\t }\n\t }", "function unit(i, units) {\n if ((typeof i === \"string\") && (!i.match(/^[\\-0-9\\.]+$/))) {\n return i;\n } else {\...
[ "0.6622079", "0.65806407", "0.65806407", "0.65793705", "0.65624154", "0.65624154", "0.61946905", "0.60811275", "0.60735935", "0.60721624", "0.60721624", "0.60721624", "0.6060846", "0.6051657", "0.6045234", "0.60335", "0.6028815", "0.5936279", "0.59199363", "0.58140886", "0.58...
0.0
-1
Get a function to be used for $ref replacement.
function getReplaceRef(container) { return function (match, key) { var rule = container.getRule(key); if (rule) return rule.selector; (0, _warning2.default)(false, '[JSS] Could not find the referenced rule %s in %s.', key, container.options.meta || container); return key; }; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function fnref(name){\n return mkdat(\"fnref\", name);\n }", "function createRef() {\n var func = function setRef(node) {\n func.current = node;\n };\n return func;\n}", "function composeRef() {\n for (\n var _len = arguments.length, refs = new Array(_len), _key = 0;\n ...
[ "0.6649858", "0.64558005", "0.61212206", "0.60655695", "0.60655695", "0.60599333", "0.59819967", "0.5978643", "0.5965357", "0.5952257", "0.58624095", "0.58603877", "0.5857155", "0.58362913", "0.58362913", "0.58349156", "0.582107", "0.582107", "0.57546806", "0.572931", "0.5696...
0.5899973
40
Sort props by length.
function jssPropsSort() { function sort(prop0, prop1) { return prop0.length - prop1.length; } function onProcessStyle(style, rule) { if (rule.type !== 'style') return style; var newStyle = {}; var props = Object.keys(style).sort(sort); for (var prop in props) { newStyle[props[prop]] = ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function sortByLength(array) {\n\treturn array.sort(function (a, b) {\n\t\treturn a.length - b.length || // sort by length, if equal then\n\t\t\ta.localeCompare(b); // sort by dictionary order\n\t});\n}", "function sortByLength(strs) {\n let sortedArray = \n strs.sort((sortedArray, valueLength) => {...
[ "0.64766407", "0.63836104", "0.62847036", "0.6231552", "0.6111517", "0.6102041", "0.6031589", "0.59946394", "0.5980601", "0.5941717", "0.5935182", "0.5909202", "0.59040016", "0.5883093", "0.5868574", "0.5841102", "0.5841102", "0.5841102", "0.5841102", "0.5841102", "0.5841102"...
0.58517116
42
Get a style property value.
function getPropertyValue(cssRule, prop) { try { return cssRule.style.getPropertyValue(prop); } catch (err) { // IE may throw if property is unknown. return ''; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function _getStyle(el, property) {\n if (window.getComputedStyle) {\n return document.defaultView.getComputedStyle(el, null)[property];\n }\n if (el.currentStyle) {\n return el.currentStyle[property];\n ...
[ "0.74297154", "0.74020785", "0.7399583", "0.7328178", "0.7311819", "0.7249292", "0.72404826", "0.72404826", "0.7203527", "0.71599", "0.7143572", "0.7133223", "0.70882905", "0.70766973", "0.7049624", "0.70360684", "0.70360684", "0.7029471", "0.7014411", "0.69898814", "0.698285...
0.0
-1
Set a style property.
function setProperty(cssRule, prop, value) { try { var cssValue = value; if (Array.isArray(value)) { cssValue = (0, _toCssValue2['default'])(value, true); if (value[value.length - 1] === '!important') { cssRule.style.setProperty(prop, cssValue, 'important'); return true; } ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "setStyle(property, value) {\n if (!this._props.style) this._props.style = {};\n this._props.style[property] = value;\n }", "function setStyle(element, property, value) {\n element.style[property] = value;\n}", "function setStyle(n, key, value) {\n n.style[key] = value;\n \n }", "function set...
[ "0.798955", "0.7963325", "0.77943856", "0.7488918", "0.73106766", "0.73015743", "0.7267794", "0.7267794", "0.7191311", "0.71117854", "0.71055925", "0.701523", "0.69587797", "0.69548684", "0.69548684", "0.69548684", "0.6919497", "0.69163847", "0.69163847", "0.6902449", "0.6784...
0.0
-1
Remove a style property.
function removeProperty(cssRule, prop) { try { cssRule.style.removeProperty(prop); } catch (err) { (0, _warning2['default'])(false, '[JSS] DOMException "%s" was thrown. Tried to remove property "%s".', err.message, prop); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function removeProperty(key) {\n var root = document.documentElement;\n\n root.style.removeProperty(key);\n}", "function removeProperty(cssRule, prop) {\n try {\n // Support CSSTOM.\n if (cssRule.attributeStyleMap) {\n cssRule.attributeStyleMap.delete(prop);\n } else {\n cssRule...
[ "0.75522846", "0.7507937", "0.740172", "0.740172", "0.7248959", "0.7172173", "0.7172173", "0.7172173", "0.7172173", "0.7172173", "0.7172173", "0.7172173", "0.7172173", "0.7172173", "0.7172173", "0.7172173", "0.7172173", "0.7172173", "0.7172173", "0.7172173", "0.7172173", "0...
0.6827647
54
Find attached sheet with an index higher than the passed one.
function findHigherSheet(registry, options) { for (var i = 0; i < registry.length; i++) { var sheet = registry[i]; if (sheet.attached && sheet.options.index > options.index && sheet.options.insertionPoint === options.insertionPoint) { return sheet; } } return null; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function findHigherSheet(registry, options) {\n for (var i = 0; i < registry.length; i++) {\n var sheet = registry[i];\n if (sheet.attached && sheet.options.index > options.index && sheet.options.insertionPoint === options.insertionPoint) {\n return sheet;\n }\n }\n return null;\n }...
[ "0.7568327", "0.7539894", "0.7499265", "0.7499265", "0.747529", "0.747529", "0.747529", "0.747529", "0.747529", "0.747529", "0.747529", "0.747529", "0.747529", "0.747529", "0.747529", "0.747529", "0.747529", "0.747529", "0.747529", "0.747529", "0.747529", "0.747529", "0.7...
0.74848413
33
Find attached sheet with the highest index.
function findHighestSheet(registry, options) { for (var i = registry.length - 1; i >= 0; i--) { var sheet = registry[i]; if (sheet.attached && sheet.options.insertionPoint === options.insertionPoint) { return sheet; } } return null; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function findHighestSheet(registry, options) {\n for (var i = registry.length - 1; i >= 0; i--) {\n var sheet = registry[i];\n if (sheet.attached && sheet.options.insertionPoint === options.insertionPoint) {\n return sheet;\n }\n }\n return null;\n }", "function findHighestSheet(r...
[ "0.77357453", "0.7704632", "0.7696885", "0.7696885", "0.76521736", "0.76521736", "0.76521736", "0.76521736", "0.76521736", "0.76521736", "0.76521736", "0.76521736", "0.76521736", "0.76521736", "0.76521736", "0.76521736", "0.76521736", "0.76521736", "0.76521736", "0.76521736", ...
0.7669926
33
Find a comment with "jss" inside.
function findCommentNode(text) { var head = getHead(); for (var i = 0; i < head.childNodes.length; i++) { var node = head.childNodes[i]; if (node.nodeType === 8 && node.nodeValue.trim() === text) { return node; } } return null; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "IsInComment (ss, nn)\r\n { let ii=-1, bb=0;\r\n do { ii=ss.indexOf(\"{\",ii+1); bb++; }\r\n while ((ii>=0)&&(ii<nn));\r\n ii=-1;\r\n do { ii=ss.indexOf(\"}\",ii+1); bb--; }\r\n while ((ii>=0)&&(ii<nn));\r\n return(bb);\r\n }", "function findCommentNode(text) {\n var head = ...
[ "0.6377393", "0.6230793", "0.61686164", "0.61218774", "0.61005807", "0.61005807", "0.61005807", "0.61005807", "0.61005807", "0.61005807", "0.61005807", "0.61005807", "0.61005807", "0.61005807", "0.61005807", "0.61005807", "0.61005807", "0.61005807", "0.61005807", "0.61005807", ...
0.61737394
29
Find a node before which we can insert the sheet.
function findPrevNode(options) { var registry = _sheets2['default'].registry; if (registry.length > 0) { // Try to insert before the next higher sheet. var sheet = findHigherSheet(registry, options); if (sheet) return sheet.renderer.element; // Otherwise insert after the last attached. sheet ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function findPrevNode(options) {\n var registry = sheets.registry;\n\n if (registry.length > 0) {\n // Try to insert before the next higher sheet.\n var sheet = findHigherSheet(registry, options);\n\n if (sheet && sheet.renderer) {\n return {\n parent: sheet.renderer.element.pa...
[ "0.7421259", "0.74022955", "0.7398367", "0.7398367", "0.7362382", "0.7362382", "0.7362382", "0.7362382", "0.7362382", "0.7362382", "0.7362382", "0.7362382", "0.7362382", "0.7362382", "0.7362382", "0.7362382", "0.7362382", "0.7362382", "0.7362382", "0.7362382", "0.7362382", ...
0.69664556
62
Insert style element into the DOM.
function insertStyle(style, options) { var insertionPoint = options.insertionPoint; var prevNode = findPrevNode(options); if (prevNode) { var parentNode = prevNode.parentNode; if (parentNode) parentNode.insertBefore(style, prevNode); return; } // Works with iframes and any node types. if (in...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function insertStyle(style) {\n var a=document.createElement(\"style\");\n a.innerHTML=style;\n document.head.appendChild(a);\n}", "function insertStyle(style, options) {\n var insertionPoint = options.insertionPoint;\n var nextNode = findPrevNode(options);\n\n if (nextNode !== false && nextNode.pare...
[ "0.7943686", "0.7706128", "0.7683789", "0.7653549", "0.7653549", "0.76448977", "0.76448977", "0.76448977", "0.76448977", "0.76448977", "0.76448977", "0.76448977", "0.76448977", "0.76448977", "0.76448977", "0.76448977", "0.76448977", "0.76448977", "0.76448977", "0.76448977", "...
0.7471658
60
Create a rule instance.
function createRule() { var name = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 'unnamed'; var decl = arguments[1]; var options = arguments[2]; var jss = options.jss; var declCopy = (0, _cloneStyle2['default'])(decl); var rule = jss.plugins.onCreateRule(name, declCopy, options); i...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "static makeRule(options) {\n return new Rule(options.name, options.severity, options.selector ? Selector.parse(options.selector) : null, Rule.makePattern(options.pattern), options.lint || options.message, options.applies);\n }", "create(context) {\n freezeDeeply(context.opt...
[ "0.68356055", "0.6653184", "0.65755916", "0.64988756", "0.6485865", "0.6473794", "0.6325255", "0.6288921", "0.6207557", "0.61734235", "0.6164909", "0.61511165", "0.5944397", "0.59429896", "0.594144", "0.5869456", "0.58078146", "0.58078146", "0.58069164", "0.5770457", "0.57704...
0.64504606
32
Extracts a styles object with only props that contain function values.
function getDynamicStyles(styles) { var to = null; for (var key in styles) { var value = styles[key]; var type = typeof value === 'undefined' ? 'undefined' : _typeof(value); if (type === 'function') { if (!to) to = {}; to[key] = value; } else if (type === 'object' && value !== null && ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function extractStyleParts() {\n var args = [];\n for (var _i = 0; _i < arguments.length; _i++) {\n args[_i] = arguments[_i];\n }\n var classes = [];\n var objects = [];\n var stylesheet = _Stylesheet__WEBPACK_IMPORTED_MODULE_0__.Stylesheet.getInstance();\n function _processArgs(argsLis...
[ "0.6276235", "0.6276235", "0.62759775", "0.625942", "0.6162788", "0.6100102", "0.60855395", "0.60697323", "0.60697323", "0.60697323", "0.60697323", "0.60697323", "0.60697323", "0.60697323", "0.60697323", "0.60697323", "0.60697323", "0.60697323", "0.60697323", "0.60697323", "0...
0.60051996
61
Link rule with CSSStyleRule and nested rules with corresponding nested cssRules if both exists.
function linkRule(rule, cssRule) { rule.renderable = cssRule; if (rule.rules && cssRule.cssRules) rule.rules.link(cssRule.cssRules); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function linkRule(rule, cssRule) {\n rule.renderable = cssRule;\n if (rule.rules && cssRule.cssRules) rule.rules.link(cssRule.cssRules);\n }", "function linkRule(rule, cssRule) {\n\t rule.renderable = cssRule;\n\t if (rule.rules && cssRule.cssRules) rule.rules.link(cssRule.cssRules);\n\t}", "function ...
[ "0.668618", "0.6599938", "0.6599938", "0.58266324", "0.581942", "0.570616", "0.56474924", "0.5623747", "0.5611517", "0.55530465", "0.5530931", "0.5530931", "0.5500031", "0.5462916", "0.544259", "0.544092", "0.5435225", "0.5435225", "0.53858876", "0.5370974", "0.5360726", "0...
0.66892326
32
Converts a Rule to CSS string.
function toCss(selector, style) { var options = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {}; var result = ''; if (!style) return result; var _options$indent = options.indent, indent = _options$indent === undefined ? 0 : _options$indent; var fallbacks = style.fallbacks; ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function toCSSDeclaration(prop, val) {\n var props = toCSSProps(prop);\n for (var i = 0, ii = props.length; i < ii; ++i) {\n props[i] += \": \"+val+\";\";\n }\n return props.join(\"\");\n }", "toString(): string {\n if (Array.isArray(this.style)) {\n let str = ''\n for (let index =...
[ "0.6156099", "0.6117747", "0.5704", "0.5685539", "0.5682971", "0.564685", "0.5641924", "0.5641924", "0.5641924", "0.5641924", "0.56349224", "0.56349224", "0.56349224", "0.56349224", "0.56349224", "0.56349224", "0.56349224", "0.56349224", "0.56349224", "0.56349224", "0.5634922...
0.0
-1
Converts array values to string. `margin: [['5px', '10px']]` > `margin: 5px 10px;` `border: ['1px', '2px']` > `border: 1px, 2px;` `margin: [['5px', '10px'], '!important']` > `margin: 5px 10px !important;` `color: ['red', !important]` > `color: red !important;`
function toCssValue(value) { var ignoreImportant = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false; if (!Array.isArray(value)) return value; var cssValue = ''; // Support space separated values via `[['5px', '10px']]`. if (Array.isArray(value[0])) { for (var i = 0; i < value.l...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function toCssValue(value) {\n var ignoreImportant = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;\n\n if (!Array.isArray(value)) return value;\n\n var cssValue = '';\n\n // Support space separated values via `[['5px', '10px']]`.\n if (Array.isArray(value[0])) {\n f...
[ "0.69039696", "0.6801018", "0.6792182", "0.6579683", "0.65262175", "0.65044874", "0.64299", "0.64299", "0.6380504", "0.6380504", "0.6380504", "0.6380504", "0.6380504", "0.6380504", "0.6380504", "0.6380504", "0.6380504", "0.6380504", "0.6380504", "0.6380504", "0.6380504", "0...
0.6788105
30
Expose a method for transforming tokens into the path function.
function tokensToFunction (tokens) { // Compile all the tokens into regexps. var matches = new Array(tokens.length) // Compile all the patterns before compilation. for (var i = 0; i < tokens.length; i++) { if (typeof tokens[i] === 'object') { matches[i] = new RegExp('^(?:' + tokens[i].pattern + ')$')...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function tokensToFunction (tokens) {\n // Compile all the tokens into regexps.\n const matches = new Array(tokens.length)\n\n // Compile all the patterns before compilation.\n for (let i = 0; i < tokens.length; i++) {\n if (typeof tokens[i] === 'object') {\n matches[i] = new RegExp('^...
[ "0.6186804", "0.6011498", "0.5988314", "0.59597945", "0.59597945", "0.59597945", "0.59597945", "0.59597945", "0.59275687", "0.5921299", "0.5902797", "0.5896205", "0.5896205", "0.5896205", "0.5896205", "0.5896205", "0.5896205", "0.5875311", "0.5868575", "0.58594", "0.5856725",...
0.59863955
8
See for API details
function v1(options, buf, offset) { var i = buf && offset || 0; var b = buf || []; options = options || {}; var clockseq = options.clockseq !== undefined ? options.clockseq : _clockseq; // UUID timestamps are 100 nano-second units since the Gregorian epoch, // (1582-10-15 00:00). JSNumbers aren't precis...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private public function m246() {}", "obtain(){}", "function API(){}", "function API(){}", "private internal function m248() {}", "transient private internal function m185() {}", "transient private protected internal function m182() {}", "transient protected internal function m189() {}", "protected ...
[ "0.64539295", "0.628222", "0.6083875", "0.6083875", "0.58966196", "0.58931714", "0.5843906", "0.5807617", "0.56874675", "0.55977154", "0.55894995", "0.55894995", "0.5536012", "0.54927725", "0.547576", "0.5461862", "0.5457917", "0.54515964", "0.54515964", "0.54515964", "0.5451...
0.0
-1
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
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 si...
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 ...
{ "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.73533624", "0.73533624", "0.73533624", "0.73533624", "0.697312", "0.6893881", "0.6893881", "0.6847371", "0.6847371", "0.6847371", "0.6847371", "0.6847371", "0.6847371", "0.6847371", "0.6837159", "0.6837159", "0.6837159", "0.6837159", "0.6837159", "0.6837159", "0.6837159", ...
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 va...
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 = 0x7fffff...
{ "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.8281952", "0.8254239", "0.8254239", "0.82526803", "0.82526803", "0.82526803", "0.82526803", "0.82526803", "0.82526803", "0.82526803", "0.82526803", "0.8247719", "0.8245617", "0.8243793", "0.8243793", "0.8227476", "0.8219407", "0.82180357", "0.82180357", "0.82180357", "0.82...
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.66712785", "0.66712785", "0.6632945", "0.65210676", "0.63827264", "0.62754023", "0.62562263", "0.62335545", "0.62335545", "0.61056054", "0.6035937", "0.6017502", "0.59810936", "0.5959609", "0.5951102", "0.5951102", "0.5951102", "0.5951102", "0.5951102", "0.5951102", "0.595...
0.0
-1
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.6635265", "0.65760595", "0.65354884", "0.6478273", "0.6463494", "0.62667626", "0.62661046", "0.62631136", "0.62570816", "0.6208488", "0.61463493", "0.61388755", "0.61089295", "0.61089295", "0.61089295", "0.61089295", "0.61089295", "0.61089295", "0.61089295", "0.61089295", ...
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.8007454", "0.79413825", "0.7896979", "0.78161865", "0.78161865", "0.77798647", "0.7769451", "0.7756668", "0.7756668", "0.7756668", "0.7756668", "0.7756668", "0.7756668", "0.7756668", "0.7756668", "0.7756668", "0.7756668", "0.7756668", "0.7756668", "0.7756668", "0.7756668",...
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 =...
{ "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.8210542", "0.8210542", "0.81338847", "0.81338847", "0.80531883", "0.80531883", "0.80293983", "0.80098975", "0.78473496", "0.7843246", "0.7776618", "0.7749451", "0.7749451", "0.7749451", "0.7749451", "0.7749451", "0.7749451", "0.7749451", "0.7749451", "0.7749451", "0.774945...
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 continuatio...
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 ((...
{ "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.79385614", "0.79385614", "0.74667364", "0.73106414", "0.73106414", "0.711437", "0.6711619", "0.659092", "0.65597266", "0.6546813", "0.6482932", "0.64376056", "0.63858914", "0.6272032", "0.59877753", "0.59877753", "0.59877753", "0.59877753", "0.59877753", "0.59877753", "0.5...
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(...
{ "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.71285844", "0.701326", "0.678287", "0.67024726", "0.6565176", "0.64727366", "0.64727366", "0.6346288", "0.63428015", "0.63428015", "0.6312178", "0.616763", "0.616763", "0.616763", "0.616763", "0.616763", "0.616763", "0.616763", "0.616763", "0.616763", "0.616763", "0.6167...
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.6675586", "0.6675586", "0.623337", "0.6222627", "0.6221357", "0.6221357", "0.5834258", "0.5804138", "0.5804138", "0.58015794", "0.58015794", "0.58015794", "0.58015794", "0.58015794", "0.58015794", "0.58015794", "0.56985795", "0.5689638", "0.5689638", "0.56599504", "0.56358...
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.last...
{ "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.69670606", "0.69225675", "0.69225675", "0.68157375", "0.674668", "0.674668", "0.67353374", "0.67353374", "0.672664", "0.66413814" ]
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.61741793", "0.61722815", "0.6166875", "0.6157539", "0.6157539", "0.60805225", "0.6043108", "0.5879082", "0.5879082", "0.5811586", "0.5811586", "0.5811586", "0.5811586", "0.5811586", "0.5811586", "0.5811586", "0.57904005", "0.57904005", "0.5742406", "0.57081676", "0.5700781...
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.63480157", "0.63194925", "0.6203319", "0.61778533", "0.6119751", "0.6044178", "0.5955961", "0.5948356", "0.59131217", "0.59131217", "0.59131217", "0.5899713", "0.58946466", "0.5892134", "0.5868687", "0.5868687", "0.5868687", "0.5868687", "0.5787701", "0.57683253", "0.57243...
0.0
-1
Based on the jquery plugin
function detectScrollType() { if (cachedType) { return cachedType; } if (!inDOM || !window.document.body) { return 'indeterminate'; } var dummy = window.document.createElement('div'); dummy.appendChild(document.createTextNode('ABCD')); dummy.dir = 'rtl'; dummy.style.fontS...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function letsJQuery() {\r\n\tcreateOptionsMenu();\r\n\tpressthatButton();\r\n }", "function letsJQuery() {\r\n if (typeof $ == 'function') {\r\n // Your Script Code Here\r\n $('ul.ghnavsub li a').each( function() {\r\n $(this).attr('href', $(this).attr('href') +...
[ "0.5739969", "0.54825324", "0.5414143", "0.54043096", "0.53570336", "0.533439", "0.5311655", "0.524411", "0.5233962", "0.5224589", "0.51932734", "0.51886165", "0.5180954", "0.5164674", "0.51628804", "0.51546305", "0.51441187", "0.5134989", "0.5106428", "0.50865716", "0.506587...
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.6596648", "0.61723727", "0.6049048", "0.6027027", "0.59230334", "0.588856", "0.58478546", "0.5781408", "0.5778739", "0.57072663", "0.5629663", "0.5589972", "0.55750215", "0.546834", "0.5458209", "0.534628", "0.5325675", "0.53214645", "0.53055155", "0.52779263", "0.5268738"...
0.0
-1
A more optimised version of compose that takes exactly two functions
function compose2(f1, f2){ return function(){ return f1.call(this,f2.apply(this,arguments)); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function compose(fns) {\n\n\n}", "function compose(a, b) {\r\n return function() {\r\n const args = Array.prototype.slice.call(arguments);\r\n return a(b.apply(null, args));\r\n }\r\n}", "function compose() {\n for (var _len = arguments.length, funcs = new Array(_len), _key = 0; _key < _le...
[ "0.8419084", "0.8105095", "0.8078732", "0.79621416", "0.78335154", "0.78079516", "0.77981746", "0.7765516", "0.7695053", "0.7638688", "0.76265115", "0.7568083", "0.7527039", "0.7512861", "0.75069493", "0.7491056", "0.7491056", "0.7491056", "0.7491056", "0.7491056", "0.7491056...
0.7880795
10
This file declares various pieces of functional programming. This isn't a general purpose functional library, to keep things small it has just the parts useful for Oboe.js. Call a single function with the given arguments array. Basically, a functionalstyle version of the OOstyle Functionapply for when we don't care abo...
function apply(args, fn) { return fn.apply(undefined, args); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function apply (args, fn) {\n return fn.apply(undefined, args)\n}", "function callTogether () {\n var funcs = arguments\n var length = funcs.length\n var index = length\n\n if (!length) {\n return function () {}\n }\n\n return function () {\n length = index\n\n while (length--) {\n var fn = ...
[ "0.68140984", "0.6780703", "0.6765222", "0.6765222", "0.66247797", "0.6517778", "0.6517778", "0.6386464", "0.63534546", "0.6334131", "0.63336253", "0.62478995", "0.62478995", "0.62249124", "0.62053615", "0.61863077", "0.61857396", "0.61787087", "0.61678", "0.61678", "0.616188...
0.6848948
6
Swap the order of parameters to a binary function A bit like this flip:
function flip(fn){ return function(a, b){ return fn(b,a); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function flip (fn) {\n return function (a, b) {\n return fn(b, a)\n }\n}", "function flip(f) {\n return function (b, a) {\n return f(a, b);\n };\n}", "function flip(f){\n return function(y, x){ return f(x, y); }\n}", "function flip(f, b, a) {\n return _2(f, a, b);\n }", "function swapValue...
[ "0.68240273", "0.66296613", "0.65083003", "0.6503746", "0.64308774", "0.615056", "0.6075499", "0.6036123", "0.60337204", "0.602667", "0.5999114", "0.59705955", "0.59542966", "0.58845", "0.5834248", "0.5819574", "0.5816574", "0.57398254", "0.56990516", "0.5667944", "0.5626816"...
0.72228533
6