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
returns last known position
get position() { if (!position || (Date.now() - position.timestamp > positionTTL)) { updatePosition(); } return position; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function GetLastPosition(index) {\n\n if(index == 0) {\n return 0;\n } else {\n index--;\n if (Sequence[\"Steps\"][index+1][\"Type\"] == 1) {\n return Sequence[\"Steps\"][index+1][\"Params\"][\"Position\"];\n } else {\n return GetLastPosition(index);\n ...
[ "0.76008767", "0.7581431", "0.7549097", "0.71990484", "0.6991204", "0.68937105", "0.68761545", "0.68006766", "0.6771463", "0.6736989", "0.6710569", "0.66946036", "0.6681814", "0.66597116", "0.6628878", "0.65778977", "0.65237814", "0.6476147", "0.64644533", "0.6464182", "0.646...
0.0
-1
Validate pass, throws error if missing a mandatory toplevel field or image.
validate() { // Check required top level fields for (const requiredField of [ 'description', 'organizationName', 'passTypeIdentifier', 'serialNumber', 'teamIdentifier', ]) if (!(requiredField in this.fields)) ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "validate(step) {\n switch (step) {\n case 0:\n if (this.state.title.length > 2) {\n return true;\n }\n break;\n case 1:\n if (this.state.image) {\n return true;\n }\n break;\n default:\n return false;\n }\n return false;\n ...
[ "0.6052738", "0.59401494", "0.57224333", "0.5655335", "0.5597503", "0.55292714", "0.55032676", "0.54722726", "0.5449928", "0.54017055", "0.5382798", "0.5269438", "0.52690697", "0.52690214", "0.5250547", "0.52142346", "0.5213904", "0.5207206", "0.5203456", "0.5202911", "0.5184...
0.64043903
0
osVersion, platform, releaseVersion, manufacturer, model / Lifecycle Methods
constructor(props) { super(props); this.state = { email: '', password: '', width:ScreenService.getScreenSize().width, height:ScreenService.getScreenSize().height, extraHeight:0 }; _this = this; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "get osVersion() {\n return this.getStringAttribute('os_version');\n }", "get hardwareVersion() {\n return this.sysInfo.hw_ver;\n }", "get platformVersion() {\n return this.getStringAttribute('platform_version');\n }", "init() {\r\n\t\tthis.sendCommand(\"get/System/SoftwareVersio...
[ "0.65045303", "0.632505", "0.6226153", "0.59357136", "0.58087367", "0.56582224", "0.56525415", "0.5630876", "0.5629224", "0.5576233", "0.5553418", "0.55516165", "0.55413365", "0.5536486", "0.5536486", "0.5525218", "0.55212843", "0.5501992", "0.5501992", "0.5490952", "0.545736...
0.0
-1
means import all, it is old js framework
function CourseListComponent_tr_19_Template(rf, ctx) { if (rf & 1) { _angular_core__WEBPACK_IMPORTED_MODULE_2__["ɵɵelementStart"](0, "tr"); _angular_core__WEBPACK_IMPORTED_MODULE_2__["ɵɵelementStart"](1, "td"); _angular_core__WEBPACK_IMPORTED_MODULE_2__["ɵɵtext"](2); _angular_core__WEBPACK_IMPORTED_MODU...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "import() {\n }", "function myImport() {\n\tvar args = Array.prototype.slice.call(arguments);\n var filename = args.shift();\n if (typeof(filename) == typeof(undefined)) {\n return;\n }\n var preImport = function(args){myImport.apply(null, args);};\n var next = function(){preImport(args);...
[ "0.67495006", "0.6309636", "0.62665874", "0.6179657", "0.5973394", "0.5968337", "0.5908268", "0.58464646", "0.5798183", "0.5783327", "0.5747853", "0.57310194", "0.57117325", "0.5695171", "0.5678511", "0.5677556", "0.56603706", "0.56583947", "0.5652118", "0.5624471", "0.562419...
0.0
-1
dependancy injection instead of using httpObj:HttpClient = new HttpClient()
constructor(httpObj, globalObj) { this.httpObj = httpObj; this.globalObj = globalObj; this.courseObj = new _app_app_model__WEBPACK_IMPORTED_MODULE_0__["Course"](); //binded with UI this.courseList = new Array(); //collection //errorM: string = ''; this.errorList = new Arr...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "constructor(http) {\n this.http = http;\n }", "constructor(http) {\n this.http = http;\n }", "bindHttpClient() {\n\t\tthis.app.singleton('http', HttpClient);\n\t}", "constructor(http){\n this.http = http;\n }", "bindHttpClient() {\n this.app.singleton('http', _Client.defaul...
[ "0.7141536", "0.7141536", "0.7109813", "0.7088854", "0.7064491", "0.6997928", "0.6919777", "0.69159055", "0.6869317", "0.6496202", "0.6473604", "0.6377858", "0.6343975", "0.63417166", "0.6295573", "0.62305665", "0.6226988", "0.6218111", "0.6143273", "0.61407876", "0.61357546"...
0.0
-1
used for edit to display the customer obj response we get from server, create a new customer obj with a formgroup, then display to the angular UI
Select(selected) { this.courseObj = new _app_app_model__WEBPACK_IMPORTED_MODULE_0__["Course"](); this.courseObj.id = selected.id; this.courseObj.courseName = selected.courseName; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function saveCustomers(customerId){ \n $scope.editCustomerValues = {\n \"action\": \"edit\",\n \"cAddress\": $scope.customer.customerAddress,\n \"cContact\": $scope.customer.customerContact,\n \"cDOB\": $scope.customer.customerDOB,\n ...
[ "0.6892824", "0.65846795", "0.6446805", "0.64370006", "0.6418055", "0.63867486", "0.6305739", "0.61852825", "0.6171652", "0.6167477", "0.61581", "0.60584664", "0.6055365", "0.60493153", "0.6028797", "0.6023856", "0.6013575", "0.5998468", "0.5996979", "0.5957259", "0.5946739",...
0.0
-1
Function to pass state values as props
function mapStateToProps(state,ownProps) { return { categories: state.itemCatData.categories, CBMUsed : state.itemCatData.CBMUsed, daysOnHand: state.itemCatData.daysOnHand } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function mapStatetoProps(state) {\n return state;\n}", "function mapStatetoProps(state){\n // this function will return an object\n // property will be the props in this component\n // the value will be the piece of state from the reducer \n return{\n students: state.students\n } \n}", "...
[ "0.6379288", "0.63494456", "0.63267016", "0.6305316", "0.6276386", "0.623401", "0.6200577", "0.6193438", "0.61825645", "0.6159468", "0.6155267", "0.61547244", "0.61416423", "0.6083643", "0.6074041", "0.60607255", "0.6046611", "0.60328263", "0.60267085", "0.60262483", "0.60198...
0.0
-1
febo[2] = febo[21] + febo[22]; febo[3] = febo[31] + febo[32]; febo[4] = febo[41] + febo[42]; febo[5] = febo[51] + febo[52]; febo[6] = febo[61] + febo[62]; console.log(febo);
function febonacci(n){ let febo = [0,1]; for(let i = 2; i <= n; i++){ febo[i] = febo[i - 1] + febo [i- 2]; } return febo; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function fibTabulation(n) {\n\nlet arrOfFib = new Array(n + 1).fill(0);\narrOfFib[1] = 1;\nfor(let i = 0; i < arrOfFib.length; i++) {\n\ncurruntPosition = arrOfFib[i];\nif(arrOfFib[i + 1] !== undefined) arrOfFib[i + 1] += curruntPosition;\nif( arrOfFib[i + 2] !== undefined) arrOfFib[i + 2] += curruntPosition;\n}...
[ "0.6053161", "0.59876907", "0.59506285", "0.5937577", "0.5819511", "0.58178985", "0.57603866", "0.5732016", "0.5658621", "0.56413585", "0.5627399", "0.562441", "0.5614659", "0.56111646", "0.56083", "0.5604013", "0.5599326", "0.55761397", "0.5559701", "0.5552445", "0.55353224"...
0.6336161
0
function to add a new forum Forum Category
function addForum(forum) { var deferred = $q.defer(); $http.post(BASE_URL + '/forum/new', forum).then( function(response) { debugger; deferred.resolve(response.data); }, function(errResponse...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function addCategory() {\n ajaxCall('action=add-category&new_category=' + categoryName.value.trim(),\n function(response) {\n categoryCloseButton.click();\n console.log(response);\n var data = JSON.parse(response);\n console.log(data);\n...
[ "0.71855116", "0.6952776", "0.67555237", "0.655294", "0.6528289", "0.6401261", "0.6322916", "0.62967294", "0.626254", "0.62321234", "0.6223982", "0.6215711", "0.61882836", "0.6140136", "0.60973424", "0.60874057", "0.6074364", "0.60376906", "0.60346496", "0.601167", "0.5970688...
0.6269026
8
Function to fetch list of forum categories
function fetchForums() { var deferred = $q.defer(); $http.get(BASE_URL + '/forum/list').then( function(response) { deferred.resolve(response.data); }, function(errResponse) { ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "async categories() {\n return await this.fetch(\"/categories/list\");\n }", "function getCategories() {\n \n // API call to get categories\n fetch(\"https://my-store2.p.rapidapi.com/catalog/categories\", {\n \"method\": \"GET\",\n \"headers\": {\n ...
[ "0.73337674", "0.68696", "0.6835657", "0.68116343", "0.67916155", "0.6790551", "0.6786086", "0.6769596", "0.67448694", "0.6712481", "0.67122555", "0.6707594", "0.66864556", "0.66385937", "0.66104466", "0.6600565", "0.6567849", "0.65167594", "0.64881134", "0.6471172", "0.64617...
0.57998955
89
Function for viewing single blog using blog id as a parameter
function viewForum(id) { var deferred = $q.defer(); $http.get(BASE_URL + '/forum/' + id) .then ( function(response) { deferred.resolve(response.data); }, ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function getBlog(id) {\n return BLOGS.filter((blog) => blog.id === id)[0];\n}", "function viewBlog(id) {\n console.log('Inside factory now');\n var deferred = $q.defer();\n\n $http.get(blogUrl + '/blog/' + id)\n .then (\n function(response) {\n ...
[ "0.73965484", "0.7137955", "0.7106256", "0.69210166", "0.68001467", "0.6707746", "0.6511975", "0.6421637", "0.63565695", "0.63347644", "0.6334115", "0.62389684", "0.6204039", "0.6181308", "0.60882294", "0.60880303", "0.6073551", "0.60581195", "0.6057848", "0.6045875", "0.5984...
0.0
-1
Function to send forum join request
function joinRequest() { var deferred = $q.defer(); var id = $rootScope.currentUser.userId; var forumId = $routeParams.id; $http.post(BASE_URL + '/forum/request/' + id, forumId) .then ( ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function forum(request, response){\r\n //prints message\r\n console.log(\"user requested 'forum'\");\r\n}", "async cmd_join_guild(params) {\n let [ to ] = params\n\n let toGuild = GUILDS[to.toUpperCase()]\n\n if ( !toGuild ) throw {\n reason: `guild \"${to}\" not found`,\n ...
[ "0.6789706", "0.6614352", "0.6266754", "0.61573726", "0.6123664", "0.6091793", "0.5982903", "0.59480554", "0.5945322", "0.5921698", "0.59154814", "0.5912359", "0.5908673", "0.57911485", "0.57791215", "0.5742866", "0.5729814", "0.5713792", "0.56921124", "0.56811696", "0.561872...
0.75891036
0
Function to fetch the list of ParticipatedUsers
function getParticipatedUsers(id) { var deferred = $q.defer(); $http.get(BASE_URL + '/forum/participatedUsers/list/' + id) .then ( function(response) { deferred.resolve(response.data); ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function fetchUsers() {\n skygear.publicDB.query(\n new skygear.Query(skygear.UserRecord)\n .contains('_id', this.props.conversation.participant_ids)\n ).then(userList => {\n const {title} = this.props.conversation;\n let names = userList\n .filter(u => u._id !== skygear.currentUser.id)\n ....
[ "0.6622603", "0.65787953", "0.6450901", "0.6430241", "0.64064074", "0.63719827", "0.6370151", "0.63700664", "0.63657", "0.6330906", "0.63258183", "0.63204664", "0.6307635", "0.6276863", "0.6272696", "0.6221265", "0.62131524", "0.621198", "0.62102", "0.6206083", "0.6206057", ...
0.74836195
0
function to add a new forum post
function addForumPost(forumPost) { var deferred = $q.defer(); var forumId = $routeParams.id; $http.post(BASE_URL + '/forum/post/new/' + forumId, forumPost).then( function(response) { debugger; def...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function addPost(post) {\n return db.query(\"insert into post (user_id, post_subject, post_content, post_topic_code) \"\n + \"values ( ?, ?, ?, ? );\", [post.user_id, post.subject, post.content, post.topic]);\n}", "function addForum(forum) {\r\n\r\n var deferred = $q.defer();\r\n\r\n ...
[ "0.7426806", "0.7166638", "0.7161405", "0.713439", "0.7008181", "0.6914009", "0.6843478", "0.66705036", "0.666279", "0.66460276", "0.654395", "0.65322876", "0.6509974", "0.6499214", "0.6491834", "0.6471998", "0.6446496", "0.6436849", "0.6426053", "0.64189714", "0.64172053", ...
0.7650806
0
Function to fetch forum post list
function fetchBlogPosts(forumId) { console.log('Inside factory now'); var deferred = $q.defer(); $http.get(BASE_URL+ '/forum/posts/list/' + forumId) .then ( function(response) { deferred.resolve(response....
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function fetchForums() {\r\n \r\n var deferred = $q.defer();\r\n\r\n $http.get(BASE_URL + '/forum/list').then(\r\n function(response) {\r\n deferred.resolve(response.data);\r\n }, function(errResponse) {\r\n ...
[ "0.75132203", "0.71600026", "0.70011055", "0.6828441", "0.66958106", "0.66653126", "0.6530338", "0.65266263", "0.6500923", "0.6393391", "0.6351359", "0.6349457", "0.6348038", "0.6329266", "0.63269395", "0.63134265", "0.6288153", "0.623128", "0.62191236", "0.6204043", "0.61734...
0.681404
4
Function to fetch forum join request with pending status
function fetchForumRequests() { var deferred = $q.defer(); $http.get(BASE_URL + '/forum/request/list') .then ( function(response) { deferred.resolve(response.data); }, ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function joinRequest() {\r\n \r\n var deferred = $q.defer();\r\n var id = $rootScope.currentUser.userId;\r\n var forumId = $routeParams.id;\r\n $http.post(BASE_URL + '/forum/request/' + id, forumId)\r\n .then (\r\n ...
[ "0.70890456", "0.5880734", "0.560514", "0.5588742", "0.5562283", "0.5537251", "0.553689", "0.5491478", "0.54892176", "0.5442147", "0.5378268", "0.5353447", "0.53101736", "0.52475", "0.52278984", "0.51853406", "0.51584524", "0.5139711", "0.51174253", "0.5110747", "0.5109524", ...
0.6447268
1
Function to change status pending forum request
function changeFRStatus(id) { var deferred = $q.defer(); $http.post(BASE_URL + '/forum/request/approval/' + id) .then ( function(response) { deferred.resolve(response.data); }, ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function updateStatus(userid, div, flag) {\n\t \n\t divId = div;\n\t adminFlag = flag;\n\t var request = userid + \" \" + flag;\n\t XHR = createXHR();\n\t if(XHR) {\n\t \t\tXHR.onreadystatechange = approveReject;\n\t\t\tXHR.open(\"POST\", 'approveRevoke.do', true);\n\t\t\tXHR.setRequestHeader(\"Content-Type\", \"...
[ "0.6420099", "0.64087224", "0.62655014", "0.6087767", "0.5948153", "0.59400463", "0.59379786", "0.59107155", "0.58966506", "0.5826546", "0.5813017", "0.58124804", "0.57952803", "0.5777947", "0.577379", "0.5772588", "0.5771255", "0.5770304", "0.57627594", "0.5755373", "0.57401...
0.68732375
0
clear all the squares
function clearBoard(){ for(var i=0;i<squares.length;i++) squares[i].textContent = ''; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "reset() {\n this.domSquares.forEach(square => {\n this.setSquare(square, '');\n });\n }", "function clearBoard() {\n for (i=0; i<=maxX; i++) {\n for (j=0; j<=maxY; j++) {\n with (cellArray[arrayIndexOf(i,j)]) {\n isExposed = false;\n isBomb = false...
[ "0.7878449", "0.77744144", "0.7759135", "0.7741784", "0.76756054", "0.76468205", "0.7610988", "0.758618", "0.7534789", "0.7506241", "0.7503319", "0.746913", "0.7459417", "0.7431464", "0.7428059", "0.73908806", "0.7346691", "0.7317596", "0.7313415", "0.72863513", "0.72793156",...
0.735676
16
DEMO: [ ] create Request Entity to get single planet: [ ] return the JSON response of the request on a route /planet/:planetId.json [ ] create function reducer that returns an HTML with information of the planet [ ] return the HTML response of the request & the html reducer on route /planet/:planetId
async function main() { const app = express(); const port = 3000; const dp = DataPoint.create(); // json route: /planet/:planetId.json // html route: /planet/:planetId app.listen(port, () => console.log(`Example app listening on port ${port}!`)); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "byId(req, res) {\n PetsService.byId(req.params.id)\n .then((result) => {\n res.json(result);\n })\n .catch((error) => {\n res.status(500).json(error);\n });\n }", "function reqPlanet() {\n\t\tif(this.status === 404){\n\t\tthrowError();\n\t}\n\tconst requestData = JSON.parse(...
[ "0.6323932", "0.5927074", "0.5813922", "0.5534477", "0.5502104", "0.5489562", "0.5483014", "0.54650384", "0.5459176", "0.543188", "0.54223585", "0.5417086", "0.54065067", "0.5406392", "0.5383237", "0.53760105", "0.5358678", "0.53457105", "0.5340561", "0.533003", "0.53292996",...
0.5998931
1
handleChange function pass to each input for update their data state
function handleChange(event, index = null) { // ! ****************************************************** /* because We have two array elements , we check if index of those Array element not null if not 👇 */ if (index !== null) { // call array from formState const arr = [...formState[event.target.name]]; ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "handleChange(event) {\n let field = event.target.name; // which input\n let value = event.target.value; // what value\n\n let changes = {}; // object to hold changes\n changes[field] = value; // change this field\n this.setState(changes); // update state\n }", "handleChange(...
[ "0.7624438", "0.7553042", "0.7410126", "0.738636", "0.73750687", "0.72920054", "0.72726357", "0.7256161", "0.72508776", "0.7196034", "0.71843016", "0.71832985", "0.71729106", "0.7161879", "0.7156882", "0.7154943", "0.7151451", "0.7143824", "0.7114696", "0.71049124", "0.709789...
0.0
-1
! This one call in input type file for uploading image
async function handleImageFile(e) { const file = e.target.files[0]; setFileName(file.name); if (file) { let imageData; const data = new FormData(); data.append('file', file); data.append('upload_preset', 'ljxjnqss'); imageData = await uploadPostImage(data); setImgFromCloud(imageData); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "click_input (event) {\r\n file = event.target.files[0];\r\n this.$parent.upload_image(file);\r\n }", "function InputUpload(e){\n var files = e.target.files;\n var file = files[0];\n if (isValid(file)){\n loadPreview(file);\n uploadImage(file);\n }\n}", "function upl...
[ "0.7709791", "0.7460398", "0.74539244", "0.74526244", "0.74526244", "0.7433641", "0.728901", "0.70640856", "0.7045961", "0.70265913", "0.7003611", "0.6998142", "0.69769603", "0.69693625", "0.6957562", "0.6897619", "0.68795484", "0.68529034", "0.68444026", "0.68423784", "0.682...
0.70541155
8
Handle Submit for Add
async function handleSubmit(event) { event.preventDefault(); // if condition not null we can do update if (props.food) { props.handleUpdate( // specfically add img to formState { ...formState, img: imgFromCloud.data.secure_url }, props.food.id ); } else { const { title, url, ingredients, d...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "handleAddSubmit() {}", "function handleAdd(){\n console.log('clicked on Submit button');\n\n let newTask = {\n task: $('#taskIn').val()\n }\n // run addTask with newTask variable\n addTask(newTask);\n\n // empty input task\n $('#taskIn').val('')\n} // end handleAdd", "function handl...
[ "0.8211756", "0.7095814", "0.7064653", "0.69943535", "0.6989508", "0.68981093", "0.68559617", "0.6833828", "0.6821554", "0.6806422", "0.6788468", "0.67788196", "0.6752858", "0.67448556", "0.6722707", "0.67135215", "0.67059886", "0.6638989", "0.66355103", "0.6633483", "0.66153...
0.0
-1
Adapted from convertsourcemap (MIT)
function toComment(sourceMap) { // eslint-disable-next-line no-undef var base64 = btoa(unescape(encodeURIComponent(JSON.stringify(sourceMap)))); var data = 'sourceMappingURL=data:application/json;charset=utf-8;base64,' + base64; return '/*# ' + data + ' */'; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function extractSourceMap(fs, logger, file) {\n var inline = convert_source_map_1.commentRegex.test(file.text);\n var external = convert_source_map_1.mapFileCommentRegex.exec(file.text);\n if (inline) {\n var inlineSourceMap = convert_source_map_1.fromSource(file.text);\n ...
[ "0.6966464", "0.69360375", "0.6764034", "0.64398926", "0.6327182", "0.62972784", "0.625466", "0.62094045", "0.619243", "0.6179658", "0.6173272", "0.6158152", "0.6158152", "0.6158152", "0.6154658", "0.60939026", "0.603713", "0.5988026", "0.59799474", "0.5977742", "0.59769917",...
0.0
-1
Translates the list format produced by cssloader into something easier to manipulate.
function listToStyles (parentId, list) { var styles = [] var newStyles = {} for (var i = 0; i < list.length; i++) { var item = list[i] var id = item[0] var css = item[1] var media = item[2] var sourceMap = item[3] var part = { id: parentId + ':' + i, css: css, media: medi...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function listToStyles(parentId, list) {\n var styles = [];\n var newStyles = {};\n\n for (var i = 0; i < list.length; i++) {\n var item = list[i];\n var id = item[0];\n var css = item[1];\n var media = item[2];\n var sourceMap = item[3];\n ...
[ "0.6305201", "0.629988" ]
0.0
-1
globals __VUE_SSR_CONTEXT__ IMPORTANT: Do NOT use ES2015 features in this file (except for modules). This module is a runtime utility for cleaner component module output and will be included in the final webpack user bundle.
function normalizeComponent ( scriptExports, render, staticRenderFns, functionalTemplate, injectStyles, scopeId, moduleIdentifier, /* server only */ shadowMode, /* vue-cli only */ components, // fixed by xxxxxx auto components renderjs // fixed by xxxxxx renderjs ) { // Vue.extend constructor expo...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function Es(t,e,n,i,r,o,a,s){var u=(\"function\"===typeof n?n.options:n)||{};return u.__file=\"source.vue\",u.render||(u.render=t.render,u.staticRenderFns=t.staticRenderFns,u._compiled=!0,r&&(u.functional=!0)),u._scopeId=i,u}", "extend(config, ctx) {\n // if (process.server && process.browser) {\n if (...
[ "0.5848036", "0.57285064", "0.5725956", "0.5725956", "0.5725956", "0.5725956", "0.5725956", "0.5725956", "0.5725956", "0.5725956", "0.5725956", "0.5725956", "0.5725956", "0.5725956", "0.5725956", "0.5725956", "0.5725956", "0.5725956", "0.5725956", "0.5725956", "0.5725956", ...
0.0
-1
how do we ensure proper handling of success and error?
async function canRejectOrReturn() { await new Promise((resolve) => { setTimeout(() => resolve(), 100); }); if (Math.random() > 0.1) { throw new Error('number too bigggg'); } return 'perfect numberrrr!'; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "handleFailure (error_)\n\t{\n\t\tthrow error_;\n\t}", "function processErrors(data){\n \n}", "error(error) {}", "function failureCB(){}", "handleFailure (error_)\n\t{\n\t\t// todo: Undo all actions\n\t\tthis.cleanup ();\n\t\tthrow error_;\n\t}", "isSuccess(status, _headers, _payload) {\n retu...
[ "0.68644756", "0.6437789", "0.6386393", "0.6362017", "0.634553", "0.6300784", "0.61934507", "0.6192089", "0.61875206", "0.6165207", "0.61575955", "0.61485237", "0.61485237", "0.61485237", "0.61485237", "0.60680604", "0.6067045", "0.5986048", "0.59582305", "0.5943143", "0.5941...
0.0
-1
if we want to run this n times.
async function runMany(numTimesToRun) { for (let i = 0; i < numTimesToRun; i++) { const result = await foo(); console.log(`result of iteration ${i + 1}:`, result); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function repeat_(n, action) {\n for(let i = 0; i < n; i++) {\n action(i)\n }\n}", "function repeat(fn,n){\n\tfor(x=0; x<n; x++){\n\t\tfn();\n\t}\n}", "function repeat(fn, n) {\n for (let i = 0; i < n; i++)\n fn();\n}", "function repeatCall(fn, n, arg) {\n if (n > 0) {\n fn(arg);\n r...
[ "0.7481603", "0.74601305", "0.73618233", "0.73613214", "0.7357176", "0.7261655", "0.72054493", "0.7134546", "0.7052468", "0.70230305", "0.6933158", "0.68519336", "0.68510574", "0.67930496", "0.67823493", "0.6715938", "0.669619", "0.66770416", "0.66770416", "0.6657246", "0.664...
0.0
-1
Section Functions prepare section
function section_prepareLoad(sectionID){ if(this.verbose)console.log('Navigation | section_prepareLoad: '+sectionID); if(FLOCK.sections[sectionID]['prepare']){ console.log('section '+sectionID+' has prepare function') } if(!FLOCK.sections[sectionID].prepared){ if...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "prepare() {}", "function section_prepareLoad(sectionID){\n if(this.verbose)console.log('Navigation | section_prepareLoad: '+sectionID);\n\n if (oblio.sections[sectionID].prepare) {\n console.log('section ' + sectionID + ' has prepare function');\n }\n if (!oblio.sections[se...
[ "0.6627855", "0.6458028", "0.6353807", "0.5979318", "0.5925957", "0.58988285", "0.58282584", "0.57572556", "0.56834054", "0.5654978", "0.5584856", "0.5578434", "0.5577731", "0.5528543", "0.5505117", "0.5505117", "0.5501985", "0.54994667", "0.5483909", "0.54774624", "0.5472711...
0.62863225
3
adding htmlData to DOM
function section_add(sectionID, callbackFn){ if(this.verbose)console.log('Navigation | section_add: '+sectionID); var shell = (FLOCK.sections[sectionID] && FLOCK.sections[sectionID].shell)?FLOCK.sections[sectionID].shell:"#"+this.shell; if(FLOCK.sections[sectionID] && !FLOCK.sections[sectionID]...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function addData2(data, target) {\n let htmlString = data;\n document.querySelector(target).innerHTML = htmlString;\n}", "set data(html: string) {\n const data = parseHtml(html, {\n onTransform: this.transformNode,\n allowScript: true,\n });\n this._data = data;\n ...
[ "0.6708483", "0.6568475", "0.6511393", "0.65023375", "0.6475021", "0.6475021", "0.64332545", "0.63888633", "0.62758577", "0.62326443", "0.6174246", "0.6079917", "0.6015631", "0.5990636", "0.5963137", "0.59488726", "0.59378177", "0.5926469", "0.591703", "0.5892715", "0.5883454...
0.0
-1
remove htmlData from DOM
function section_remove(sectionID, callbackFn){ if(this.verbose)console.log('Navigation | section_remove '+sectionID); if(!FLOCK.sections[sectionID]){ callbackFn(); return; } var shell = (FLOCK.sections[sectionID] && FLOCK.sections[sectionID].shell)?FLOCK.sections[sectionID].shell:...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "remove () {\n this.html.remove();\n }", "function strip(html){\n var doc = new DOMParser().parseFromString(html, 'text/html');\n return doc.body.textContent || \"\";\n }", "limpiarHTML(){\n while(detPedido.firstChild) {\n detPedido.removeChild( detPedido.firstChild)...
[ "0.7030822", "0.6794371", "0.67791975", "0.6750809", "0.6708215", "0.6706716", "0.66742235", "0.6628956", "0.66135377", "0.6409517", "0.6402724", "0.6360811", "0.62986755", "0.6291971", "0.6250184", "0.62483", "0.62341076", "0.6233595", "0.62065905", "0.6196739", "0.6194305",...
0.0
-1
Enable / Disable Functions enable navigation
function enable(completeFn){ if(this.verbose)console.log('/////// navigation_enable /////////'); this.active = true; if(this.cover)this.cover.style.display = 'none'; if(completeFn)completeFn(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function enableWalking () {\n // This method shows links on SV and enables users to walk.\n if (!status.lockDisableWalking) {\n // Enable clicking links and changing POV\n showLinks();\n $spanModeSwitchWalk.css('opacity', 1);\n status.disableWalking = false...
[ "0.64477766", "0.6424261", "0.6221799", "0.621422", "0.61669946", "0.6144627", "0.60933566", "0.60720813", "0.606194", "0.602849", "0.6014845", "0.6004432", "0.5999894", "0.59978247", "0.59657484", "0.5952448", "0.58879805", "0.5854373", "0.58240443", "0.5816654", "0.57993585...
0.72207266
1
freeze site when external link launched
function freezeSite(){ if(this.verbose)console.log('navigation_freezeSite'); if(FLOCK.sections[sectionID]['freeze']){ FLOCK.sections[sectionID]['freeze'](); } /* tween in a cover of some sort */ // TweenLite.to($('#freezeSite'), 0.5, {css: {opacity: 1}}); /* ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function freezeSite(){\n if(this.verbose)console.log('navigation_freezeSite');\n\n if (oblio.sections[sectionID].freeze) {\n oblio.sections[sectionID].freeze();\n }\n }", "function unFreezeSite(){\n if(this.verbose)console.log('navigation_unFreezeSite');\n\n if (o...
[ "0.67767394", "0.64403796", "0.6293168", "0.61951244", "0.58683324", "0.5831032", "0.5818379", "0.5764993", "0.57596976", "0.5733844", "0.5721857", "0.57164115", "0.57055706", "0.5697624", "0.5680186", "0.567721", "0.5643564", "0.5640939", "0.5587937", "0.55828184", "0.557757...
0.6447899
1
unfreeze site when returning from external link
function unFreezeSite(){ if(this.verbose)console.log('navigation_unFreezeSite'); if(FLOCK.sections[sectionID]['unfreeze']){ FLOCK.sections[sectionID]['unfreeze'](); } /* if the sound was on before the freeze, turn it back on */ // if(freezeSoundWasOn)soundToggle(); ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function unFreezeSite(){\n if(this.verbose)console.log('navigation_unFreezeSite');\n\n if (oblio.sections[sectionID].unfreeze) {\n oblio.sections[sectionID].unfreeze();\n }\n }", "function freezeSite(){\n if(this.verbose)console.log('navigation_freezeSite');\n\n i...
[ "0.68367165", "0.6213033", "0.6208285", "0.6167115", "0.6061243", "0.60030496", "0.59495354", "0.5879012", "0.58458656", "0.58287066", "0.5825945", "0.58188313", "0.5766427", "0.5750286", "0.56786555", "0.56645817", "0.5624032", "0.5622814", "0.5593377", "0.5561127", "0.55554...
0.6532845
1
TODO share this with mainscripts.js
function getBarWidth(currentBar, currentPointRect, pointList){ var maxWidth = currentPointRect.parent.width; var nextX = maxWidth - currentPointRect.width / 2 for(var i=0;i<pointList.length;i++){ if (pointList[i].isPoint != undefined && pointList[i].isPoint == "true") { if(pointList[i].x < nextX && pointList[...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function _____SHARED_functions_____(){}", "function _main() {\n window.tools = {} || window.tools;\n window.tools.log = _log;\n }", "function _main() {\n try {\n // the modules own main routine\n //_logCalls();\n\n // enable a global accessability from w...
[ "0.6162951", "0.6151819", "0.6113379", "0.59821355", "0.5980905", "0.5977267", "0.5796836", "0.5795681", "0.5791503", "0.57875407", "0.5754946", "0.57046705", "0.56964725", "0.56923944", "0.56845796", "0.568119", "0.56784725", "0.5668001", "0.56313235", "0.5620457", "0.560898...
0.0
-1
use that api to send test post request
render() { const { email, password, accessToken } = this.state; return ( <LoginContainer> <ToastContainer autoClose={2000} position="top-left" zIndex={99999} /> <button type="button" className="btn btn-dark loginButton" data-toggle="modal" data-targ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function applicationsTests({ apiGET, apiPOST }) {}", "function postTest(route){\n describe(\"Testing the post route for engine\", () => {\n test(\"Expecting 200 from GET route\", done => {\n request(app)\n .post(`/vehicles/1111/${route}`)\n .then(response => {\n expect(response.st...
[ "0.68951195", "0.67948794", "0.677503", "0.65614057", "0.6547894", "0.65290135", "0.64475757", "0.6405605", "0.64042664", "0.63694155", "0.63615394", "0.6356486", "0.6345469", "0.63418204", "0.6338857", "0.63002425", "0.6292414", "0.6234397", "0.6219214", "0.62190413", "0.621...
0.0
-1
update force layout (called automatically each iteration)
function tick() { // draw directed edges with proper padding from node centers path.attr('d', function(d) { var deltaX = d.target.x - d.source.x, deltaY = d.target.y - d.source.y, dist = Math.sqrt(deltaX * deltaX + deltaY * deltaY), normX = deltaX / dist, normY = deltaY / d...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "updateLayoutAutomatically() {\n if ( this._enabled ) {\n this.updateLayout();\n }\n }", "updateLayout() {\n if ( !this.isLocked ) {\n this.lock();\n\n this.layout();\n\n this.unlock();\n }\n }", "function fixLayout() {\r\n nodes.forEach(function(d) {\r\n d.fixed = true...
[ "0.7306434", "0.72363305", "0.6839005", "0.68221694", "0.66698426", "0.66384995", "0.66284496", "0.6613002", "0.6526807", "0.64935195", "0.64882565", "0.64518833", "0.64325476", "0.64045167", "0.63672364", "0.63274306", "0.6326389", "0.63134366", "0.62731266", "0.6264007", "0...
0.0
-1
update graph (called when needed)
function restart() { // path (link) group path = path.data(links); // update existing links path.classed('selected', function(d) { return d === selected_link; }) .style('marker-start', function(d) { return d.left ? 'url(#start-arrow)' : ''; }) .style('marker-end', function(d) { return d.rig...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "updateGraph(graph) {\n this.currGraph = graph;\n this.initCameras(false);\n }", "function update_graph()\n {\n //Coloring old state and link with the default color.\n if($old_current_state !== \"\")\n {\n $links[$old_previous_state+\"-\"+$old_current_state].att...
[ "0.7955011", "0.7514656", "0.74613047", "0.71965295", "0.7078737", "0.70696145", "0.7035881", "0.70259106", "0.69398326", "0.68449944", "0.6814155", "0.6756324", "0.6755585", "0.6753095", "0.6692042", "0.6682546", "0.6665631", "0.6648028", "0.6626861", "0.66069776", "0.659997...
0.0
-1
Resolves as soon as search value is found.
async waitFor(search) { const searchImplementation = typeof search === "function" ? search : (value) => value === search; return new Promise((resolve, reject) => { const subscription = this.updates.subscribe({ next: (newValue) => { if (searchImplementation...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "searchByRef(queryStr) {\n\n return this.refSearcher.search(queryStr)\n .then((results) => {\n if (results.length > 0) {\n this.results.push(...results);\n this.isLoadingResults = false;\n this.onUpdateSearchStatus();\n return results;\n } else {\n ...
[ "0.6134651", "0.61054254", "0.6073441", "0.5990953", "0.58348256", "0.574853", "0.574853", "0.57363147", "0.57363147", "0.5707829", "0.57057786", "0.57021874", "0.56992906", "0.5697322", "0.56707114", "0.5651054", "0.56385535", "0.56279457", "0.5622329", "0.56118643", "0.5611...
0.531073
90
This function determines the index of a boundary within the fragment The boundary will always be 0 or fragSize 1 (the edge of the fragment) unless this fragment contains one of the edges of the volume selected in the spatial search See function below this one for usage bound indicates one of the overall boundaries of t...
function boundaryInFrag(bound, fragNum, fragSize, defaultVal) { return (bound >= fragNum * fragSize && bound < (fragNum + 1) * fragSize ? bound % fragSize : defaultVal); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function boundedIndex(activeHit, range) {\n const bounded = activeHit % range\n\n return bounded < 0 ? range + bounded : bounded\n}", "function findBoundaryWordIndex(selectionRange, wordRanges, goal, initialLowerBound, initialUpperBound) {\n\t var bestValidWordIndex = -1;\n\t var lowerBound = initialLowe...
[ "0.5314749", "0.52309126", "0.5115479", "0.50330764", "0.4858631", "0.48091123", "0.47909823", "0.47129458", "0.46950045", "0.46950045", "0.46950045", "0.4684822", "0.46770382", "0.46230876", "0.46075237", "0.45989183", "0.4580417", "0.45778772", "0.45735678", "0.45702162", "...
0.7925751
0
Converts a Date into YYYYMM format
function yyyymm(d, separator) { if (!separator) { separator = ''; } var yyyy = d.getFullYear().toString(); var mm = (d.getMonth() + 1).toString(); return yyyy + separator + (mm[1] ? mm : '0' + mm[0]); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function getYYYYMM(date) {\n const month = date.getMonth() + 1;\n const mm = ((month < 10) ? '0' : '') + month\n const yyyy = date.getFullYear();\n return yyyy + mm; \n }", "function dateToDDMMYYYY(date) {\n let d = date.getDate();\n let m = date.getMonth() + 1;\n let y = date.getFullYear();\n ...
[ "0.757771", "0.7389641", "0.72971714", "0.7251536", "0.7140181", "0.7121484", "0.7025879", "0.69454706", "0.6932874", "0.6844151", "0.6815951", "0.67956704", "0.676772", "0.6734182", "0.6692543", "0.66175896", "0.66160494", "0.6607701", "0.65840316", "0.6544379", "0.6514318",...
0.68217605
10
On va appeler l'API de Pokemon
function fetchPokemonBase(){ fetch("https://pokeapi.co/api/v2/pokemon?limit=151") .then(reponse => reponse.json()) .then((allPoke) => { //console.log(allPoke); Ca fonctionne, on en a plus besoin allPoke.results.forEach((pokemon) => { // Pour chaque élément du tableau on envoi...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "getPokemon(id) {\n return this.apiHandler.get(`pokemon/${id}/`);\n }", "async function getSpecificPokemon(pokemon) {\n const response = await axios.get(`https://pokeapi.co/api/v2/pokemon/${pokemon}`)\n // console.log(response.data);\n yourPokemon = response.data\n displayYourPokemon(response.data...
[ "0.7674358", "0.7169257", "0.69814557", "0.6968308", "0.6870421", "0.6848337", "0.6793486", "0.6784259", "0.677171", "0.6771417", "0.67475647", "0.6708377", "0.6706028", "0.6669473", "0.6659858", "0.665414", "0.6652169", "0.66258734", "0.6580871", "0.656292", "0.656026", "0...
0.6860306
5
Returns the result of calling fn on an item or each item in an array
function fmap(item, fn) { return Array.isArray(item) ? item.map(fn) : fn(item); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function doThis(arr, fn){\n // create an empty array to hold return values \n var returnArr = [];\n // loop through the fed in array and perform the fed in function on each item\n for(var i=0;i<arr.length;i++){\n //update the value of the return array with the result of performing the fed in fun...
[ "0.7274826", "0.69085073", "0.6875909", "0.67204005", "0.6647976", "0.6612802", "0.65603966", "0.6554832", "0.65416986", "0.65159893", "0.6498406", "0.6493558", "0.6488752", "0.6469019", "0.6446118", "0.6436504", "0.6395402", "0.63726574", "0.63720065", "0.63359004", "0.63191...
0.6897649
2
Returns a mongo transformer that chains multiple transformers together.
function chainTransformers(...transformers) { return function (filter) { for (const transformer of transformers) { filter = transformer(filter); } return filter; }; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function transformer (selection) {\n const type = quantum.isSelection(selection) ? selection.type() : undefined\n const entityTransform = transformMap[type] || defaultTransform\n return entityTransform(selection, transformer, meta) // bootstrap to itself to make the transformer accessible to children\n ...
[ "0.5906773", "0.5739336", "0.53959155", "0.5214492", "0.5129026", "0.50839186", "0.50839186", "0.50839186", "0.50839186", "0.50810397", "0.507899", "0.49915966", "0.49915966", "0.49915966", "0.49915966", "0.49915966", "0.49726", "0.49136728", "0.48929313", "0.4885633", "0.488...
0.59302974
0
Returns a list of the keys that are used in this Mongo filter
function getUsedKeys(filter) { if (!filter) { return []; } const usedKeys = []; if (filter.$and) { for (const subfilter of filter.$and) { for (const key of getUsedKeys(subfilter)) { if (!usedKeys.includes(key)) { usedKeys.push(key); ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function keys() {\n return this.pluck('key');\n }", "keys() {\n return Object.keys(this._rawQuery);\n }", "keys() {\n return Object.keys(this._rawQuery);\n }", "keys() {\r\n return Object.keys(this._documents);\r\n }", "keys() {\r\n return Object.keys(this._document...
[ "0.73414946", "0.7273447", "0.7273447", "0.71692055", "0.71692055", "0.71680844", "0.7093953", "0.6968244", "0.6961353", "0.68186945", "0.6816255", "0.6784331", "0.6783296", "0.6783296", "0.6783296", "0.6783296", "0.6783296", "0.67443407", "0.6741699", "0.6741699", "0.6741699...
0.7128252
6
check whether there have been any new notifications since the last one we fetched this simply polls: since the request is quite light, this will scale quite a way, but eventually it might be better to longpoll or even use push technology
async function checkForNotifications() { const credentials = 'same-origin'; try { const response = await fetch('/ajax/notifications/last-update', { credentials }); if (!response.ok) { notifyFail('Notification latest-timestamp failed!'); return; } const lastNotificati...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "async function retrieveNotifications() {\n console.log(\"Retrieving notifications: \" + (new Date()).toISOString());\n\n try {\n // Retrieve latest unread notifications\n const since = new Date();\n since.setHours(since.getHours() - 1); // last hour\n\n let client = octokit;\n if (lastModifiedHead...
[ "0.7163844", "0.7087016", "0.6498561", "0.64400274", "0.64302623", "0.6406175", "0.62819946", "0.627408", "0.62647563", "0.62520874", "0.6228218", "0.6217007", "0.6118286", "0.61039186", "0.6076431", "0.6047416", "0.6033828", "0.6029692", "0.5971341", "0.5932422", "0.5887315"...
0.7915355
0
fetch notifications from the server in order to update the dropdown list
async function refreshNotifications() { const credentials = 'same-origin'; try { const response = await fetch('/ajax/notifications', { credentials }); if (!response.ok) { notifyFail('Notification refresh failed!'); return; } const notificationsJson = await response.j...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function getNotifications(em) {\n \n fetch(urlNewNotifications, {\n method: \"POST\",\n headers: {\n 'Accept': 'application/json',\n 'content-type': 'application/json',\n 'Authorization': ('Bearer ' + JSON.parse(localStorage.token))\n },\n body: JS...
[ "0.6818269", "0.6760982", "0.6553504", "0.64331824", "0.6325518", "0.6297713", "0.62941617", "0.6293241", "0.61858076", "0.61784685", "0.6135303", "0.6133925", "0.6072864", "0.5994292", "0.5987503", "0.5962648", "0.5933067", "0.59186256", "0.5905647", "0.59036887", "0.5884872...
0.63974833
4
update the dropdown list with new notifications
function displayNotifications(notificationsJson) { const nNotifications = notificationsJson.count; if (nNotifications == 0) { document.querySelector('nav .notifications').classList.add('hide'); } if (nNotifications > 0) { const notifcns = document.querySelector('...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function refreshPage()\n{\n lblMessage.innerHTML = \"\";\n inputAction.value = \"\";\n inputIP.value = \"\";\n inputSite.value = \"\";\n\n requestsData = getLiveData(\"requests\");\n requestsJSON = JSON.parse(requestsData)[\"requests\"];\n\n var i, L = selectNotification.options.length - 1;\n ...
[ "0.69365656", "0.6853758", "0.65140826", "0.6292825", "0.6288848", "0.60951895", "0.6082499", "0.60723776", "0.60410947", "0.6035976", "0.589608", "0.5890386", "0.5866811", "0.5862751", "0.5815452", "0.5765299", "0.57325065", "0.5729461", "0.57191646", "0.569865", "0.5690192"...
0.0
-1
signal that notification updates have failed
function notifyFail(msg) { const notifcns = document.querySelector('#notifications'); if (notifcns) notifcns.remove(); document.querySelector('nav .notifications .counter').textContent = ' ! '; // note U+2005 ¼ em spaces const notificationsHtml = `<div id="notifications">${msg}</div>`; ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "static notifyFailure()\n\t\t{\n\t\t\tthis.notify(NotificationFeedbackType.Error);\n\t\t}", "function notifyDeviceOfFailure() {\n pubsub.publish(\"device\", \"error\");\n}", "function OnUpdateFailure(error, userContext, methodName) {\n //alert('failure');\n if (error !== null) {\n showAlert(error....
[ "0.70826536", "0.6642094", "0.6036339", "0.599892", "0.5975825", "0.5869677", "0.5843114", "0.57926667", "0.5781444", "0.5776028", "0.57520014", "0.57229245", "0.5719243", "0.56954867", "0.5691919", "0.568606", "0.5670608", "0.56419927", "0.5617514", "0.55981356", "0.5576114"...
0.5331443
63
Function for sending user data to budget site/server
function sendData(value, host_url){ let url = 'http://localhost:5000/user/73298dhabc712hd6'; let currentDate = new Date(); let userInput = { description: host_url, amount: value, transaction_dd: currentDate.getDate(), transaction_mm: currentDate.getMonth(), transactio...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function userInformationSend() {\n let data = {\n email: document.getElementById('email').value,\n phoneNumber: document.getElementById('phoneNumber').value,\n bio: document.getElementById('bio').value\n }\n /* Use Fetch API */\n fetch(`/admin/mypage/${userId}/submit`, {\n m...
[ "0.63940465", "0.59875196", "0.5955985", "0.593528", "0.59014755", "0.5889122", "0.58506", "0.5824747", "0.57925814", "0.5701717", "0.5677165", "0.5669152", "0.56676614", "0.5664508", "0.56615317", "0.56170386", "0.5595229", "0.5586494", "0.5563065", "0.5558869", "0.55577904"...
0.57274777
9
This is to account for the difference in height between dishes and boxes
function getOffset (fromRect, toRect) { if (fromRect.height < toRect.height) return (fromRect.height - toRect.height) / 2 return 0; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function normalizeHeight () {\n var $boxes = $('.height-normalize');\n var tempHeight = 0;\n $boxes.each(function (index, element) {\n var $this = $(this);\n var height = $this.height();\n tempHeight = (height > tempHeight) ? height : tempHeight;\n });\n if (tempHeight > 0) {\n $...
[ "0.65846246", "0.6567586", "0.65455824", "0.6534959", "0.64751774", "0.642593", "0.6424947", "0.6413763", "0.6413763", "0.641102", "0.6401277", "0.63372606", "0.63347584", "0.6319202", "0.6312506", "0.6246869", "0.6231246", "0.6223674", "0.61996925", "0.61651725", "0.6158661"...
0.0
-1
Admin Table data goes here
render() { {this.props.user.username} return ( <div> <h2>Admin Data Table</h2> <table> <tbody> <tr> <th>User Name</th> <th>Is Admin</th> <th>Is Active</th> ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function userTable() { }", "function adminUpdate(data) {\n\t\t\t\n\t\t\t\n\t\t}", "function displayData()\n{\n \n createTable(dataBase)\n}", "function setupTable() {\n window.actionEvents = {\n \"click .edit\": function (e, value, row, index) {\n showEditDialog(row);\n...
[ "0.6446971", "0.6255968", "0.6252754", "0.6170984", "0.6170984", "0.6110425", "0.6045149", "0.603172", "0.6009396", "0.59581035", "0.5926466", "0.5921225", "0.5916678", "0.58915037", "0.5874924", "0.584987", "0.584598", "0.58394814", "0.57344264", "0.5731902", "0.57314", "0...
0.5598868
43
Grabs the student's major in a contextaware manner.
function getCurrentMajor() { var $programList = $(".esg-person-card__list-item"); // Scroll through the list and find the first non-UG or non-CE major for (var i = 1; i <= $programList.length - 1; i++) { var iProgramText = $.trim($programList.eq(i).text()); if (isValidMajor(iProgramText...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function retrieveMajor(semver) {\n semver = semver.split('.')\n\tconsole.log(semver[0]);\n \n}", "setMajor(major) {\n this.major = major\n }", "function getMajorAsClass(major) {\n return major.replace(/ /g,'');\n}", "get _majorAvailable() {\n return this._incl.major;\n }", "function ...
[ "0.66992587", "0.6079839", "0.6076284", "0.5709786", "0.56952834", "0.5478701", "0.5422369", "0.54219353", "0.54113036", "0.53790385", "0.52271235", "0.5099495", "0.50676554", "0.5006307", "0.49935928", "0.49863428", "0.49763295", "0.49161807", "0.49129373", "0.48350552", "0....
0.670138
0
Compares the given line of text to those that are identified as invalid majors.
function isValidMajor(text) { const nonmajorList = ["(CE)", // The Records office has not been consistent with Continuing Education "CE", // indications on a student's record. Hence we need to have both of these. "(UG)", ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function testLine(line) {\n return /^\\d{2}/.test(line) && RE_LINE.test(line);\n}", "validLine(line, index) {\n let wordCount = line.split(' ').filter(word => word !== '').length\n return index % 2 === 0 ? wordCount === 3 : wordCount === 5\n }", "function testLine(line) {\n return RE_LINE.test(lin...
[ "0.53347653", "0.51185393", "0.510778", "0.50337696", "0.5000902", "0.4972406", "0.49143586", "0.48686975", "0.48401153", "0.48345834", "0.4811544", "0.47785762", "0.47785762", "0.47785762", "0.4760537", "0.47580957", "0.4756282", "0.47556362", "0.47282284", "0.47282284", "0....
0.5221218
1
// Colleague Functions // All functions here should apply to Colleague (exclusively, if possible) // Most of the code here is "existencebased", in that it will only execute if the given // elements exist. // //
async function colleagueFix() { let student = JSON.parse(await GM.getValue("trans-eval-bundle", JSON.stringify(new Student(0,"")))); if ($(".formActive").eq(0).text().includes("NAE")) { // Fill out the ID Number lookup if we have data to do so if ($("#popup-lookup").val().length === 0) { ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function winnow(elements,qualifier,not){if(jQuery.isFunction(qualifier)){return jQuery.grep(elements,function(elem,i){/* jshint -W018 */return!!qualifier.call(elem,i,elem)!==not;});}if(qualifier.nodeType){return jQuery.grep(elements,function(elem){return elem===qualifier!==not;});}if(typeof qualifier===\"string\")...
[ "0.56387764", "0.5637832", "0.56260306", "0.56260306", "0.5613408", "0.55995077", "0.55731606", "0.55436987", "0.5505007", "0.548709", "0.54830295", "0.54660046", "0.54061854", "0.53814024", "0.53814024", "0.5369099", "0.5362648", "0.53536654", "0.53521764", "0.53101844", "0....
0.0
-1
Inserts a tooltip after the selected element
function insertTooltip(msg, selector) { if ($("#tooltip").length) $("#tooltip").remove(); const STYLE_TOOLTIP = {"font-weight":"bold", "color":"DarkSlateBlue"}; return $("<p>", { id: "tooltip" }).css(STYLE_TOOLTIP) .insertAfter($(selector)) .text(msg); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function showTip(element, message)\r\n{\r\n var tipMarkup = \"<div class=\\\"tip\\\"><div class=\\\"pointer\\\"></div>\" + message + \"</div>\";\r\n element.first().append(tipMarkup);\r\n}", "set tooltip(value) {}", "function showTooltip(content, event) {\n tt.style('opacity', 1.0)\n .html(conten...
[ "0.6689816", "0.6620954", "0.64709103", "0.6464653", "0.64163905", "0.6406584", "0.63962126", "0.63941133", "0.6393973", "0.63343316", "0.6327041", "0.6281793", "0.6280621", "0.6264929", "0.6260618", "0.625645", "0.6229138", "0.6219805", "0.6206318", "0.6203239", "0.6200429",...
0.6906175
0
Function when user clicks on a state
function clicked (event, d) { // Define polygon coordinates of what was clicked. Used to zoom in on the state const [[x0, y0], [x1, y1]] = path.bounds(d) event.stopPropagation() var counties = g.append('g') .classed("counties", true) // Used to remove in reset function below ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function stateChange(){\n\n}", "function SomaClickState() {\n setState(stateValue = stateValue + 1); // Mesma coisa que isso state[1](stateValue);\n // Por setState ser uma funcao ele temq ue ser escrito seu nome e parenteses\n }", "handleClick() {}", "function Click() {\n state = (state == 0) ? 1 : ...
[ "0.7177429", "0.6823272", "0.6780662", "0.67716765", "0.67643523", "0.6700936", "0.66903865", "0.6684519", "0.66780174", "0.66671586", "0.66649216", "0.6645724", "0.6595023", "0.6569939", "0.65445954", "0.6527285", "0.64957005", "0.64941347", "0.6434885", "0.6428996", "0.6401...
0.0
-1
Function adjust graph as you zoom in on it
function zoomed (event) { const { transform } = event g.attr('transform', transform) g.attr('stroke-width', 1 / transform.k) }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function doZoom( increment ) {\n newZoom = increment === undefined ? d3.event.scale \n\t\t\t\t\t: zoomScale(currentZoom+increment);\n if( currentZoom == newZoom )\n\treturn;\t// no zoom change\n\n // See if we cross the 'show' threshold in either direction\n if( currentZoom<SHOW_THRESHOLD && ne...
[ "0.76360244", "0.75763476", "0.7393642", "0.7383235", "0.7230609", "0.7230609", "0.7207029", "0.72024524", "0.7167598", "0.7151105", "0.71361417", "0.71319693", "0.7123023", "0.7123023", "0.7123023", "0.7123023", "0.71173877", "0.7116055", "0.71074796", "0.70947284", "0.70913...
0.657063
98
Function to reset the page after user has click away from counties view
function reset () { d3.select("g.counties").remove(); d3.select("g.clickState").remove() d3.selectAll("path.countyLines").remove(); d3.selectAll("path.clickStateLines").remove(); svg .transition() .duration(750) .call( zoom.transform, d3.zoo...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function resetCounty() {\n countyClick = false;\n d3.selectAll(\"button.county_reset\").style(\"display\", \"none\");\n d3.select(\"#counties\").remove();\n if (pollClick) {\n mapTitle.text(selRiskString + \" Assessment for \" + selPoll + \" in \" + selStateName);\n } else {\n mapTitle.text(selRiskStrin...
[ "0.7014444", "0.6686771", "0.6625877", "0.6625011", "0.6624382", "0.66203433", "0.6595978", "0.6584331", "0.65551317", "0.6522", "0.6512955", "0.6512955", "0.65029734", "0.64932734", "0.64932734", "0.6489781", "0.64759517", "0.6471126", "0.6464434", "0.64516956", "0.64496523"...
0.63162494
40
generating next data by active data
async generateData({ state, dispatch, getters, commit }) { state.data = await this._vm.$calc.nextStep.promise(state.data, [new ArrayBuffer()]); /// run is auto playing const canDoNext = state.isAuto && getters.isSizeMatches; commit("createTimeout", () => { ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function _next() {\n _pos ++;\n var t1 = i < d.length ? d[i] : null;\n var t2 = j < _data.length ? _data[j] : null;\n if (!t1 && !t2) {\n return null;\n }\n if (!t1) {\n j++;\n return t2;\n }\n if (!t2) {\n i++;\n max_pos_of_using_new_data ...
[ "0.69840777", "0.68886155", "0.6668755", "0.6593427", "0.63896567", "0.63811904", "0.63783056", "0.6346795", "0.6286534", "0.6282182", "0.6258787", "0.6248758", "0.61891735", "0.61792153", "0.61780053", "0.6154495", "0.6139333", "0.6130977", "0.6130574", "0.6099609", "0.60910...
0.5843068
49
Retrieves a reference to a WorkerHandle associated with a FrameWorker and a new ClientPort.
function FrameWorker(url, clientWindow, name) { // first create the client port we are going to use. Laster we will // message the worker to create the worker port. let portid = _nextPortId++; let clientPort = new ClientPort(portid, clientWindow); let existingWorker = workerCache[url]; if (!existingWorker...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function initClientMessageHandler(worker, workerWindow) {\n function _messageHandler(event) {\n // We will ignore all messages destined for otherType.\n let data = event.data;\n let portid = data.portId;\n let port;\n if (!data.portFromType || data.portFromType === \"client\") {\n // this is a...
[ "0.5927676", "0.54154813", "0.51147443", "0.50109017", "0.48415518", "0.48415518", "0.48415518", "0.48415518", "0.48415518", "0.48415518", "0.48415518", "0.48415518", "0.48415518", "0.48415518", "0.48030046", "0.47779515", "0.47542658", "0.47542277", "0.47542277", "0.47542277",...
0.67036897
0
FrameWorker A FrameWorker is an iframe that is attached to the hiddenWindow, which contains a pair of MessagePorts. It is constructed with the URL of some JavaScript that will be run in the context of the window; the script does not have a full DOM but is instead run in a sandbox that has a select set of methods cloned...
function FrameWorkerObject(url, name) { this.url = url; this.name = name || url; this.ports = {}; this.pendingPorts = []; this.loaded = false; this.frame = makeHiddenFrame(); var self = this; Services.obs.addObserver(function injectController(doc, topic, data) { if (!doc.defaultView || doc.default...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function FrameWorker(url, clientWindow, name) {\n // first create the client port we are going to use. Laster we will\n // message the worker to create the worker port.\n let portid = _nextPortId++;\n let clientPort = new ClientPort(portid, clientWindow);\n\n let existingWorker = workerCache[url];\n if (!ex...
[ "0.6807155", "0.57962716", "0.5582165", "0.5582165", "0.5575842", "0.5509052", "0.543566", "0.5418153", "0.5412363", "0.53903687", "0.537953", "0.5379161", "0.53779393", "0.5365636", "0.5344425", "0.5340096", "0.5326322", "0.5326322", "0.5321062", "0.53152823", "0.529193", ...
0.73143035
0
the iframe has loaded the js file as text first inject the magic porthandling code into the sandbox.
function getProtoSource(ob) { let raw = ob.prototype.toSource(); return ob.name + ".prototype=" + raw + ";" }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function inject() {\n\t\tpaDebug('Injecting Maddock\\'s script');\n\t\tvar script = document.createElement(\"script\");\n\t\ttxt = main.toString();\n\t\tif (window.opera != undefined)\n\t\t\ttxt = txt.replace(/</g, \"&lt;\");\n\t\tscript.innerHTML = \"(\" + txt + \")();\";\n\t\tscript.type = \"text/javascript\";\n...
[ "0.6351889", "0.60495913", "0.6002555", "0.59671587", "0.5961642", "0.5917693", "0.5905249", "0.5839285", "0.5770749", "0.57682747", "0.57569766", "0.575508", "0.57375944", "0.57042927", "0.56961983", "0.569097", "0.5682507", "0.5671192", "0.564862", "0.564676", "0.56160164",...
0.0
-1
This function is magically injected into the sandbox and used there. Thus, it is only ever dealing with "worker" ports.
function __initWorkerMessageHandler() { let ports = {}; // all "worker" ports currently alive, keyed by ID. function messageHandler(event) { // We will ignore all messages destined for otherType. let data = event.data; let portid = data.portId; let port; if (!data.portFromType || data.portFrom...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function sharedWorkerHostingPDRPort()\n{\n return new SharedWorker('perspectives-sharedworker.js').port;\n}", "IsPortAllowed() {\n\n }", "runWorkers () {\n }", "work() {}", "async changeWorker() {\n const lastAddress = this.workerAddress;\n const result = await this.request('get-available-no...
[ "0.6724406", "0.6200739", "0.61288995", "0.5929503", "0.5895142", "0.58927065", "0.5872544", "0.5827083", "0.57502127", "0.57451576", "0.5696729", "0.5673931", "0.5648543", "0.5619119", "0.56170636", "0.5593538", "0.5592034", "0.5539839", "0.55377746", "0.55048335", "0.549652...
0.645362
1
all "worker" ports currently alive, keyed by ID.
function messageHandler(event) { // We will ignore all messages destined for otherType. let data = event.data; let portid = data.portId; let port; if (!data.portFromType || data.portFromType === "worker") { // this is a message posted by ourself so ignore it. return; } switch (da...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function workerIds() { return Object.keys(cluster.workers) }", "getPaddleWorkers(cb) {\n let sites = [];\n\n for (let site in this.workers) {\n sites.push({ site: this.workers });\n }\n\n if (sites.length > 0) {\n cb(null, this.workers);\n } else {\n ...
[ "0.652649", "0.6110646", "0.5629955", "0.5576802", "0.55382025", "0.54690194", "0.54600555", "0.54453725", "0.5352687", "0.5339449", "0.532937", "0.5323823", "0.532282", "0.532282", "0.5289984", "0.5281341", "0.524958", "0.52470183", "0.51627", "0.513765", "0.5133081", "0.5...
0.0
-1
And this is the message listener for the client (ie, chrome) side of the world.
function initClientMessageHandler(worker, workerWindow) { function _messageHandler(event) { // We will ignore all messages destined for otherType. let data = event.data; let portid = data.portId; let port; if (!data.portFromType || data.portFromType === "client") { // this is a message poste...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "on_message(message) {\r\n }", "on_message(message) {\r\n }", "on_message(message) {\r\n }", "onMessage( message ) {\n\t\tconsole.log(`Received message from client: ${ message.toString() }`);\n\t}", "function messageListener(event) {\r\n //console.log(event.data);\r\n }", "function onme...
[ "0.712676", "0.712676", "0.712676", "0.69871867", "0.6905574", "0.68799835", "0.68735135", "0.67745167", "0.6760962", "0.6604843", "0.6577062", "0.6577062", "0.65546465", "0.6499985", "0.64654744", "0.64654744", "0.6450256", "0.6418466", "0.6374466", "0.63722825", "0.6357302"...
0.0
-1
this can probably go once debugged and working correctly!
function messageHandler(event) { try { _messageHandler(event); } catch (ex) { Cu.reportError("FrameWorker: Error handling client port control message: " + ex + "\n" + ex.stack); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private internal function m248() {}", "private public function m246() {}", "protected internal function m252() {}", "transient private protected internal function m182() {}", "static private internal function m121() {}", "transient protected internal function m189() {}", "transient private internal fun...
[ "0.72727084", "0.6915101", "0.6817438", "0.65133494", "0.64246213", "0.6397086", "0.63574386", "0.63421607", "0.6260209", "0.61648923", "0.60303634", "0.60136545", "0.6009154", "0.59693676", "0.58933145", "0.5887716", "0.585929", "0.5857386", "0.584517", "0.5701468", "0.56982...
0.0
-1
The port implementation which is shared between clients and workers.
function AbstractPort(portid) { this._portid = portid; this._handler = undefined; // pending messages sent to this port before it has a message handler. this._pendingMessagesIncoming = []; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function Port() {\n\n //if (!(this instanceof Port)) return new Port(options);\n\n // important to just name it input for refactor.\n\t// eventually can be renamed to something else.\n //\n\t// node.input[port] becomes node.getPort(port).input\n //\n this.input = undefined;\n\n this._open = false;\n\n // If...
[ "0.74129504", "0.7309057", "0.7162375", "0.70453954", "0.69294375", "0.6906233", "0.68305093", "0.68305093", "0.68233615", "0.677562", "0.6673748", "0.65047365", "0.6478937", "0.6478937", "0.63805586", "0.63142794", "0.6201072", "0.6201072", "0.61993676", "0.6192787", "0.6054...
0.6702429
10
Note: this is never instantiated in chrome the source is sent across to the worker and it is evaluated there and created in response to a portcreate message we send.
function WorkerPort(portid) { AbstractPort.call(this, portid); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function startMessagePort() {\n 'use strict';\n\n try {\n \tconsole.log(\"local port creation\");\n gLocalMessagePort = tizen.messageport\n .requestLocalMessagePort(localMessagePortName);\n gLocalMessagePortWatchId = gLocalMessagePort\n .addMessagePortListener(function ...
[ "0.6128946", "0.59771204", "0.59165645", "0.58657473", "0.5863323", "0.57230765", "0.5711333", "0.56624746", "0.5648921", "0.5637524", "0.5624157", "0.5581127", "0.5571936", "0.55608034", "0.5557027", "0.555293", "0.55513525", "0.55396813", "0.55180883", "0.547479", "0.545210...
0.5208052
36
function to compute the genre
function myGenre() { var genreList = document.getElementById("genreList"); return genreList.options[genreList.selectedIndex].text; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function getGenre(genre) {\n if (genre == 1) {\n newGenre = 'Horror'\n } else if (genre == 2) {\n newGenre = 'Action-Adventure'\n } else if (genre == 3) {\n newGenre = 'Romance'\n } else if (genre == 4) {\n newGenre = 'Thriller'\n } else if (genre == 5) {\n newGenr...
[ "0.7239648", "0.69656587", "0.69656587", "0.6553627", "0.6501732", "0.6494436", "0.64906186", "0.64216894", "0.642004", "0.63908714", "0.6379146", "0.63141435", "0.62926704", "0.6280993", "0.626605", "0.6255725", "0.62373114", "0.62163526", "0.62144643", "0.6200017", "0.61989...
0.59099734
73
Function to compute the url formatting for genre based on user input
function computeGenre(inputGenre) { if (inputGenre) { inputGenre = inputGenre.toLowerCase(); switch (inputGenre) { case "action": parseGenre = "&with_genres=28"; break; case "adventure": parseGenre = "&with_genres=12"; ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "async function makeUrl(genre, releaseYear, runtime) {\n await computeGenre(genre);\n await computeYear(releaseYear);\n await computeTime(runtime);\n \n \n let api_url = `https://api.themoviedb.org/3/discover/movie?with_original_language=en${parseGenre}${parseYear}${parseTime}&sort_by=popularity.d...
[ "0.62236184", "0.62236184", "0.61871207", "0.60826117", "0.60418797", "0.5976714", "0.5975558", "0.59676725", "0.58665514", "0.5840927", "0.5820443", "0.57930833", "0.57917565", "0.577466", "0.57322407", "0.56919223", "0.564871", "0.56470484", "0.5629893", "0.5624288", "0.561...
0.69893914
1
Function to compute the url formatting based on user input for release year
function computeYear(inputYear) { if (inputYear) parseYear = `&primary_release_year=${inputYear}`; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function convertYear(year) {\n year += \"\";\n\n return year.length < 4 ? \"200\" + year : year;\n }", "function makeURL(term,year) {\n var api = 'https://api.nytimes.com/svc/search/v2/articlesearch.jsonp?callback=svc_search_v2_articlesearch&';\n var query = '?q='+term+'&begin_date='+year+'010...
[ "0.6068859", "0.6068831", "0.60375464", "0.59541196", "0.5945745", "0.59165", "0.5881033", "0.57776344", "0.57717407", "0.5662192", "0.5643357", "0.5639018", "0.56004375", "0.55994785", "0.55920166", "0.5584687", "0.5584687", "0.5580406", "0.55775964", "0.5569622", "0.5536136...
0.7144466
1
Function to compute the url formatting based on user input for runtime
function computeTime(inputTime) { inputTime && (parseTime = `&with_runtime.lte=${inputTime}`); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function urlFormatter(urlParam, pathParam) {\n\t\tvar path = (pathParam) ? pathParam : '';\n\t\tvar url = (urlParam.indexOf('http://') === 0 || urlParam.indexOf('https://') === 0)\n\t\t\t? urlParam\n\t\t\t: path + urlParam;\n\t\treturn url;\n\t}", "function formatPath(input) {\n if (input && input.las...
[ "0.700075", "0.6877523", "0.6749453", "0.667186", "0.66298896", "0.6598182", "0.6589031", "0.6553843", "0.6491469", "0.648106", "0.6476528", "0.64524114", "0.6436066", "0.6436066", "0.64339083", "0.6431966", "0.64253134", "0.6419249", "0.64186186", "0.64042133", "0.6396271", ...
0.0
-1
Function that develops the movie url by running all three compute functions above, and building the url with the results, then pulling data from the url
async function makeUrl(genre, releaseYear, runtime) { await computeGenre(genre); await computeYear(releaseYear); await computeTime(runtime); let api_url = `https://api.themoviedb.org/3/discover/movie?with_original_language=en${parseGenre}${parseYear}${parseTime}&sort_by=popularity.desc&api_key...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function movieThis() {\n var movieName = \"\";\n\n //move over all of the entered words to \n for (var i = 3; i < input.length; i++) {\n if (i > 3 && i < input.length) {\n movieName = movieName + \"+\" + input[i];\n } else {\n movieName += input[i];\n }\n }\n ...
[ "0.6589969", "0.626651", "0.6116563", "0.608981", "0.6078675", "0.6070877", "0.6047502", "0.60471684", "0.60425884", "0.6039139", "0.6005508", "0.5987605", "0.59857816", "0.5983977", "0.597442", "0.5959561", "0.59591967", "0.5945169", "0.5923681", "0.59205514", "0.58992785", ...
0.67870474
1
these helpers produces better vm code in JS engines due to their explicitness and function inlining
function isUndef (v) { return v === undefined || v === null }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function Module() {\n \"use asm\";\n\n function d0() {\n do { } while(false);\n return 110;\n }\n\n function d1() {\n do { return 111; } while(false);\n return 112;\n }\n\n function d2() {\n do { break; } while(false);\n return 113;\n }\n\n function d3(a) {\n a = a | 0;\n do { if (a...
[ "0.6217585", "0.6019511", "0.6019511", "0.59548193", "0.585786", "0.58430815", "0.5797208", "0.5781874", "0.5750883", "0.57074183", "0.56613123", "0.5650239", "0.56268257", "0.56140244", "0.56140244", "0.5580779", "0.5543671", "0.5520648", "0.5511693", "0.5463509", "0.5459733...
0.0
-1
Check if value is primitive
function isPrimitive (value) { return typeof value === 'string' || typeof value === 'number' }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function isPrimitive(value){return typeof value==='string'||typeof value==='number';}", "function isPrimitive(value){return typeof value==='string'||typeof value==='number'||typeof value==='boolean';}", "function isPrimitive(value){return typeof value==='string'||typeof value==='number'||typeof value==='boolea...
[ "0.842668", "0.8386476", "0.8386476", "0.8342391", "0.8267003", "0.823295", "0.823295", "0.823295", "0.823295", "0.823295", "0.823295", "0.823295", "0.823295", "0.82243407", "0.8198997", "0.8198997", "0.8197481", "0.81682295", "0.81682295", "0.81682295", "0.81682295", "0.81...
0.81603813
36
Quick object check this is primarily used to tell Objects from primitive values when we know the value is a JSONcompliant type.
function isObject (obj) { return obj !== null && typeof obj === 'object' }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "#isPrimitive(value) {\n return value !== Object(value); \n }", "function isValueObject(obj) {\n\treturn (obj instanceof Number) || (obj instanceof String) || (obj instanceof Boolean) || (obj === null);\n}", "function isPrimitiveType (obj) {\r\n return ( typeof obj === 'boolean' ||\r\n typeof o...
[ "0.7209288", "0.70470786", "0.6916205", "0.69089663", "0.68988675", "0.6770455", "0.67205334", "0.6710933", "0.670159", "0.67004734", "0.67004734", "0.67004734", "0.67004734", "0.67004734", "0.67004734", "0.67004734", "0.67004734", "0.67004734", "0.67004734", "0.67004734", "0...
0.0
-1
Convert a value to a string that is actually rendered.
function _toString (val) { return val == null ? '' : typeof val === 'object' ? JSON.stringify(val, null, 2) : String(val) }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function renderStringify(value) {\n if (typeof value === 'string')\n return value;\n if (value == null)\n return '';\n return '' + value;\n}", "function valueToHTML(value) {\n var valueType = typeof value;\n\n var output = \"\";\n if (value == null) {\n outp...
[ "0.7583682", "0.7350029", "0.7300044", "0.7300044", "0.7300044", "0.7300044", "0.7300044", "0.7300044", "0.7300044", "0.7300044", "0.7300044", "0.7300044", "0.7300044", "0.7300044", "0.7300044", "0.7300044", "0.72896737", "0.7267361", "0.7260151", "0.7191873", "0.7167368", ...
0.0
-1
Convert a input value to a number for persistence. If the conversion fails, return original string.
function toNumber (val) { var n = parseFloat(val); return isNaN(n) ? val : n }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function toNumber(value) {\n if (hasValue(value) && !isNumber(value)) {\n var converted = Number(value);\n if (isNaN(converted) && isString(value) && value != \"\") {\n return toNumber(value.replace(/[^0-9.\\-]+/g, ''));\n }\n return converted;\n }\n return value;\n}...
[ "0.6704623", "0.6612754", "0.63621587", "0.6353078", "0.6353078", "0.6353078", "0.6341244", "0.6256715", "0.6256715", "0.6256715", "0.6256715", "0.6256715", "0.62517154", "0.6251364", "0.6251364", "0.6251364", "0.6251364", "0.6244528", "0.623729", "0.62147915", "0.6214398", ...
0.0
-1
Make a map and return a function for checking if a key is in that map.
function makeMap ( str, expectsLowerCase ) { var map = Object.create(null); var list = str.split(','); for (var i = 0; i < list.length; i++) { map[list[i]] = true; } return expectsLowerCase ? function (val) { return map[val.toLowerCase()]; } : function (val) { return map[val]; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "async has(key) {}", "has (key, strict = true) {\n if (!strict) {\n return [...this.keys()].some((_key) => {\n return isEqual(key, _key);\n });\n }\n return Map.prototype.has.call(this, key);\n }", "has(key) {\n return this.map[key] !== ...
[ "0.61569345", "0.600622", "0.5998857", "0.58671963", "0.5805278", "0.5792354", "0.5767979", "0.56549007", "0.55954605", "0.55640113", "0.5560432", "0.55430305", "0.5534952", "0.5533804", "0.5533804", "0.5524802", "0.55174714", "0.5492793", "0.546708", "0.54544216", "0.5441529...
0.0
-1
Remove an item from an array
function remove (arr, item) { if (arr.length) { var index = arr.indexOf(item); if (index > -1) { return arr.splice(index, 1) } } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function remove$1(arr,item){if(arr.length){var index=arr.indexOf(item);if(index>-1){return arr.splice(index,1);}}}", "function remove(arr, item){\n\t var idx = indexOf(arr, item);\n\t if (idx !== -1) arr.splice(idx, 1);\n\t }", "function remove(array, item) {\n var index = _.indexOf...
[ "0.801349", "0.7984709", "0.79359716", "0.7885612", "0.78852826", "0.7868985", "0.7868985", "0.7790787", "0.77843815", "0.7777567", "0.77433133", "0.77433133", "0.77433133", "0.7734339", "0.77222", "0.77097017", "0.77055365", "0.77055365", "0.77055365", "0.77055365", "0.77055...
0.0
-1
Create a cached version of a pure function.
function cached (fn) { var cache = Object.create(null); return (function cachedFn (str) { var hit = cache[str]; return hit || (cache[str] = fn(str)) }) }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function cached(fn){var cache=Object.create(null);return function cachedFn(str){var hit=cache[str];return hit||(cache[str]=fn(str));};}", "function cached(fn){var cache=Object.create(null);return function cachedFn(str){var hit=cache[str];return hit||(cache[str]=fn(str));};}", "function cached(fn){var cache=Obj...
[ "0.69524795", "0.69524795", "0.69524795", "0.6894079", "0.6888596", "0.68645334", "0.68645334", "0.68345284", "0.68345284", "0.68345284", "0.68345284", "0.68345284", "0.68345284", "0.68345284", "0.68345284", "0.68345284", "0.68345284", "0.68345284", "0.68345284", "0.68345284", ...
0.0
-1
Simple bind, faster than native
function bind (fn, ctx) { function boundFn (a) { var l = arguments.length; return l ? l > 1 ? fn.apply(ctx, arguments) : fn.call(ctx, a) : fn.call(ctx) } // record original fn length boundFn._length = fn.length; return boundFn }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function simpleBind(context,fn){return function(value){fn.call(context,value);};}", "function simpleBind(context, fn) { // 14775\n return function(value) { ...
[ "0.7496607", "0.7335848", "0.713787", "0.713787", "0.70185053", "0.6932239", "0.693094", "0.693094", "0.689574", "0.68954074", "0.688864", "0.6852869", "0.68492305", "0.68492305", "0.68492305", "0.68492305", "0.68492305", "0.68492305", "0.68492305", "0.68492305", "0.68492305"...
0.67703414
80
Convert an Arraylike object to a real Array.
function toArray (list, start) { start = start || 0; var i = list.length - start; var ret = new Array(i); while (i--) { ret[i] = list[i + start]; } return ret }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function convertArray( array, type, forceClone ) {\n\n\tif ( ! array || // let 'undefined' and 'null' pass\n\t\t! forceClone && array.constructor === type ) return array;\n\n\tif ( typeof type.BYTES_PER_ELEMENT === 'number' ) {\n\n\t\treturn new type( array ); // create typed array\n\n\t}\n\n\treturn Array.prototy...
[ "0.73040587", "0.7301542", "0.72855735", "0.7278617", "0.72582656", "0.7179821", "0.7134585", "0.71301657", "0.71301657", "0.7129415", "0.7129415", "0.7129415", "0.7129415", "0.7129415", "0.7129415", "0.7129415", "0.7129415", "0.7129415", "0.70944196", "0.708892", "0.70535296...
0.0
-1
Mix properties into target object.
function extend (to, _from) { for (var key in _from) { to[key] = _from[key]; } return to }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function fillProperties(target,source){for(var key in source){if(source.hasOwnProperty(key)&&!target.hasOwnProperty(key)){target[key]=source[key]}}}", "function fillProperties(target,source){for(var key in source){if(source.hasOwnProperty(key)&&!target.hasOwnProperty(key)){target[key]=source[key];}}}", "functi...
[ "0.73263377", "0.73095685", "0.7214008", "0.71767485", "0.71767485", "0.71767485", "0.70545983", "0.7018322", "0.7018322", "0.7018322", "0.7018322", "0.7012555", "0.7012555", "0.7012555", "0.7012555", "0.7012555", "0.7012555", "0.7012555", "0.7012555", "0.7012555", "0.6934832...
0.0
-1
Merge an Array of Objects into a single Object.
function toObject (arr) { var res = {}; for (var i = 0; i < arr.length; i++) { if (arr[i]) { extend(res, arr[i]); } } return res }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function bs_arrayMerge(obj1, obj2) {\n if (!bs_isObject(obj1) || !bs_isObject(obj2)) return false;\n for (var key in obj2) {obj1[key] = obj2[key];}\n return obj1;\n}", "function merge (...params) {\n // check if all are objects\n let l = params.length\n for (l; l > 0; l--) {\n const item = params[l - 1]...
[ "0.6403866", "0.6157577", "0.6079626", "0.60319227", "0.60078406", "0.5958751", "0.5936174", "0.5872089", "0.5847438", "0.58379513", "0.5837888", "0.5808705", "0.5794686", "0.5779685", "0.5777849", "0.5777849", "0.5775897", "0.57679904", "0.57679904", "0.5754346", "0.5743135"...
0.0
-1
Generate a static keys string from compiler modules.
function genStaticKeys (modules) { return modules.reduce(function (keys, m) { return keys.concat(m.staticKeys || []) }, []).join(',') }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function genStaticKeys(modules){return modules.reduce(function(keys,m){return keys.concat(m.staticKeys||[]);},[]).join(',');}", "function genStaticKeys(modules){return modules.reduce(function(keys,m){return keys.concat(m.staticKeys||[]);},[]).join(',');}", "function genStaticKeys(modules){return modules.reduce...
[ "0.8597233", "0.8597233", "0.8597233", "0.84344506", "0.8410699", "0.8408263", "0.8408263", "0.8408263", "0.8402766", "0.8393647", "0.83934194", "0.8385252", "0.8385252", "0.8384894" ]
0.0
-1
Check if two values are loosely equal that is, if they are plain objects, do they have the same shape?
function looseEqual (a, b) { var isObjectA = isObject(a); var isObjectB = isObject(b); if (isObjectA && isObjectB) { try { return JSON.stringify(a) === JSON.stringify(b) } catch (e) { // possible circular reference return a === b } } else if (!isObjectA && !isObjectB) { return ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function sameExactShape(a, b) {\n\treturn JSON.stringify(a) === JSON.stringify(b)\n}", "function sameShape(a, b) {\n return JSON.stringify(a) === JSON.stringify(b)\n}", "function looseEqual(a,b){var isObjectA=isObject(a);var isObjectB=isObject(b);if(isObjectA&&isObjectB){return JSON.stringify(a)===JSON.string...
[ "0.80201745", "0.77488035", "0.7320277", "0.7272505", "0.7229929", "0.7223583", "0.7223583", "0.72072494", "0.72072494", "0.72072494", "0.72072494", "0.72072494", "0.71947175", "0.71499604", "0.71499604", "0.7115097", "0.7083912", "0.7083912", "0.7083912", "0.70690525", "0.70...
0.70926565
26
Ensure a function is called only once.
function once (fn) { var called = false; return function () { if (!called) { called = true; fn.apply(this, arguments); } } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function once(fn){var called=false;return function(){var args=[],len=arguments.length;while(len--){args[len]=arguments[len];}if(called){return;}called=true;return fn.apply(this,args);};}", "function once(fn){var called=false;return function(){if(!called){called=true;fn.apply(this,arguments);}};}", "function on...
[ "0.78162867", "0.7794991", "0.7794991", "0.77837825", "0.7511972", "0.7486433", "0.7455255", "0.7455255", "0.74350595", "0.7431102", "0.7431102", "0.7431102", "0.7425318", "0.7425318", "0.74080145", "0.74080145", "0.74080145", "0.74080145" ]
0.0
-1
Check if a string starts with $ or _ Define a property.
function def (obj, key, val, enumerable) { Object.defineProperty(obj, key, { value: val, enumerable: !!enumerable, writable: true, configurable: true }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "_isValidPropertyName(str) {\n return /^(?![0-9])[a-zA-Z0-9$_]+$/.test(str);\n }", "function isBareProp(prop) {\n return /^[A-Za-z_$][A-Za-z0-9_\\-$]*$/.test(prop);\n }", "static validateInterpolationProps(str, props) {\n if (typeof str === 'function') {\n return true;\n ...
[ "0.71869695", "0.66710484", "0.6637253", "0.6410481", "0.6284688", "0.62651134", "0.62651134", "0.62651134", "0.62651134", "0.6053404", "0.6053404", "0.59905374", "0.59848046", "0.5935958", "0.5865132", "0.5835369", "0.5759376", "0.56993145", "0.5656543", "0.56421244", "0.564...
0.0
-1
detect devtools / istanbul ignore next
function isNative (Ctor) { return typeof Ctor === 'function' && /native code/.test(Ctor.toString()) }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "extend (config, ctx) {\n config.devtool = ctx.isClient ? \"eval-source-map\" : \"inline-source-map\";\n\n // if (ctx.isDev && ctx.isClient) {\n // config.module.rules.push({\n // enforce: \"pre\",\n // test: /\\.(js|vue)$/,\n // ...
[ "0.5792452", "0.5768311", "0.5693427", "0.56020385", "0.5502614", "0.5453381", "0.5451066", "0.53991055", "0.53863275", "0.5375369", "0.5348094", "0.5305254", "0.53020626", "0.53020626", "0.52918184", "0.52912205", "0.52787596", "0.52708185", "0.52510995", "0.5207946", "0.520...
0.0
-1
helpers Augment an target Object or Array by intercepting the prototype chain using __proto__
function protoAugment (target, src) { /* eslint-disable no-proto */ target.__proto__ = src; /* eslint-enable no-proto */ }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function protoAugment(target,src){/* eslint-disable no-proto */target.__proto__=src;/* eslint-enable no-proto */}", "function protoAugment(target, src) {\n target.__proto__ = src\n}", "function protoAugment(target, src) {\n\t /* eslint-disable no-proto */\n\t target.__proto__ = src;\n\t /* eslint-enable ...
[ "0.7684818", "0.7602835", "0.75431037", "0.75340587", "0.75340587", "0.75340587", "0.75340587", "0.75340587", "0.75340587", "0.75340587", "0.75316787", "0.7530263", "0.7530263", "0.7529199", "0.7529199", "0.75241697", "0.75241697", "0.75241697", "0.75241697", "0.75194526", "0...
0.0
-1
Augment an target Object or Array by defining hidden properties. / istanbul ignore next
function copyAugment (target, src, keys) { for (var i = 0, l = keys.length; i < l; i++) { var key = keys[i]; def(target, key, src[key]); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function borderLayoutvue_type_script_lang_js_objectSpread(target) {\n for (var i = 1; i < arguments.length; i++) {\n var source = arguments[i] != null ? arguments[i] : {};\n var ownKeys = Object.keys(source);\n\n if (typeof Object.getOwnPropertySymbols === 'function') {\n ownKeys = ownKeys.concat(Ob...
[ "0.62725294", "0.6011004", "0.5852952", "0.5722282", "0.5722282", "0.57013226", "0.57013226", "0.57013226", "0.56734824", "0.56690204", "0.56681067", "0.56659377", "0.5655603", "0.5655603", "0.5585294", "0.5585294", "0.5585294", "0.5585294", "0.5585294", "0.5585294", "0.55852...
0.0
-1
Attempt to create an observer instance for a value, returns the new observer if successfully observed, or the existing observer if the value already has one.
function observe (value, asRootData) { if (!isObject(value)) { return } var ob; if (hasOwn(value, '__ob__') && value.__ob__ instanceof Observer) { ob = value.__ob__; } else if ( observerState.shouldConvert && !isServerRendering() && (Array.isArray(value) || isPlainObject(value)) && Obj...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function observer(value) {\n let ob = null;\n if (hasOwn(value, '__ob__') && value.__ob__ instanceof Observer) {\n ob = value.__ob__;\n } else if (Array.isArray(value) || isObject(value)) {\n ob = new Observer(value);\n }\n return ob;\n }", "function ob...
[ "0.7413728", "0.65222126", "0.6444797", "0.64431584", "0.6414603", "0.6409182", "0.6409182", "0.63647825", "0.5903358", "0.5884158", "0.57966596", "0.5749717", "0.5749717", "0.5749717", "0.5749717", "0.5749717", "0.57493556", "0.57493556", "0.57199544", "0.5671228", "0.567122...
0.57974625
32
Define a reactive property on an Object.
function defineReactive$$1 ( obj, key, val, customSetter ) { var dep = new Dep(); var property = Object.getOwnPropertyDescriptor(obj, key); if (property && property.configurable === false) { return } // cater for pre-defined getter/setters var getter = property && property.get; var setter = ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function defineReactive(obj,key,val,customSetter,shallow){var dep=new Dep();var property=Object.getOwnPropertyDescriptor(obj,key);if(property&&property.configurable===false){return;}// cater for pre-defined getter/setters\nvar getter=property&&property.get;var setter=property&&property.set;var childOb=!shallow&&ob...
[ "0.72791314", "0.72791314", "0.727433", "0.7127494", "0.7061651", "0.7045527", "0.6923424", "0.6918172", "0.69101816", "0.68589103", "0.6853851", "0.6853851", "0.685129", "0.68401927", "0.6833513", "0.6816881", "0.68088764", "0.68023205", "0.6798727", "0.6794959", "0.6792586"...
0.6750302
49
Set a property on an object. Adds the new property and triggers change notification if the property doesn't already exist.
function set (target, key, val) { if (Array.isArray(target) && typeof key === 'number') { target.length = Math.max(target.length, key); target.splice(key, 1, val); return val } if (hasOwn(target, key)) { target[key] = val; return val } var ob = (target ).__ob__; if (target._isVue || (ob ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@action\n setProp(property, newVal) {\n this.set(property, newVal);\n }", "set property(){}", "function patchProperty(obj, prop, value) {\n obj[prop] = value;\n}", "function patchProperty(obj, prop, value) {\n obj[prop] = value;\n}", "function patchProperty(obj, prop, value) {\n obj[prop] = v...
[ "0.7590802", "0.732422", "0.71645296", "0.71645296", "0.71645296", "0.71645296", "0.71645296", "0.71645296", "0.71645296", "0.71645296", "0.71645296", "0.71645296", "0.71645296", "0.71645296", "0.71645296", "0.71645296", "0.71645296", "0.71645296", "0.7137108", "0.7137108", "...
0.0
-1
Delete a property and trigger change if necessary. Collect dependencies on array elements when the array is touched, since we cannot intercept array element access like property getters.
function dependArray (value) { for (var e = (void 0), i = 0, l = value.length; i < l; i++) { e = value[i]; e && e.__ob__ && e.__ob__.dep.depend(); if (Array.isArray(e)) { dependArray(e); } } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function deletePropertyFromArray(property, array) {\n array.splice(array.indexOf(getPropertyFromArray(property, array)), 1);\n }", "function deletePropertyFromArray(property, array) {\n array.splice(array.indexOf(getPropertyFromArray(property, array)), 1);\n }", "function del (target, key) ...
[ "0.71196955", "0.71196955", "0.68616927", "0.673581", "0.67215544", "0.6702833", "0.6702833", "0.6702833", "0.66642463", "0.6621619", "0.65792567", "0.65792567", "0.65792567", "0.65792567", "0.65792567", "0.65792567", "0.65792567", "0.65792567", "0.65792567", "0.65792567", "0...
0.0
-1
Helper that recursively merges two data objects together.
function mergeData (to, from) { if (!from) { return to } var key, toVal, fromVal; var keys = Object.keys(from); for (var i = 0; i < keys.length; i++) { key = keys[i]; toVal = to[key]; fromVal = from[key]; if (!hasOwn(to, key)) { set(to, key, fromVal); } else if (isPlainObject(toVal) &&...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function mergeData(to,from){if(!from){return to;}var key,toVal,fromVal;var keys=Object.keys(from);for(var i=0;i<keys.length;i++){key=keys[i];toVal=to[key];fromVal=from[key];if(!hasOwn(to,key)){set(to,key,fromVal);}else if(isPlainObject(toVal)&&isPlainObject(fromVal)){mergeData(toVal,fromVal);}}return to;}", "fun...
[ "0.729745", "0.729745", "0.72922087", "0.72851914", "0.7261224", "0.7256715", "0.7256715", "0.72341484", "0.7123417", "0.7123417", "0.7108912", "0.70633286", "0.70633286", "0.70633286", "0.70605797", "0.70537204", "0.70537204", "0.7036381", "0.7035379", "0.7035379", "0.703537...
0.0
-1
Hooks and props are merged as arrays.
function mergeHook ( parentVal, childVal ) { return childVal ? parentVal ? parentVal.concat(childVal) : Array.isArray(childVal) ? childVal : [childVal] : parentVal }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function $merge(){\r\n var mix = {};\r\n for (var i = 0; i < arguments.length; i++) {\r\n for (var property in arguments[i]) {\r\n var ap = arguments[i][property];\r\n var mp = mix[property];\r\n if (mp && $type(ap) == 'object' && $type(mp) == '...
[ "0.5942144", "0.59220487", "0.581958", "0.577723", "0.56988394", "0.5694502", "0.5694502", "0.55787134", "0.5573753", "0.5573753", "0.5573753", "0.5573753", "0.5573753", "0.55637807", "0.555034", "0.555034", "0.555034", "0.5546893", "0.5546893", "0.55361134", "0.5495715", "...
0.0
-1
Assets When a vm is present (instance creation), we need to do a threeway merge between constructor options, instance options and parent options.
function mergeAssets (parentVal, childVal) { var res = Object.create(parentVal || null); return childVal ? extend(res, childVal) : res }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function mergeAssets(parentVal,childVal,vm,key){var res=Object.create(parentVal||null);if(childVal){\"development\"!=='production'&&assertObjectType(key,childVal,vm);return extend(res,childVal);}else{return res;}}", "function mergeAssets(parentVal,childVal,vm,key){var res=Object.create(parentVal||null);if(childV...
[ "0.6300805", "0.6300805", "0.60885996", "0.60885996", "0.60885996", "0.60885996", "0.6065999", "0.60649264", "0.6064737", "0.6064737", "0.60500985", "0.6046327", "0.6046327", "0.6046327", "0.6046327", "0.6046327", "0.6046327", "0.6046327", "0.6046327", "0.6046327", "0.6046327...
0.0
-1
Merge two option objects into a new one. Core utility used in both instantiation and inheritance. Resolve an asset. This function is used because child instances need access to assets defined in its ancestor chain. / / Runtime helper for rendering vfor lists.
function renderList ( val, render ) { var ret, i, l, keys, key; if (Array.isArray(val) || typeof val === 'string') { ret = new Array(val.length); for (i = 0, l = val.length; i < l; i++) { ret[i] = render(val[i], i); } } else if (typeof val === 'number') { ret = new Array(val); for (i...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function resolveAsset(options,type,id,warnMissing){/* istanbul ignore if */if(typeof id!=='string'){return;}var assets=options[type];// check local registration variations first\nif(hasOwn(assets,id)){return assets[id];}var camelizedId=camelize(id);if(hasOwn(assets,camelizedId)){return assets[camelizedId];}var Pas...
[ "0.6828769", "0.6828769", "0.6793356", "0.6547702", "0.6547702", "0.6547702", "0.6537119", "0.6537119", "0.6537119", "0.6537119", "0.6537119", "0.6531142", "0.65289044", "0.65289044", "0.651531", "0.6496411", "0.64914167", "0.6483891", "0.6471842", "0.64053124", "0.6392022", ...
0.0
-1