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
Loop through rows and find the longest 2D array element
function getTableDimensions(data) { let width = 0; let height = 0; if (Array.isArray(data)) { data.forEach(element => { if (element.length > width) width = element.length; }); height = data.length; } return [width, height]; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function largestOfFour(arr) {\n var longest = [0, 0, 0, 0];\n for (var i = 0; i < arr.length; i++) {\n for (var j = 0; s < arr[i].length; s++) {\n if (longest[i] < arr[i][s]) {\n longest[i] = arr[i][s];\n }\n }\n }\n\n\n return longest;\n}", "function largestOfFour(arr) {\n var retu...
[ "0.7076965", "0.67478013", "0.671844", "0.6654538", "0.6619572", "0.66142774", "0.6592924", "0.65276855", "0.6515298", "0.6469621", "0.6424584", "0.6409311", "0.63431895", "0.6265667", "0.6229832", "0.6218169", "0.6215327", "0.61861247", "0.6151872", "0.61493623", "0.6144392"...
0.0
-1
Reducer handles cell navigation and updates It does not mix the toast dispatchers Any actions are available globally in the app
function reducer(state, action) { let { type, x, y, value, tableData, code } = action; switch (type) { case 'LOAD_DATA': { // Input data is valid JSON here tableData = JSON.parse(tableData); let size = getTableDimensions(tableData); // Loop though array object and convert formulas to values // TODO: ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "dispatch(tr) {\n let dispatchTransaction = this._props.dispatchTransaction;\n if (dispatchTransaction)\n dispatchTransaction.call(this, tr);\n else\n this.updateState(this.state.apply(tr));\n }", "function ActionCell_ActionCell(_ref) {\n var logsEnabled = _ref.logsEnabled,\n rowIndex = ...
[ "0.5890872", "0.586496", "0.5763221", "0.5671196", "0.56536806", "0.5645852", "0.56282604", "0.55577123", "0.5553955", "0.5542347", "0.5538781", "0.55339533", "0.54689723", "0.5417787", "0.5406585", "0.5401427", "0.5400274", "0.5392186", "0.5391098", "0.53639126", "0.5363891"...
0.5664812
4
Coodinates and size use 'tuples' instead of objects. Comparing tuples is less computing than deep isEquals on objects The pattern is [0] is x, [1], is y
function DataProvider({ children, initialData }) { // Default table state const [state, dispatch] = React.useReducer( reducer, initialData || { mouseDown: false, coordinates: [0, 0], selection_coordinates: [0, 0], size: [4, 3], tableData: [ ['Kiril', 'wants', 'to work', '@BranchLabs'], [1, ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "equals(x,y){\n let point = new Point(x,y); //this will handle the 'x' being numbers, array, a simple object, or another Point \n return (this.x === point.x && this.y === point.y); \n }", "isEqual(x, y) {\n return this.x === x && this.y === y;\n }", "equals(...args) \r\n {\r\n ...
[ "0.6290267", "0.6260589", "0.61123323", "0.5978917", "0.59072614", "0.58694106", "0.58287996", "0.5819145", "0.57871133", "0.5767569", "0.5752272", "0.5707228", "0.56802756", "0.56797785", "0.5677025", "0.56700313", "0.5666203", "0.5652008", "0.56501937", "0.56400305", "0.559...
0.0
-1
Unless the value starts with an equals sign, return cell value
function parseFomula(table, value) { if (value && value.length > 0 && value.charAt(0) === '=') { // This is called when there is a comma between variable names Excel.on('callCellValue', function(cellCoord, done) { // using label let row = cellCoord.row.index; let column = cellCoord.column.index; done(g...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "getExcelComparison(value) {\n return value === '' ? 'NULL' : 'EQUAL';\n }", "getExcelComparison(value) {\n return value === '' ? 'NULL' : 'EQUAL';\n }", "getExcelComparison(value) {\n return value === '' ? 'EMPTY' : 'EQUAL_CASE_SENSITIVE';\n }", "getExcelComparison(value) {\n ...
[ "0.58228123", "0.58228123", "0.57137984", "0.57137984", "0.55758905", "0.55050266", "0.5436235", "0.53637177", "0.53631413", "0.53520656", "0.5285231", "0.52378154", "0.52045286", "0.51885796", "0.5161829", "0.51531744", "0.51241577", "0.5105807", "0.5091207", "0.5079587", "0...
0.48834252
38
currently only support top level key
function getEntityNameKeyMap(structure) { const result = {}; for (const kk in structure) { const vv = structure[kk]; if (typeof vv === 'string') { if (types.isMap(vv)) { const info = types.getTypeInfo(vv); const entityName = info.entity; if (_entityNameType[ent...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function key(kind, key) {\n \n}", "function KeyValue() {}", "function KeyValue() {}", "function KeyValue() {}", "keyForRelationship(key) {\n return key; \n }", "objectKeyHandler (key, parentObject, parentKey, parentObjectArrayBool, iterCt) {\n return '\"' + key.replace(/\\\\/g, '\\\\\\\\')....
[ "0.6686956", "0.6650407", "0.6650407", "0.6650407", "0.66025525", "0.6590592", "0.65578055", "0.6551147", "0.6551147", "0.65368414", "0.6532133", "0.65270114", "0.6304066", "0.6298267", "0.6246117", "0.62417805", "0.62204987", "0.62007815", "0.61880344", "0.6163346", "0.61376...
0.0
-1
Basic functionality of Hello World with $() and document.write
function helloWorld() { $(document).ready(function(){ document.write("Hello World"); }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function hello(){\r\n document.write(\"Hello World\");\r\n}", "function culc(){\n\tdocument.write('Hello ');\n}", "function sayHI(name,age){\r\n \r\n document.write(\"<h1>hello \" +name+ \"</h1>\");\r\n document.write(\"<p> your age is \"+age+\"</p>\")\r\n\r\n //alert(\"hey\")\r\n \r\n }"...
[ "0.71509796", "0.6629475", "0.6383549", "0.62653023", "0.6218541", "0.6203375", "0.618212", "0.6179108", "0.61544067", "0.61503655", "0.6132916", "0.6129117", "0.61261255", "0.6088325", "0.60653365", "0.6028343", "0.60170573", "0.6006924", "0.59887403", "0.59865564", "0.59683...
0.77814704
0
Alert window by clicking on the hyperlink
function alertClick() { $(document).ready(function() { $("a").click(function(event) { alert("JQUERY Site"); event.preventDefault(); }); }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "_onClickUrl(urlLink) {\n //Alert.alert(\"clicked\");\n Linking.openURL(\"http://\"+urlLink);\n \n }", "function AlertTest()\n{\n Log.AppendFolder(\"Alert Test\");\n let page = Aliases.browser.Page;\n page.panelPage.panelDialogbox.link.Click();\n page.Alert.buttonOk.ClickButton();\n page.Wait();\n ...
[ "0.7032143", "0.6783112", "0.6727856", "0.6571755", "0.65607226", "0.6511448", "0.64708066", "0.6244133", "0.62377304", "0.6230574", "0.6218623", "0.61951745", "0.6173466", "0.6168209", "0.61591595", "0.6146868", "0.6139022", "0.6132043", "0.6111123", "0.6094102", "0.60659444...
0.6225441
10
to verify the functionality of .hide()
function hideMethod() { $(function() { $("a").show(); $("a").click(function(event) { event.preventDefault(); $("a").hide("slow"); }); }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "hide() {}", "function displayMonitorError(){\r\n\t$(\".hide\").removeClass(\"hide\");\r\n}", "function xHide(e){return xVisibility(e,0);}", "function hideFailMessage() {\n $('#failMsg').hide();\n}", "afterHidden() {}", "hide() {\n var event = this.fireBeforeEvent_();\n if (!event.defaultPrevente...
[ "0.7387498", "0.69093287", "0.6894545", "0.68487304", "0.68344015", "0.6825782", "0.68006134", "0.68006134", "0.67375165", "0.67375165", "0.67227364", "0.6717378", "0.6692916", "0.66852695", "0.66804504", "0.6651273", "0.66434324", "0.66328937", "0.66311646", "0.6573241", "0....
0.6308055
72
to verify the functionality of slideUp()
function slideupMethod() { $(function() { $("img").slideUp(1000); }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function slideUP() {\n $( \"#target\" ).slideUp();}", "function slideUp(){\n\t// Gets the imported image ID\n\tvar image = document.getElementById('imported_image');\n\n\t// Detects if the element exists\n\tif (image) {\n\t\t// Detects if browser is IE7\n\t\tif (ie7) {\n\t\t\tvar topPosition = parseInt(im...
[ "0.7452803", "0.6884645", "0.66443825", "0.6621092", "0.63878685", "0.62967473", "0.62819624", "0.6248395", "0.62040436", "0.6198068", "0.61852044", "0.61774355", "0.6157214", "0.6141861", "0.61239046", "0.5958489", "0.59563714", "0.591659", "0.588146", "0.5874525", "0.582522...
0.6959939
1
to verify the functionality of fadeout()
function fadeoutMethod() { $(function() { $("img").fadeOut(1000); }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function teardownFade() {\n fader.removeClass('show fadeOut');\n }", "function fadeOut(a){return a.style.opacity=1,function b(){(a.style.opacity-=.1)<0?a.style.display=\"none\":requestAnimationFrame(b)}(),!0}", "function fadeOut() {\n $( \"#target\" ).fadeOut();}", "function fadeOut(el) {\n e...
[ "0.7758483", "0.7170666", "0.6918584", "0.6901705", "0.689725", "0.6891727", "0.68677306", "0.6862373", "0.68529457", "0.6842583", "0.68419933", "0.6820198", "0.6814255", "0.6806423", "0.67969537", "0.67936957", "0.6783399", "0.6772745", "0.67649037", "0.67642057", "0.6758222...
0.66548246
29
to verify the functionality of on()
function clickMethod() { $(function() { $("p").show(); $("p").on("click", function() { console.log("paraghraph is clicked"); }); }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "on() {\r\n throw new Error('Abstract method \"on\" must be implemented');\r\n }", "static on() {\n var args = Array.prototype.slice.apply(arguments);\n return _ee.on.apply(_ee, args);\n }", "onEvent() {\n \n }", "function on(){\n addEventToStorage( arguments[0], 'on' );\n retu...
[ "0.7092111", "0.68560356", "0.6435595", "0.6402367", "0.6402291", "0.6383148", "0.63028854", "0.62865674", "0.6254449", "0.6221674", "0.62189764", "0.61673534", "0.61531276", "0.61391526", "0.6137059", "0.6137059", "0.61319375", "0.6127323", "0.6074456", "0.6074456", "0.60744...
0.0
-1
to verify the functionality of one()
function oneMethod() { $(function() { $("p").show(); $("p").one("click",onemethodCheck); }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function one() {\n console.log('function one was called');\n return false;\n}", "one(fn) {\n return this._one(fn);\n }", "one(fn) {\r\n return this._one(fn);\r\n }", "oneOf () { return this[ util.randomInt(this.length) ] }", "function oneOf(args) { }", "function one(){\n addEve...
[ "0.65560395", "0.65077335", "0.6274583", "0.6159583", "0.6136094", "0.6133988", "0.6098185", "0.6039732", "0.6035667", "0.5912889", "0.59050536", "0.58516306", "0.5789599", "0.5789599", "0.5768234", "0.57035094", "0.568982", "0.56515026", "0.56446433", "0.5578211", "0.5568421...
0.566194
17
to verify the functionality of toggle()
function toggleMethod() { $(function() { $("img").toggle(1000); }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "onToggle() {}", "toggle(){this.off=!this.off}", "action() {\n\t\tthis.toggle();\n\t}", "action() {\n\t\tthis.toggle();\n\t}", "action() {\n\t\tthis.toggle();\n\t}", "onToggle() {\r\n this.toggle = !this.toggle;\r\n }", "toggle4() {\r\n }", "toggle_() {\n if (this.isOpen_()) {\n t...
[ "0.7454172", "0.7225304", "0.7151616", "0.7151616", "0.7151616", "0.69567966", "0.6868214", "0.67467", "0.67101854", "0.6644265", "0.66378665", "0.6637316", "0.6607134", "0.65587515", "0.65587515", "0.65462184", "0.652574", "0.6515805", "0.6459588", "0.64514756", "0.644936", ...
0.0
-1
to verify the slidetoggle() function
function slidetoggleMethod() { $(function() { $("img").slideToggle(2000); }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function toggle_slide(){\n clickSound.play();\n\n if (slide.bodyOffset > 0){ \n slide.close();\n }\n else{\n slide.open();\n }\n\n e.stopPropagation();\n}", "function toggleSlide() {\n var $this = $(this);\n if (!$this.hasClass(\"disabled\")) {\n self.toggle($thi...
[ "0.6951042", "0.66737735", "0.65691966", "0.64159924", "0.63568324", "0.63109374", "0.6305806", "0.6255506", "0.6211948", "0.6207447", "0.62058276", "0.6203456", "0.6144919", "0.6144548", "0.6133692", "0.6133489", "0.6097422", "0.60935104", "0.60523534", "0.60486597", "0.6047...
0.6373
4
to verify the usage of various methods in one line
function manyMethod() { $(function() { $("h2").show(); $("h2").hide(1000).delay(1500).show(1000); }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function check() {}", "verify() {\n // TODO\n }", "function TestMethods() {}", "function check (args) {\n\tvar actual = args.length;\n\tvar expected = args.callee.length;\n\tif (actual !== expected)\n\t\tthrow Error(\"Expected \" + expected + \" args; got \" + actual);\n}", "function checkFunctio...
[ "0.6644949", "0.62184924", "0.6199784", "0.5976521", "0.5887775", "0.58133745", "0.5801074", "0.57454747", "0.57334834", "0.5716277", "0.5706827", "0.5696678", "0.5667433", "0.5620291", "0.5594685", "0.559104", "0.5584882", "0.55679977", "0.555837", "0.55321735", "0.55321735"...
0.0
-1
To verify the functionality of animate()
function animateMethod() { $(function() { $("img.image1").animate( { left:"+=1000", opacity: 0.40 }, 3000, function() { console.log("Result obtained"); }); }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function testAnimation(element) {\n if (!element.hasClass('anim-running') &&\n Utils.isInView(element, {topoffset: offset})) {\n element\n .addClass('anim-running');\n\n setTimeout(function () {\n ...
[ "0.7113772", "0.70904773", "0.70904773", "0.69137734", "0.6723804", "0.6706252", "0.6679947", "0.6635781", "0.6609295", "0.65995955", "0.6596807", "0.65738153", "0.65525097", "0.65405846", "0.6507279", "0.6495413", "0.6491028", "0.6481762", "0.64644283", "0.6442399", "0.64293...
0.59660935
78
This gets called only once after login is finished to populate the Messages Log with old messages
addOldMessages(messageList) { for (let i in messageList) { let bIsSelf = false; if (messageList[i].user == this.props.user) bIsSelf=true; this.state.list.push({name: messageList[i].user, msg: messageList[i].message, ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function _saveMessages()\n\t\t{\n\t\t\tvar messages = _getMessages();\n\t\t\tif (messages.length)\t\t\t//delete messages already displayed\n\t\t\t{\n\t\t\t\twhile (messages.length && EZ.getTime(messages[0].time) < displayTime)\n\t\t\t\t\tmessages.shift();\n\t\t\t}\n\t\t\tif (messages.length)\n\t\t\t{\n\t\t\t\tpage...
[ "0.6429734", "0.6294224", "0.6288256", "0.6267448", "0.6138427", "0.613722", "0.6064013", "0.6045805", "0.6029359", "0.602491", "0.5980553", "0.59126776", "0.5908179", "0.5908179", "0.5908179", "0.59018636", "0.5901812", "0.5889961", "0.58642036", "0.58489144", "0.58468455", ...
0.5770584
30
function which adds "required" to an input's couple if it is not empty (please note that this validation will run on both forms tab 1 and 3 a "clear fields" procedure, should be add to the tabswitch functionality)
function validateRequired() { fieldCouplesArray.forEach(function (inputCouple) { if (inputCouple[0].value === "" && inputCouple[1].value !== "") { inputCouple[0].required = true; } else if (inputCouple[0].value !== "" && inputCouple[1].value === "") { ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function required(element) {\n if (element.value === \"\") {\n $(element).next().remove();\n var value = $(element).closest('.form__group').find('.form__label').text();\n $(element).after(`<span class=\"form-error-msg\">${value} is required</span>`\n );\n return true;\n } e...
[ "0.7273697", "0.71036416", "0.70281106", "0.6989627", "0.6943709", "0.6905607", "0.6882507", "0.68074524", "0.6796334", "0.6790042", "0.67899114", "0.676405", "0.67570174", "0.67379755", "0.67077714", "0.6704975", "0.66758513", "0.6669831", "0.66407055", "0.66330373", "0.6632...
0.7716919
0
declaration de ma function add joueurs
function add_joueurs() { //afficher et stocker les joueurs joueurs.push(prompt("Ecrire un nom de joueur en majuscule.")); // tester varibale joueurs if(joueurs !=null) { alert(joueurs.length) //mettre en majuscule document.getElementById("affiche_joueur").innerHTML=joueur...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function User_Insert_Journaux_Liste_des_journaux0(Compo_Maitre)\n{\n\n/*\n***** INFOS ******\n\nNbr d'esclaves = 8\n\nId dans le tab: 52;\nsimple\nNbr Jointure: 1;\n Joint n° 0 = typejournal,tj_numero,tj_numero\n\nId dans le tab: 53;\nsimple\nNbr Jointure: PAS DE JOINTURE;\n\nId dans le tab: 54;\nsimple\nNbr Jo...
[ "0.6989579", "0.6597122", "0.63563573", "0.62625104", "0.6201763", "0.61757743", "0.59878564", "0.5944662", "0.5917507", "0.59056556", "0.58264595", "0.581973", "0.5817277", "0.5803665", "0.5797754", "0.5756482", "0.5730177", "0.57014817", "0.570115", "0.56993467", "0.5693006...
0.5742897
16
declaration de ma function tirage_au_sort
function tirage_au_sort () { //tester la longueur de la chaine if (joueurs.length >0) { /* - déclaration d'une variable - methode mathematique pour melanger des donnees - tirage au sort d'une donnee - indication de la longueur de mon tableau joueurs */ var rand = Math.floor(Math.random()*joueurs.length); // aff...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function Sort() {}", "sort() {\n\t}", "sort() {\n\t}", "sort(){\n\n }", "Sort() {\n\n }", "function sortData (data) {\n ...\n}", "function funzioneSort(type) {\n\tvar freturn;\n\n\ttype= Number(type)\n\n\tswitch (type) {\n\t\tcase 0:\n\t\t\t\t\t\tfreturn=function(a,b) {\n\t\t\t\t\t\t\tvar tita...
[ "0.77340084", "0.75063723", "0.75063723", "0.74498975", "0.72386485", "0.70577157", "0.70062983", "0.6817365", "0.6765226", "0.67633146", "0.6738104", "0.669977", "0.66935825", "0.6646647", "0.6622803", "0.66184086", "0.6615645", "0.66143537", "0.66125965", "0.66082346", "0.6...
0.6094798
96
create a function around the fs.readFile to call
function readJSON ( filename, callback ) { fs.readFile ( filename , function ( err , filedata ) { if (err) { console.log( "We have a problem broski :" + err ) } console.log(countryname) var jsondata = JSON.parse( filedata ) jsondata.forEach( function ( country ) { if ( country.name == countryname ) { ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "readFile (filepath, callback) {\n let option = {encoding: this.encoding, flag: 'r'}\n fs.readFile(filepath, option, (err, data) => {\n callback(err, data)\n })\n }", "static readFile(filepath, callback) {\n fs.readFile(filepath, function (err, data) {\n if (er...
[ "0.7206378", "0.70569354", "0.69823897", "0.6981759", "0.69233257", "0.6809702", "0.67769957", "0.6772387", "0.67619365", "0.6711953", "0.667342", "0.6637057", "0.6600005", "0.65548325", "0.65400314", "0.65141046", "0.6513383", "0.65132767", "0.65095633", "0.65021443", "0.649...
0.0
-1
Get next level entities
function createGoingUpObj( startingPgm, entrels, DiagramChild, entityId, ChildId, InitialObj ) { let StartingPgmParentRels = entrels.filter(rel => { return rel.CHLD.trim() === startingPgm; }); let DiagramParents = StartingPgmParentRels.map(rel => { return rel.PAR; }); // if (!InitialObj &&...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "fetchNext() {\n if (!this.busy && !this.complete && this.models.length) {\n let nextStart = this.models[this.models.length - 1].get('parent');\n\n if (nextStart === '') {\n this.complete = true;\n } else {\n this.options.start = nextStart;\n\n ...
[ "0.57785875", "0.56962353", "0.5526726", "0.5470669", "0.54487985", "0.5401424", "0.5371717", "0.53493565", "0.53141624", "0.52868146", "0.5265171", "0.5262571", "0.52598953", "0.5193684", "0.5184942", "0.5181525", "0.51799035", "0.51799035", "0.51523674", "0.5148079", "0.513...
0.0
-1
generates random number inclusive, taking min & max as arguments
function getRandom(min, max) { return Math.floor((Math.random() * (max-min+1))+min); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function randomNumberGenerator(min, max) {return Math.floor(Math.random() * (max - min + 1) ) + min;}", "function numberGenerator(min, max) {\n return min + Math.floor(Math.random() * max)\n}", "function generateNumber(min, max) {\r\n return Math.floor(Math.random()* (max - min) + min);\r\n}", "function ...
[ "0.8899972", "0.8822758", "0.8809232", "0.8711913", "0.8700233", "0.8654521", "0.8649814", "0.86061054", "0.8588224", "0.8583019", "0.8582188", "0.85697657", "0.8562761", "0.85496867", "0.85425323", "0.8537246", "0.85292625", "0.85205245", "0.8518176", "0.8517652", "0.8516999...
0.0
-1
Pixel color representation of this position
getPixelData() : PixelData { var c = Math.abs(this.height) * 255; return new PixelData(c, c, c); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function getPixelColor(img, x, y) {\n var data = img.data;\n var offset = ((y * (img.width * 4)) + (x * 4));\n var result = data[offset + 0] << 24; // r\n result |= data[offset + 1] << 16; // g\n result |= data[offset + 2] << 8; // b\n return result;\n }", "getColor...
[ "0.6665513", "0.65762424", "0.6492818", "0.6407672", "0.6374277", "0.6306999", "0.6287661", "0.6286929", "0.62740135", "0.6218362", "0.6188606", "0.61881405", "0.61701775", "0.6146235", "0.6138042", "0.6134426", "0.61268085", "0.60366184", "0.60306835", "0.60274863", "0.60261...
0.6444274
3
return string of function
function GetName() { return "Hello, my name is jokosu"; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function callString(f) {\n return '(' + f.toString() + ')()';\n}", "static _functionToCode(fn, name) {\r\n var txt = fn.toString()\r\n .replace(/\\/\\/.*/g, '')\r\n .replace(/\\s+/g, '')\r\n .replace(/var/g,'var ')\r\n .replace('return','return ') + ';';\r\n return txt\r\n }", "fu...
[ "0.71539116", "0.6919739", "0.6912341", "0.6829076", "0.6804078", "0.6796927", "0.67792743", "0.6693347", "0.66748273", "0.6670561", "0.6634379", "0.6593228", "0.65864456", "0.6571324", "0.6564934", "0.6564515", "0.6534363", "0.652156", "0.6517803", "0.65071315", "0.6447898",...
0.0
-1
example parameter in function
function multiply(val1, val2) { return val1 * val2; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function example(param1, opt_param2, var_args){\n\t\n}", "function test_param(name, age, gender) {\n console.log(name);\n console.log(age);\n console.log(gender);\n}", "function passingValueToParamDemo(a,b,c) {\n\treturn \"This got passed to me A \" + a + \" B \" + b + \" C \" + c;\n}", "function ex...
[ "0.7048898", "0.6996498", "0.68308294", "0.6792636", "0.6736976", "0.6645436", "0.6621916", "0.6621916", "0.6582474", "0.65033996", "0.645862", "0.6454725", "0.6406795", "0.6406795", "0.63986915", "0.6393022", "0.6393022", "0.6378931", "0.634799", "0.63148475", "0.629058", ...
0.0
-1
the goal here isn't to be comprehensive (the RDKit has tests for that), just to make sure that the wrappers are working as expected
function test_basics(){ var bmol = RDKitModule.get_mol("c1ccccc"); assert.equal(bmol.is_valid(),0); var mol = RDKitModule.get_mol("c1ccccc1O"); assert.equal(mol.is_valid(),1); assert.equal(mol.get_smiles(),"Oc1ccccc1"); assert.equal(mol.get_inchi(),"InChI=1S/C6H6O/c7-6-4-2-1-3-5-6/h1-5,7H")...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "transient private protected internal function m182() {}", "transient private internal function m185() {}", "private public function m246() {}", "transient protected internal function m189() {}", "function DWRUtil() { }", "private internal function m248() {}", "transient private protected public interna...
[ "0.60372126", "0.6026086", "0.58066285", "0.57613343", "0.57321906", "0.5617579", "0.5460373", "0.5430532", "0.5397345", "0.5382316", "0.529554", "0.5259568", "0.52586263", "0.52450424", "0.52442235", "0.5217113", "0.5201096", "0.51987106", "0.51969045", "0.51147324", "0.5087...
0.52096534
16
out" basis. People must adopt either the "oldest" (based on arrival time) of all animals at the shelter, or they can select whether they would prefer a dog or a cat (and will receive the oldest animal of that type). They cannot select which specific animal they would like. Create the data structures to maintain this sy...
function AnimalShelter() { this.dogQueue = new Queue(); this.catQueue = new Queue(); this.count=0 }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "animalShelterEnqueue(animal) {\n //if cat - enqueue into cat queue\n //if dog - enqueue into dog queue\n if (animal.value === 'cat') {\n this.cat.enqueue(animal);\n } else {\n this.dog.enqueue(animal);\n }\n }", "dequeueDog() {\n let adopted = this.DHead;\n if (adopted.acN...
[ "0.62584984", "0.576285", "0.55758286", "0.5560069", "0.5538194", "0.52656466", "0.52072173", "0.5205057", "0.5041291", "0.49671936", "0.49667248", "0.49003905", "0.48999786", "0.48996174", "0.48979107", "0.4886936", "0.487786", "0.48574534", "0.483921", "0.48326865", "0.4827...
0.59708124
1
[[[0,0],[0,0],[0,0]],[[0,0],[0,0],[0,0]],[[0,0],[0,0],[0,0]],[[0,0],[0,0],[0,0]],[[0,0],[0,0],[0,0]],[[0,0],[0,0],[0,0]]]; //Seasontotals = [grade totals[gender totals[boy and girl]]]
function onOpen() { var ui = SpreadsheetApp.getUi(); ui.createMenu('Athletics Totals') .addItem('Count Totals', 'myFunction') .addToUi(); //console.log("test1"); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function getTotalGrades(section) {\n var grades = [];\n var grade;\n for (var repo in section.students) {\n grade = section.students[repo].totalGrade;\n if ($.type(grade) != \"null\") grades.push(grade);\n };\n\n return grades;\n}", "function getGrades(){\n return [8,8.5,6,7]\n}", "functio...
[ "0.54651976", "0.5465191", "0.5415287", "0.5413548", "0.5358031", "0.53241587", "0.531455", "0.53112364", "0.52799904", "0.5251307", "0.52482045", "0.52427524", "0.5212709", "0.516348", "0.51621807", "0.5132255", "0.512879", "0.51266783", "0.51217353", "0.5114977", "0.5110615...
0.0
-1
calling function to show temperature
function C() { $("#farenheit").css("background-color", "grey"); //setting button color $("#celcius").css("background-color","grey"); a="metric"; ab(); show(); //calling main method }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function displayTemperature(temperature) {\n\tlet returnTemp = temperature\n\tif (!isMetric()) {\n\n\t\t\treturnTemp = temperature * (9 / 5) + 32;\n\t\t// this equation was wrong returnTemp = (temperature - 32) * (5 / 9)\n\t}\n\t//rounding the temp\n\treturn Math.round(returnTemp)\n}", "function showTemperature(...
[ "0.7343239", "0.7270051", "0.72476256", "0.72159004", "0.71925384", "0.7174653", "0.7172118", "0.7091579", "0.7050322", "0.7041601", "0.6974273", "0.6969376", "0.6955603", "0.6938071", "0.6935195", "0.69336414", "0.6929843", "0.69291514", "0.6902335", "0.6894778", "0.6883336"...
0.0
-1
Fetch all users stored
getUsers() { this.showLoader(600); axios .get(`users-list${this.request.toString()}`, { params: { page: this.page } }) .then(response => { this.users = response.dat...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "allUsers() {\r\n this.log(`Getting list of users...`);\r\n return this.context\r\n .retrieve(`\r\n SELECT emailAddress, password\r\n FROM Users\r\n `\r\n )\r\n }", "function findAllUsers() {\n return fetch(self.url).then(response => response.json())\n }", "function fetch...
[ "0.8307446", "0.82482874", "0.81875855", "0.8144547", "0.81061953", "0.80567026", "0.8007273", "0.8001755", "0.79701596", "0.79686254", "0.7899519", "0.7886442", "0.7876225", "0.7872559", "0.78491473", "0.7835855", "0.7769026", "0.7765347", "0.77543014", "0.7748183", "0.77343...
0.0
-1
Update all edited users in storage.
update() { this.showLoader(); axios .put(`users`, { users: this.users }) .then(response => { if (response.data.success) { this.alert("Users updated", " ", "success", 2000); ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "updateUsers (store, users) {\n store.users = users;\n }", "async updateUsers () {\n\t\tconst usersToUpdate = this.renderedEmails.map(userAndHtml => userAndHtml.user);\n\t\tawait Promise.all(usersToUpdate.map(async user => {\n\t\t\tawait this.updateUser(user);\n\t\t}));\n\t}", "function editUs...
[ "0.6823774", "0.68002427", "0.6529465", "0.65098983", "0.6427899", "0.63050556", "0.6248189", "0.61273175", "0.61272883", "0.6035844", "0.6024873", "0.59589046", "0.5939948", "0.5916023", "0.5879827", "0.5853611", "0.5845426", "0.58162373", "0.5766659", "0.5758862", "0.572110...
0.6566679
2
Set an object as primitive to be ignored traversing children in clone or merge
function setAsPrimitive(obj) { obj[primitiveKey] = true; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function setAsPrimitive(obj) {\n obj[primitiveKey] = true;\n }", "function setAsPrimitive(obj) {\n\t obj[primitiveKey] = true;\n\t}", "function setAsPrimitive(obj) {\n obj[primitiveKey] = true;\n }", "function setAsPrimitive(obj) {\n obj[primitiveKey] = true;\n ...
[ "0.6690821", "0.6626453", "0.6613599", "0.6613599", "0.63387674", "0.5628509", "0.54233634", "0.54124993", "0.53967017", "0.53695726", "0.5347259", "0.5282712", "0.5180013", "0.5173394", "0.5148008", "0.5135972", "0.51214164", "0.51214164", "0.51150763", "0.5105766", "0.50838...
0.63652956
13
This is a dummy function to check if the function name has been altered by minification. If the function has been minified and NODE_ENV !== 'production', warn the user.
function isCrushed() {}
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function uglify(name) {\n console.log(\"Hello \" + name);\n}", "function keepNonMinified(file) {\n\tvar keep = true;\n\tif(file.path.match('.js$')) {\n\t\tvar minPath = file.path.replace('.js', '.min.js');\n\t\tkeep = !exists(minPath);\n\t}\n\treturn keep;\n}", "function markFuncFreeze(fun, opt_name) {\n /...
[ "0.60268617", "0.57781506", "0.5717464", "0.5680803", "0.5680803", "0.5637184", "0.5637184", "0.5621175", "0.5575853", "0.5548215", "0.5529817", "0.5520376", "0.5520376", "0.5520376", "0.5520376", "0.5520376", "0.55096394", "0.5493174", "0.5485926", "0.54793435", "0.54786927"...
0.0
-1
It should to be noted that this function isn't equivalent to `texttransform: capitalize`. A strict capitalization should uppercase the first letter of each word a the sentence. We only handle the first word.
function capitalize(string) { if (false) { throw new Error('Material-UI: capitalize(string) expects a string argument.'); } return string.charAt(0).toUpperCase() + string.slice(1); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function sentenceCapitalizer1(text) {\n text = text.toLowerCase();\n let output = \"\";\n text.split(\" \").forEach( sentence => {\n output += sentence.slice(0, 1).toUpperCase();\n output += sentence.slice(1, sentence.length)+\" \";\n } );\n return output.trim();\n}", "function capit...
[ "0.7846306", "0.7635373", "0.76215124", "0.76206636", "0.76174986", "0.76139426", "0.76054466", "0.7586552", "0.7550366", "0.7518982", "0.7518821", "0.75142384", "0.7513061", "0.7500775", "0.74998087", "0.74790484", "0.74651855", "0.746171", "0.74413735", "0.7440085", "0.7438...
0.0
-1
Event `rendered` is triggered when zr rendered. It is useful for realtime snapshot (reflect animation). Event `finished` is triggered when: (1) zrender rendering finished. (2) initial animation finished. (3) progressive rendering finished. (4) no pending action. (5) no delayed setOption needs to be processed.
function bindRenderedEvent(zr, ecIns) { zr.on('rendered', function () { ecIns.trigger('rendered'); // The `finished` event should not be triggered repeatly, // so it should only be triggered when rendering indeed happend // in zrender. (Consider the case that dipatchAction is keep // triggering when m...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function completeRender() {\n var afterRender = options.afterRender;\n\n if (afterRender) {\n afterRender.call(root, root);\n }\n\n // Always emit an afterRender event.\n root.trigger(\"afterRender\", root);\n }", "function completeRender() {\n var afterRen...
[ "0.6279269", "0.6279269", "0.61146736", "0.5770001", "0.5723044", "0.56036395", "0.55704445", "0.5520249", "0.5420462", "0.5420462", "0.53874916", "0.53564095", "0.53542143", "0.5350398", "0.5307551", "0.52943355", "0.52539366", "0.52539366", "0.52206737", "0.5207219", "0.520...
0.71377945
4
Render each chart and component
function renderSeries(ecIns, ecModel, api, payload, dirtyMap) { // Render all charts var scheduler = ecIns._scheduler; var unfinished; ecModel.eachSeries(function (seriesModel) { var chartView = ecIns._chartsMap[seriesModel.__viewId]; chartView.__alive = true; var renderTask = chartView.renderTask; ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "renderComponents() {\n this.algedonodeActivators.forEach(aa => {\n aa.render(this.renderer)\n })\n this.dials.forEach(d => {\n d.render(this.renderer)\n })\n this.strips.forEach(s => {\n s.render(this.renderer)\n })\n this.rows.forEach(r => {\n r.forEach(c => {\n c.r...
[ "0.7473573", "0.7403123", "0.69380677", "0.6869042", "0.684144", "0.67867094", "0.67843324", "0.6767544", "0.6739161", "0.6739161", "0.6714284", "0.6659189", "0.6650795", "0.6618465", "0.6532486", "0.6525728", "0.6523463", "0.64996064", "0.64785266", "0.6468907", "0.6445784",...
0.60248715
72
Extend shape with parameters
function extendShape(opts) { return Path.extend(opts); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function extendShape(opts) {\n\t return Path.extend(opts);\n\t }", "function extendShape(opts) {\n return zrender_lib_graphic_Path__WEBPACK_IMPORTED_MODULE_3__[/* default */ \"b\"].extend(opts);\n}", "function baseParams_2_extendedParams()\n {\n rg.b.value = 1- rg.a.value;\n setRgPoin...
[ "0.7005202", "0.6436609", "0.60699636", "0.56709445", "0.5648829", "0.55835265", "0.5462741", "0.5448022", "0.54328185", "0.5429609", "0.5429609", "0.52849346", "0.5266649", "0.5246164", "0.5209159", "0.5109845", "0.5107622", "0.5099576", "0.5089148", "0.5088283", "0.50840217...
0.6893373
9
Give some default value to the input `textStyle` object, based on the current settings in this `textStyle` object. The Scenario: when text position is `inside` and `textFill` is not specified, we show text border by default for better view. But it should be considered that text position might be changed when hovering o...
function applyDefaultTextStyle(textStyle) { var opt = textStyle.insideRollbackOpt; // Only `insideRollbackOpt` created (in `setTextStyleCommon`), // applyDefaultTextStyle works. if (!opt || textStyle.textFill != null) { return; } var useInsideStyle = opt.useInsideStyle; var textPosition = textStyle.in...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function applyDefaultTextStyle(textStyle) {\n var textPosition = textStyle.textPosition;\n var opt = textStyle.insideRollbackOpt;\n var insideRollback;\n\n if (opt && textStyle.textFill == null) {\n var autoColor = opt.autoColor;\n var isRectText = opt.isRectText;\n var useInsideStyle = opt.useInsideS...
[ "0.84850574", "0.84850574", "0.6956331", "0.6817606", "0.6408872", "0.6376766", "0.60561687", "0.59187925", "0.5891205", "0.58824885", "0.57079303", "0.5669912", "0.56262016", "0.55825406", "0.5580179", "0.5564394", "0.5562992", "0.55597496", "0.5514771", "0.5510497", "0.5500...
0.86113167
1
Apply group transition animation from g1 to g2. If no animatableModel, no animation.
function groupTransition(g1, g2, animatableModel, cb) { if (!g1 || !g2) { return; } function getElMap(g) { var elMap = {}; g.traverse(function (el) { if (!el.isGroup && el.anid) { elMap[el.anid] = el; } }); return elMap; } function getAnimatableProps(el) { var obj...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function groupTransition(g1, g2, animatableModel) {\n\t if (!g1 || !g2) {\n\t return;\n\t }\n\t\n\t function getElMap(g) {\n\t var elMap = {};\n\t g.traverse(function (el) {\n\t if (isNotGroup(el) && el.anid) {\n\t elMap[el.anid] = el;\n\t }\n\t ...
[ "0.82009727", "0.8087827", "0.6136968", "0.60111254", "0.5600348", "0.55152535", "0.5512211", "0.5407871", "0.5343184", "0.5328385", "0.5293422", "0.52854705", "0.5275739", "0.5247094", "0.52007985", "0.5175826", "0.51679087", "0.51490414", "0.51416284", "0.5083781", "0.50789...
0.8376019
8
Zepto.js (c) 20102013 Thomas Fuchs Zepto.js may be freely distributed under the MIT license.
function detect(ua) { var os = {}; var browser = {}; // var webkit = ua.match(/Web[kK]it[\/]{0,1}([\d.]+)/); // var android = ua.match(/(Android);?[\s\/]+([\d.]+)?/); // var ipad = ua.match(/(iPad).*OS\s([\d_]+)/); // var ipod = ua.match(/(iPod)(.*OS\s([\d_]+))?/); // var iphone = !ipad && ua.match(/(iPhone...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function zXmlDom() {\n\n}", "function ie(){Z.apply(this,arguments),this._timer=null,this._input=null}", "function ie(e,r){var n=o(e),a=void 0===w[0]\nr=void 0===r||!!r,t.animate&&!a&&i(_,t.cssClasses.tap,t.animationDuration),E.forEach((function(e){re(e,function(e,r){return null===e||!1===e||void 0===e?w[r]:(\"...
[ "0.5447129", "0.53985137", "0.52307963", "0.5163453", "0.51136255", "0.5103567", "0.5097593", "0.5047328", "0.4995225", "0.49946833", "0.49501795", "0.49347034", "0.49233836", "0.49233836", "0.49075207", "0.48996463", "0.48826176", "0.48730955", "0.48465693", "0.4840273", "0....
0.0
-1
Determine if we're running in a standard browser environment This allows axios to run in a web worker, and reactnative. Both environments support XMLHttpRequest, but not fully standard globals. web workers: typeof window > undefined typeof document > undefined reactnative: navigator.product > 'ReactNative' nativescript...
function isStandardBrowserEnv() { if (typeof navigator !== 'undefined' && (navigator.product === 'ReactNative' || navigator.product === 'NativeScript' || navigator.product === 'NS')) { return false; } return ( typeof win...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function isStandardBrowserEnv() {\n if (typeof navigator !== 'undefined' && (navigator.product === 'ReactNative' ||\n navigator.product === 'NativeScript' ||\n navigator.product === 'NS')) {\n return false;\n ...
[ "0.80762243", "0.8072195", "0.8061644", "0.8040761", "0.80332917", "0.80332917", "0.8031172", "0.80204666" ]
0.0
-1
Print error in a useful way whether in a browser environment (with expandable error stack traces), or in a node.js environment (textonly log output)
function log(level, message) { var error = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : ''; /*eslint-disable no-console*/ if (typeof window === 'undefined') { console.log('redux-saga ' + level + ': ' + message + '\n' + (error && error.stack || error)); } else { console[level](mes...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function showErr (e) {\n console.error(e, e.stack);\n}", "function PrintError(err) {\n\tvar u = require('util');\n\tconsole.error(u.log('ERROR: ' + u.inspect(err)));\n}", "function printError(error){\n console.error(error.message);\n}", "function printError(e) {\n console.error(e.message);\n}", "fun...
[ "0.7307129", "0.7195309", "0.7127001", "0.71048266", "0.707311", "0.70667964", "0.70667964", "0.70531344", "0.7049032", "0.7001629", "0.69987", "0.69987", "0.6916608", "0.6910838", "0.6896317", "0.6889079", "0.68778265", "0.68453544", "0.68241763", "0.68033266", "0.6799327", ...
0.0
-1
Check if the given character code, or the character code at the first character, is a whitespace character.
function whitespace(character) { return re.test( typeof character === 'number' ? fromCode(character) : character.charAt(0) ) }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function is_whitespace(char) {\n return \" \\t\\n\".indexOf(char) >= 0;\n }", "function isWhiteSpace(code) {\n return isNewline(code) || code === 0x0020 || code === 0x0009;\n}", "function isWhitespace(char) {\n\treturn /\\s/.test(char);\n}", "function sc_isCharWhitespace(c) {\n var tmp = c.va...
[ "0.78409445", "0.78340477", "0.783171", "0.782192", "0.77739525", "0.7719754", "0.7719754", "0.7719754", "0.7719754", "0.7719754", "0.7719754", "0.7719754", "0.7719754", "0.7719754", "0.7719754", "0.7683152", "0.76666564", "0.7659878", "0.76198775", "0.7570246", "0.7570246", ...
0.77974325
9
channel(pattern, [buffer]) => creates an event channel for store actions
function actionChannel(pattern, buffer) { Object(__WEBPACK_IMPORTED_MODULE_0__utils__["h" /* check */])(pattern, __WEBPACK_IMPORTED_MODULE_0__utils__["q" /* is */].notUndef, 'actionChannel(pattern,...): argument pattern is undefined'); if (arguments.length > 1) { Object(__WEBPACK_IMPORTED_MODULE_0__utils__["h" ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function actionChannel(pattern$1,buffer$1){if(true){check(pattern$1,_redux_saga_is__WEBPACK_IMPORTED_MODULE_2__[\"pattern\"],'actionChannel(pattern,...): argument pattern is not valid');if(arguments.length>1){check(buffer$1,_redux_saga_is__WEBPACK_IMPORTED_MODULE_2__[\"notUndef\"],'actionChannel(pattern, buffer): ...
[ "0.72849715", "0.7270163", "0.7198183", "0.7063598", "0.7063598", "0.69953597", "0.6993113", "0.697016", "0.6943661", "0.68677664", "0.68677664", "0.68677664", "0.68677664", "0.68663955", "0.6846084", "0.6846084", "0.67139465", "0.6706977", "0.5925411", "0.59123886", "0.58939...
0.6906714
11
Can not use instanceof, consider different scope by cross domain or es module import in ec extensions. Mount a method "isInstance()" to Clz.
function enableClassCheck(Clz) { var classAttr = ['__\0is_clz', classBase++, Math.random().toFixed(3)].join('_'); Clz.prototype[classAttr] = true; Clz.isInstance = function (obj) { return !!(obj && obj[classAttr]); }; } // superCall should have class info, which can not be fetch from 'this'.
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function instanceOf (obj, Clss) {\n return Clss[Symbol.hasInstance](obj);\n}", "static isInstance(obj) {\n if (obj === undefined || obj === null) {\n return false;\n }\n return obj['__pulumiType'] === Addon.__pulumiType;\n }", "static isInstance(obj) {\n if (obj ===...
[ "0.74124175", "0.72359425", "0.7222275", "0.71965176", "0.71644956", "0.7133096", "0.71092373", "0.7054066", "0.7042724", "0.7042724", "0.7027875", "0.6991137", "0.6991137", "0.6991137", "0.69897777", "0.6974765", "0.6960734", "0.6953518", "0.69375765", "0.69133353", "0.69122...
0.0
-1
Consider this case: class A has method f, class B inherits class A, overrides method f, f call superApply('f'), class C inherits class B, do not overrides method f, then when method of class C is called, dead loop occured.
function superCall(context, methodName) { var args = zrUtil.slice(arguments, 2); return this.superClass.prototype[methodName].apply(context, args); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function __applyUp(self, func, args)\r\n{\r\n func.apply(self, args);\r\n if (self.__parent) {\r\n __applyUp(self.__parent, func, args);\r\n }\r\n}", "function b(){f.call(this)}", "function __applyDown(self, func, args)\r\n{\r\n func.apply(self, args);\r\n if (self.__children) {\r\n ...
[ "0.61271", "0.55909157", "0.5322409", "0.52313393", "0.5199879", "0.5199879", "0.51838225", "0.51768816", "0.51607907", "0.5114153", "0.5089366", "0.50572246", "0.5031861", "0.5020725", "0.5020725", "0.5020725", "0.49850824", "0.49586225", "0.49429613", "0.49251193", "0.49119...
0.0
-1
Returns true if the HTML5 history API is supported. Taken from Modernizr. changed to avoid false negatives for Windows Phones:
function supportsHistory() { var ua = window.navigator.userAgent; if ((ua.indexOf('Android 2.') !== -1 || ua.indexOf('Android 4.0') !== -1) && ua.indexOf('Mobile Safari') !== -1 && ua.indexOf('Chrome') === -1 && ua.indexOf('Windows Phone') === -1) return false; return window.history && 'pushState' in window.histo...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function supportsHistory() { // 60\n var ua = navigator.userAgent; // 61\n if ((ua.indexOf('Android 2.') !== -1 || ua.indexOf('Android 4.0') !== -1) && ua.indexOf('Mobile Safari') !== -1 && ua.indexOf('Chrome') === -1 && ua.indexOf(...
[ "0.8456593", "0.8436398", "0.8436398", "0.8436398", "0.8436398", "0.8436398", "0.8436398", "0.8436398", "0.8436398", "0.8436398", "0.8436398", "0.8436398", "0.8436398", "0.8436398", "0.8436398", "0.8436398", "0.8436398", "0.8436398", "0.8436398", "0.8436398", "0.8436398", "...
0.83404016
99
Returns true if browser fires popstate on hash change. IE10 and IE11 do not.
function supportsPopStateOnHashChange() { return window.navigator.userAgent.indexOf('Trident') === -1; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function supportsPopStateOnHashChange(){return window.navigator.userAgent.indexOf('Trident')===-1;}", "function supportsPopStateOnHashChange() {\n return window.navigator.userAgent.indexOf('Trident') === -1;\n }", "function supportsHashChange(documentMode, global) {\n return 'onhashchange' i...
[ "0.85096633", "0.84287786", "0.73452735", "0.73452735", "0.73452735", "0.73452735", "0.7324405", "0.7241189", "0.71064144", "0.6865565", "0.6817643", "0.6817643", "0.6817643", "0.6804248", "0.6773816", "0.6762726", "0.67330664", "0.6706965", "0.6660287", "0.66571045", "0.6567...
0.8299278
59
Returns false if using go(n) with hash history causes a full page reload.
function supportsGoWithoutReloadUsingHash() { return window.navigator.userAgent.indexOf('Firefox') === -1; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "changed()\n {\n if (window.location.hash !== this.lastHash)\n {\n this.lastHash = window.location.hash;\n return true;\n }\n else\n {\n return false;\n }\n }", "function checkHash() {\r\n if (location.hash && $this.find(l...
[ "0.6851354", "0.66238165", "0.61683345", "0.61197215", "0.6119047", "0.6107423", "0.6104077", "0.61029226", "0.60937685", "0.60870457", "0.606839", "0.6028918", "0.6026122", "0.602402", "0.59971255", "0.59971255", "0.59971255", "0.59971255", "0.59971255", "0.59971255", "0.599...
0.59966
99
Returns true if a given popstate event is an extraneous WebKit event. Accounts for the fact that Chrome on iOS fires real popstate events containing undefined state when pressing the back button.
function isExtraneousPopstateEvent(event) { event.state === undefined && navigator.userAgent.indexOf('CriOS') === -1; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function isExtraneousPopstateEvent(event){event.state===undefined&&navigator.userAgent.indexOf('CriOS')===-1;}", "function isExtraneousPopstateEvent(event) {\n return event.state === undefined && navigator.userAgent.indexOf('CriOS') === -1;\n}", "function isExtraneousPopstateEvent(event) {\n return event.sta...
[ "0.8188345", "0.81109804", "0.81109804", "0.81109804", "0.81109804", "0.81109804", "0.81109804", "0.81109804", "0.81109804", "0.81109804", "0.81109804", "0.81109804", "0.81109804", "0.81109804", "0.81109804", "0.81109804", "0.81109804", "0.81109804", "0.81109804", "0.81109804",...
0.81056064
59
Creates a history object that uses the HTML5 history API including pushState, replaceState, and the popstate event.
function createBrowserHistory(props) { if (props === void 0) { props = {}; } !canUseDOM ? false ? invariant(false, 'Browser history needs a DOM') : Object(__WEBPACK_IMPORTED_MODULE_4_tiny_invariant__["a" /* default */])(false) : void 0; var globalHistory = window.history; var canUseHistory = supportsHis...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function createBrowserHistory() {\r\n\t var options = arguments.length <= 0 || arguments[0] === undefined ? {} : arguments[0];\r\n\t\r\n\t !_ExecutionEnvironment.canUseDOM ? process.env.NODE_ENV !== 'production' ? _invariant2['default'](false, 'Browser history needs a DOM') : _invariant2['default'](false) : unde...
[ "0.7363786", "0.73297745", "0.73297745", "0.7308966", "0.7308966", "0.7308966", "0.7308966", "0.73071915", "0.7304227", "0.73013365", "0.72933525", "0.72880805", "0.7287984", "0.7283137", "0.7282849", "0.7282849", "0.7282849", "0.7282849", "0.7282849", "0.7254896", "0.7254281...
0.0
-1
Creates a history object that stores locations in memory.
function createMemoryHistory(props) { if (props === void 0) { props = {}; } var _props = props, getUserConfirmation = _props.getUserConfirmation, _props$initialEntries = _props.initialEntries, initialEntries = _props$initialEntries === void 0 ? ['/'] : _props$initialEntries, _props$in...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function createMemoryHistory(base = '') {\n let listeners = [];\n let queue = [START];\n let position = 0;\n function setLocation(location) {\n position++;\n if (position === queue.length) {\n // we are at the end, we can simply append a new entry\n queue.push(locati...
[ "0.6710825", "0.66617906", "0.6636309", "0.6517103", "0.6497341", "0.64954966", "0.64776564", "0.64506316", "0.6402563", "0.6384455", "0.6384455", "0.6384455", "0.6384455", "0.6384455", "0.6384455", "0.6378855", "0.6375972", "0.6373176", "0.63639265", "0.63639265", "0.6363926...
0.63322234
27
Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE file distributed with this work for additional information regarding copyright ownership. The ASF licenses this file to you under the Apache License, Version 2.0 (the "License"); you may not use this file e...
function DefaultDataProvider(source, dimSize) { if (!Source.isInstance(source)) { source = Source.seriesDataToSource(source); } this._source = source; var data = this._data = source.data; var sourceFormat = source.sourceFormat; // Typed array. TODO IE10+? if (sourceFormat === SOURCE_FORMAT_TYPED_ARRAY...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function jdcDataProvider(o){\n\t//Too many characters/values set\n\tvar ret = {};\n\tvar cache = {}; //= dataArray; //cached slices\n\tvar calc = {}; //calculated definitions\n\tvar o;\n\n\tvar def = {\n\t\tall : '_', //used for where no filter on dimension\n\t\tfn : 'fn', //used for function branching\n\t\tresult...
[ "0.6300078", "0.5725563", "0.5681955", "0.5522123", "0.54491186", "0.5447694", "0.5333014", "0.53159463", "0.5303632", "0.5223298", "0.5185989", "0.5165324", "0.5075347", "0.5041912", "0.503744", "0.49829143", "0.49746037", "0.49515712", "0.49491763", "0.4922769", "0.49220964...
0.60197246
5
Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE file distributed with this work for additional information regarding copyright ownership. The ASF licenses this file to you under the Apache License, Version 2.0 (the "License"); you may not use this file e...
function getScaleExtent(scale, model) { var scaleType = scale.type; var min = model.getMin(); var max = model.getMax(); var fixMin = min != null; var fixMax = max != null; var originalExtent = scale.getExtent(); var axisDataLen; var boundaryGap; var span; if (scaleType === 'ordinal') { axisData...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function getScaleExtent(scale, model) {\n var scaleType = scale.type;\n var min = model.getMin();\n var max = model.getMax();\n var originalExtent = scale.getExtent();\n var axisDataLen;\n var boundaryGap;\n var span;\n\n if (scaleType === 'ordinal') {\n axisDataLen = model.getCategories().length;\n } ...
[ "0.66903776", "0.66903776", "0.6635214", "0.6635214", "0.6635214", "0.64821434", "0.6250071", "0.61511594", "0.59884244", "0.5891907", "0.57624054", "0.5707274", "0.56746405", "0.5660276", "0.56570685", "0.5629411", "0.5598804", "0.55947566", "0.556655", "0.55653775", "0.5557...
0.6609556
7
Check if the axis corss 0
function ifAxisCrossZero(axis) { var dataExtent = axis.scale.getExtent(); var min = dataExtent[0]; var max = dataExtent[1]; return !(min > 0 && max > 0 || min < 0 && max < 0); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function ifAxisCrossZero(axis) {\n\t var dataExtent = axis.scale.getExtent();\n\t var min = dataExtent[0];\n\t var max = dataExtent[1];\n\t return !(min > 0 && max > 0 || min < 0 && max < 0);\n\t }", "hasAxisOrientSignalRef() {\n return (this.component.axes.x?.some(a => a.hasOrientS...
[ "0.79084367", "0.6435964", "0.64173824", "0.63664246", "0.6054823", "0.6044323", "0.6015769", "0.59150916", "0.5879838", "0.57272536", "0.5702873", "0.56943345", "0.56880975", "0.5687422", "0.56293803", "0.5625402", "0.56174374", "0.5593879", "0.5576341", "0.55748653", "0.557...
0.77958435
8
Find price that can fill order and buffer price by one order
function getBestOrderPrice(orderAmount,orderTotal,side,orderbook){if(side.toUpperCase()==='BUY'){var asks=orderbook.asks;// if orderTotal is provided for buy this means pre-fill was used if(orderTotal){var total=0;var _index2=asks.length-1;while(total<orderTotal&&_index2>=0){total+=parseFloat(asks[_index2].total);_inde...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "async findPriceList(code) {\n //\n // QUERY for exact DENOM\n const feasiblePacks = await CatalogDetail.query()\n .where(\"product_code\", code)\n .where(\"status\", \"ENABLE\")\n .orderBy(\"min\", \"asc\")\n .fetch();\n /// no records\n if (feasiblePacks.length === 0) {\n r...
[ "0.61981004", "0.6109941", "0.58704454", "0.5869854", "0.58123153", "0.5700399", "0.5699231", "0.56761074", "0.5649617", "0.56363875", "0.56348705", "0.5618242", "0.55905616", "0.55744934", "0.55632436", "0.55405843", "0.5503424", "0.5493798", "0.54799175", "0.54581344", "0.5...
0.651592
0
Fast path to cloning, since this is monomorphic
function cloneLayoutItem(layoutItem) { return { w: layoutItem.w, h: layoutItem.h, x: layoutItem.x, y: layoutItem.y, i: layoutItem.i, minW: layoutItem.minW, maxW: layoutItem.maxW, minH: layoutItem.minH, maxH: layoutItem.maxH, moved: Boolean(layoutItem.moved), static: Boolean...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function Clone() {}", "function Clone() {}", "function Clone() {}", "function Clone() {}", "function Clone() { }", "function Clone() { }", "function Clone() { }", "function clone(a) {if (!a) return a;var c, b = [Number, String, Boolean];if (b.forEach(function(b) { a instanceof b && (c = b(a)); }), \"...
[ "0.76937884", "0.76937884", "0.76937884", "0.76937884", "0.73716086", "0.73716086", "0.73716086", "0.72560656", "0.7109731", "0.7065125", "0.7061807", "0.7017915", "0.700856", "0.69749796", "0.69529814", "0.69529814", "0.69529814", "0.69529814", "0.69529814", "0.69224864", "0...
0.0
-1
Comparing React `children` is a bit difficult. This is a good way to compare them. This will catch differences in keys, order, and length.
function childrenEqual(a, b) { return (0, _lodash2.default)(_react2.default.Children.map(a, function (c) { return c.key; }), _react2.default.Children.map(b, function (c) { return c.key; })); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function childrenEqual(a\n/*: ReactChildren*/\n, b\n/*: ReactChildren*/\n)\n/*: boolean*/\n{\n return (0, _lodash.default)(_react.default.Children.map(a, function (c) {\n return c.key;\n }), _react.default.Children.map(b, function (c) {\n return c.key;\n }));\n}", "function childrenEqual(a, b) {\n // $...
[ "0.7850615", "0.75196177", "0.6728879", "0.6320843", "0.62723505", "0.62723505", "0.6058709", "0.6019686", "0.5841167", "0.5829393", "0.5829356", "0.5801001", "0.5706948", "0.56959206", "0.56754225", "0.56680614", "0.56672454", "0.5648948", "0.56467366", "0.5623756", "0.56226...
0.75979424
2
Given two layoutitems, check if they collide.
function collides(l1, l2) { if (l1 === l2) return false; // same element if (l1.x + l1.w <= l2.x) return false; // l1 is left of l2 if (l1.x >= l2.x + l2.w) return false; // l1 is right of l2 if (l1.y + l1.h <= l2.y) return false; // l1 is above l2 if (l1.y >= l2.y + l2.h) return false; // l1 is below l2 re...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function collides(l1\n/*: LayoutItem*/\n, l2\n/*: LayoutItem*/\n)\n/*: boolean*/\n{\n if (l1.i === l2.i) return false; // same element\n\n if (l1.x + l1.w <= l2.x) return false; // l1 is left of l2\n\n if (l1.x >= l2.x + l2.w) return false; // l1 is right of l2\n\n if (l1.y + l1.h <= l2.y) return false; // l1 ...
[ "0.80237585", "0.70319617", "0.69711435", "0.67970145", "0.6730727", "0.6716791", "0.67025715", "0.669219", "0.6678458", "0.6618596", "0.659672", "0.6590639", "0.65876585", "0.654835", "0.65261537", "0.65261537", "0.6508175", "0.65019", "0.64876187", "0.6457678", "0.64284253"...
0.67554885
6
Before moving item down, it will check if the movement will cause collisions and move those items down before.
function resolveCompactionCollision(layout, item, moveToCoord, axis) { var sizeProp = heightWidth[axis]; item[axis] += 1; var itemIndex = layout.indexOf(item); // Go through each item we collide with. for (var _i4 = itemIndex + 1; _i4 < layout.length; _i4++) { var otherItem = layout[_i4]; // Ignore s...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function move_down() {\n\t check_pos(); \n\t blob_pos_y = blob_pos_y + move_speed;\n\t}", "moveActualBlockDown () {\n // If any collision occurs - add the block to the landed blocks array\n if (this.checkBlockCollision('down')) {\n this.landBlock()\n this.checkFullRow()\n this.createBlock()\...
[ "0.7066146", "0.697333", "0.6954674", "0.68720376", "0.68440264", "0.6828357", "0.6658349", "0.65899444", "0.65548337", "0.65428257", "0.65382874", "0.6481792", "0.6480561", "0.646844", "0.64506876", "0.6436268", "0.6431473", "0.64204735", "0.6418832", "0.6405917", "0.6389712...
0.0
-1
Compact an item in the layout.
function compactItem(compareWith, l, compactType, cols, fullLayout) { var compactV = compactType === "vertical"; var compactH = compactType === "horizontal"; if (compactV) { // Bottom 'y' possible is the bottom of the layout. // This allows you to do nice stuff like specify {y: Infinity} // This is he...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function compactItem(compareWith\n/*: Layout*/\n, l\n/*: LayoutItem*/\n, verticalCompact\n/*: boolean*/\n)\n/*: LayoutItem*/\n{\n if (verticalCompact) {\n // Move the element up as far as it can go without colliding.\n while (l.y > 0 && !getFirstCollision(compareWith, l)) {\n l.y--;\n }\n } // Move...
[ "0.6574337", "0.6574337", "0.65441877", "0.6206254", "0.583148", "0.56320024", "0.5434896", "0.5427741", "0.53075033", "0.521415", "0.519827", "0.51959985", "0.51774585", "0.51774585", "0.51774585", "0.5070988", "0.49896237", "0.49621382", "0.4931759", "0.4927066", "0.4843404...
0.6029055
4
Flow can't really figure this out, so we just use Object
function autoBindHandlers(el, fns) { fns.forEach(function (key) { return el[key] = el[key].bind(el); }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function Object() {}", "function Object() {}", "function Object(){}", "function Object(){}", "function NXObject() {}", "get object() {\n\n }", "objd(obj) {\n\n return toObject(obj);\n }", "function Obj() {}", "function object(obj) {\n if (this == window && !isundefined(obj) && cal...
[ "0.6589869", "0.6589869", "0.6530274", "0.6530274", "0.62831235", "0.62071157", "0.6142698", "0.60488874", "0.59703", "0.5941648", "0.58274406", "0.5815791", "0.57981735", "0.5780073", "0.57720995", "0.57629997", "0.5752905", "0.57090175", "0.56909746", "0.5690108", "0.568299...
0.0
-1
Converts array values to string. `margin: [['5px', '10px']]` > `margin: 5px 10px;` `border: ['1px', '2px']` > `border: 1px, 2px;` `margin: [['5px', '10px'], '!important']` > `margin: 5px 10px !important;` `color: ['red', !important]` > `color: red !important;`
function toCssValue(value) { var ignoreImportant = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false; if (!Array.isArray(value)) return value; var cssValue = ''; // Support space separated values via `[['5px', '10px']]`. if (Array.isArray(value[0])) { for (var i = 0; i < value.l...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function toCssValue(value) {\n var ignoreImportant = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;\n\n if (!Array.isArray(value)) return value;\n\n var cssValue = '';\n\n // Support space separated values via `[['5px', '10px']]`.\n if (Array.isArray(value[0])) {\n f...
[ "0.690426", "0.6801259", "0.67925686", "0.6577485", "0.6524869", "0.65052235", "0.6428712", "0.6428712", "0.63812345", "0.63812345", "0.63812345", "0.63812345", "0.63812345", "0.63812345", "0.63812345", "0.63812345", "0.63812345", "0.63812345", "0.63812345", "0.63812345", "0....
0.678838
28
Create a rule instance.
function createRule() { var name = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 'unnamed'; var decl = arguments[1]; var options = arguments[2]; var jss = options.jss; var declCopy = (0, _cloneStyle2['default'])(decl); var rule = jss.plugins.onCreateRule(name, declCopy, options); i...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "static makeRule(options) {\n return new Rule(options.name, options.severity, options.selector ? Selector.parse(options.selector) : null, Rule.makePattern(options.pattern), options.lint || options.message, options.applies);\n }", "create(context) {\n freezeDeeply(context.opt...
[ "0.68346745", "0.6652633", "0.6574626", "0.6499335", "0.64848536", "0.64727724", "0.632433", "0.62896234", "0.6206375", "0.6174969", "0.61651593", "0.6152218", "0.5943596", "0.594291", "0.5940071", "0.58681977", "0.58068746", "0.58068746", "0.58058995", "0.5769641", "0.576964...
0.64493954
31
This is done to register the method called with moment() without creating circular dependencies.
function setHookCallback (callback) { hookCallback = callback; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "constructor(moment) {\n this.moment = moment;\n }", "moment(date) {\n return moment(date);\n }", "viewDateMoment () {\n const m = moment(this.props.viewDate)\n return function () {\n return m.clone()\n }\n }", "function Sb(a,b){return function(c,d){var e,f;\n//invert the arguments,...
[ "0.68071914", "0.6107244", "0.59238935", "0.57483727", "0.57483727", "0.57483727", "0.57483727", "0.57483727", "0.57483727", "0.57483727", "0.57483727", "0.57483727", "0.57483727", "0.57483727", "0.57483727", "0.57483727", "0.57399976", "0.57399976", "0.57399976", "0.57353735",...
0.0
-1
compare two arrays, return the number of differences
function compareArrays(array1, array2, dontConvert) { var len = Math.min(array1.length, array2.length), lengthDiff = Math.abs(array1.length - array2.length), diffs = 0, i; for (i = 0; i < len; i++) { if ((dontConvert && array1[i] !== array2[i]) || ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function compareArrays(array1, array2) {\n var len = Math.min(array1.length, array2.length),\n lengthDiff = Math.abs(array1.length - array2.length),\n diffs = 0,\n i;\n for (i = 0; i < len; i++) {\n if (~~array1[i] !== ~~array2[i]) {\n diffs+...
[ "0.82811505", "0.82811505", "0.82811505", "0.82811505", "0.82811505", "0.82811505", "0.82811505", "0.82811505", "0.82811505", "0.82811505", "0.82811505", "0.7997368", "0.7985993", "0.7953109", "0.7923902", "0.7710744", "0.7559878", "0.75489837", "0.7534625", "0.7505893", "0.7...
0.0
-1
format date using native date object
function formatMoment(m, format) { if (!m.isValid()) { return m.localeData().invalidDate(); } format = expandFormat(format, m.localeData()); formatFunctions[format] = formatFunctions[format] || makeFormatFunction(format); return formatFunctions[format](m); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "formatDate(date) {\n\t\treturn date.toString()\n\t\t.replace(/(\\d{4})(\\d{2})(\\d{2})/, (string, year, month, day) => `${year}-${month}-${day}`);\n\t}", "static formatDate(date) {\n return new Date(date).toLocaleDateString();\n }", "formatTheDate(date, format) {\n const [ year, month, day ] = (date.toI...
[ "0.75326866", "0.7420164", "0.73876584", "0.7385484", "0.7349305", "0.73363584", "0.7304889", "0.73006487", "0.7294178", "0.7294178", "0.7294178", "0.72198546", "0.7214603", "0.7210451", "0.71882045", "0.71826977", "0.7178597", "0.7168202", "0.7166666", "0.71578765", "0.71361...
0.0
-1
pick the locale from the array try ['enau', 'engb'] as 'enau', 'engb', 'en', as in move through the list trying each substring from most specific to least, but move to the next array item if it's a more specific variant than the current root
function chooseLocale(names) { var i = 0, j, next, locale, split; while (i < names.length) { split = normalizeLocale(names[i]).split('-'); j = split.length; next = normalizeLocale(names[i + 1]); next = next ? next.split('-') : null; while (j >...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function chooseLocale(names) {\n var i = 0, j, next, locale, split;\n \n while (i < names.length) {\n split = normalizeLocale(names[i]).split('-');\n j = split.length;\n next = normalizeLocale(names[i + 1]);\n next = next ? next.split('-') : nu...
[ "0.70808", "0.70762366", "0.70762366", "0.70762366", "0.70762366", "0.70762366", "0.70762366", "0.70762366", "0.70762366", "0.70762366", "0.70762366", "0.70762366", "0.70762366", "0.70762366", "0.70762366", "0.70762366", "0.70762366", "0.70762366", "0.70762366", "0.70762366", ...
0.0
-1
This function will load locale and then set the global locale. If no arguments are passed in, it will simply return the current global locale key.
function getSetGlobalLocale (key, values) { var data; if (key) { if (isUndefined(values)) { data = getLocale(key); } else { data = defineLocale(key, values); } if (data) { // moment.duration._loc...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function getSetGlobalLocale(key,values){var data;if(key){if(isUndefined(values)){data = getLocale(key);}else {data = defineLocale(key,values);}if(data){ // moment.duration._locale = moment._locale = data;\nglobalLocale = data;}else {if(typeof console !== 'undefined' && console.warn){ //warn user if arguments are p...
[ "0.7326747", "0.7298492", "0.72952205", "0.7249647", "0.7249647", "0.7249647", "0.7249647", "0.7249647", "0.7249647", "0.72418416", "0.72418416", "0.72305644", "0.72183263", "0.72145385", "0.72106117", "0.72106117", "0.72106117", "0.72106117", "0.72068065", "0.72064245", "0.7...
0.0
-1
Pick the first defined of two or three arguments.
function defaults(a, b, c) { if (a != null) { return a; } if (b != null) { return b; } return c; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function pick() {\n\tvar args = arguments,\n\t\ti,\n\t\targ,\n\t\tlength = args.length;\n\tfor (i = 0; i < length; i++) {\n\t\targ = args[i];\n\t\tif (typeof arg !== 'undefined' && arg !== null) {\n\t\t\treturn arg;\n\t\t}\n\t}\n}", "function pick() {\n\t\tvar args = arguments,\n\t\t\ti,\n\t\t\targ,\n\t\t\tlengt...
[ "0.76293796", "0.75582266", "0.7454984", "0.7448525", "0.6879006", "0.6671625", "0.6651035", "0.6640051", "0.6581468", "0.648993", "0.6479717", "0.64059037", "0.6300056", "0.6299914", "0.6286635", "0.61624765", "0.6150181", "0.59610116", "0.595939", "0.59325296", "0.59306544"...
0.0
-1
convert an array to a date. the array should mirror the parameters below note: all values past the year are optional and will default to the lowest possible value. [year, month, day , hour, minute, second, millisecond]
function configFromArray (config) { var i, date, input = [], currentDate, expectedWeekday, yearToUse; if (config._d) { return; } currentDate = currentDateArray(config); //compute day of the year from weeks and weekdays if (config._w && config._a[DATE] == nu...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function dateFromArray(input) {\n return new Date(input[0], input[1] || 0, input[2] || 1, input[3] || 0, input[4] || 0, input[5] || 0, input[6] || 0);\n }", "function dateFromArray(input) {\n return new Date(input[0], input[1] || 0, input[2] || 1, input[3] || 0, input[4] || 0, input[5] || 0, inp...
[ "0.70556146", "0.70556146", "0.6968585", "0.6850404", "0.6635095", "0.6459753", "0.613038", "0.61257774", "0.6066985", "0.6015293", "0.6015293", "0.6015293", "0.6015293", "0.6015293", "0.59616965", "0.59616965", "0.59616965", "0.5901381", "0.58887535", "0.58766466", "0.586786...
0.0
-1
date from iso format
function configFromISO(config) { var i, l, string = config._i, match = extendedIsoRegex.exec(string) || basicIsoRegex.exec(string), allowTime, dateFormat, timeFormat, tzFormat; if (match) { getParsingFlags(config).iso = true; for (i = 0, l = ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function isoDate(date)\n{\n\treturn date.getFullYear() + \"-\" + (date.getMonth() + 1) + \"-\" + date.getDate()\n}", "function dateFromISO8601(isostr) {\n var parts = isostr.match(/\\d+/g);\n var date = new Date(parts[0], parts[1] - 1, parts[2], parts[3], parts[4], parts[5]);\n var mm = date...
[ "0.7161587", "0.7084152", "0.69561076", "0.68181574", "0.66757625", "0.66372114", "0.6559707", "0.6525335", "0.6466161", "0.6465599", "0.644205", "0.64171946", "0.6406543", "0.6406543", "0.6406543", "0.6406543", "0.63656497", "0.63241196", "0.6322188", "0.62742394", "0.626350...
0.0
-1
date and time from ref 2822 format
function configFromRFC2822(config) { var match = rfc2822.exec(preprocessRFC2822(config._i)); if (match) { var parsedArray = extractFromRFC2822Strings(match[4], match[3], match[2], match[5], match[6], match[7]); if (!checkWeekday(match[1], parsedArray, config)) { r...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function createDrupalDateFromPieces(date, hour, minute, marker) {\n //Build time\n var time = hour + ':' + minute + ' ' + marker;\n //Build full date\n var dateTime = moment(date + ' ' + time, 'YYYY-MM-DD hh:mm A');\n //Return date in 24-hour format\n return moment(dateTime);\n }",...
[ "0.653082", "0.63895303", "0.6154629", "0.6096161", "0.60804975", "0.605977", "0.60540193", "0.605324", "0.605324", "0.605324", "0.605324", "0.6040541", "0.6028883", "0.6021129", "0.6021129", "0.6021129", "0.6021129", "0.6021129", "0.6021129", "0.6021129", "0.6021129", "0.6...
0.0
-1
date from iso format or fallback
function configFromString(config) { var matched = aspNetJsonRegex.exec(config._i); if (matched !== null) { config._d = new Date(+matched[1]); return; } configFromISO(config); if (config._isValid === false) { delete config._isValid; } ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function isoToDate(s) {\n if (s instanceof Date) { return s; }\n if (typeof s === 'string') { return new Date(s); }\n}", "function isoStringToDate(match){var date=new Date(0);var tzHour=0;var tzMin=0;// match[8] means that the string contains \"Z\" (UTC) or a timezone like \"+01:00\" or \"+0100\"\nvar dateSett...
[ "0.69155526", "0.669977", "0.6644896", "0.65540725", "0.65540725", "0.65211886", "0.6494941", "0.6487338", "0.64510757", "0.6431595", "0.6431595", "0.6410263", "0.6410263", "0.6407163", "0.6404758", "0.6404758", "0.6404758", "0.6404758", "0.6404758", "0.6404758", "0.6404758",...
0.0
-1
date from string and format string
function configFromStringAndFormat(config) { // TODO: Move this to another part of the creation flow to prevent circular deps if (config._f === hooks.ISO_8601) { configFromISO(config); return; } if (config._f === hooks.RFC_2822) { configFromRFC2822(con...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function makeDateFromStringAndFormat(string, format) {\n var datePartArray = [0, 0, 1, 0, 0, 0, 0],\n config = {\n tzh : 0, // timezone hour offset\n tzm : 0 // timezone minute offset\n },\n tokens = format.match(formattingTokens),\n ...
[ "0.7541918", "0.73771065", "0.7178186", "0.7178186", "0.7178186", "0.7178186", "0.7165116", "0.71642524", "0.71642524", "0.71642524", "0.71642524", "0.71642524", "0.7151704", "0.71465707", "0.71465707", "0.71465707", "0.70902205", "0.708685", "0.70298785", "0.70298785", "0.70...
0.0
-1
date from string and array of format strings
function configFromStringAndArray(config) { var tempConfig, bestMoment, scoreToBeat, i, currentScore; if (config._f.length === 0) { getParsingFlags(config).invalidFormat = true; config._d = new Date(NaN); return; ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function makeDateFromStringAndArray(string, formats) {\n var output,\n inputParts = string.match(parseMultipleFormatChunker) || [],\n formattedInputParts,\n scoreToBeat = 99,\n i,\n currentDate,\n currentScore;\n for (i = 0; i < format...
[ "0.6992099", "0.69120616", "0.6811551", "0.6738145", "0.6738145", "0.6738145", "0.6738145", "0.6738145", "0.6711522", "0.6711522", "0.6711522", "0.6697953", "0.65985", "0.65868574", "0.65868574", "0.6574106", "0.6574106", "0.6574106", "0.6574106", "0.6574106", "0.6574106", ...
0.0
-1
Pick a moment m from moments so that m[fn](other) is true for all other. This relies on the function fn to be transitive. moments should either be an array of moment objects or an array, whose first element is an array of moment objects.
function pickBy(fn, moments) { var res, i; if (moments.length === 1 && isArray(moments[0])) { moments = moments[0]; } if (!moments.length) { return createLocal(); } res = moments[0]; for (i = 1; i < moments.length; ++i) { if (!m...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function pickBy(fn, moments) {\n var res, i;\n if (moments.length === 1 && isArray(moments[0])) {\n moments = moments[0];\n }\n if (!moments.length) {\n return moment();\n }\n res = moments[0];\n for (i = 1; i < moments.length; ++i) {\n ...
[ "0.7611572", "0.7611572", "0.7611572", "0.7611572", "0.7611572", "0.7611572", "0.7611572", "0.7611572", "0.7611572", "0.7611572", "0.7611572", "0.7611572", "0.7611572", "0.7611572", "0.7611572", "0.7611572", "0.7611572", "0.7611572", "0.7611572", "0.7611572", "0.7611572", "...
0.0
-1
TODO: Use [].sort instead?
function min () { var args = [].slice.call(arguments, 0); return pickBy('isBefore', args); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "sort() {\n\t}", "sort() {\n\t}", "function Sort() {}", "sort(){\n\n }", "function sortItems(arr) {\r\n return arr.sort();\r\n}", "function sort(theArray){\n\n}", "function arrangeElements( array ) {\r\n\tarray = array.sort();\r\n\treturn array;\r\n}", "function alfa (arr){\n\tfor (var i = 0; i<...
[ "0.7690018", "0.7690018", "0.743278", "0.73817414", "0.7223793", "0.7045839", "0.7001987", "0.6979922", "0.6941385", "0.68807125", "0.6870136", "0.6870136", "0.6834353", "0.6828496", "0.6822426", "0.68005633", "0.6790196", "0.6769818", "0.6721127", "0.6708953", "0.6707716", ...
0.0
-1
Return a moment from input, that is local/utc/zone equivalent to model.
function cloneWithOffset(input, model) { var res, diff; if (model._isUTC) { res = model.clone(); diff = (isMoment(input) || isDate(input) ? input.valueOf() : createLocal(input).valueOf()) - res.valueOf(); // Use low-level api, because this fn is low-level api. ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function makeAs(input, model) {\n\t return model._isUTC ? moment(input).zone(model._offset || 0) :\n\t moment(input).local();\n\t }", "function makeAs(input, model) {\n return model._isUTC ? moment(input).zone(model._offset || 0) :\n moment(input).local();\n }", "funct...
[ "0.85007477", "0.84180284", "0.84180284", "0.84180284", "0.84180284", "0.84180284", "0.84180284", "0.84180284", "0.84180284", "0.84180284", "0.84180284", "0.84180284", "0.84180284", "0.84180284", "0.84180284", "0.84180284", "0.84180284", "0.84180284", "0.7951696", "0.7934528", ...
0.0
-1
MOMENTS keepLocalTime = true means only change the timezone, without affecting the local hour. So 5:31:26 +0300 [utcOffset(2, true)]> 5:31:26 +0200 It is possible that 5:31:26 doesn't exist with offset +0200, so we adjust the time as needed, to be valid. Keeping the time actually adds/subtracts (one hour) from the actu...
function getSetOffset (input, keepLocalTime, keepMinutes) { var offset = this._offset || 0, localAdjust; if (!this.isValid()) { return input != null ? this : NaN; } if (input != null) { if (typeof input === 'string') { input = offsetFro...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function getSetOffset(input,keepLocalTime){var offset=this._offset||0,localAdjust;if(!this.isValid()){return input!=null?this:NaN;}if(input!=null){if(typeof input==='string'){input=offsetFromString(matchShortOffset,input);}else if(Math.abs(input)<16){input=input*60;}if(!this._isUTC&&keepLocalTime){localAdjust=getD...
[ "0.6656803", "0.6656803", "0.6616482", "0.6616482", "0.6616482", "0.6616482", "0.6616482", "0.6616482", "0.6616482", "0.6616482", "0.6616482", "0.6616482", "0.6616482", "0.6616482", "0.6616482", "0.6616482", "0.6616482", "0.6616482", "0.6616482", "0.6616482", "0.6616482", "...
0.0
-1
TODO: remove 'name' arg after deprecation is removed
function createAdder(direction, name) { return function (val, period) { var dur, tmp; //invert the arguments, but complain about it if (period !== null && !isNaN(+period)) { deprecateSimple(name, 'moment().' + name + '(period, number) is deprecated. Please us...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "setName(name) { }", "constructor(name) {\n super(name);\n this.name = name;\n }", "constructor(name) {\n this.name = name;\n }", "constructor(name) {\n this.name = name;\n }", "constructor(name) {\n this.name = name;\n }", "constructor(name) {\n this.name = name;\n }", "construct...
[ "0.67782986", "0.6759405", "0.67381084", "0.67381084", "0.67381084", "0.67381084", "0.6733258", "0.6733258", "0.67120683", "0.66484624", "0.6612438", "0.6540716", "0.65202653", "0.65195", "0.6489472", "0.6465985", "0.6462259", "0.6415414", "0.6381141", "0.6297654", "0.6276111...
0.0
-1
Return a human readable representation of a moment that can also be evaluated to get a new moment which is the same
function inspect () { if (!this.isValid()) { return 'moment.invalid(/* ' + this._i + ' */)'; } var func = 'moment'; var zone = ''; if (!this.isLocal()) { func = this.utcOffset() === 0 ? 'moment.utc' : 'moment.parseZone'; zone = 'Z'; } ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function inspect(){if(!this.isValid()){return'moment.invalid(/* '+this._i+' */)';}var func='moment';var zone='';if(!this.isLocal()){func=this.utcOffset()===0?'moment.utc':'moment.parseZone';zone='Z';}var prefix='['+func+'(\"]';var year=0<=this.year()&&this.year()<=9999?'YYYY':'YYYYYY';var datetime='-MM-DD[T]HH:mm:...
[ "0.7135904", "0.7135904", "0.7119796", "0.70928735", "0.70805424", "0.70805424", "0.70805424", "0.70805424", "0.7056497", "0.7056497", "0.7056497", "0.7056497", "0.7056497", "0.7056497", "0.7056497", "0.7056497", "0.7056497", "0.7056497", "0.7056497", "0.7056497", "0.7056497"...
0.0
-1
If passed a locale key, it will set the locale for this instance. Otherwise, it will return the locale configuration variables for this instance.
function locale (key) { var newLocaleData; if (key === undefined) { return this._locale._abbr; } else { newLocaleData = getLocale(key); if (newLocaleData != null) { this._locale = newLocaleData; } return this; }...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function locale(key){var newLocaleData;if(key===undefined){return this._locale._abbr;}else{newLocaleData=getLocale(key);if(newLocaleData!=null){this._locale=newLocaleData;}return this;}}", "function locale(key){var newLocaleData;if(key===undefined){return this._locale._abbr;}else{newLocaleData=getLocale(key);if(...
[ "0.7287264", "0.7287264", "0.7233862", "0.7206993", "0.7206993", "0.70927703", "0.70927703", "0.70927703", "0.70927703", "0.70927703", "0.70927703", "0.70927703", "0.70927703", "0.70927703", "0.70927703", "0.70927703", "0.70927703", "0.70927703", "0.70927703", "0.70927703", "...
0.0
-1
actual modulo handles negative numbers (for dates before 1970):
function mod$1(dividend, divisor) { return (dividend % divisor + divisor) % divisor; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function mod (x, y) {return x < 0? y - (-x % y) : x % y;}", "function testRemainder_17() {\n assertEquals(-0, -0 % Number.MAX_VALUE);\n}", "function moduloWithNegativeZeroDividend(a, b, c)\n{\n var temp = a * b;\n return temp % c;\n}", "function modulo(dividend, divisor)\n{\n var epsilon = divisor ...
[ "0.7011867", "0.6988145", "0.674535", "0.6723566", "0.6723566", "0.6723566", "0.6701297", "0.6668326", "0.6645316", "0.66428584", "0.66218877", "0.6618685", "0.6583922", "0.6566572", "0.6554226", "0.6554226", "0.6554226", "0.6545889", "0.6528715", "0.6494052", "0.6486551", ...
0.0
-1
() (5) (fmt, 5) (fmt) (true) (true, 5) (true, fmt, 5) (true, fmt)
function listWeekdaysImpl (localeSorted, format, index, field) { if (typeof localeSorted === 'boolean') { if (isNumber(format)) { index = format; format = undefined; } format = format || ''; } else { format = localeSorted; ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function foo5(a /* : number */, a2 /* : number */) /* : string => boolean => Foo */ {\n return s => b => ({\n moom: b,\n soup: s,\n nmb: a + a2 + 1\n })\n}", "function P$4(t){return t?[l$b(t[0]),l$b(t[1]),l$b(t[2]),l$b(t[3]),l$b(t[4]),l$b(t[5])]:[l$b(),l$b(),l$b(),l$b(),l$b(),l$b()]}", "funct...
[ "0.5453822", "0.5414574", "0.5402059", "0.53024715", "0.5250682", "0.51431453", "0.51302475", "0.50907373", "0.49966303", "0.49958006", "0.4973244", "0.4966433", "0.4916147", "0.4915344", "0.49099034", "0.49097955", "0.49097955", "0.49097955", "0.49097955", "0.49097955", "0.4...
0.0
-1
supports only 2.0style add(1, 's') or add(duration)
function add$1 (input, value) { return addSubtract$1(this, input, value, 1); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function Duration(time) {\n var d = document.createElement('span');\n d.classList.add('duration');\n d.innerText = time;\n return d;\n}", "function duration_add_subtract__add (input, value) {\n\t return duration_add_subtract__addSubtract(this, input, value, 1);\n\t }", "function duration_add_subt...
[ "0.6429438", "0.6106337", "0.6106337", "0.6106337", "0.6106337", "0.6106337", "0.6106337", "0.6106337", "0.6106337", "0.6106337", "0.6106337", "0.6106337", "0.6106337", "0.6082893", "0.6058429", "0.6012984", "0.6012984", "0.60103923", "0.58925086", "0.58925086", "0.58925086",...
0.0
-1
supports only 2.0style subtract(1, 's') or subtract(duration)
function subtract$1 (input, value) { return addSubtract$1(this, input, value, -1); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function duration_add_subtract__subtract (input, value) {\n\t return duration_add_subtract__addSubtract(this, input, value, -1);\n\t }", "function duration_add_subtract__subtract (input, value) {\n\t return duration_add_subtract__addSubtract(this, input, value, -1);\n\t }", "function durati...
[ "0.7399754", "0.7399754", "0.7399754", "0.7399754", "0.7399754", "0.7399754", "0.7399754", "0.7399754", "0.7399754", "0.7399754", "0.7399754", "0.7399754", "0.73797023", "0.7362792", "0.7362792", "0.7273233", "0.7273233", "0.7273233", "0.7273233", "0.7273233", "0.7273233", ...
0.0
-1
helper function for moment.fn.from, moment.fn.fromNow, and moment.duration.fn.humanize
function substituteTimeAgo(string, number, withoutSuffix, isFuture, locale) { return locale.relativeTime(number || 1, !!withoutSuffix, string, isFuture); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function $a(a,b){var c;\n// moment.duration._locale = moment._locale = data;\nreturn a&&(c=p(b)?bb(a):_a(a,b),c&&(vf=c)),vf._abbr}", "function $a(a,b){var c;\n// moment.duration._locale = moment._locale = data;\nreturn a&&(c=p(b)?bb(a):_a(a,b),c&&(vf=c)),vf._abbr}", "function $a(a,b){var c;\n// moment.duration...
[ "0.6559295", "0.6559295", "0.6559295", "0.6559295", "0.6475756", "0.63828397", "0.6327027", "0.6327027", "0.6327027", "0.6327027", "0.6327027", "0.6327027", "0.6327027", "0.6327027", "0.6327027", "0.6212658", "0.6122627", "0.6122627", "0.60974634", "0.60974634", "0.60974634",...
0.0
-1
This function allows you to set the rounding function for relative time strings
function getSetRelativeTimeRounding (roundingFunction) { if (roundingFunction === undefined) { return round; } if (typeof(roundingFunction) === 'function') { round = roundingFunction; return true; } return false; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function duration_humanize__getSetRelativeTimeRounding (roundingFunction) {\n if (roundingFunction === undefined) {\n return round;\n }\n if (typeof(roundingFunction) === 'function') {\n round = roundingFunction;\n return true;\n }\n ...
[ "0.72622484", "0.72409254", "0.72409254", "0.72409254", "0.72409254", "0.72409254", "0.72409254", "0.72409254", "0.70998174", "0.70998174", "0.70998174", "0.70998174", "0.70998174", "0.70998174", "0.70998174", "0.70998174", "0.70998174", "0.70998174", "0.70998174", "0.70998174"...
0.0
-1
This function allows you to set a threshold for relative time strings
function getSetRelativeTimeThreshold (threshold, limit) { if (thresholds[threshold] === undefined) { return false; } if (limit === undefined) { return thresholds[threshold]; } thresholds[threshold] = limit; if (threshold === 's') { thre...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function getSetRelativeTimeThreshold (threshold, limit) {\n if (thresholds[threshold] === undefined) {\n return false;\n }\n if (limit === undefined) {\n return thresholds[threshold];\n }\n thresholds[threshold] = limit;\n if (threshol...
[ "0.6979532", "0.6935547", "0.69083905", "0.69083905", "0.69083905", "0.69083905", "0.69083905", "0.69083905", "0.69026154", "0.69026154", "0.69026154", "0.69026154", "0.69026154", "0.69026154", "0.6896398", "0.6887791", "0.6873328", "0.68426573", "0.68257725", "0.68257725", "...
0.0
-1
Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE file distributed with this work for additional information regarding copyright ownership. The ASF licenses this file to you under the Apache License, Version 2.0 (the "License"); you may not use this file e...
function _default(properties) { // Normalize for (var i = 0; i < properties.length; i++) { if (!properties[i][1]) { properties[i][1] = properties[i][0]; } } return function (model, excludes, includes) { var style = {}; for (var i = 0; i < properties.length; i++) { var propName = pr...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "get path()\t\t{ return this.match[7] || \"\" }", "_getDirectMatchProps() {\n return ['file'];\n }", "function PathMapper() {\n\t}", "function PathMapper() {\n\t}", "resolveAsPath() { }", "get fullpath()\t{ return \"\" + this.prefix + this.path }", "function segment(WrappedComponent, mapping) {\n /...
[ "0.5330813", "0.52984315", "0.529492", "0.529492", "0.5274405", "0.5143759", "0.5018973", "0.501283", "0.4958384", "0.49160057", "0.49114686", "0.49084407", "0.48925844", "0.48905814", "0.4841846", "0.48293707", "0.4828044", "0.48060423", "0.47611177", "0.4760366", "0.4759058...
0.0
-1
which is reasonable. But dimension name is duplicated. Returns undefined or an array contains only object without null/undefiend or string.
function normalizeDimensionsDefine(dimensionsDefine) { if (!dimensionsDefine) { // The meaning of null/undefined is different from empty array. return; } var nameMap = createHashMap(); return map(dimensionsDefine, function (item, index) { item = extend({}, isObject(item) ? item : { name: item...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function getDimensionName() {\n var dummyRecord = {};\n Object.keys(dimensions).forEach(function(d) {\n dummyRecord[d] = d;\n });\n\n return dimensionFct(dummyRecord);\n }", "parseArrayDimension () {\n const dimToken = this.getToken();\n if(dimToken.type === this.lexerClass.INTEGER) {\n ...
[ "0.68834513", "0.61371076", "0.5990806", "0.59609914", "0.586945", "0.5856131", "0.57627916", "0.575407", "0.57120514", "0.55914956", "0.5591027", "0.55378836", "0.5502637", "0.5488591", "0.54847807", "0.54847807", "0.5290612", "0.52511287", "0.52511287", "0.5245239", "0.5233...
0.5711538
13
default encode making logic. And the default rule should depends on series? consider 'map'.
function makeDefaultEncode(seriesModel, datasetModel, data, sourceFormat, seriesLayoutBy, completeResult) { var coordSysDefine = getCoordSysDefineBySeries(seriesModel); var encode = {}; // var encodeTooltip = []; // var encodeLabel = []; var encodeItemName = []; var encodeSeriesName = []; var seriesType = ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "encode(ctx, encode) {\n const {marktype, channels} = encode,\n fn = ctx.functions,\n swap = marktype === 'group'\n || marktype === 'image'\n || marktype === 'rect';\n\n return (item, _) => {\n const datum = item.datum;\n let m = 0, v;\n\n for (const ...
[ "0.6003305", "0.54790604", "0.5398591", "0.53889954", "0.53614396", "0.531016", "0.5245948", "0.5194732", "0.5176595", "0.51000935", "0.5093149", "0.5070505", "0.5070505", "0.5070505", "0.5070505", "0.5070505", "0.5070505", "0.5070505", "0.5070505", "0.5070505", "0.5070505", ...
0.69167316
2
If return null/undefined, indicate that should not use datasetModel.
function getDatasetModel(seriesModel) { var option = seriesModel.option; // Caution: consider the scenario: // A dataset is declared and a series is not expected to use the dataset, // and at the beginning `setOption({series: { noData })` (just prepare other // option but no data), then `setOption({series: {dat...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function datasetDangerously () {}", "function useSelectedDataset() {\n let modUrl = \"/models-for-dataset?dataset=\" + getSelectedDatasetName();\n let imgUrl = \"/dataset-details?dataset=\" + getSelectedDatasetName();\n\n populateModels(modUrl);\n populateStaticImages(imgUrl);\n}", "get dataset() {...
[ "0.6384554", "0.6067768", "0.56133175", "0.55288565", "0.5475066", "0.53938586", "0.5337803", "0.53140265", "0.5255647", "0.5209002", "0.5209002", "0.5209002", "0.5186419", "0.51407415", "0.5140565", "0.5138516", "0.50701576", "0.50483054", "0.50458163", "0.49737072", "0.4962...
0.6283021
5
Build axisPointerModel, mergin tooltip.axisPointer model for each axis. allAxesInfo should be updated when setOption performed.
function collect(ecModel, api) { var result = { /** * key: makeKey(axis.model) * value: { * axis, * coordSys, * axisPointerModel, * triggerTooltip, * involveSeries, * snap, * seriesModels, * seriesDataCount * } */ ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function saveTooltipAxisInfo(fromTooltip, triggerTooltip, axis) {\n var axisPointerModel = axis.model.getModel('axisPointer', globalAxisPointerModel);\n var axisPointerShow = axisPointerModel.get('show');\n\n if (!axisPointerShow || axisPointerShow === 'auto' && !fromTooltip && !isHandleTrigger(axis...
[ "0.5693873", "0.5636385", "0.5636385", "0.5636385", "0.5636385", "0.5636385", "0.5636385", "0.5636385", "0.5636385", "0.56148744", "0.55848104", "0.55848104", "0.5581302", "0.5558696", "0.5493384", "0.5264039", "0.507943", "0.49443126", "0.49220106", "0.49116898", "0.48798317...
0.0
-1
fromTooltip: true | false | 'cross' triggerTooltip: true | false | null
function saveTooltipAxisInfo(fromTooltip, triggerTooltip, axis) { var axisPointerModel = axis.model.getModel('axisPointer', globalAxisPointerModel); var axisPointerShow = axisPointerModel.get('show'); if (!axisPointerShow || axisPointerShow === 'auto' && !fromTooltip && !isHandleTrigger(axisPointerMo...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "tooltipClicked() {}", "setTooltip(valueNew){let t=e.ValueConverter.toString(valueNew);null===t&&(t=this.getAttributeDefaultValueInternal(\"Tooltip\")),t!==this.__tooltip&&(this.__tooltip=t,e.EventProvider.raise(this.__id+\".onPropertyChanged\",{propertyName:\"Tooltip\"}),this.__processTooltip())}", "toggleTool...
[ "0.7494436", "0.73168004", "0.7181213", "0.715156", "0.70786935", "0.70663327", "0.69018006", "0.68914866", "0.6801135", "0.677454", "0.6710075", "0.6703516", "0.6672522", "0.6609714", "0.66061527", "0.65261465", "0.65257114", "0.65245795", "0.65063286", "0.65041316", "0.6481...
0.0
-1
Check if the given character code, or the character code at the first character, is decimal.
function decimal(character) { var code = typeof character === 'string' ? character.charCodeAt(0) : character return code >= 48 && code <= 57 /* 0-9 */ }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function decimal(character) {\n var code = typeof character === 'string' ? character.charCodeAt(0) : character;\n return code >= 48 && code <= 57; /* 0-9 */\n}", "function _isDecimalDigit(ch) {\n return ch >= 48 && ch <= 57; // 0...9\n }", "function isdecimal(num) {\n return (/^\\d+(\\.\\d+)?$/.te...
[ "0.79054266", "0.7266932", "0.67030036", "0.6647496", "0.66463494", "0.6593356", "0.65619695", "0.65289533", "0.6522555", "0.6487612", "0.6487612", "0.6465668", "0.6428157", "0.6406563", "0.6406563", "0.6393902", "0.63832724", "0.6336196", "0.6335597", "0.6279863", "0.6278032...
0.7949005
4
Removes all keyvalue entries from the hash.
function hashClear() { this.__data__ = nativeCreate ? nativeCreate(null) : {}; this.size = 0; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "clear() {\n var map = this._map;\n var keys = Object.keys(map);\n\n for (var i = 0; i < keys.length; i++) {\n var key = keys[i];\n map[key].clear();\n }\n }", "function clear() {\n this.keys.forEach((key) => {\n this._store[key] = undefined;\n delete this._store[key];\n });\n}", ...
[ "0.67325383", "0.66216296", "0.6511944", "0.6454195", "0.6214277", "0.6200593", "0.61385626", "0.61101323", "0.6029097", "0.5966128", "0.5934792", "0.5905935", "0.5905935", "0.5905935", "0.5903774", "0.5899288", "0.5899288", "0.5899288", "0.58634514", "0.58634514", "0.5863451...
0.0
-1
Removes all keyvalue entries from the list cache.
function listCacheClear() { this.__data__ = []; this.size = 0; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function listCacheClear(){this.__data__=[];}", "function listCacheClear(){this.__data__=[];}", "function listCacheClear(){this.__data__=[];}", "function listCacheClear(){this.__data__=[];}", "function listCacheClear() {\n\t\t this.__data__ = [];\n\t\t this.size = 0;\n\t\t}", "function listCacheClear() ...
[ "0.7357779", "0.7357779", "0.7357779", "0.7357779", "0.7317932", "0.72645503", "0.72645503", "0.7262977", "0.72569066", "0.72569066", "0.7236393", "0.7236393", "0.7236393", "0.7236393", "0.7236393", "0.7236393", "0.7236393", "0.7236393", "0.7236393", "0.7236393", "0.7234546",...
0.0
-1