├── README.md ├── requirements.txt ├── .github └── ISSUE_TEMPLATE │ ├── trc-review-issue-template.md │ ├── TSG_Charter.md │ └── recipe.md ├── .gitignore ├── code ├── generateMeetings.py ├── counter.py └── standing.py └── LICENSE /README.md: -------------------------------------------------------------------------------- 1 | # trc 2 | Technical Review Committee issue review 3 | -------------------------------------------------------------------------------- /requirements.txt: -------------------------------------------------------------------------------- 1 | ics 2 | python-dateutil 3 | pygithub 4 | gspread 5 | -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/trc-review-issue-template.md: -------------------------------------------------------------------------------- 1 | --- 2 | name: TRC Review Issue Template 3 | about: Template for normative spec issues that require TRC review 4 | title: '' 5 | labels: '' 6 | assignees: '' 7 | 8 | --- 9 | 10 | ## Links 11 | 12 | * Original Issue: https://github.com/IIIF/api/issues/ 13 | * Pull Request: https://github.com/IIIF/api/pull/ 14 | * Preview: https://preview.iiif.io/api//api/ 15 | 16 | ## Background and Summary 17 | 18 | [Summarize the issue, any relevant history, and subsequent discussion] 19 | 20 | ## Proposed Solution 21 | 22 | [Summarize the proposed solution, and any pros, cons, follow-on issues, etc.] 23 | -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/TSG_Charter.md: -------------------------------------------------------------------------------- 1 | --- 2 | name: TSG Charter Review 3 | about: Template for review of TSG Charters before their formation. 4 | title: '' 5 | labels: '' 6 | assignees: '' 7 | 8 | --- 9 | ## Charter 10 | 11 | * [TSG Charter]() 12 | 13 | ## Background and Summary 14 | 15 | [Summarize the issue, any relevant history, and subsequent discussion] 16 | 17 | ## Voting 18 | 19 | The TRC role with respect to TSG formation is to: 20 | 21 | * [Reviewing proposals for the formation and charters of new TSGs](https://iiif.io/community/trc/) 22 | 23 | So please add any comments either to the charter or in this issue. We will also hold a vote for approval so: 24 | 25 | * If you approve with the charter after submitting any of your comments please vote +1 (thumbs up). 26 | * If you don't think this group should go ahead vote -1 or thumbs down. 27 | * To abstain select the confused face. 28 | 29 | -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/recipe.md: -------------------------------------------------------------------------------- 1 | --- 2 | name: TRC Recipe review template 3 | about: Template for reviewing cookbook recipes. 4 | title: 'Recipe # : ' 5 | labels: '' 6 | assignees: '' 7 | 8 | --- 9 | 10 | ## Links 11 | 12 | * Original Issue: https://github.com/IIIF/cookbook-recipes/issues/ 13 | * Pull Request: https://github.com/IIIF/cookbook-recipes/pull/ 14 | * Preview: https://preview.iiif.io/cookbook// 15 | 16 | ## Background and Summary 17 | 18 | [Summarize the issue, any relevant history, and subsequent discussion] 19 | 20 | ## Voting and changes 21 | 22 | We welcome comments on the recipe and as well as voting +1, confused face or -1 feel free to add comments to this issue. If this issue is approved then the author will take account of the comments before we merge the branch in to the master cookbook branch. 23 | 24 | If the recipe is rejected by the TRC then we will make the changes requested and resubmit it to a future TRC meeting. If you feel that your comments are substantial enough that the recipe should be looked at again by the TRC after the changes have been made please vote -1 (thumbs down). A confused face is treated as abstaining. 25 | 26 | Changes to the recipe will only be made after the TRC voting process has concluded. 27 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | 2 | # Configuration files 3 | 4 | code/iiif-gspread-credentials.json 5 | code/token.txt 6 | 7 | # Byte-compiled / optimized / DLL files 8 | __pycache__/ 9 | *.py[cod] 10 | *$py.class 11 | 12 | *.swp 13 | 14 | # C extensions 15 | *.so 16 | 17 | # Distribution / packaging 18 | .Python 19 | build/ 20 | develop-eggs/ 21 | dist/ 22 | downloads/ 23 | eggs/ 24 | .eggs/ 25 | lib/ 26 | lib64/ 27 | parts/ 28 | sdist/ 29 | var/ 30 | wheels/ 31 | *.egg-info/ 32 | .installed.cfg 33 | *.egg 34 | MANIFEST 35 | 36 | # PyInstaller 37 | # Usually these files are written by a python script from a template 38 | # before PyInstaller builds the exe, so as to inject date/other infos into it. 39 | *.manifest 40 | *.spec 41 | 42 | # Installer logs 43 | pip-log.txt 44 | pip-delete-this-directory.txt 45 | 46 | # Unit test / coverage reports 47 | htmlcov/ 48 | .tox/ 49 | .coverage 50 | .coverage.* 51 | .cache 52 | nosetests.xml 53 | coverage.xml 54 | *.cover 55 | .hypothesis/ 56 | .pytest_cache/ 57 | 58 | # Translations 59 | *.mo 60 | *.pot 61 | 62 | # Django stuff: 63 | *.log 64 | local_settings.py 65 | db.sqlite3 66 | 67 | # Flask stuff: 68 | instance/ 69 | .webassets-cache 70 | 71 | # Scrapy stuff: 72 | .scrapy 73 | 74 | # Sphinx documentation 75 | docs/_build/ 76 | 77 | # PyBuilder 78 | target/ 79 | 80 | # Jupyter Notebook 81 | .ipynb_checkpoints 82 | 83 | # pyenv 84 | .python-version 85 | 86 | # celery beat schedule file 87 | celerybeat-schedule 88 | 89 | # SageMath parsed files 90 | *.sage.py 91 | 92 | # Environments 93 | .env 94 | .venv 95 | env/ 96 | venv/ 97 | ENV/ 98 | env.bak/ 99 | venv.bak/ 100 | 101 | # Spyder project settings 102 | .spyderproject 103 | .spyproject 104 | 105 | # Rope project settings 106 | .ropeproject 107 | 108 | # mkdocs documentation 109 | /site 110 | 111 | # mypy 112 | .mypy_cache/ 113 | -------------------------------------------------------------------------------- /code/generateMeetings.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/python 2 | 3 | import sys 4 | from ics import Calendar, Event 5 | from datetime import datetime,timedelta 6 | from dateutil import tz 7 | 8 | def timezone(timeInstance, timezone): 9 | return timeInstance.astimezone(tz.gettz(timezone)).time() 10 | 11 | if __name__ == "__main__": 12 | if len(sys.argv) != 3 and len(sys.argv) != 4: 13 | print ('Usage:\n\t./code/calendar.py [start_date YYYY-MM-DD] [Occurrence count] [Japan time frequency]') 14 | sys.exit(0) 15 | 16 | if len(sys.argv) == 3: 17 | frequency = 4 18 | else: 19 | frequency = int(sys.argv[3]) 20 | 21 | cal = Calendar() 22 | 23 | first_meeting = datetime(int(sys.argv[1][0:4]), int(sys.argv[1][5:7]), int(sys.argv[1][8:10]), 12, 0, 0, 0, tz.gettz('America/New_York')) 24 | occurences = sys.argv[2] 25 | next_meeting = first_meeting 26 | for i in range(int(occurences)): 27 | issues_shared = next_meeting - timedelta(days=7) 28 | voting_closes = next_meeting + timedelta(days=7*2) 29 | if i % frequency == 0 and i != 0: 30 | meeting_time = next_meeting.replace(hour=19) 31 | else: 32 | meeting_time = next_meeting 33 | timestr = '{} Europe / {} UK / {} US Eastern / {} US Pacific / {} Japan'.format(timezone(meeting_time, 'Europe/Paris'), timezone(meeting_time, 'Europe/London'), timezone(meeting_time, 'America/New_York'), timezone(meeting_time, 'America/Los_Angeles'), timezone(meeting_time, 'Asia/Tokyo')) 34 | print ('TRC meeting: {} ({}), \nSend out issues: {}, \nVoting closes: {}\n'.format(meeting_time.date(), timestr, issues_shared.date(), voting_closes.date())) 35 | 36 | e = Event() 37 | e.name = 'IIIF Technical Review Committee' 38 | e.begin = next_meeting 39 | cal.events.add(e) 40 | next_meeting += timedelta(days=4*7) 41 | 42 | with open('/tmp/trc.ics', 'w') as ics_file: 43 | ics_file.writelines(cal) 44 | 45 | 46 | 47 | -------------------------------------------------------------------------------- /code/counter.py: -------------------------------------------------------------------------------- 1 | 2 | from github import Github 3 | import gspread 4 | import sys 5 | import standing 6 | from oauth2client.service_account import ServiceAccountCredentials 7 | 8 | # github lib is: https://pygithub.readthedocs.io/en/latest/ 9 | # gspread lib is: https://github.com/burnash/gspread 10 | # Need to refactor away from gspread as it uses up teh quota pritty quickly. 11 | 12 | # Change this to other milestones 13 | CURR_MILESTONE = 12 14 | POST_TO_ISSUES = True 15 | 16 | # Pull in list of github accounts from the registration spreadsheet 17 | scope = ['https://spreadsheets.google.com/feeds', 18 | 'https://www.googleapis.com/auth/drive'] 19 | credentials = ServiceAccountCredentials.from_json_keyfile_name('iiif-gspread-credentials.json', scope) 20 | gc = gspread.authorize(credentials) 21 | ss1 = gc.open_by_key('1YS7X6KOB2KytqAdxDjLqp54JHOW8KVT4CJv9ZIYOhas') 22 | trc_accounts = standing.getTRCAccounts(ss1.get_worksheet(0)) 23 | activity = standing.buildStanding(ss1.get_worksheet(1), CURR_MILESTONE) 24 | 25 | # Check all accounts are in standing list if not exit 26 | missingEligable = set(trc_accounts.keys()) - set(activity.keys()) 27 | extraEligable = set(activity.keys()) - set(trc_accounts.keys()) 28 | if len(missingEligable) > 0: 29 | print ('To continue the following trc members need to have a row in the Eligability sheet:') 30 | for member in missingEligable: 31 | print (" * {} ".format(member)) 32 | print ('The following can be removed as they are no longer part of the TRC:') 33 | for member in extraEligable: 34 | print (" * {} ".format(member)) 35 | sys.exit() 36 | 37 | (eligible, ineligible) = standing.getStatus(activity) 38 | 39 | # Now configure github and repo 40 | orgName = "iiif" 41 | repoName = "trc" 42 | userName = "glenrobson" 43 | pwh = open("token.txt") 44 | pw = pwh.read().strip() 45 | pwh.close() 46 | gh = Github(userName, pw) 47 | repo = gh.get_repo("%s/%s" % (orgName, repoName)) 48 | 49 | # Find the issues for the current call 50 | milestone = repo.get_milestone(CURR_MILESTONE) 51 | issuelist = repo.get_issues(milestone=milestone) 52 | 53 | report = [] 54 | report.append("## Results for %s" % milestone.title) 55 | report.append("") 56 | report.append("### Eligible Voters: %s" % len(eligible)) 57 | report.append(" ".join(eligible)) 58 | report.append("") 59 | 60 | active = {} 61 | non_trc = {} 62 | 63 | issues = list(issuelist) 64 | issues.sort(key=lambda x: x.number) 65 | 66 | for issue in issues: 67 | reactions = list(issue.get_reactions()) 68 | comments = list(issue.get_comments()) 69 | 70 | votes = {'+1': set(), '-1': set(), '0': set()} 71 | voteNotEligable = {} 72 | for reaction in reactions: 73 | who = reaction.user.login 74 | if who in trc_accounts: 75 | trc_accounts[who] = "1" 76 | if who in eligible: 77 | which = reaction.content 78 | # Agree: '+1' Disagree: '-1' +0: 'confused' 79 | # Allow 'heart' as synonym for '+1' 80 | if which == 'confused': 81 | which = '0' 82 | elif which == 'heart': 83 | which = '+1' 84 | if which in votes: 85 | votes[which].add(who) 86 | else: 87 | voteNotEligable[who] = 1 88 | else: 89 | non_trc[who] = 1 90 | 91 | # invalid state: 92 | # same user casting multiple votes 93 | # discard all votes and make a note 94 | dupes = set() 95 | dupes.update(votes['+1'].intersection(votes['-1'])) 96 | dupes.update(votes['+1'].intersection(votes['0'])) 97 | dupes.update(votes['0'].intersection(votes['-1'])) 98 | 99 | for vv in votes.values(): 100 | for d in dupes: 101 | if d in vv: 102 | vv.remove(d) 103 | 104 | issue_report = [] 105 | issue_report.append("### Issue %s (%s)" % (issue.number, issue.title)) 106 | issue_report.append(" +1: %s [%s]" % (len(votes['+1']), ' '.join(sorted(votes['+1'])))) 107 | issue_report.append(" 0: %s [%s]" % (len(votes['0']), ' '.join(sorted(votes['0'])))) 108 | issue_report.append(" -1: %s [%s]" % (len(votes['-1']), ' '.join(sorted(votes['-1'])))) 109 | issue_report.append(" Not TRC: %s [%s]" % (len(non_trc), ' '.join(sorted(non_trc)))) 110 | issue_report.append(" Ineligible: %s [%s]" % (len(voteNotEligable), ' '.join(sorted(voteNotEligable)))) 111 | issue_report.append("") 112 | 113 | 114 | against = len(votes['0']) + len(votes['-1']) 115 | favor = len(votes['+1']) 116 | issue_report.append("### Result: %s / %s = %0.2f" % (favor, against+favor, float(favor) / (against+favor))) 117 | if float(favor) / (against + favor) >= 0.6665: 118 | issue_report.append("Super majority is in favor, issue is approved") 119 | tag = "Approved" 120 | elif float(favor) / (against + favor) >= 0.5: 121 | issue_report.append("No super majority, issue is referred to ex officio for decision") 122 | tag = "Ex Officio Decision" 123 | else: 124 | issue_report.append("Issue is rejected") 125 | tag = "Rejected" 126 | 127 | if POST_TO_ISSUES: 128 | issue_report_str = "\n".join(issue_report) 129 | issue.create_comment(issue_report_str) 130 | issue.add_to_labels(tag) 131 | 132 | report.extend(issue_report) 133 | report.append("") 134 | 135 | for comment in comments: 136 | who = comment.user.login 137 | if who in trc_accounts: 138 | trc_accounts[who] = "1" 139 | 140 | active_accounts = [] 141 | for who in trc_accounts: 142 | if trc_accounts[who] == '1': 143 | active_accounts.append(who) 144 | 145 | inactive_accounts = sorted(list(set(trc_accounts.keys()) - set(active_accounts))) 146 | 147 | report.append("### Active on Issues") 148 | report.append(" ".join(active_accounts)) 149 | report.append("") 150 | report.append("### Inactive") 151 | report.append(" ".join(inactive_accounts)) 152 | report.append("") 153 | report.append("### Discarded as Ineligible") 154 | report.append(" ".join(sorted(non_trc.keys()))) 155 | report.append(" ".join(sorted(ineligible))) 156 | report_str = '\n'.join(report) 157 | 158 | standing.updateStanding(ss1.get_worksheet(1), trc_accounts, activity, CURR_MILESTONE) 159 | if POST_TO_ISSUES: 160 | issue = repo.get_issue(1) 161 | issue.create_comment(report_str) 162 | else: 163 | print(report_str) 164 | 165 | -------------------------------------------------------------------------------- /code/standing.py: -------------------------------------------------------------------------------- 1 | from github import Github 2 | import gspread 3 | from gspread.exceptions import APIError 4 | import sys 5 | import time 6 | from oauth2client.service_account import ServiceAccountCredentials 7 | 8 | 9 | scope = ['https://spreadsheets.google.com/feeds', 10 | 'https://www.googleapis.com/auth/drive'] 11 | credentials = ServiceAccountCredentials.from_json_keyfile_name('iiif-gspread-credentials.json', scope) 12 | gsheets = gspread.authorize(credentials) 13 | 14 | def getRepo(): 15 | orgName = "iiif" 16 | repoName = "trc" 17 | userName = "glenrobson" 18 | pwh = open("token.txt") 19 | pw = pwh.read().strip() 20 | pwh.close() 21 | gh = Github(userName, pw) 22 | return gh.get_repo("%s/%s" % (orgName, repoName)) 23 | 24 | def activtyFromMilestone(milestoneNo, trc_accounts): 25 | repo = getRepo() 26 | milestone = repo.get_milestone(milestoneNo) 27 | issuelist = repo.get_issues(milestone=milestone) 28 | 29 | for issue in issuelist: 30 | reactions = list(issue.get_reactions()) 31 | comments = list(issue.get_comments()) 32 | for reaction in reactions: 33 | if reaction.user.login in trc_accounts: 34 | trc_accounts[reaction.user.login] = "1" 35 | 36 | for comment in comments: 37 | if comment.user.login in trc_accounts: 38 | trc_accounts[comment.user.login] = "1" 39 | 40 | def getTRCAccounts(sheet): 41 | sheet1 = sheet.get_all_values() 42 | trc_accouts_activity = {} 43 | for row in sheet1: 44 | if row[3] != '' and row[3] != 'Github': 45 | trc_accouts_activity[row[3]] = "0" 46 | return trc_accouts_activity 47 | 48 | def getStatus(activity): 49 | eligible = {} 50 | ineligible = {} 51 | for person in activity: 52 | if activity[person]['status'] == '1': 53 | eligible[person] = True 54 | else: 55 | ineligible[person] = False 56 | 57 | 58 | return (eligible, ineligible) 59 | 60 | def buildStanding(sheet, milestone): 61 | """ 62 | This method reads the spreadsheet and stores all of the information in the following format: 63 | { 64 | "github_username": { 65 | "status": "1 or 0", # this is the eligability status 66 | "index": 1, # this is the row number in the spreadsheet 67 | "activity": [ 68 | '0','1','0','1' # This is a list of milestones and if the user was active (1) or inactive (0) 69 | ] 70 | } 71 | } 72 | """ 73 | sheet2 = sheet.get_all_values() # Efficient method with reduced API calls 74 | activity = {} 75 | activitySize = milestone 76 | if len(sheet2[0]) - 2 > milestone: 77 | activitySize = len(sheet2[0]) - 2 78 | rowNo = 2 79 | for row in sheet2[1:]: 80 | activity[row[0]] = { 81 | "status": row[1], 82 | "activity": [''] * activitySize, 83 | "index": rowNo 84 | } 85 | rowNo += 1 86 | i = 0 87 | for cell in row[2:]: 88 | activity[row[0]]['activity'][i] = cell 89 | i += 1 90 | return activity 91 | 92 | def updateEligibility(user, activity, sheet): 93 | activityCount = 0 94 | for value in activity['activity'][-3:]: 95 | if value is '': 96 | if activity['status'] == '0': 97 | print ('{} is a new TRC user so should be eligable ({})'.format(user, activity['activity'][-3:])) 98 | sheet.update_cell(int(activity["index"]), 2, '1') 99 | return 100 | activityCount += int(value) 101 | if activity['status'] == '1' and activityCount == 0: 102 | print ("Changing {} to ineligibile. Current status {} Activity {}".format(user, activity['status'],activity['activity'][-3:])) 103 | sheet.update_cell(int(activity["index"]), 2, '0') 104 | elif activity['status'] == '0' and activityCount == 3: 105 | print ("Changing {} to eligibile. Current status {} Activity {}".format(user, activity['status'],activity['activity'][-3:])) 106 | sheet.update_cell(int(activity["index"]), 2, '1') 107 | 108 | def updateStanding(sheet, trc_accouts_activity, activity, milestone): 109 | for person in trc_accouts_activity: 110 | if activity[person]['activity'][milestone - 1] == '': 111 | activity[person]['activity'][milestone -1] = trc_accouts_activity[person] 112 | while True: 113 | try: 114 | cell = sheet.update_cell(int(activity[person]["index"]), milestone + 2, trc_accouts_activity[person]) 115 | updateEligibility(person, activity[person], sheet) 116 | break 117 | except APIError as e: 118 | print ('Reached limit, waiting 2mins before retrying') 119 | sleep(100) 120 | cell = sheet2Obj.update_cell(int(activity[person]["index"]), milestone + 2, trc_accouts_activity[person]) 121 | 122 | elif activity[person]['activity'][milestone - 1] != trc_accouts_activity[person]: 123 | print ('There is an existing value in {} milestone {} but latest count differes orig "{}" new "{}"'.format(person,milestone,activity[person]['activity'][milestone - 1], trc_accouts_activity[person])) 124 | 125 | 126 | def sleep(length): 127 | short_sleep = length / 10 128 | for i in range(10): 129 | print ('{} seconds to go'.format(int((10 - i) * short_sleep))) 130 | time.sleep(short_sleep) 131 | 132 | if __name__ == "__main__": 133 | if len(sys.argv) != 2: 134 | print ("usage:\n\tpython3 standing.py [milestone_num]") 135 | sys.exit(-1) 136 | else: 137 | milestone = int(sys.argv[1]) 138 | 139 | worksheet = gsheets.open_by_key('1YS7X6KOB2KytqAdxDjLqp54JHOW8KVT4CJv9ZIYOhas') 140 | 141 | # Get trc accounts with a default of 0 for no activity 142 | trc_accouts_activity = getTRCAccounts(worksheet.get_worksheet(0)) 143 | 144 | # Update accounts which have either voted or commented to 1 145 | activtyFromMilestone(milestone, trc_accouts_activity) 146 | 147 | activity = buildStanding(worksheet.get_worksheet(1), milestone) 148 | 149 | updateStanding(worksheet.get_worksheet(1), trc_accouts_activity, activity, milestone) 150 | 151 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | Apache License 2 | Version 2.0, January 2004 3 | http://www.apache.org/licenses/ 4 | 5 | TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION 6 | 7 | 1. Definitions. 8 | 9 | "License" shall mean the terms and conditions for use, reproduction, 10 | and distribution as defined by Sections 1 through 9 of this document. 11 | 12 | "Licensor" shall mean the copyright owner or entity authorized by 13 | the copyright owner that is granting the License. 14 | 15 | "Legal Entity" shall mean the union of the acting entity and all 16 | other entities that control, are controlled by, or are under common 17 | control with that entity. For the purposes of this definition, 18 | "control" means (i) the power, direct or indirect, to cause the 19 | direction or management of such entity, whether by contract or 20 | otherwise, or (ii) ownership of fifty percent (50%) or more of the 21 | outstanding shares, or (iii) beneficial ownership of such entity. 22 | 23 | "You" (or "Your") shall mean an individual or Legal Entity 24 | exercising permissions granted by this License. 25 | 26 | "Source" form shall mean the preferred form for making modifications, 27 | including but not limited to software source code, documentation 28 | source, and configuration files. 29 | 30 | "Object" form shall mean any form resulting from mechanical 31 | transformation or translation of a Source form, including but 32 | not limited to compiled object code, generated documentation, 33 | and conversions to other media types. 34 | 35 | "Work" shall mean the work of authorship, whether in Source or 36 | Object form, made available under the License, as indicated by a 37 | copyright notice that is included in or attached to the work 38 | (an example is provided in the Appendix below). 39 | 40 | "Derivative Works" shall mean any work, whether in Source or Object 41 | form, that is based on (or derived from) the Work and for which the 42 | editorial revisions, annotations, elaborations, or other modifications 43 | represent, as a whole, an original work of authorship. For the purposes 44 | of this License, Derivative Works shall not include works that remain 45 | separable from, or merely link (or bind by name) to the interfaces of, 46 | the Work and Derivative Works thereof. 47 | 48 | "Contribution" shall mean any work of authorship, including 49 | the original version of the Work and any modifications or additions 50 | to that Work or Derivative Works thereof, that is intentionally 51 | submitted to Licensor for inclusion in the Work by the copyright owner 52 | or by an individual or Legal Entity authorized to submit on behalf of 53 | the copyright owner. For the purposes of this definition, "submitted" 54 | means any form of electronic, verbal, or written communication sent 55 | to the Licensor or its representatives, including but not limited to 56 | communication on electronic mailing lists, source code control systems, 57 | and issue tracking systems that are managed by, or on behalf of, the 58 | Licensor for the purpose of discussing and improving the Work, but 59 | excluding communication that is conspicuously marked or otherwise 60 | designated in writing by the copyright owner as "Not a Contribution." 61 | 62 | "Contributor" shall mean Licensor and any individual or Legal Entity 63 | on behalf of whom a Contribution has been received by Licensor and 64 | subsequently incorporated within the Work. 65 | 66 | 2. Grant of Copyright License. Subject to the terms and conditions of 67 | this License, each Contributor hereby grants to You a perpetual, 68 | worldwide, non-exclusive, no-charge, royalty-free, irrevocable 69 | copyright license to reproduce, prepare Derivative Works of, 70 | publicly display, publicly perform, sublicense, and distribute the 71 | Work and such Derivative Works in Source or Object form. 72 | 73 | 3. Grant of Patent License. Subject to the terms and conditions of 74 | this License, each Contributor hereby grants to You a perpetual, 75 | worldwide, non-exclusive, no-charge, royalty-free, irrevocable 76 | (except as stated in this section) patent license to make, have made, 77 | use, offer to sell, sell, import, and otherwise transfer the Work, 78 | where such license applies only to those patent claims licensable 79 | by such Contributor that are necessarily infringed by their 80 | Contribution(s) alone or by combination of their Contribution(s) 81 | with the Work to which such Contribution(s) was submitted. If You 82 | institute patent litigation against any entity (including a 83 | cross-claim or counterclaim in a lawsuit) alleging that the Work 84 | or a Contribution incorporated within the Work constitutes direct 85 | or contributory patent infringement, then any patent licenses 86 | granted to You under this License for that Work shall terminate 87 | as of the date such litigation is filed. 88 | 89 | 4. Redistribution. You may reproduce and distribute copies of the 90 | Work or Derivative Works thereof in any medium, with or without 91 | modifications, and in Source or Object form, provided that You 92 | meet the following conditions: 93 | 94 | (a) You must give any other recipients of the Work or 95 | Derivative Works a copy of this License; and 96 | 97 | (b) You must cause any modified files to carry prominent notices 98 | stating that You changed the files; and 99 | 100 | (c) You must retain, in the Source form of any Derivative Works 101 | that You distribute, all copyright, patent, trademark, and 102 | attribution notices from the Source form of the Work, 103 | excluding those notices that do not pertain to any part of 104 | the Derivative Works; and 105 | 106 | (d) If the Work includes a "NOTICE" text file as part of its 107 | distribution, then any Derivative Works that You distribute must 108 | include a readable copy of the attribution notices contained 109 | within such NOTICE file, excluding those notices that do not 110 | pertain to any part of the Derivative Works, in at least one 111 | of the following places: within a NOTICE text file distributed 112 | as part of the Derivative Works; within the Source form or 113 | documentation, if provided along with the Derivative Works; or, 114 | within a display generated by the Derivative Works, if and 115 | wherever such third-party notices normally appear. The contents 116 | of the NOTICE file are for informational purposes only and 117 | do not modify the License. You may add Your own attribution 118 | notices within Derivative Works that You distribute, alongside 119 | or as an addendum to the NOTICE text from the Work, provided 120 | that such additional attribution notices cannot be construed 121 | as modifying the License. 122 | 123 | You may add Your own copyright statement to Your modifications and 124 | may provide additional or different license terms and conditions 125 | for use, reproduction, or distribution of Your modifications, or 126 | for any such Derivative Works as a whole, provided Your use, 127 | reproduction, and distribution of the Work otherwise complies with 128 | the conditions stated in this License. 129 | 130 | 5. Submission of Contributions. Unless You explicitly state otherwise, 131 | any Contribution intentionally submitted for inclusion in the Work 132 | by You to the Licensor shall be under the terms and conditions of 133 | this License, without any additional terms or conditions. 134 | Notwithstanding the above, nothing herein shall supersede or modify 135 | the terms of any separate license agreement you may have executed 136 | with Licensor regarding such Contributions. 137 | 138 | 6. Trademarks. This License does not grant permission to use the trade 139 | names, trademarks, service marks, or product names of the Licensor, 140 | except as required for reasonable and customary use in describing the 141 | origin of the Work and reproducing the content of the NOTICE file. 142 | 143 | 7. Disclaimer of Warranty. Unless required by applicable law or 144 | agreed to in writing, Licensor provides the Work (and each 145 | Contributor provides its Contributions) on an "AS IS" BASIS, 146 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 147 | implied, including, without limitation, any warranties or conditions 148 | of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A 149 | PARTICULAR PURPOSE. You are solely responsible for determining the 150 | appropriateness of using or redistributing the Work and assume any 151 | risks associated with Your exercise of permissions under this License. 152 | 153 | 8. Limitation of Liability. In no event and under no legal theory, 154 | whether in tort (including negligence), contract, or otherwise, 155 | unless required by applicable law (such as deliberate and grossly 156 | negligent acts) or agreed to in writing, shall any Contributor be 157 | liable to You for damages, including any direct, indirect, special, 158 | incidental, or consequential damages of any character arising as a 159 | result of this License or out of the use or inability to use the 160 | Work (including but not limited to damages for loss of goodwill, 161 | work stoppage, computer failure or malfunction, or any and all 162 | other commercial damages or losses), even if such Contributor 163 | has been advised of the possibility of such damages. 164 | 165 | 9. Accepting Warranty or Additional Liability. While redistributing 166 | the Work or Derivative Works thereof, You may choose to offer, 167 | and charge a fee for, acceptance of support, warranty, indemnity, 168 | or other liability obligations and/or rights consistent with this 169 | License. However, in accepting such obligations, You may act only 170 | on Your own behalf and on Your sole responsibility, not on behalf 171 | of any other Contributor, and only if You agree to indemnify, 172 | defend, and hold each Contributor harmless for any liability 173 | incurred by, or claims asserted against, such Contributor by reason 174 | of your accepting any such warranty or additional liability. 175 | 176 | END OF TERMS AND CONDITIONS 177 | 178 | APPENDIX: How to apply the Apache License to your work. 179 | 180 | To apply the Apache License to your work, attach the following 181 | boilerplate notice, with the fields enclosed by brackets "[]" 182 | replaced with your own identifying information. (Don't include 183 | the brackets!) The text should be enclosed in the appropriate 184 | comment syntax for the file format. We also recommend that a 185 | file or class name and description of purpose be included on the 186 | same "printed page" as the copyright notice for easier 187 | identification within third-party archives. 188 | 189 | Copyright [yyyy] [name of copyright owner] 190 | 191 | Licensed under the Apache License, Version 2.0 (the "License"); 192 | you may not use this file except in compliance with the License. 193 | You may obtain a copy of the License at 194 | 195 | http://www.apache.org/licenses/LICENSE-2.0 196 | 197 | Unless required by applicable law or agreed to in writing, software 198 | distributed under the License is distributed on an "AS IS" BASIS, 199 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 200 | See the License for the specific language governing permissions and 201 | limitations under the License. 202 | --------------------------------------------------------------------------------