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
d3 mouse out function animating arc of donut chart
function handleMouseOut(d, i) { d3.select(this).transition().duration(300).attr('d', d3.arc().innerRadius(70).outerRadius(185)); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function mouseoutC() {\n d3.select(this).select(\"circle\").transition()\n .duration(750)\n .attr(\"r\", function(d){return d.r});\n }", "function mouseOutBubble(dataPoint) {\n\n dataPoint\n .transition()\n .ease(d3.easeElastic)\n .duration(800)\n ...
[ "0.74038583", "0.70446503", "0.6923425", "0.68371713", "0.68223464", "0.6789421", "0.6776291", "0.6738581", "0.670313", "0.6683869", "0.6671727", "0.654313", "0.6536373", "0.652436", "0.6503788", "0.6482724", "0.6478557", "0.6469275", "0.6449245", "0.6441286", "0.64365184", ...
0.755956
0
d3 function creating donut charts Author: Modified by: Avneet Arora
function donutChart(chartId, id, dataObj) { let data = Object.assign({}, dataObj[id]); delete data['item']; //deleting some values that are not required in the chart delete data['Calories']; delete data['Category']; let node = document.getElementById(chartId); while (node.hasChildNodes()) { ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function donutChart(){\r\n\t\r\n\t\r\n\t/* Initial settings */\r\n var width,\r\n height,\r\n\t\tradius,\r\n margin = { top: 0, bottom: 0, left: 0, right: 0 },\r\n\t\tvariable=\"value\",\r\n\t\tcategory=\"name\"\r\n\t\tzScale = d3.scaleOrdinal(d3.schemeCategory10),\r\n\t\tcornerRadius=3,\r\n\t\tpa...
[ "0.78912914", "0.78739214", "0.76752454", "0.7583078", "0.7569613", "0.7531942", "0.73509526", "0.7313388", "0.7111415", "0.7072449", "0.7033858", "0.6945767", "0.69345057", "0.688602", "0.6806702", "0.67470783", "0.6726972", "0.6672993", "0.6641847", "0.660994", "0.6598712",...
0.7586584
3
function of randomizing food location
function foodLocation() { let x = floor(random(w)); let y = floor(random(h)); food = createVector(x, y); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function getRandomLocation() {\n\n}", "function randomFood() {\n\tfor(var i=0; i<3; i++) {\n\t\tvar rfood = Math.floor(Math.random()*food.length);\n\t\tfoods[i].className = 'food';\n\t\tfoods[i].classList.add(food[rfood]);\n\t\tfoods[i].style.top = randomPosition()+\"px\";\n\t\tfoods[i].style.left = randomPosit...
[ "0.7650283", "0.75151306", "0.74546236", "0.74373174", "0.7400737", "0.72598106", "0.7256709", "0.72404504", "0.717138", "0.716956", "0.71631575", "0.7100458", "0.7077652", "0.700295", "0.6991865", "0.69903225", "0.69885683", "0.69719255", "0.6964246", "0.69622666", "0.694175...
0.7500672
2
function to write press keys
function keyPressed() { switch (keyCode){ case LEFT_ARROW: console.log('pressed', keyCode) snake.setDir(-1, 0); break; case RIGHT_ARROW: console.log('pressed', keyCode) snake.setDir(1, 0); break; case DOWN_ARROW: console.log('pressed', keyCode) snake.setDir(0, 1) ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function keyPressed() {\n if (key == 0) {\n serial.write(0);\n }\n if (key == 1) {\n serial.write(1);\n }\n if (key == 2) {\n serial.write(2);\n }\n if (key == 3) {\n serial.write(3);\n }\n if (key == 4) {\n serial.write(4);\n }\n if (key == 5) {\n serial.write(5);\n }\n if (key == 6...
[ "0.7286308", "0.6885377", "0.68213296", "0.67444754", "0.6708396", "0.66634077", "0.66368604", "0.6621167", "0.6618925", "0.6612948", "0.6606856", "0.65884006", "0.65841717", "0.65620184", "0.6528591", "0.64802873", "0.6475941", "0.6468972", "0.64290863", "0.6428426", "0.6415...
0.633966
29
Systeme de recette possibles
function comparaisonRecettesFrigo(){ let xhr = new XMLHttpRequest(); xhr.open('get', 'comparaisonRecettesFrigo?userID=' + userID, true) xhr.onload = analyseRecettes; xhr.send(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function esquiver() \n{\n //Cas spéciaux : Mort, ou pas d'ennemi\n if (presenceEnnemi === 666){\n dialogBox(\"Eh me saoule pas là relance le jeu ou casse toi connard J'AI AUTRE CHOSE A FOUTRE LA.\")\n \n }else if(presenceEnnemi ===0){ \n dialogBox(\"Tu donnes l'impression de danser sur le...
[ "0.6054863", "0.59204143", "0.5854735", "0.5784654", "0.563883", "0.5606479", "0.55119205", "0.54884046", "0.5468967", "0.54625887", "0.54305685", "0.54175574", "0.5382172", "0.5353896", "0.5347443", "0.53420943", "0.5339955", "0.53226984", "0.5315625", "0.53095853", "0.52966...
0.0
-1
delete animation from UI
function deleteFromUI(act) { if (screen.width < 560) { animate(act, "bounceOut"); setTimeout(() => { act.style.display = "none"; }, 1000); } else { animate(act, "fadeOutLeft"); setTimeout(() => { act.style.display = "none"; }, 1000); ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "remove() {\n this._animation.removeAction(this);\n }", "static clearAnimations() {\n this.clearItems('cycleAnimation');\n }", "function removeWidget(){\n\tfrmAnimation.hboxContainer.setVisibility(false, animationConfigDisable);\n}", "function button_tokushima_animationRemove()...
[ "0.78808117", "0.7383001", "0.7359899", "0.73193026", "0.7304599", "0.7297005", "0.7278521", "0.72755396", "0.725807", "0.7237308", "0.7224888", "0.7155176", "0.7137374", "0.71329343", "0.7077121", "0.70573014", "0.701385", "0.69991946", "0.69932437", "0.69760823", "0.6926445...
0.0
-1
deleteAccount delete button function datastructure
function ctrlDeleteItem(event) { let accID, splitID, ID; acc = event.target.parentNode.parentNode.parentNode; // get the li accID = event.target.parentNode.parentNode.parentNode.id; // get the id if (accID) { ID = accID; // if user confirms delete //delete acc from use...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "handleDeleteAccountButtonClick() {\n this.openConfirmAccountDeletionDialog();\n }", "function DeleteAccountAction() {\n}", "function deleteAccount() {\n $(this).closest('tr').remove();\n }", "deleteAccount (accountName) {\r\n let accountIndex = this.findAccountIndex(accountName);\r\n if (...
[ "0.7320606", "0.7252469", "0.71924394", "0.7096542", "0.7044118", "0.7013875", "0.69405925", "0.6938941", "0.68125814", "0.6687331", "0.66726017", "0.66621655", "0.665425", "0.6618363", "0.66112876", "0.6594575", "0.65429556", "0.65293807", "0.65012896", "0.647811", "0.640314...
0.6038975
62
show delete btn function
function showDeleteBtn(e) { let acc, accItem, child; acc = e.target.parentNode; // console.log(acc); if (screen.width < 570) { if (acc.classList.contains("main__list-items-acc")) { accItem = acc.parentNode; child = accItem.childNodes; if (accItem.classList.contains("onpres...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function showDeleteDiv() {\n\tshowActionDiv('delete');\n}", "function openDelete(){\n $('#modalWindow').css('display', 'block');\n $('#confirmDelete').css('display', 'block');\n var domElement = $(this).parent().parent();\n var id = $(domElement).attr(\"id\");\n $('#aceptDelete...
[ "0.7930155", "0.7180763", "0.7150069", "0.71157146", "0.7098608", "0.7095374", "0.7069788", "0.7007883", "0.6976488", "0.693553", "0.6928359", "0.6897951", "0.6888916", "0.6882312", "0.68818814", "0.68802774", "0.6857068", "0.6852033", "0.68482906", "0.68464434", "0.68389547"...
0.6545708
59
check the search input and return a valid match
function search() { if (searchField.value !== "" && searchField.value.length !== " ") { let searchAcc, lists = []; //return the matched acc searchAcc = data; searchAcc.forEach((acc) => { if ( acc.accName .toLowerCase() .i...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "searchIsValid(search) {\n if (search) {\n return true;\n }\n return false;\n }", "function checkSearchInput(searchInput){\n console.log(\"length\" +searchInput.length);\n if(searchInput.length <= 0){\n return false;\n }\n return true;...
[ "0.69396824", "0.63720703", "0.626513", "0.6247747", "0.6200188", "0.61791784", "0.61457855", "0.6109836", "0.6108015", "0.60818374", "0.6038997", "0.6032654", "0.60013044", "0.59980404", "0.5975243", "0.5970717", "0.59578604", "0.59241515", "0.59030676", "0.5884247", "0.5876...
0.0
-1
Validation and Add account to list
function ValidateField(bank, name, number) { if (bank.id === "default") { console.log(bank.id); displayAlert("danger", "bank must not be empty"); return false; } else if (name.value === "" || !isNaN(name.value)) { console.log(name.value); displayAlert("danger", "invalid acc name");...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function addAccountsToList(listId,index,account){\n var li = document.createElement('LI');\n var input = document.createElement('INPUT')\n input.value = account;\n input.id = 'account'+index;\n input.disabled=true;\n li.appendChild(input)\n var list = document.getElementById(listId);\n list...
[ "0.67688847", "0.66842866", "0.6566578", "0.6384769", "0.6322159", "0.620805", "0.6166576", "0.61022145", "0.602578", "0.5944248", "0.59367204", "0.58060306", "0.5805589", "0.57919943", "0.5762168", "0.57279074", "0.57164556", "0.571174", "0.5710762", "0.571074", "0.5705666",...
0.0
-1
Function Add / remove or toggle class
function AddRemoveClass(element, a, className) { if (a === "add") { element.classList.add(className); } else if (a === "remove") { element.classList.remove(className); } else if (a === "toggle") { element.classList.toggle(className); } else { return false; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function toggleClass (v) {\n return v ? 'addClass' : 'removeClass';\n }", "function putActiveClass(e) {\n removeActiveClass()\n e.classList.add(\"active\")\n}", "function toggleClasses(r, a) {\n var cArray = el.className.split(' ');\n if (a && cArray.indexOf(a) === -1) cArray.push(a);\n ...
[ "0.721708", "0.71127486", "0.69046974", "0.6892377", "0.6872051", "0.68692845", "0.6825658", "0.68004537", "0.67961967", "0.67742485", "0.6767052", "0.67607224", "0.6748199", "0.67338693", "0.67338693", "0.6715621", "0.6711288", "0.6673524", "0.6672572", "0.665732", "0.665507...
0.62359786
73
Add and remove animation
function animated(element, animation) { // add the class animate and the animation AddRemoveClass(element, "add", "animated"); AddRemoveClass(element, "add", animation); // remove the class animate and the animation thereby ending it setTimeout(() => { AddRemoveClass(element, "remove", "animat...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "remove() {\n this._animation.removeAction(this);\n }", "function animationManager () {\n for (var i = tasks.length; i--;) {\n if (tasks[i].step() == false) {\n // remove animation tasks\n logToScreen(\"remove animation\");\n tasks.splice(i...
[ "0.7295426", "0.7236765", "0.7098563", "0.70203805", "0.69858646", "0.69613415", "0.69092625", "0.6829433", "0.6789118", "0.6781158", "0.66998804", "0.66998804", "0.6674246", "0.6661786", "0.6655512", "0.663722", "0.6597021", "0.6592014", "0.65718883", "0.6558384", "0.6532023...
0.6214339
58
a wait function for 1sec to remove/add/turn visibility/turn off visiblity/display none /display block
function wait(element, a, className) { setTimeout(() => { switch (a) { case "add": return AddRemoveClass(element, "add", className); break; case "remove": return AddRemoveClass(element, "remove", className); break; case "vOn": return (e...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function delay(objt,visible,time) {\n\tsetTimeout(function(){\n\t\tdocument.getElementById(objt).style.visibility = visible;\n\t},time);\n}", "function delayOnVisibilityChange() {\n if ($document[0].hidden) {\n poller.delayAll();\n } else {\n ...
[ "0.7205697", "0.7165518", "0.71574825", "0.68720263", "0.68464625", "0.67942566", "0.6713512", "0.67105407", "0.66420144", "0.6622138", "0.6599765", "0.6573571", "0.6567697", "0.65655315", "0.65533364", "0.65528387", "0.6551658", "0.65480435", "0.6546044", "0.6539612", "0.653...
0.72651875
0
function to find the provider in user auth
function getName(authData) { switch(authData.provider) { case 'password': return authData.password.email.replace(/@.*/, ''); case 'twitter': return authData.twitter.displayName; case 'facebook': return authData.facebook.displayName; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function getProvider()\n{\n return providers[ iProvider ];\n}", "static getProvider(providerName) {\n const provider = this.providers.find(provider => provider.name === providerName);\n provider.authLink = this.getAuthLink(provider);\n return provider;\n }", "function getAuthenticationProvider(req...
[ "0.66677594", "0.6441005", "0.63531417", "0.6321974", "0.62226295", "0.6138356", "0.6102427", "0.6050378", "0.5982571", "0.59641224", "0.59563226", "0.5902713", "0.5886693", "0.5882684", "0.5880882", "0.5846437", "0.5844859", "0.5828396", "0.5804707", "0.5803766", "0.57856333...
0.53972065
56
Used to fetch current values.
function getter (value, properties) { // Most calculations happen within the typecast and the value passed is typically the value we want to use. // Typically, the getter just returns the value. // Modifications to the value within the getter are not written to the object. // Getter can transform value after t...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "get currentValues() {\n return this._currentValues;\n }", "get currentValues() {\n return this._currentValues;\n }", "getValues() {\n return this._currentValues;\n }", "getValues() {\n return this._currentValue;\n }", "getValues() {\n return this._currentValue...
[ "0.79311454", "0.79311454", "0.75070614", "0.7256009", "0.7256009", "0.6629448", "0.6619302", "0.66050935", "0.65040064", "0.64040047", "0.6395248", "0.6362435", "0.6299429", "0.6283107", "0.6256603", "0.6256603", "0.612518", "0.60964394", "0.608312", "0.60810715", "0.606717"...
0.0
-1
Used to write value to object.
function writeValue (value, fieldSchema) { // onBeforeValueSet allows you to cancel the operation. // It doesn't work like transform and others that allow you to modify the value because all typecast has already happened. // For use-cases where you need to modify the value, you can set a new value in the handler ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "writeValue(value) {\r\n this._value = value;\r\n }", "writeValue(value) {\n this.value = value;\n }", "writeValue(value) {\n this.value = value;\n }", "writeValue(value) {\n this.value = value;\n }", "writeValue(value) {\n this._assignValueProgrammatically(val...
[ "0.8495931", "0.8366662", "0.8366662", "0.8366662", "0.8094193", "0.7727112", "0.7556266", "0.7556266", "0.75551385", "0.75551385", "0.75551385", "0.7341718", "0.7083998", "0.70650756", "0.70625347", "0.67705864", "0.6726081", "0.6703319", "0.6687012", "0.66231865", "0.660545...
0.70186144
15
Reset field to default value.
function clearField (index, properties) { // Aliased fields reflect values on other fields and do not need to be cleared. if (properties.isAlias === true) { return } // If the property value is already not set, there's nothing to do. if (typeof this[properties.name] === 'undefined') { return } /...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "setDefault() {\n\n if ( this.options.default ) {\n\n this.$field.val(this.options.default).change();\n }\n }", "reset() {\n this.fieldContainer.all().forEach((field) => {\n field.initialValue = field.value;\n this._validateField(field, field.value);\n });\n }", "fun...
[ "0.7641092", "0.74289525", "0.7259955", "0.7240927", "0.70773804", "0.6950265", "0.69179535", "0.68874824", "0.68127835", "0.67912745", "0.66869533", "0.6681661", "0.6672389", "0.6658243", "0.6617158", "0.66126156", "0.658116", "0.6558699", "0.653782", "0.6518505", "0.6510631...
0.0
-1
es6: destructuring an object
function say({subject, verb, object}) { // template strings console.log(`${subject} ${verb} ${object}`); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function f2(o) { \n\tconst {p1, p2, p3} = o; // name must by same as property in object\n\tconsole.log(p1, p2, p3);\n}", "function destruct({nome: name}) {\n console.log(\"Name :\", name);\n}", "function spread(o) { return { ...o }; }", "destructuring() {\n let numbers = [1, 2, 3];\n let [one,...
[ "0.6133124", "0.60970366", "0.5959062", "0.59404683", "0.59263957", "0.59104276", "0.59023976", "0.5899374", "0.58881485", "0.578659", "0.5620644", "0.56169426", "0.5600355", "0.5569776", "0.5562875", "0.5560477", "0.5466238", "0.5466238", "0.54648334", "0.54400545", "0.54308...
0.0
-1
returns a promise that will refresh the token
function refresh_token(){ return iprom.then(function(){ return new Promise(function(resolve, reject){ let t_url = 'https://myanimelist.net/v1/oauth2/token'; let http = new XMLHttpRequest(); let params2 = `client_id=${CLIENT_ID}&grant_type=refresh_token&refresh_token=${rtoken}`; ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function refreshToken(token) {\n return $http.post('/auth/refreshToken', { token: token });\n }", "static RefreshToken() {\n return new Promise((resolve, reject) => {\n const email = localStorage.email;\n const id = localStorage.id;\n const refresh_token = localStorage...
[ "0.77040595", "0.7652952", "0.74289656", "0.73617744", "0.7340863", "0.7330008", "0.73287094", "0.7319933", "0.7248544", "0.7170767", "0.7166425", "0.7162543", "0.714198", "0.70917386", "0.7033438", "0.69947183", "0.6977063", "0.69680935", "0.69680935", "0.6960138", "0.694773...
0.7828723
0
function for handling upload widget for cloudinary
function Upload({ user }) { const history = useHistory(); const options = { title: 'SUCCESS!', message: 'Photo successfully uploaded!', type: 'success', container: 'center', animationIn: ['animated', 'fadeIn'], animationOut: ['animated', 'fadeOut'], dismiss: { duration: 1500, }...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function openUploadWidget () {\n cloudinary.openUploadWidget({\n cloud_name: 'ddanielnp',\n upload_preset: 'profile_preset',\n multiple: false\n }, function (error, result) {\n $('.profile_image').attr('src', result[0].eager[0].secure_url)\n $('#account_profile_image').val(result[0].eager[0].secur...
[ "0.7677386", "0.7394014", "0.72285116", "0.71183974", "0.6949678", "0.6885614", "0.68136275", "0.6717562", "0.667539", "0.66199154", "0.65870094", "0.65189385", "0.64957416", "0.64875513", "0.6460405", "0.64045763", "0.6396704", "0.63636696", "0.6361488", "0.63520914", "0.629...
0.6269457
23
Called by IDE when a new behavior type is to be created
function CreateIDEBehaviorType() { return new IDEBehaviorType(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function CreateIDEBehaviorType()\r\n{\r\n\treturn new IDEBehaviorType();\r\n}", "createTypes(){\n }", "createBehavior() {\n return undefined;\n }", "function displayNewBehavior (behavior)\n {\n $('.behavior-list').append(behavior.getListItem());\n }", "function IDEBehaviorType()\n{\n\ta...
[ "0.74549305", "0.63930225", "0.61176217", "0.6034356", "0.59698915", "0.59698915", "0.59698915", "0.59698915", "0.59698915", "0.59698915", "0.59698915", "0.59698915", "0.59698915", "0.59698915", "0.59698915", "0.59698915", "0.59698915", "0.59698915", "0.58972967", "0.5850289", ...
0.72966576
13
Class representing a behavior type in the IDE
function IDEBehaviorType() { assert2(this instanceof arguments.callee, "Constructor called as a function"); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function CreateIDEBehaviorType()\r\n{\r\n\treturn new IDEBehaviorType();\r\n}", "function CreateIDEBehaviorType()\n{\n\treturn new IDEBehaviorType();\n}", "function CreateIDEBehaviorType()\n{\n\treturn new IDEBehaviorType();\n}", "function CreateIDEBehaviorType()\n{\n\treturn new IDEBehaviorType();\n}", "f...
[ "0.7630826", "0.76208895", "0.76208895", "0.76208895", "0.76208895", "0.76208895", "0.76208895", "0.76208895", "0.76208895", "0.76208895", "0.76208895", "0.76208895", "0.76208895", "0.76208895", "0.76208895", "0.62830997", "0.62478065", "0.61843866", "0.61153984", "0.5953842", ...
0.601763
32
Class representing an individual instance of the behavior in the IDE
function IDEInstance(instance, type) { assert2(this instanceof arguments.callee, "Constructor called as a function"); // Save the constructor parameters this.instance = instance; this.type = type; // Set the default property values from the property table this.properties = {}; for (var i = 0; i < property_...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function CreateIDEBehaviorType()\r\n{\r\n\treturn new IDEBehaviorType();\r\n}", "function CreateIDEBehaviorType()\n{\n\treturn new IDEBehaviorType();\n}", "function CreateIDEBehaviorType()\n{\n\treturn new IDEBehaviorType();\n}", "function CreateIDEBehaviorType()\n{\n\treturn new IDEBehaviorType();\n}", "f...
[ "0.6600628", "0.65088755", "0.65088755", "0.65088755", "0.65088755", "0.65088755", "0.65088755", "0.65088755", "0.65088755", "0.65088755", "0.65088755", "0.65088755", "0.65088755", "0.65088755", "0.65088755", "0.6378327", "0.637103", "0.6315103", "0.6288565", "0.6288565", "0....
0.6147998
54
Parse the AcceptCharset header.
function parseAcceptCharset(accept) { var accepts = accept.split(','); for (var i = 0, j = 0; i < accepts.length; i++) { var charset = parseCharset(accepts[i].trim(), i); if (charset) { accepts[j++] = charset; } } // trim accepts accepts.length = j; return accepts; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function parseAcceptCharset(accept){var accepts=accept.split(',');for(var i=0,j=0;i<accepts.length;i++){var charset=parseCharset(accepts[i].trim(),i);if(charset){accepts[j++]=charset;}}// trim accepts\naccepts.length=j;return accepts;}", "function parseAcceptCharset(accept) {\n var accepts = accept.split(',');\...
[ "0.7039995", "0.68552816", "0.6784992", "0.6687397", "0.60886407", "0.6056493", "0.6045923", "0.6044288", "0.6044288", "0.6044288", "0.6044288", "0.6044288", "0.6044288", "0.6044288", "0.6044288", "0.6044288", "0.6044288", "0.6044288", "0.6044288", "0.6044288", "0.6044288", ...
0.67593646
18
Parse a charset from the AcceptCharset header.
function parseCharset(str, i) { var match = simpleCharsetRegExp.exec(str); if (!match) return null; var charset = match[1]; var q = 1; if (match[2]) { var params = match[2].split(';'); for (var j = 0; j < params.length; j++) { var p = params[j].trim().split('='); if (p[0] === 'q') { ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function parseAcceptCharset(accept){var accepts=accept.split(',');for(var i=0,j=0;i<accepts.length;i++){var charset=parseCharset(accepts[i].trim(),i);if(charset){accepts[j++]=charset;}}// trim accepts\naccepts.length=j;return accepts;}", "function parseAcceptCharset(accept) {\n var accepts = accept.split(',');\...
[ "0.6499314", "0.6420927", "0.6343317", "0.6343317", "0.6343317", "0.6343317", "0.6343317", "0.6343317", "0.6343317", "0.6343317", "0.6343317", "0.6343317", "0.6343317", "0.6343317", "0.6343317", "0.6343317", "0.6343317", "0.6343317", "0.6343317", "0.6343317", "0.63281506", ...
0.5733173
42
Get the priority of a charset.
function getCharsetPriority(charset, accepted, index) { var priority = {o: -1, q: 0, s: 0}; for (var i = 0; i < accepted.length; i++) { var spec = specify(charset, accepted[i], index); if (spec && (priority.s - spec.s || priority.q - spec.q || priority.o - spec.o) < 0) { priority = spec; } } ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function getCharsetPriority(charset,accepted,index){var priority={o:-1,q:0,s:0};for(var i=0;i<accepted.length;i++){var spec=specify(charset,accepted[i],index);if(spec&&(priority.s-spec.s||priority.q-spec.q||priority.o-spec.o)<0){priority=spec;}}return priority;}", "function getCharsetPriority(charset, accepted, ...
[ "0.751586", "0.69577765", "0.6953194", "0.69219106", "0.690706", "0.67971313", "0.62817925", "0.60753196", "0.5847219", "0.5751705", "0.57367706", "0.5733306", "0.5733306", "0.5733306", "0.5733306", "0.5733306", "0.5733306", "0.5733306", "0.5733306", "0.5733306", "0.5733306",...
0.69209915
18
Get the specificity of the charset.
function specify(charset, spec, index) { var s = 0; if(spec.charset.toLowerCase() === charset.toLowerCase()){ s |= 1; } else if (spec.charset !== '*' ) { return null } return { i: index, o: spec.i, q: spec.q, s: s } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "get charset() {\n return true;\n\t}", "function getFullCharset(spec){return spec.charset;}", "function getCharsetPriority(charset,accepted,index){var priority={o:-1,q:0,s:0};for(var i=0;i<accepted.length;i++){var spec=specify(charset,accepted[i],index);if(spec&&(priority.s-spec.s||priority.q-spec.q||priorit...
[ "0.6546839", "0.62998265", "0.61902744", "0.6022435", "0.5876446", "0.58677155", "0.5835083", "0.5835083", "0.5835083", "0.5835083", "0.5835083", "0.5835083", "0.5835083", "0.5835083", "0.5835083", "0.5835083", "0.5835083", "0.5835083", "0.5835083", "0.5835083", "0.5835083", ...
0.0
-1
Get the preferred charsets from an AcceptCharset header.
function preferredCharsets(accept, provided) { // RFC 2616 sec 14.2: no header = * var accepts = parseAcceptCharset(accept === undefined ? '*' : accept || ''); if (!provided) { // sorted list of all charsets return accepts .filter(isQuality) .sort(compareSpecs) .map(getFullCharset); }...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function preferredCharsets(accept,provided){// RFC 2616 sec 14.2: no header = *\nvar accepts=parseAcceptCharset(accept===undefined?'*':accept||'');if(!provided){// sorted list of all charsets\nreturn accepts.filter(isQuality).sort(compareSpecs).map(getFullCharset);}var priorities=provided.map(function getPriority(...
[ "0.7673057", "0.73790044", "0.73272055", "0.7212407", "0.7062331", "0.6508374", "0.64996797", "0.64701474", "0.64701474", "0.64701474", "0.64701474", "0.64701474", "0.64701474", "0.64701474", "0.64701474", "0.64701474", "0.64701474", "0.64701474", "0.64701474", "0.64701474", ...
0.7317671
18
Get full charset string.
function getFullCharset(spec) { return spec.charset; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function getFullCharset(spec){return spec.charset;}", "function getFullCharset(spec) {\n\t return spec.charset;\n\t}", "function getFullEncoding(spec){return spec.encoding;}", "function $Lk2d$var$getFullEncoding(spec) {\n return spec.encoding;\n}", "function getFullEncoding(spec) {\n return spec.encodin...
[ "0.7217704", "0.68951017", "0.61000806", "0.6091716", "0.5827547", "0.5827547", "0.5827547", "0.5827547", "0.5827547", "0.5827547", "0.5827547", "0.5827547", "0.5827547", "0.5827547", "0.5827547", "0.5827547", "0.5827547", "0.5827547", "0.5827547", "0.5827547", "0.5827547", ...
0.695484
17
Check if a spec has any quality.
function isQuality(spec) { return spec.q > 0; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function isQuality(spec){return spec.q>0;}", "function isQuality(spec){return spec.q>0;}", "function isQuality(spec){return spec.q>0;}", "function isQuality(spec){return spec.q>0;}", "function isQuality(spec) {\n\t return spec.q > 0;\n\t}", "function isQuality(spec) {\n\t return spec.q > 0;\n\t}", "f...
[ "0.8293954", "0.8293954", "0.8293954", "0.8293954", "0.82828325", "0.82828325", "0.82828325", "0.82828325", "0.8019909", "0.8019909", "0.7844618", "0.7792394", "0.77438265", "0.77438265", "0.7717935", "0.75713885", "0.75713885", "0.61072475", "0.5858215", "0.5632551", "0.5478...
0.8405716
65
Parse the AcceptEncoding header.
function parseAcceptEncoding(accept) { var accepts = accept.split(','); var hasIdentity = false; var minQuality = 1; for (var i = 0, j = 0; i < accepts.length; i++) { var encoding = parseEncoding(accepts[i].trim(), i); if (encoding) { accepts[j++] = encoding; hasIdentity = hasIdentity || s...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function parseAcceptEncoding(accept){var accepts=accept.split(',');var hasIdentity=false;var minQuality=1;for(var i=0,j=0;i<accepts.length;i++){var encoding=parseEncoding(accepts[i].trim(),i);if(encoding){accepts[j++]=encoding;hasIdentity=hasIdentity||specify('identity',encoding);minQuality=Math.min(minQuality,enc...
[ "0.71432865", "0.67086786", "0.6649227", "0.6649227", "0.6649227", "0.6649227", "0.6649227", "0.6649227", "0.6649227", "0.6649227", "0.6649227", "0.6649227", "0.6649227", "0.6649227", "0.6649227", "0.6649227", "0.6649227", "0.6649227", "0.66337097", "0.6621949", "0.65052336",...
0.6642721
18
Parse an encoding from the AcceptEncoding header.
function parseEncoding(str, i) { var match = simpleEncodingRegExp.exec(str); if (!match) return null; var encoding = match[1]; var q = 1; if (match[2]) { var params = match[2].split(';'); for (var j = 0; j < params.length; j++) { var p = params[j].trim().split('='); if (p[0] === 'q') { ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function parseAcceptEncoding(accept){var accepts=accept.split(',');var hasIdentity=false;var minQuality=1;for(var i=0,j=0;i<accepts.length;i++){var encoding=parseEncoding(accepts[i].trim(),i);if(encoding){accepts[j++]=encoding;hasIdentity=hasIdentity||specify('identity',encoding);minQuality=Math.min(minQuality,enc...
[ "0.7013149", "0.6589018", "0.65319437", "0.6530741", "0.6530741", "0.6530741", "0.6530741", "0.6530741", "0.6530741", "0.6530741", "0.6530741", "0.6530741", "0.6530741", "0.6530741", "0.6530741", "0.6530741", "0.6530741", "0.6530741", "0.6530741", "0.65225047", "0.6481561", ...
0.5822086
41
Get the priority of an encoding.
function getEncodingPriority(encoding, accepted, index) { var priority = {o: -1, q: 0, s: 0}; for (var i = 0; i < accepted.length; i++) { var spec = specify$1(encoding, accepted[i], index); if (spec && (priority.s - spec.s || priority.q - spec.q || priority.o - spec.o) < 0) { priority = spec; } ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function getEncodingPriority(encoding,accepted,index){var priority={o:-1,q:0,s:0};for(var i=0;i<accepted.length;i++){var spec=specify(encoding,accepted[i],index);if(spec&&(priority.s-spec.s||priority.q-spec.q||priority.o-spec.o)<0){priority=spec;}}return priority;}", "get priority()\n {\n return 0xfb;\...
[ "0.7349095", "0.71173537", "0.69802105", "0.69708896", "0.69574994", "0.69574994", "0.69574994", "0.69574994", "0.69574994", "0.69574994", "0.69574994", "0.69574994", "0.69574994", "0.69574994", "0.69574994", "0.69574994", "0.69574994", "0.69574994", "0.69574994", "0.69574994",...
0.6895123
22
Get the specificity of the encoding.
function specify$1(encoding, spec, index) { var s = 0; if(spec.encoding.toLowerCase() === encoding.toLowerCase()){ s |= 1; } else if (spec.encoding !== '*' ) { return null } return { i: index, o: spec.i, q: spec.q, s: s } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "_getEncodingMode(val) {\r\n if (/^\\d+$/.test(val)) {\r\n //Numeric Mode\r\n return 1;\r\n }\r\n else if (/^[A-Z0-9 $%*+\\-./:]*$/.test(val)) {\r\n //Alphanumeric Mode\r\n return 2;\r\n }\r\n else if (\r\n /^[\\u3000-\\u303F\...
[ "0.5889609", "0.5877029", "0.560527", "0.5564978", "0.5548051", "0.5536993", "0.5511985", "0.5415192", "0.53408486", "0.53127474", "0.5312689", "0.52835333", "0.52697015", "0.52697015", "0.52697015", "0.52697015", "0.52265984", "0.5187956", "0.5160117", "0.5159451", "0.514797...
0.0
-1
Get the preferred encodings from an AcceptEncoding header.
function preferredEncodings(accept, provided) { var accepts = parseAcceptEncoding(accept || ''); if (!provided) { // sorted list of all encodings return accepts .filter(isQuality$1) .sort(compareSpecs$1) .map(getFullEncoding); } var priorities = provided.map(function getPriority(type...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function preferredEncodings(accept,provided){var accepts=parseAcceptEncoding(accept||'');if(!provided){// sorted list of all encodings\nreturn accepts.filter(isQuality).sort(compareSpecs).map(getFullEncoding);}var priorities=provided.map(function getPriority(type,index){return getEncodingPriority(type,accepts,inde...
[ "0.73731464", "0.70190084", "0.69102305", "0.68625146", "0.6822369", "0.67981094", "0.67981094", "0.67981094", "0.67981094", "0.67981094", "0.67981094", "0.67981094", "0.67981094", "0.67981094", "0.67981094", "0.67981094", "0.67981094", "0.67981094", "0.67981094", "0.67981094",...
0.6781894
21
Get full encoding string.
function getFullEncoding(spec) { return spec.encoding; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function getFullEncoding(spec){return spec.encoding;}", "function getFullEncoding(spec) {\n\t return spec.encoding;\n\t}", "function $Lk2d$var$getFullEncoding(spec) {\n return spec.encoding;\n}", "get encoding() {\n return this._encoding;\n }", "function getFullCharset(spec){return spec.charset...
[ "0.7535593", "0.7318322", "0.7302668", "0.6406901", "0.63541704", "0.6282776", "0.62758064", "0.6212579", "0.6212579", "0.6150168", "0.614859", "0.614859", "0.614859", "0.614859", "0.614859", "0.614859", "0.614859", "0.614859", "0.614859", "0.614859", "0.614859", "0.614859"...
0.73156565
18
Check if a spec has any quality.
function isQuality$1(spec) { return spec.q > 0; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function isQuality(spec) {\n return spec.q > 0;\n}", "function isQuality(spec) {\n return spec.q > 0;\n}", "function isQuality(spec) {\n return spec.q > 0;\n}", "function isQuality(spec) {\n return spec.q > 0;\n}", "function isQuality(spec) {\n return spec.q > 0;\n}", "function isQuality(spec) {\n ...
[ "0.8407581", "0.8407581", "0.8407581", "0.8407581", "0.8407581", "0.8407581", "0.8407581", "0.8407581", "0.8407581", "0.8407581", "0.8407581", "0.8407581", "0.8407581", "0.8407581", "0.8407581", "0.8407581", "0.8407581", "0.8407581", "0.8407581", "0.8407581", "0.8407581", "...
0.80218095
79
Parse the AcceptLanguage header.
function parseAcceptLanguage(accept) { var accepts = accept.split(','); for (var i = 0, j = 0; i < accepts.length; i++) { var language = parseLanguage(accepts[i].trim(), i); if (language) { accepts[j++] = language; } } // trim accepts accepts.length = j; return accepts; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function parseAcceptLanguage(accept){var accepts=accept.split(',');for(var i=0,j=0;i<accepts.length;i++){var langauge=parseLanguage(accepts[i].trim(),i);if(langauge){accepts[j++]=langauge;}}// trim accepts\naccepts.length=j;return accepts;}", "function parseAcceptLanguage(accept) {\n var accepts = accept.split(...
[ "0.7237235", "0.7020808", "0.68175346", "0.68175346", "0.68175346", "0.68175346", "0.68175346", "0.68175346", "0.68175346", "0.68175346", "0.68131745", "0.5779814", "0.5629911", "0.55641806", "0.5497162", "0.544716", "0.54365283", "0.5412191", "0.5371203", "0.5371203", "0.537...
0.6901108
10
Parse a language from the AcceptLanguage header.
function parseLanguage(str, i) { var match = simpleLanguageRegExp.exec(str); if (!match) return null; var prefix = match[1], suffix = match[2], full = prefix; if (suffix) full += "-" + suffix; var q = 1; if (match[3]) { var params = match[3].split(';'); for (var j = 0; j < params.length; ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function parseAcceptLanguage(accept){var accepts=accept.split(',');for(var i=0,j=0;i<accepts.length;i++){var langauge=parseLanguage(accepts[i].trim(),i);if(langauge){accepts[j++]=langauge;}}// trim accepts\naccepts.length=j;return accepts;}", "function parseAcceptLanguage(accept) {\n var accepts = accept.split(...
[ "0.6601255", "0.64653665", "0.636879", "0.636879", "0.636879", "0.636879", "0.636879", "0.636879", "0.636879", "0.636879", "0.636879", "0.636879", "0.6256652", "0.6256652", "0.6256652", "0.6256652", "0.6256652", "0.6256652", "0.6256652", "0.6256652", "0.62063956", "0.598510...
0.5616479
32
Get the priority of a language.
function getLanguagePriority(language, accepted, index) { var priority = {o: -1, q: 0, s: 0}; for (var i = 0; i < accepted.length; i++) { var spec = specify$2(language, accepted[i], index); if (spec && (priority.s - spec.s || priority.q - spec.q || priority.o - spec.o) < 0) { priority = spec; } ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function getLanguagePriority(language,accepted,index){var priority={o:-1,q:0,s:0};for(var i=0;i<accepted.length;i++){var spec=specify(language,accepted[i],index);if(spec&&(priority.s-spec.s||priority.q-spec.q||priority.o-spec.o)<0){priority=spec;}}return priority;}", "function $liTQ$var$getLanguagePriority(langu...
[ "0.7335595", "0.6977126", "0.6956258", "0.6923045", "0.6920323", "0.6920323", "0.6920323", "0.6920323", "0.6920323", "0.6920323", "0.6920323", "0.6920323", "0.6920323", "0.6920323", "0.6920323", "0.6920323", "0.6920323", "0.6920323", "0.6920323", "0.6920323", "0.6862178", "...
0.68767244
20
Get the specificity of the language.
function specify$2(language, spec, index) { var p = parseLanguage(language); if (!p) return null; var s = 0; if(spec.full.toLowerCase() === p.full.toLowerCase()){ s |= 4; } else if (spec.prefix.toLowerCase() === p.full.toLowerCase()) { s |= 2; } else if (spec.full.toLowerCase() === p.prefix.toLowerC...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "identifyLanguage(codeElement) {\n let regex = /(?:\\s|^)panda[_-](\\w+)(?:\\s|$)/;\n\n if (regex.test(codeElement.className)) {\n return regex.exec(codeElement.className)[1];\n }\n\n return 'default'\n }", "function getLangCode() {\n\treturn getCo...
[ "0.62081033", "0.54541916", "0.53952163", "0.5361916", "0.5355653", "0.5347709", "0.52777916", "0.5272118", "0.5251397", "0.5249669", "0.5245143", "0.5233496", "0.5195905", "0.51840144", "0.5179384", "0.5174517", "0.5157747", "0.5152776", "0.51516306", "0.5135221", "0.5131292...
0.0
-1
Get the preferred languages from an AcceptLanguage header.
function preferredLanguages(accept, provided) { // RFC 2616 sec 14.4: no header = * var accepts = parseAcceptLanguage(accept === undefined ? '*' : accept || ''); if (!provided) { // sorted list of all languages return accepts .filter(isQuality$2) .sort(compareSpecs$2) .map(getFullLangua...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function preferredLanguages(accept,provided){// RFC 2616 sec 14.4: no header = *\nvar accepts=parseAcceptLanguage(accept===undefined?'*':accept||'');if(!provided){// sorted list of all languages\nreturn accepts.filter(isQuality).sort(compareSpecs).map(getFullLanguage);}var priorities=provided.map(function getPrior...
[ "0.75214154", "0.7287705", "0.7241299", "0.7225982", "0.7225982", "0.7225982", "0.7225982", "0.7225982", "0.7225982", "0.7225982", "0.7225982", "0.7225982", "0.7225982", "0.7225982", "0.7225982", "0.7225982", "0.7225982", "0.7225982", "0.7225982", "0.72138476", "0.6733221", ...
0.71985203
20
Get full language string.
function getFullLanguage(spec) { return spec.full; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function ls_getLanguage() {\n var language = '';\n \n // Priority:\n // 1. Cookie\n // 2. Browser autodetection\n \n // grab according to cookie\n language = ls_getCookieLanguage();\n \n // grab according to browser if none defined\n if (!language) {\n language = ls_getBrowserLanguage();\n }\n ...
[ "0.7114745", "0.7095166", "0.7043999", "0.70279914", "0.6950143", "0.68233633", "0.68023175", "0.6756723", "0.6733215", "0.66783124", "0.6668467", "0.6546655", "0.6507804", "0.6507335", "0.6478282", "0.64767236", "0.64533913", "0.644378", "0.6419143", "0.6403028", "0.6364866"...
0.6746375
24
Check if a spec has any quality.
function isQuality$2(spec) { return spec.q > 0; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function isQuality(spec) {\n return spec.q > 0;\n}", "function isQuality(spec) {\n return spec.q > 0;\n}", "function isQuality(spec) {\n return spec.q > 0;\n}", "function isQuality(spec) {\n return spec.q > 0;\n}", "function isQuality(spec) {\n return spec.q > 0;\n}", "function isQuality(spec) {\n ...
[ "0.8407581", "0.8407581", "0.8407581", "0.8407581", "0.8407581", "0.8407581", "0.8407581", "0.8407581", "0.8407581", "0.8407581", "0.8407581", "0.8407581", "0.8407581", "0.8407581", "0.8407581", "0.8407581", "0.8407581", "0.8407581", "0.8407581", "0.8407581", "0.8407581", "...
0.7746043
83
Parse the Accept header.
function parseAccept(accept) { var accepts = splitMediaTypes(accept); for (var i = 0, j = 0; i < accepts.length; i++) { var mediaType = parseMediaType(accepts[i].trim(), i); if (mediaType) { accepts[j++] = mediaType; } } // trim accepts accepts.length = j; return accepts; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function parseAccept(accept){var accepts=splitMediaTypes(accept);for(var i=0,j=0;i<accepts.length;i++){var mediaType=parseMediaType(accepts[i].trim(),i);if(mediaType){accepts[j++]=mediaType;}}// trim accepts\naccepts.length=j;return accepts;}", "function parseAccept(accept) {\n var accepts = splitMediaTypes(acc...
[ "0.7183107", "0.69135046", "0.68863356", "0.68824416", "0.64964", "0.64763445", "0.64763445", "0.64763445", "0.64763445", "0.64763445", "0.64763445", "0.64763445", "0.64763445", "0.64763445", "0.64763445", "0.64763445", "0.64763445", "0.64763445", "0.64763445", "0.64763445", ...
0.6857977
19
Parse a media type from the Accept header.
function parseMediaType(str, i) { var match = simpleMediaTypeRegExp.exec(str); if (!match) return null; var params = Object.create(null); var q = 1; var subtype = match[2]; var type = match[1]; if (match[3]) { var kvps = splitParameters(match[3]).map(splitKeyValuePair); for (var j = 0; j < kvps...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function parseAccept(accept){var accepts=splitMediaTypes(accept);for(var i=0,j=0;i<accepts.length;i++){var mediaType=parseMediaType(accepts[i].trim(),i);if(mediaType){accepts[j++]=mediaType;}}// trim accepts\naccepts.length=j;return accepts;}", "function parseAccept(accept) {\n var accepts = splitMediaTypes(acc...
[ "0.7406251", "0.6864228", "0.6782024", "0.6782024", "0.6782024", "0.6782024", "0.6782024", "0.6782024", "0.6782024", "0.6782024", "0.6782024", "0.6782024", "0.6782024", "0.6782024", "0.6782024", "0.6782024", "0.6782024", "0.6782024", "0.6782024", "0.6782024", "0.67674446", ...
0.60185355
46
Get the priority of a media type.
function getMediaTypePriority(type, accepted, index) { var priority = {o: -1, q: 0, s: 0}; for (var i = 0; i < accepted.length; i++) { var spec = specify$3(type, accepted[i], index); if (spec && (priority.s - spec.s || priority.q - spec.q || priority.o - spec.o) < 0) { priority = spec; } } ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function getMediaTypePriority(type,accepted,index){var priority={o:-1,q:0,s:0};for(var i=0;i<accepted.length;i++){var spec=specify(type,accepted[i],index);if(spec&&(priority.s-spec.s||priority.q-spec.q||priority.o-spec.o)<0){priority=spec;}}return priority;}", "function $LYXh$var$getMediaTypePriority(type, accep...
[ "0.6851231", "0.666107", "0.65999347", "0.65929127", "0.65903455", "0.65903455", "0.65903455", "0.65903455", "0.65903455", "0.65903455", "0.65903455", "0.65903455", "0.65903455", "0.65903455", "0.65903455", "0.65903455", "0.65903455", "0.65903455", "0.65903455", "0.65903455", ...
0.6569718
21
Get the specificity of the media type.
function specify$3(type, spec, index) { var p = parseMediaType(type); var s = 0; if (!p) { return null; } if(spec.type.toLowerCase() == p.type.toLowerCase()) { s |= 4; } else if(spec.type != '*') { return null; } if(spec.subtype.toLowerCase() == p.subtype.toLowerCase()) { s |= 2; } ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function _getMediaType(data) {\n for (var type in mediaTypeDetection) {\n if (mediaTypeDetection[type](data)) {\n return type;\n }\n }\n \n return null;\n }", "function getMediatype(bidRequest) {\n if (deepAccess(bidRequest, 'mediaTypes.banner')) {\n return BANNER;\n }\n if (d...
[ "0.6442261", "0.6371189", "0.6023399", "0.6020641", "0.5980956", "0.5908649", "0.5908281", "0.58689964", "0.58485276", "0.58438915", "0.58398956", "0.58099765", "0.57997376", "0.57500637", "0.5736278", "0.5698451", "0.569589", "0.569589", "0.569589", "0.5680494", "0.5680494",...
0.0
-1
Get the preferred media types from an Accept header.
function preferredMediaTypes(accept, provided) { // RFC 2616 sec 14.2: no header = */* var accepts = parseAccept(accept === undefined ? '*/*' : accept || ''); if (!provided) { // sorted list of all types return accepts .filter(isQuality$3) .sort(compareSpecs$3) .map(getFullType); } ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function preferredMediaTypes(accept,provided){// RFC 2616 sec 14.2: no header = */*\nvar accepts=parseAccept(accept===undefined?'*/*':accept||'');if(!provided){// sorted list of all types\nreturn accepts.filter(isQuality).sort(compareSpecs).map(getFullType);}var priorities=provided.map(function getPriority(type,in...
[ "0.81544185", "0.80122674", "0.79795897", "0.79643583", "0.79643583", "0.79643583", "0.79643583", "0.79643583", "0.79643583", "0.79643583", "0.79643583", "0.79643583", "0.79643583", "0.79643583", "0.79643583", "0.79643583", "0.79643583", "0.79643583", "0.79643583", "0.79093117"...
0.79329485
19
Get full type string.
function getFullType(spec) { return spec.type + '/' + spec.subtype; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function typeString(dataType) {\n let baseString = typeStringWithoutLocation(dataType);\n if (isReferenceType(dataType) && dataType.location) {\n return baseString + \" \" + dataType.location;\n }\n else {\n return baseString;\n }\n}", "function typeString(dataType) {\n let baseSt...
[ "0.71518964", "0.71518964", "0.7109266", "0.710606", "0.70249", "0.6871704", "0.6848804", "0.6834191", "0.6797645", "0.6772061", "0.6676748", "0.66636056", "0.66406435", "0.6615611", "0.66022146", "0.6584048", "0.6578183", "0.6571187", "0.6546915", "0.6541422", "0.64591765", ...
0.65322685
38
Check if a spec has any quality.
function isQuality$3(spec) { return spec.q > 0; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function isQuality(spec) {\n return spec.q > 0;\n}", "function isQuality(spec) {\n return spec.q > 0;\n}", "function isQuality(spec) {\n return spec.q > 0;\n}", "function isQuality(spec) {\n return spec.q > 0;\n}", "function isQuality(spec) {\n return spec.q > 0;\n}", "function isQuality(spec) {\n ...
[ "0.8407581", "0.8407581", "0.8407581", "0.8407581", "0.8407581", "0.8407581", "0.8407581", "0.8407581", "0.8407581", "0.8407581", "0.8407581", "0.8407581", "0.8407581", "0.8407581", "0.8407581", "0.8407581", "0.8407581", "0.8407581", "0.8407581", "0.8407581", "0.8407581", "...
0.7573658
86
Count the number of quotes in a string.
function quoteCount(string) { var count = 0; var index = 0; while ((index = string.indexOf('"', index)) !== -1) { count++; index++; } return count; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function quoteCount(string){var count=0;var index=0;while((index=string.indexOf('\"',index))!==-1){count++;index++;}return count;}", "function quoteCount(string) {\n\t var count = 0;\n\t var index = 0;\n\n\t while ((index = string.indexOf('\"', index)) !== -1) {\n\t count++;\n\t index++;\n\t }\n\n\t r...
[ "0.89641804", "0.8822943", "0.8561428", "0.69985396", "0.69766796", "0.68593544", "0.65635526", "0.65064037", "0.64898115", "0.6444662", "0.63877225", "0.62471694", "0.619486", "0.61745155", "0.61638755", "0.61364454", "0.6101259", "0.6100344", "0.60916185", "0.6082782", "0.6...
0.88083434
20
Split a key value pair.
function splitKeyValuePair(str) { var index = str.indexOf('='); var key; var val; if (index === -1) { key = str; } else { key = str.substr(0, index); val = str.substr(index + 1); } return [key, val]; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function splitKeyValuePair(str){var index=str.indexOf('=');var key;var val;if(index===-1){key=str;}else{key=str.substr(0,index);val=str.substr(index+1);}return[key,val];}", "function splitKeyValuePair(str) {\n\t var index = str.indexOf('=');\n\t var key;\n\t var val;\n\n\t if (index === -1) {\n\t key = st...
[ "0.7475404", "0.74691206", "0.62587357", "0.61767524", "0.61384565", "0.607199", "0.5794541", "0.567432", "0.5603683", "0.5520893", "0.55022675", "0.55003923", "0.5486882", "0.54863447", "0.536892", "0.5276511", "0.52448493", "0.52448493", "0.52448493", "0.52448493", "0.52448...
0.7452404
20
Split an Accept header into media types.
function splitMediaTypes(accept) { var accepts = accept.split(','); for (var i = 1, j = 0; i < accepts.length; i++) { if (quoteCount(accepts[j]) % 2 == 0) { accepts[++j] = accepts[i]; } else { accepts[j] += ',' + accepts[i]; } } // trim accepts accepts.length = j + 1; return accep...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function parseAccept(accept){var accepts=splitMediaTypes(accept);for(var i=0,j=0;i<accepts.length;i++){var mediaType=parseMediaType(accepts[i].trim(),i);if(mediaType){accepts[j++]=mediaType;}}// trim accepts\naccepts.length=j;return accepts;}", "function parseAccept(accept) {\n var accepts = splitMediaTypes(acc...
[ "0.73153925", "0.71197796", "0.7060059", "0.7060059", "0.7060059", "0.7060059", "0.7060059", "0.7060059", "0.7060059", "0.7060059", "0.7060059", "0.7060059", "0.7060059", "0.7060059", "0.7060059", "0.7060059", "0.7060059", "0.7060059", "0.7060059", "0.7060059", "0.70233434", ...
0.65962666
40
Split a string of parameters.
function splitParameters(str) { var parameters = str.split(';'); for (var i = 1, j = 0; i < parameters.length; i++) { if (quoteCount(parameters[j]) % 2 == 0) { parameters[++j] = parameters[i]; } else { parameters[j] += ';' + parameters[i]; } } // trim parameters parameters.length = j...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function splitParameters(str) {\n\t var parameters = str.split(';');\n\n\t for (var i = 1, j = 0; i < parameters.length; i++) {\n\t if (quoteCount(parameters[j]) % 2 == 0) {\n\t parameters[++j] = parameters[i];\n\t } else {\n\t parameters[j] += ';' + parameters[i];\n\t }\n\t }\n\n\t // trim ...
[ "0.7432967", "0.7428324", "0.73058045", "0.6664909", "0.6664909", "0.648407", "0.6439373", "0.6249416", "0.6249416", "0.6249416", "0.6249416", "0.6249416", "0.6249416", "0.6249416", "0.6249416", "0.6249416", "0.6249416", "0.6249416", "0.6249416", "0.6249416", "0.6249416", "...
0.7466361
17
Load the given module.
function loadModule(moduleName) { var module = modules[moduleName]; if (module !== undefined) { return module; } // This uses a switch for static require analysis switch (moduleName) { case 'charset': module = charset; break; case 'encoding': module = encoding; break; ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function loadModule(module) {\n freeze(module);\n markFuncFreeze(module.instantiate);\n return callPub(myNewModuleHandler, 'handle', [module]);\n }", "function loadModule(module) {\n var xhr = new XMLHttpRequest();\n var result = null;\n if (config.amd && self.requirejs) {\n if (module....
[ "0.7972385", "0.689793", "0.6815983", "0.6787327", "0.6787327", "0.6787327", "0.6787327", "0.67590326", "0.6729388", "0.66708523", "0.66398305", "0.66317254", "0.6631419", "0.66246635", "0.6621205", "0.66149974", "0.6563675", "0.65552795", "0.6551803", "0.65015167", "0.649623...
0.6914492
1
Populate the extensions and types maps.
function populateMaps (extensions, types) { // source preference (least -> most) var preference = ['nginx', 'apache', undefined, 'iana']; Object.keys(mimeDb).forEach(function forEachMimeType (type) { var mime = mimeDb[type]; var exts = mime.extensions; if (!exts || !exts.length) { return }...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function populateMaps(extensions,types){// source preference (least -> most)\nvar preference=['nginx','apache',undefined,'iana'];(0,_keys2.default)(db).forEach(function forEachMimeType(type){var mime=db[type];var exts=mime.extensions;if(!exts||!exts.length){return;}// mime -> extensions\nextensions[type]=exts;// e...
[ "0.7303083", "0.7164928", "0.7141253", "0.71156484", "0.70797336", "0.7071166", "0.7071166", "0.70700127", "0.70689434", "0.70689434", "0.7059342", "0.70523834", "0.70523834", "0.70523834", "0.70523834", "0.70523834", "0.70523834", "0.70523834", "0.70523834", "0.70523834", "0...
0.7088489
4
alternative to using Object.keys for old browsers
function copyProps (src, dst) { for (var key in src) { dst[key] = src[key]; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function getKeys(obj) {\n return Object.keys(obj); // Yes it is builtin!\n }", "function Object_keys(obj) {\n\t if (Object.keys) return Object.keys(obj)\n\t else {\n\t var res = [];\n\t for (var key in obj) res.push(key);\n\t return res;\n\t }\n\t}", "function keys(obj){\n return Object....
[ "0.73831874", "0.7312123", "0.72404635", "0.7200322", "0.7200322", "0.7200322", "0.7200322", "0.7200322", "0.7200322", "0.7200322", "0.7200322", "0.7200322", "0.7110697", "0.69966066", "0.6959291", "0.69318104", "0.69272774", "0.691635", "0.68801504", "0.68786746", "0.6869826...
0.0
-1
Currently only WebKitbased Web Inspectors, Firefox >= v31, and the Firebug extension (any Firefox version) are known to support "%c" CSS customizations. TODO: add a `localStorage` variable to explicitly enable/disable colors
function useColors() { // NB: In an Electron preload script, document will be defined but not fully // initialized. Since we know we're in Chrome, we'll just detect this case // explicitly if (typeof window !== 'undefined' && window.process && window.process.type === 'renderer') { return true; } // is ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function useColors(){ // is webkit? http://stackoverflow.com/a/16459606/376773\nreturn 'WebkitAppearance' in document.documentElement.style || // is firebug? http://stackoverflow.com/a/398120/376773\nwindow.console && (console.firebug || console.exception && console.table) || // is firefox >= v31?\n// https://de...
[ "0.6764195", "0.62980324", "0.62980324", "0.62980324", "0.62528557", "0.62528557", "0.62528557", "0.62528557", "0.62528557", "0.62528557", "0.62528557", "0.62528557", "0.62528557", "0.62528557", "0.62528557", "0.62528557", "0.62528557", "0.62528557", "0.62528557", "0.62528557",...
0.0
-1
Colorize log arguments if enabled.
function formatArgs(args) { var useColors = this.useColors; args[0] = (useColors ? '%c' : '') + this.namespace + (useColors ? ' %c' : ' ') + args[0] + (useColors ? '%c ' : ' ') + '+' + exports.humanize(this.diff); if (!useColors) return; var c = 'color: ' + this.color; args.splice(1, 0,...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "log(...args) {\n console.log(this.getColorOn() + args.join(\" \"));\n }", "function writelnColor(){\n\t\tfor(var i=0; i<arguments.length; i=i+2)\n\t\t\tgrunt.log.write(arguments[i][arguments[i+1]]);\n\t\tgrunt.log.writeln('');\n\t}", "debug(...args) {\n console.debug(this.getColorOn() + args.join(...
[ "0.6760166", "0.6711751", "0.65307504", "0.65290976", "0.65290976", "0.65290976", "0.6475225", "0.64737195", "0.64728016", "0.6462169", "0.645757", "0.6455942", "0.6453729", "0.64420164", "0.64335275", "0.64298606", "0.642863", "0.6418752", "0.6418752", "0.6418752", "0.641875...
0.0
-1
Invokes `console.log()` when available. Noop when `console.log` is not a "function".
function log() { // this hackery is required for IE8/9, where // the `console.log` function doesn't have 'apply' return 'object' === typeof console && console.log && Function.prototype.apply.call(console.log, console, arguments); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function log() {\n if (window.console) console.log.apply(console,arguments);\n}", "function consoleLog() {\n if (typeof(console) == 'object' && typeof(console[\"log\"]) != \"undefined\") {\n console.log.apply(console, arguments);\n }\n}", "function L() {\n if (window.console && console.log) {\n ...
[ "0.7739394", "0.7717552", "0.77075", "0.76093554", "0.7566829", "0.7566829", "0.7531627", "0.7490471", "0.7414659", "0.7336425", "0.73305815", "0.7329548", "0.7324058", "0.73122233", "0.73095244", "0.73095244", "0.73095244", "0.73095244", "0.73095244", "0.73051697", "0.730516...
0.0
-1
Is stdout a TTY? Colored output is enabled when `true`.
function useColors() { return 'colors' in exports.inspectOpts ? Boolean(exports.inspectOpts.colors) : tty.isatty(fd); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function useColors() {\n return 'colors' in exports.inspectOpts ?\n Boolean(exports.inspectOpts.colors) :\n tty.isatty(process.stderr.fd);\n}", "function useColors() {\n return 'colors' in exports.inspectOpts\n ? Boolean(exports.inspectOpts.colors)\n : tty.isatty(process.stderr.fd);\n}", "function us...
[ "0.7456743", "0.74190146", "0.74190146", "0.74190146", "0.74190146", "0.74190146", "0.74190146", "0.74190146", "0.74190146", "0.74190146", "0.74190146", "0.74190146", "0.74190146", "0.74190146", "0.74190146", "0.741493", "0.7394626", "0.7394626", "0.7394626", "0.7394626", "0....
0.7334658
65
Adds ANSI color escape codes if enabled.
function formatArgs(args) { var name = this.namespace; var useColors = this.useColors; if (useColors) { var c = this.color; var prefix = ' \u001b[3' + c + ';1m' + name + ' ' + '\u001b[0m'; args[0] = prefix + args[0].split('\n').join('\n' + prefix); args.push('\u001b[3' + c + 'm+' + exports.huma...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function colorize(text, ansiCode) {\n return `${ansiCode}${text}${\"\\033[0m\"}`;\n}", "function ansiColor(open, close) {\n return color\n\n function color(value) {\n return '\\u001B[' + open + 'm' + value + '\\u001B[' + close + 'm'\n }\n}", "setAnsiColor(data) {\n const event = this._parseAnsiCo...
[ "0.627715", "0.6059129", "0.5894811", "0.56410426", "0.56410426", "0.56410426", "0.5463393", "0.53362644", "0.52928996", "0.52356327", "0.51805675", "0.5039385", "0.5039385", "0.5039385", "0.5039385", "0.5039385", "0.5039385", "0.5039385", "0.5039385", "0.5039385", "0.5039385...
0.0
-1
Invokes `util.format()` with the specified arguments and writes to `stream`.
function log() { return stream.write(util.format.apply(util, arguments) + '\n'); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function log() {\n\t return stream.write(util.format.apply(util, arguments) + '\\n');\n\t}", "function log() {\n\t return stream.write(util.format.apply(util, arguments) + '\\n');\n\t}", "function log() {\n\t\t return stream.write(util.format.apply(util, arguments) + '\\n');\n\t\t}", "function log() {\n ...
[ "0.6612562", "0.6612562", "0.6562237", "0.6394336", "0.6394336", "0.62405187", "0.62405187", "0.62405187", "0.62405187", "0.62405187", "0.62405187", "0.62405187", "0.62404484", "0.6223653", "0.6182293", "0.6182293", "0.60069674", "0.58900803", "0.58809334", "0.5765783", "0.56...
0.6515317
49
Copied from `node/src/node.js`. XXX: It's lame that node doesn't expose this API outofthebox. It also relies on the undocumented `tty_wrap.guessHandleType()` which is also lame.
function createWritableStdioStream (fd) { var stream; var tty_wrap = process.binding('tty_wrap'); // Note stream._type is used for test-module-load-list.js switch (tty_wrap.guessHandleType(fd)) { case 'TTY': stream = new tty.WriteStream(fd); stream._type = 'tty'; // Hack to have stream ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function createWritableStdioStream (fd) {\n\t var stream;\n\t var tty_wrap = process.binding('tty_wrap');\n\t\n\t // Note stream._type is used for test-module-load-list.js\n\t\n\t switch (tty_wrap.guessHandleType(fd)) {\n\t case 'TTY':\n\t stream = new tty.WriteStream(fd);\n\t stream._type = 'tty'...
[ "0.5418163", "0.5411787", "0.5343691", "0.5343691", "0.5343691", "0.5343691", "0.5343691", "0.5343691", "0.5343691", "0.53420466", "0.5332154", "0.5320217", "0.53172976", "0.5308294", "0.5276164", "0.5253364", "0.5249028", "0.5249028", "0.5249028", "0.5249028", "0.52446574", ...
0.5098157
66
Init logic for `debug` instances. Create a new `inspectOpts` object in case `useColors` is set differently for a particular `debug` instance.
function init (debug) { debug.inspectOpts = {}; var keys = Object.keys(exports.inspectOpts); for (var i = 0; i < keys.length; i++) { debug.inspectOpts[keys[i]] = exports.inspectOpts[keys[i]]; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function init (debug) {\n\t debug.inspectOpts = {};\n\n\t var keys = Object.keys(exports.inspectOpts);\n\t for (var i = 0; i < keys.length; i++) {\n\t debug.inspectOpts[keys[i]] = exports.inspectOpts[keys[i]];\n\t }\n\t}", "function init (debug) {\n\t\t debug.inspectOpts = {};\n\n\t\t var keys = Object....
[ "0.7898227", "0.78775245", "0.7844545", "0.7844545", "0.782716", "0.78061557", "0.78061557", "0.78061557", "0.78061557", "0.78061557", "0.78061557", "0.78061557", "0.78061557", "0.78061557", "0.78061557", "0.78061557", "0.78061557", "0.78061557", "0.78061557", "0.78061557", "...
0.789997
52
Add bufferred listeners to stream
function addListeners (stream, on, listeners) { for (var i = 0; i < listeners.length; i++) { on.apply(stream, listeners[i]); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function addListeners (stream, on, listeners) {\n for (var i = 0; i < listeners.length; i++) {\n on.apply(stream, listeners[i])\n }\n}", "function addListeners (stream, on, listeners) {\n for (var i = 0; i < listeners.length; i++) {\n on.apply(stream, listeners[i])\n }\n}", "function addListeners (st...
[ "0.7003353", "0.7003353", "0.7003353", "0.7003353", "0.66018826", "0.63479555", "0.6231714", "0.62110484", "0.6076934", "0.6030281", "0.6030281", "0.5936556", "0.5918385", "0.5835415", "0.58193564", "0.5772489", "0.5772019", "0.5753909", "0.5745398", "0.5739281", "0.5735994",...
0.69944394
5
Get the length of a given chunk
function chunkLength (chunk, encoding) { if (!chunk) { return 0 } return !Buffer$1.isBuffer(chunk) ? Buffer$1.byteLength(chunk, encoding) : chunk.length }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function chunkLength (chunk, encoding) {\n if (!chunk) {\n return 0\n }\n\n return !Buffer.isBuffer(chunk)\n ? Buffer.byteLength(chunk, encoding)\n : chunk.length\n}", "function chunkLength (chunk, encoding) {\n if (!chunk) {\n return 0\n }\n\n return !Buffer.isBuffer(chunk)\n ? Buffer.byteL...
[ "0.8158192", "0.8158192", "0.8158192", "0.8158192", "0.728122", "0.71399534", "0.71399534", "0.69944566", "0.68698245", "0.66554654", "0.6593456", "0.6583977", "0.6571658", "0.6571658", "0.6571658", "0.6571658", "0.65712565", "0.653399", "0.64567363", "0.63978124", "0.6319527...
0.8136384
5
Determine if the entity should be transformed.
function shouldTransform (req, res) { var cacheControl = res.getHeader('Cache-Control'); // Don't compress for Cache-Control: no-transform // https://tools.ietf.org/html/rfc7234#section-5.2.2.4 return !cacheControl || !cacheControlNoTransformRegExp.test(cacheControl) }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "canTransform(filename) {\n const entry = this.findTransformer(filename);\n return !!entry;\n }", "transform() {\n // if this Worker is unchecked/deleted, skip all transformations\n if (!STOP_VALIDATING_ON.includes(this._status)) {\n let status = true;\n\n // status = !this._trans...
[ "0.64632714", "0.5762702", "0.5731852", "0.5731852", "0.55455387", "0.5522122", "0.54794145", "0.54347867", "0.5405241", "0.5363752", "0.53229314", "0.5298526", "0.5277921", "0.5277921", "0.524048", "0.5237167", "0.5237167", "0.5237167", "0.5237167", "0.5193887", "0.5193887",...
0.5115306
22
Coerce arguments to Buffer
function toBuffer (chunk, encoding) { return !Buffer$1.isBuffer(chunk) ? Buffer$1.from(chunk, encoding) : chunk }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function Buffer(arg){if(!(this instanceof Buffer)){ // Avoid going through an ArgumentsAdaptorTrampoline in the common case.\nif(arguments.length>1)return new Buffer(arg,arguments[1]);return new Buffer(arg);}if(!Buffer.TYPED_ARRAY_SUPPORT){this.length=0;this.parent=undefined;} // Common case.\nif(typeof arg==='num...
[ "0.778749", "0.74316794", "0.74316794", "0.74316794", "0.74316794", "0.74316794", "0.74316794", "0.74316794", "0.7399924", "0.7399924", "0.7399924", "0.7399924", "0.7399924", "0.7399924", "0.7399924", "0.7399924", "0.7399924", "0.7399924", "0.7399924", "0.7399924", "0.7399924...
0.0
-1
Used to print values in error messages.
function inspect(value) { return formatValue(value, []); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "printErrors() {\n console.log(this.toOutputString());\n }", "function displayErrors(pErr){\n console.log('-----------');\n console.log('Error in Mod: ' +pErr.mod +' | Func: ' +pErr.func);\n //console.log('name: ' +pErr.name);\n console.log(getException(pErr.name));\n console.log('msg: '+pErr.m...
[ "0.73850906", "0.68270606", "0.67731297", "0.67120796", "0.6632994", "0.6515777", "0.6515777", "0.6462721", "0.64425826", "0.6403813", "0.63979447", "0.6337862", "0.63326454", "0.6295945", "0.6295945", "0.6292053", "0.6249493", "0.6235552", "0.61916476", "0.6176068", "0.61729...
0.0
-1
Given a visitor instance, if it is leaving or not, and a node kind, return the function the visitor runtime should call.
function getVisitFn(visitor, kind, isLeaving) { var kindVisitor = visitor[kind]; if (kindVisitor) { if (!isLeaving && typeof kindVisitor === 'function') { // { Kind() {} } return kindVisitor; } var kindSpecificVisitor = isLeaving ? kindVisitor.leave : kindVisitor.enter; if (typeof kin...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function getVisitFn(visitor, kind, isLeaving) {\n var kindVisitor = visitor[kind];\n if (kindVisitor) {\n if (!isLeaving && typeof kindVisitor === 'function') {\n // { Kind() {} }\n return kindVisitor;\n }\n var kindSpecificVisitor = isLeaving ? kindVisitor.leave : ...
[ "0.735789", "0.7335283", "0.73079747", "0.72866946", "0.72866946", "0.72866946", "0.72866946", "0.72866946", "0.72866946", "0.72866946", "0.72866946", "0.72866946", "0.72866946", "0.72866946", "0.72866946", "0.72866946", "0.72866946", "0.7262107", "0.7262107", "0.7262107", "0...
0.7282289
31
=== Abstract Operations ===
function getMethod(obj, key) { var value = obj[key]; if (value == null) return undefined; if (typeof value !== 'function') throw new TypeError(value + ' is not a function'); return value; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "baseOperation1() {\n console.log(\"AbstractClass says: I am doing the bulk of the work\");\n }", "execute() {\n throw new Error(\"Must be implemented in subclass\");\n }", "PrimitiveOperation3() {\n console.log(\"ConcreteClass PrimitiveOperation3\");\n }", "PrimitiveOperation1() {\n ...
[ "0.6762317", "0.6333732", "0.62952554", "0.6287159", "0.61622936", "0.5887178", "0.57621646", "0.56813", "0.56116784", "0.55621994", "0.5560567", "0.5482582", "0.5482582", "0.5477277", "0.54723746", "0.54479396", "0.5446084", "0.54332495", "0.54269195", "0.53651536", "0.53404...
0.0
-1
Copyright (c) Facebook, Inc. and its affiliates. This source code is licensed under the MIT license found in the LICENSE file in the root directory of this source tree. Produces the value of a block string from its parsed raw value, similar to CoffeeScript's block string, Python's docstring trim or Ruby's strip_heredoc...
function dedentBlockStringValue(rawString) { // Expand a block string's raw value into independent lines. var lines = rawString.split(/\r\n|[\n\r]/g); // Remove common indentation from all lines but first. var commonIndent = getBlockStringIndentation(lines); if (commonIndent !== 0) { for (var i = 1; i < l...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function blockStringValue(rawString) {\n // Expand a block string's raw value into independent lines.\n var lines = rawString.split(/\\r\\n|[\\n\\r]/g); // Remove common indentation from all lines but first.\n\n var commonIndent = null;\n\n for (var i = 1; i < lines.length; i++) {\n var line = lines[i];\n ...
[ "0.75241756", "0.75241756", "0.75038916", "0.75038916", "0.75038916", "0.75038916", "0.75038916", "0.73474354", "0.7008963", "0.6917627", "0.68537396", "0.6786286", "0.6766712", "0.6766712", "0.6758455", "0.67541665", "0.6737881", "0.673585", "0.6720892", "0.6720892", "0.6720...
0.6401053
47
Print a block string in the indented block form by adding a leading and trailing blank line. However, if a block string starts with whitespace and is a singleline, adding a leading blank line would strip that whitespace.
function printBlockString(value) { var indentation = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : ''; var preferMultipleLines = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false; var isSingleLine = value.indexOf('\n') === -1; var hasLeadingSpace = value[0] === ' ' ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function dedentBlockStringValue(rawString) {\n // Expand a block string's raw value into independent lines.\n var lines = rawString.split(/\\r\\n|[\\n\\r]/g); // Remove common indentation from all lines but first.\n\n var commonIndent = null;\n\n for (var i = 1; i < lines.length; i++) {\n var line = lines[i...
[ "0.6653282", "0.65694857", "0.65694857", "0.65694857", "0.65675", "0.6555396", "0.65277874", "0.6515443", "0.6515443", "0.6515443", "0.6515443", "0.65039456", "0.65039456", "0.65039456", "0.65039456", "0.65039456", "0.65039456", "0.65039456", "0.65039456", "0.65039456", "0.65...
0.65020895
25
Copyright (c) Facebook, Inc. and its affiliates. This source code is licensed under the MIT license found in the LICENSE file in the root directory of this source tree. Converts an AST into a string, using one set of reasonable formatting rules.
function print(ast) { return visit(ast, { leave: printDocASTReducer }); } // TODO: provide better type coverage in future
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function church_ast_to_string(ast) {\n\tif (util.is_leaf(ast)) {\n\t\treturn ast.text;\n\t} else {\n\t\treturn \"(\" + ast.children.map(function(x) {return church_ast_to_string(x)}).join(\" \") + \")\"\n\t}\n}", "function formatAst(ast) {\n return (0, _language.visit)(ast, { leave: printDocASTReducer });\n}", ...
[ "0.7060252", "0.6983636", "0.66002166", "0.60809296", "0.6002692", "0.57919264", "0.57776946", "0.57444227", "0.5715757", "0.57030064", "0.5691071", "0.56654453", "0.56654453", "0.56654453", "0.563569", "0.5608844", "0.55828285", "0.5574143", "0.5574143", "0.55564255", "0.553...
0.5577574
17
Given maybeArray, print an empty string if it is null or empty, otherwise print all items together separated by separator if provided
function join$1(maybeArray, separator) { return maybeArray ? maybeArray.filter(function (x) { return x; }).join(separator || '') : ''; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function join(maybeArray, separator) {\n return maybeArray ? maybeArray.filter(function (x) {\n return x;\n }).join(separator || '') : '';\n }", "function join(maybeArray, separator) {\n return maybeArray ? maybeArray.filter(function (x) {\n return x;\n }).join(separator || '...
[ "0.76277524", "0.76277524", "0.75835407", "0.75275725", "0.75275725", "0.75275725", "0.74386424", "0.74386424", "0.74386424", "0.74386424", "0.74386424", "0.74386424", "0.74386424", "0.74386424", "0.74386424", "0.74386424", "0.74386424", "0.74386424", "0.74386424", "0.74386424"...
0.73414034
27
If maybeString is not null or empty, then wrap with start and end, otherwise print an empty string.
function wrap(start, maybeString, end) { return maybeString ? start + maybeString + (end || '') : ''; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function wrap(start, maybeString, end) {\n return maybeString ? start + maybeString + (end || '') : '';\n }", "function wrap(start, maybeString, end) {\n return maybeString ? start + maybeString + (end || '') : '';\n }", "function wrap(start, maybeString, end) {\n\t\t return maybeString ? star...
[ "0.8298625", "0.8298625", "0.8257017", "0.82172704", "0.82172704", "0.82172704", "0.8134717", "0.7985413", "0.7985413", "0.7985413", "0.7985413", "0.7985413", "0.7985413", "0.7959051", "0.7959051", "0.7959051", "0.7959051", "0.5566828", "0.54099494", "0.52980316", "0.5291635"...
0.8177886
25
Since this package might be used browsers, we should avoid using the Node builtin assert module.
function assert(condition, optionalMessage) { if (!condition) { throw new Error(optionalMessage || "assertion failure"); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function assert(b, err) { if(!b) { throw err; } }", "function assert(assertion, msg) {\n if (!assertion) {\n throw new Error(msg);\n }\n}", "function assert(val, msg) {\n\tif (!val) throw new Error(msg || 'Assertion failed');\n}", "function assert (b, msg) {\n if (!b) {\n throw new Error(msg || ...
[ "0.73719525", "0.7261415", "0.71148115", "0.70775795", "0.70775795", "0.70775795", "0.69880074", "0.6926308", "0.69257724", "0.69257724", "0.68685573", "0.6859721", "0.68397903", "0.681516", "0.6745387", "0.6725198", "0.67251", "0.67037404", "0.6689998", "0.668759", "0.667864...
0.0
-1
This is the most important method of the Entry API, because it determines whether the cached entry.value can be returned immediately, or must be recomputed. The overall performance of the caching system depends on the truth of the following observations: (1) this.dirty is usually false, (2) this.dirtyChildren is usuall...
function recomputeIfDirty(entry) { if (entry.dirty) { // If this Entry is explicitly dirty because someone called // entry.setDirty(), recompute. return reallyRecompute(entry); } if (mightBeDirty(entry)) { // Get fresh values for any dirty children, and if those values...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function recomputeIfDirty(entry) {\n if (entry.dirty) {\n // If this Entry is explicitly dirty because someone called\n // entry.setDirty(), recompute.\n return reallyRecompute(entry);\n }\n\n if (mightBeDirty(entry)) {\n // Get fresh values for any dirty children, and if those values\n // disagr...
[ "0.72451854", "0.64890426", "0.581753", "0.5764805", "0.56426597", "0.5636029", "0.56231123", "0.55842674", "0.5536354", "0.5525062", "0.55236", "0.54837394", "0.54613525", "0.545123", "0.5406434", "0.54050684", "0.53837824", "0.53837824", "0.53837824", "0.53837824", "0.53837...
0.7231305
2
Let a parent Entry know that one of its children may be dirty.
function reportDirtyChild(parent, child) { // Must have called rememberParent(child) before calling // reportDirtyChild(parent, child). assert(parent.childValues.has(child)); assert(mightBeDirty(child)); if (!parent.dirtyChildren) { parent.dirtyChildren = emptySetPool.pop() || new Set;...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function reportDirtyChild(entry, child) {\n // Must have called rememberParent(child) before calling\n // reportDirtyChild(parent, child).\n assert(entry.childValues.has(child));\n assert(mightBeDirty(child));\n\n if (! entry.dirtyChildren) {\n entry.dirtyChildren = emptySetPool.pop() || new Set;\n\n } el...
[ "0.71868336", "0.70683545", "0.70316416", "0.69809675", "0.69378614", "0.69378614", "0.6903829", "0.6903829", "0.6903829", "0.6903829", "0.6903829", "0.64489436", "0.6447118", "0.6447118", "0.6205762", "0.6205762", "0.61428934", "0.61428934", "0.61428934", "0.61428934", "0.61...
0.7066948
6
Let a parent Entry know that one of its children is no longer dirty.
function reportCleanChild(parent, child) { // Must have called rememberChild(child) before calling // reportCleanChild(parent, child). assert(parent.childValues.has(child)); assert(!mightBeDirty(child)); var childValue = parent.childValues.get(child); if (childValue === UNKNOWN_VALUE) { ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function reportDirtyChild(entry, child) {\n // Must have called rememberParent(child) before calling\n // reportDirtyChild(parent, child).\n assert(entry.childValues.has(child));\n assert(mightBeDirty(child));\n\n if (! entry.dirtyChildren) {\n entry.dirtyChildren = emptySetPool.pop() || new Set;\n\n } el...
[ "0.6930537", "0.6862372", "0.6862372", "0.6791234", "0.6768645", "0.6768645", "0.67623705", "0.67572606", "0.67572606", "0.67572606", "0.67572606", "0.67572606", "0.67525727", "0.67365026", "0.6723276", "0.6723276", "0.6723276", "0.6723276", "0.6723276", "0.6481468", "0.64814...
0.6511602
20
If the given entry has a reportOrphan method, and no remaining parents, call entry.reportOrphan and return true iff it returns true. The reportOrphan function should return true to indicate entry.dispose() has been called, and the entry has been removed from any other caches (see index.js for the only current example).
function maybeReportOrphan(entry) { return entry.parents.size === 0 && typeof entry.reportOrphan === "function" && entry.reportOrphan() === true; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function maybeReportOrphan(entry) {\n return entry.parents.size === 0 &&\n typeof entry.reportOrphan === \"function\" &&\n entry.reportOrphan() === true;\n}", "function maybeReportOrphan(entry) {\n var report = entry.reportOrphan;\n return typeof report === \"function\" &&\n entry.parents.s...
[ "0.82622504", "0.82483757", "0.7693883", "0.5207885", "0.5200257", "0.47965705", "0.47095898", "0.4689104", "0.4689104", "0.4686579", "0.46380284", "0.46352282", "0.46120194", "0.45800793", "0.4519318", "0.44877782", "0.4468941", "0.44595006", "0.44401747", "0.44266316", "0.4...
0.8291229
3
Removes all children from this entry and returns an array of the removed children.
function forgetChildren(parent) { var children = reusableEmptyArray; if (parent.childValues.size > 0) { children = []; parent.childValues.forEach(function (value, child) { forgetChild(parent, child); children.push(child); }); } // After we forget ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "__removeChildren() {\n let remove = (children) => {\n for(let i = 0; i < children.length; i++) {\n let child = children[i];\n\n remove(child.__akili.__children);\n child.__akili.__remove();\n i--;\n }\n };\n\n remove(this.__children);\n }", "removeFromParents() {\n...
[ "0.65623754", "0.64926183", "0.6419079", "0.61950505", "0.6069233", "0.599233", "0.598836", "0.5983101", "0.59772784", "0.5953996", "0.58716094", "0.58675", "0.5861664", "0.5848181", "0.58450633", "0.58450633", "0.58058494", "0.5710672", "0.57033545", "0.5681434", "0.56335974...
0.5834171
17
Copyright (c) Facebook, Inc. and its affiliates. This source code is licensed under the MIT license found in the LICENSE file in the root directory of this source tree. The `defineToJSON()` function defines toJSON() and inspect() prototype methods, if no function provided they become aliases for toString().
function defineToJSON( // eslint-disable-next-line flowtype/no-weak-types classObject) { var fn = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : classObject.prototype.toString; classObject.prototype.toJSON = fn; classObject.prototype.inspect = fn; if (nodejsCustomInspectSymbol) { class...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function defineToJSON( // eslint-disable-next-line flowtype/no-weak-types\nclassObject) {\n var fn = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : classObject.prototype.toString;\n classObject.prototype.toJSON = fn;\n classObject.prototype.inspect = fn;\n\n if (_nodejsCustomInspectSymbol_...
[ "0.75892305", "0.75892305", "0.72338706", "0.7185324", "0.71767753", "0.71767753", "0.6255078", "0.62275666", "0.6117696", "0.5968722", "0.58489585", "0.5807291", "0.5792691", "0.5792691", "0.5780701", "0.57463396", "0.5712686", "0.5712686", "0.5712686", "0.5712686", "0.56540...
0.75919133
0
Copyright (c) Facebook, Inc. and its affiliates. This source code is licensed under the MIT license found in the LICENSE file in the root directory of this source tree.
function invariant$3(condition, message) { /* istanbul ignore else */ if (!condition) { throw new Error(message); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "componentDidMount() {\n // if this is the first time the home screen is loading\n // we must initialize Facebook\n if (!window.FB) {\n window.fbAsyncInit = function() {\n window.FB.init({\n appId : '280945375708713',\n cookie : true, // enable cookies to allow the s...
[ "0.57112116", "0.5556745", "0.5490223", "0.5441711", "0.53799903", "0.5361021", "0.52244025", "0.52185845", "0.5207146", "0.5173472", "0.51527214", "0.51527214", "0.51329976", "0.5116327", "0.51138526", "0.5110533", "0.5105898", "0.51049036", "0.5103769", "0.50857955", "0.496...
0.0
-1
Copyright (c) Facebook, Inc. and its affiliates. This source code is licensed under the MIT license found in the LICENSE file in the root directory of this source tree. Represents a location in a Source. Takes a Source and a UTF8 character offset, and returns the corresponding line and column as a SourceLocation.
function getLocation(source, position) { var lineRegexp = /\r\n|[\n\r]/g; var line = 1; var column = position + 1; var match; while ((match = lineRegexp.exec(source.body)) && match.index < position) { line += 1; column = position + 1 - (match.index + match[0].length); } return { line: line, ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function getLocation(source, position) {\n var lineRegexp = /\\r\\n|[\\n\\r]/g;\n var line = 1;\n var column = position + 1;\n var match = undefined;\n while ((match = lineRegexp.exec(source.body)) && match.index < position) {\n line += 1;\n column = position + 1 - (match.index + match[0].length);\n }\...
[ "0.6916586", "0.69039726", "0.69039726", "0.69039726", "0.69039726", "0.69039726", "0.69039726", "0.69039726", "0.69039726", "0.69039726", "0.69039726", "0.69039726", "0.68898666", "0.6886778", "0.6886778", "0.6808966", "0.67813754", "0.6641618", "0.6641618", "0.6641618", "0....
0.6839433
31
Render a helpful description of the location of the error in the GraphQL Source document.
function highlightSourceAtLocation(source, location) { var firstLineColumnOffset = source.locationOffset.column - 1; var body = whitespace(firstLineColumnOffset) + source.body; var lineIndex = location.line - 1; var lineOffset = source.locationOffset.line - 1; var lineNum = location.line + lineOffset; var c...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function displayError() {\r\n let html = `${addBookmark()}<div id=\"error-message\">${store.error}</div>`;\r\n return html;\r\n}", "customFormatErrorFn(err){\n // original error will be set by express graphql when it detects an error i.e\n // thrown in the code (either by you or any 3rd party pac...
[ "0.5840918", "0.57837224", "0.5782172", "0.5707352", "0.56868726", "0.5657486", "0.5648254", "0.5631857", "0.5541341", "0.55393326", "0.5534274", "0.5482769", "0.54566", "0.54566", "0.5434948", "0.54090387", "0.54090387", "0.54090387", "0.54090387", "0.5400498", "0.5400498", ...
0.0
-1
Copyright (c) Facebook, Inc. and its affiliates. This source code is licensed under the MIT license found in the LICENSE file in the root directory of this source tree. Copyright (c) Facebook, Inc. and its affiliates. This source code is licensed under the MIT license found in the LICENSE file in the root directory of ...
function createLexer(source, options) { var startOfFileToken = new Tok(TokenKind.SOF, 0, 0, 0, 0, null); var lexer = { source: source, options: options, lastToken: startOfFileToken, token: startOfFileToken, line: 1, lineStart: 0, advance: advanceLexer, lookahead: lookahead }; ret...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function Lexer(source) {\n var startOfFileToken = new _ast_mjs__WEBPACK_IMPORTED_MODULE_0__.Token(_tokenKind_mjs__WEBPACK_IMPORTED_MODULE_1__.TokenKind.SOF, 0, 0, 0, 0, null);\n this.source = source;\n this.lastToken = startOfFileToken;\n this.token = startOfFileToken;\n this.line = 1;\n this.lin...
[ "0.7906511", "0.7906511", "0.7852676", "0.78473824", "0.7716667", "0.7716667", "0.7716667", "0.7716667", "0.7716667", "0.7716667", "0.77045375", "0.76929635", "0.76882696", "0.76882696", "0.76882696", "0.7687945", "0.7681798", "0.7676428", "0.76596165", "0.76391923", "0.76388...
0.75794107
29
A helper function to describe a token as a string for debugging
function getTokenDesc(token) { var value = token.value; return value ? "".concat(token.kind, " \"").concat(value, "\"") : token.kind; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function printToken(token) {\r\n\t\tif (token.type === 'quote') {\r\n\t\t\treturn `\"${token.token}\"`;\r\n\t\t} else {\r\n\t\t\treturn token.token;\r\n\t\t}\r\n\t}", "function getTokenDesc(token) {\n var value = token.value;\n return value ? \"\".concat(token.kind, \" \\\"\").concat(value, \"\\\"\") :...
[ "0.7346337", "0.72634125", "0.7247232", "0.7247232", "0.72264", "0.7213501", "0.7213501", "0.7213501", "0.7213501", "0.7213501", "0.7213501", "0.7213501", "0.7213501", "0.7213501", "0.7213501", "0.7213501", "0.7140082", "0.71369827", "0.70759815", "0.7074039", "0.7074039", ...
0.7237602
9
Helper function for constructing the Token object.
function Tok(kind, start, end, line, column, prev, value) { this.kind = kind; this.start = start; this.end = end; this.line = line; this.column = column; this.value = value; this.prev = prev; this.next = null; } // Print a simplified form when appearing in JSON/util.inspect.
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function makeToken(kind, start, end, value) {\n\t return { kind: kind, start: start, end: end, value: value };\n\t}", "function makeToken(kind, start, end, value) {\n return { kind: kind, start: start, end: end, value: value };\n}", "constructor(token, type) {\n this._token = token; //token object\n ...
[ "0.716749", "0.7155585", "0.706904", "0.7064976", "0.69540286", "0.6936082", "0.6918525", "0.68987185", "0.6793239", "0.67745304", "0.6673528", "0.66003233", "0.659534", "0.649638", "0.6490552", "0.63975376", "0.6384403", "0.6367625", "0.63613516", "0.6276101", "0.6250431", ...
0.0
-1
Gets the next token from the source starting at the given position. This skips over whitespace until it finds the next lexable token, then lexes punctuators immediately or calls the appropriate helper function for more complicated tokens.
function readToken(lexer, prev) { var source = lexer.source; var body = source.body; var bodyLength = body.length; var pos = positionAfterWhitespace(body, prev.end, lexer); var line = lexer.line; var col = 1 + pos - lexer.lineStart; if (pos >= bodyLength) { return new Tok(TokenKind.EOF, bodyLength, b...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function nextToken() {\n skipSpace();\n state.start = state.pos;\n if (state.pos >= input.length) {\n const tokens = state.tokens;\n // We normally run past the end a bit, but if we're way past the end, avoid an infinite loop.\n // Also check the token positions rather than the types since sometimes we...
[ "0.6480268", "0.64242816", "0.6414429", "0.6357853", "0.6328176", "0.62754387", "0.6217092", "0.6217092", "0.6217092", "0.6217092", "0.6217092", "0.6217092", "0.6214577", "0.6194268", "0.61879283", "0.6180411", "0.61706835", "0.61475575", "0.61475575", "0.61475575", "0.614755...
0.59453106
69
Report a message that an unexpected character was encountered.
function unexpectedCharacterMessage(code) { if (code < 0x0020 && code !== 0x0009 && code !== 0x000a && code !== 0x000d) { return "Cannot contain the invalid character ".concat(printCharCode(code), "."); } if (code === 39) { // ' return "Unexpected single quote character ('), did you mean to use " + '...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function unexpectedCharacterMessage(code) {\n if (code < 0x0020 && code !== 0x0009 && code !== 0x000a && code !== 0x000d) {\n return \"Cannot contain the invalid character \".concat(printCharCode(code), \".\");\n }\n\n if (code === 39) {\n // '\n return 'Unexpected single quote ...
[ "0.708676", "0.6923222", "0.68756294", "0.68689543", "0.68689543", "0.68689543", "0.68689543", "0.68689543", "0.68689543", "0.68689543", "0.68689543", "0.68689543", "0.68689543", "0.68689543", "0.6818663", "0.6818663", "0.6818663", "0.6818663", "0.6818663", "0.6818663", "0.67...
0.6938613
5
Reads from body starting at startPosition until it finds a nonwhitespace character, then returns the position of that character for lexing.
function positionAfterWhitespace(body, startPosition, lexer) { var bodyLength = body.length; var position = startPosition; while (position < bodyLength) { var code = body.charCodeAt(position); // tab | space | comma | BOM if (code === 9 || code === 32 || code === 44 || code === 0xfeff) { ++positio...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function positionAfterWhitespace(body, startPosition) {\n var bodyLength = body.length;\n var position = startPosition;\n while (position < bodyLength) {\n var code = charCodeAt.call(body, position);\n // Skip Ignored\n if (\n // BOM\n code === 0xFEFF ||\n // White Space\n code === 0x0009 |...
[ "0.67865866", "0.6724896", "0.66216826", "0.657222", "0.65702426", "0.64617085", "0.64617085", "0.64617085", "0.64617085", "0.64617085", "0.64617085", "0.6460696", "0.6460696", "0.6460696", "0.6460696", "0.6460696", "0.6440531", "0.6440531", "0.5772824", "0.57061243", "0.5650...
0.65357953
12
Reads a comment token from the source file. [\u0009\u0020\uFFFF]
function readComment(source, start, line, col, prev) { var body = source.body; var code; var position = start; do { code = body.charCodeAt(++position); } while (!isNaN(code) && ( // SourceCharacter but not LineTerminator code > 0x001f || code === 0x0009)); return new Tok(TokenKind.COMMENT, start, po...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function readComment(source, start, line, col, prev) {\n var body = source.body;\n var code;\n var position = start;\n\n do {\n code = body.charCodeAt(++position);\n } while (!isNaN(code) && ( // SourceCharacter but not LineTerminator\n code > 0x001f || code === 0x0009));\n\n return new _ast_mjs__WEBPACK...
[ "0.7810849", "0.7803462", "0.7702474", "0.76968354", "0.7681165", "0.7681165", "0.75763005", "0.75763005", "0.75763005", "0.7535053", "0.7519027", "0.7506334", "0.7506334", "0.7506334", "0.7506334", "0.7506334", "0.7506334", "0.7504508", "0.7503649", "0.7502324", "0.7487181",...
0.7474933
24
Reads a number token from the source file, either a float or an int depending on whether a decimal point appears. Int: ?(0|[19][09]) Float: ?(0|[19][09])(\.[09]+)?((E|e)(+|)?[09]+)?
function readNumber(source, start, firstCode, line, col, prev) { var body = source.body; var code = firstCode; var position = start; var isFloat = false; if (code === 45) { // - code = body.charCodeAt(++position); } if (code === 48) { // 0 code = body.charCodeAt(++position); if (cod...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function readNumber(source, start, firstCode, line, col, prev) {\n var body = source.body;\n var code = firstCode;\n var position = start;\n var isFloat = false;\n\n if (code === 45) {\n // -\n code = body.charCodeAt(++position);\n }\n\n if (code === 48) {\n // 0\n code = body.charCodeAt(++posit...
[ "0.78587884", "0.78396785", "0.7838272", "0.78292435", "0.7799872", "0.7799872", "0.7792799", "0.7792799", "0.7792799", "0.7785889", "0.7785889", "0.7770525", "0.7765655", "0.7757538", "0.77409196", "0.7640692", "0.7633159", "0.7633159", "0.7633159", "0.7633159", "0.76146543"...
0.77207166
15
Returns the new position in the source after reading digits.
function readDigits(source, start, firstCode) { var body = source.body; var position = start; var code = firstCode; if (code >= 48 && code <= 57) { // 0 - 9 do { code = body.charCodeAt(++position); } while (code >= 48 && code <= 57); // 0 - 9 return position; } throw syntaxError(so...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function readDigits(source, start, firstCode) {\n var body = source.body;\n var position = start;\n var code = firstCode;\n\n if (code >= 48 && code <= 57) {\n // 0 - 9\n do {\n code = body.charCodeAt(++position);\n } while (code >= 48 && code <= 57); // 0 - 9\n\n\...
[ "0.62889117", "0.6220681", "0.6220681", "0.6196409", "0.6148771", "0.61461264", "0.6117102", "0.6117102", "0.60756713", "0.60660464", "0.60437703", "0.60437703", "0.60233366", "0.60233366", "0.60233366", "0.60233366", "0.60049325", "0.6004479", "0.6004479", "0.6004479", "0.60...
0.6166372
5
Reads a block string token from the source file. """("?"?(\\"""|\\(?!=""")|[^"\\]))"""
function readBlockString(source, start, line, col, prev, lexer) { var body = source.body; var position = start + 3; var chunkStart = position; var code = 0; var rawValue = ''; while (position < body.length && !isNaN(code = body.charCodeAt(position))) { // Closing Triple-Quote (""") if (code === 34 ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function readBlockString(source, start, line, col, prev, lexer) {\n var body = source.body;\n var position = start + 3;\n var chunkStart = position;\n var code = 0;\n var rawValue = '';\n\n while (position < body.length && !isNaN(code = body.charCodeAt(position))) {\n // Closing Triple-Quote (\"\"\")\n ...
[ "0.7412126", "0.74119633", "0.7387627", "0.7387627", "0.7369222", "0.7336227", "0.73336667", "0.7330356", "0.7322", "0.7322", "0.7322", "0.7306208", "0.7288854", "0.72824717", "0.72824717", "0.72824717", "0.72824717", "0.7267307", "0.7267307", "0.72303456", "0.7224686", "0....
0.7212689
22
Converts four hexadecimal chars to the integer that the string represents. For example, uniCharCode('0','0','0','f') will return 15, and uniCharCode('0','0','f','f') returns 255. Returns a negative number on error, if a char was invalid. This is implemented by noting that char2hex() returns 1 on error, which means the ...
function uniCharCode(a, b, c, d) { return char2hex(a) << 12 | char2hex(b) << 8 | char2hex(c) << 4 | char2hex(d); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function uniCharCode(a, b, c, d) {\n return char2hex(a) << 12 | char2hex(b) << 8 | char2hex(c) << 4 | char2hex(d);\n }", "function uniCharCode(a, b, c, d) {\n\t return char2hex(a) << 12 | char2hex(b) << 8 | char2hex(c) << 4 | char2hex(d);\n\t}", "function uniCharCode(a, b, c, d) {\n\t return char2hex...
[ "0.71252704", "0.7064123", "0.7064123", "0.7064123", "0.62243646", "0.61526906", "0.61164445", "0.61136484", "0.59228283", "0.5912774", "0.5912774", "0.5912774", "0.5912774", "0.5912774", "0.5912774", "0.5912774", "0.5912774", "0.5912774", "0.5912774", "0.5912774", "0.5912774...
0.71694857
23
Converts a hex character to its integer value. '0' becomes 0, '9' becomes 9 'A' becomes 10, 'F' becomes 15 'a' becomes 10, 'f' becomes 15 Returns 1 on error.
function char2hex(a) { return a >= 48 && a <= 57 ? a - 48 // 0-9 : a >= 65 && a <= 70 ? a - 55 // A-F : a >= 97 && a <= 102 ? a - 87 // a-f : -1; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function hexstr2int(str)\n{\n\tvar i = 0;\n\tif (is_hexdigit(str)==true) i = parseInt(str, [16]);\n\treturn i;\n}", "function hexadecimalToInteger(string) {\n const DIGITS = {1:1, 2: 2, 3: 3, 4: 4, 5: 5, 6: 6, 7: 7, 8: 8, 9: 9,\n a: 10, b: 11, c: 12, d: 13, e: 14, f: 15 };\n\n string = string.toLowerCase();...
[ "0.75081", "0.72279155", "0.71748155", "0.7169434", "0.70836127", "0.69940364", "0.6981763", "0.6911231", "0.68906945", "0.6803417", "0.67275006", "0.67049414", "0.6700119", "0.6700119", "0.6700119", "0.6700119", "0.6700119", "0.6700119", "0.6700119", "0.6700119", "0.6700119"...
0.65866405
77