swegen 0.1.0__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,292 @@
1
+ Metadata-Version: 2.4
2
+ Name: swegen
3
+ Version: 0.1.0
4
+ Summary: Pipeline to convert GitHub PRs into Harbor tasks
5
+ Project-URL: Homepage, https://github.com/abundant-ai/swe-gen
6
+ Project-URL: Repository, https://github.com/abundant-ai/swe-gen
7
+ Project-URL: Issues, https://github.com/abundant-ai/swe-gen/issues
8
+ Author-email: Rishi Desai <rishi@abundant.ai>
9
+ License: Apache-2.0
10
+ License-File: LICENSE
11
+ Keywords: harbor,swe-bench,terminal-bench
12
+ Classifier: Development Status :: 3 - Alpha
13
+ Classifier: Intended Audience :: Developers
14
+ Classifier: License :: OSI Approved :: Apache Software License
15
+ Classifier: Programming Language :: Python :: 3
16
+ Classifier: Programming Language :: Python :: 3.12
17
+ Classifier: Topic :: Software Development :: Quality Assurance
18
+ Classifier: Topic :: Software Development :: Testing
19
+ Requires-Python: >=3.12
20
+ Requires-Dist: claude-agent-sdk>=0.1.20
21
+ Requires-Dist: click>=8.3.1
22
+ Requires-Dist: docker>=7.1.0
23
+ Requires-Dist: gitpython>=3.1.46
24
+ Requires-Dist: harbor>=0.1.41
25
+ Requires-Dist: openai>=2.15.0
26
+ Requires-Dist: pydantic>=2.12.5
27
+ Requires-Dist: pygithub>=2.8.1
28
+ Requires-Dist: python-dotenv>=1.2.1
29
+ Requires-Dist: pyyaml>=6.0.3
30
+ Requires-Dist: requests>=2.32.5
31
+ Requires-Dist: rich>=14.2.0
32
+ Requires-Dist: typer>=0.21.1
33
+ Provides-Extra: dev
34
+ Requires-Dist: black>=25.12.0; extra == 'dev'
35
+ Requires-Dist: pytest>=9.0.2; extra == 'dev'
36
+ Requires-Dist: ruff>=0.14.10; extra == 'dev'
37
+ Description-Content-Type: text/markdown
38
+
39
+ # SWE-gen
40
+
41
+ > Convert merged GitHub PRs into [Harbor](https://github.com/laude-institute/harbor) tasks automatically.
42
+
43
+ [![License](https://img.shields.io/badge/License-Apache%202.0-blue.svg)](https://opensource.org/licenses/Apache-2.0)
44
+ [![Python 3.12+](https://img.shields.io/badge/python-3.12+-blue.svg)](https://www.python.org/downloads/)
45
+
46
+ ## Overview
47
+
48
+ Automates creation of Harbor tasks from real-world bug fixes in open-source repositories. Works with **any programming language**: Claude Code analyzes the repo to detect language, runtime, build system, and test framework.
49
+
50
+ Each task reverses a merged PR to recreate the buggy state, validates tests fail on baseline, and pass after applying the fix. Fully containerized with all dependencies installed at build time.
51
+
52
+ ## Quick Start
53
+
54
+ ```bash
55
+ # Install
56
+ uv pip install -e .
57
+
58
+ # Generate a task from a merged PR
59
+ swegen create --repo axios/axios --pr 7150 --verbose
60
+
61
+ # Or farm all PRs from a repo
62
+ swegen farm fastapi/fastapi
63
+ ```
64
+
65
+ ## Installation
66
+
67
+ ```bash
68
+ uv pip install -e .
69
+ ```
70
+
71
+ **Requirements:**
72
+ - Python 3.12+
73
+ - Docker
74
+ - uv
75
+ - [Claude Code CLI](https://github.com/anthropics/claude-code)
76
+
77
+ **Secrets:** Create a `.env` file:
78
+
79
+ ```bash
80
+ export GITHUB_TOKEN=<gh-token>
81
+ export OPENAI_API_KEY=<api-key>
82
+ export ANTHROPIC_API_KEY=<api-key> # or CLAUDE_CODE_OAUTH_TOKEN
83
+ ```
84
+
85
+ **Note:** Cloud sandbox environments (Daytona, E2B, Modal, etc.) require additional API keys.
86
+
87
+ ## Usage
88
+
89
+ **Commands:**
90
+ - `swegen create` — Generate task from a merged PR (validates by default)
91
+ - `swegen farm` — Continuously process PRs from a repository
92
+ - `swegen validate` — Validate existing Harbor task (NOP + Oracle)
93
+ - `swegen analyze` — Deep analysis with agent trials to verify task quality
94
+
95
+ ### Generate a Task
96
+
97
+ ```bash
98
+ swegen create --repo <owner/repo> --pr <num>
99
+ ```
100
+
101
+ <details>
102
+ <summary>Options</summary>
103
+
104
+ - `--output PATH` — Output directory for generated tasks (default: `tasks`)
105
+ - `--state-dir PATH` — State directory for cache/logs (default: `.state`)
106
+ - `--cc-timeout N` — Claude Code session timeout in seconds (default: 3200)
107
+ - `--env, -e TYPE` — Environment type: `docker`, `daytona`, `e2b`, `modal`, `runloop`, `gke` (default: `docker`)
108
+ - `--no-validate` — Skip Harbor validations
109
+ - `--force` — Bypass local dedupe and regenerate
110
+ - `--no-cache` — Disable cached artifacts from previous tasks
111
+ - `--no-require-minimum-difficulty` — Skip 3+ file and LLM substantiality checks
112
+ - `--min-source-files N` — Minimum number of source files required (default: 3, tests excluded)
113
+ - `--max-source-files N` — Maximum number of source files to avoid large refactors (default: 10, tests excluded)
114
+ - `--no-require-issue` — Allow PRs without linked issues (uses PR body/title for instructions)
115
+ - `-v, --verbose` / `-q, --quiet`
116
+
117
+ </details>
118
+
119
+ ### Continuous PR Farming
120
+
121
+ Stream through entire PR history, process each immediately with automatic state persistence.
122
+
123
+ ```bash
124
+ swegen farm fastapi/fastapi
125
+ swegen farm fastapi/fastapi --resume-from 2024-01-15
126
+ swegen farm fastapi/fastapi --reset
127
+ ```
128
+
129
+ **Features:** Page-by-page streaming, automatic resumption, graceful shutdown (Ctrl+C), quality filters (test changes + minimum difficulty)
130
+
131
+ <details>
132
+ <summary>Options</summary>
133
+
134
+ - `--output PATH` — Output directory for generated tasks (default: `tasks`)
135
+ - `--state-dir PATH` — State directory for cache/logs (default: `.state`)
136
+ - `--timeout N` — Timeout per PR in seconds (default: 300)
137
+ - `--cc-timeout N` — Claude Code session timeout (default: 3200)
138
+ - `--task-delay N` — Delay between tasks in seconds (default: 60)
139
+ - `--api-delay N` — Delay between GitHub API calls in seconds (default: 0.5)
140
+ - `--env, -e TYPE` — Environment type: `docker`, `daytona`, `e2b`, `modal`, `runloop`, `gke` (default: `docker`)
141
+ - `--resume-from DATE` — Resume from date or timestamp
142
+ - `--reset` — Reset state and start from beginning
143
+ - `--dry-run` — Preview without generation
144
+ - `--force` — Regenerate even if task already exists (default: true)
145
+ - `--no-validate` — Skip Harbor validation step
146
+ - `--issue-only` — Only process PRs with linked issues (default: True)
147
+ - `--no-require-minimum-difficulty` — Skip 3+ file and LLM checks
148
+ - `--min-source-files N` — Minimum number of source files required (default: 3, tests excluded)
149
+ - `--max-source-files N` — Maximum number of source files to avoid large refactors (default: 10, tests excluded)
150
+ - `--no-cache` — Disable cached artifacts
151
+ - `--docker-prune-batch N` — Run docker cleanup after every N PRs (default: 5, 0 to disable)
152
+ - `--skip-list PATH` — Path to file with task IDs to skip (one per line)
153
+ - `-v, --verbose`
154
+
155
+ </details>
156
+
157
+ ### Validate Existing Tasks
158
+
159
+ Verify that a task passes NOP (baseline fails) and Oracle (solution succeeds) agents:
160
+
161
+ ```bash
162
+ swegen validate tasks/<task_id>
163
+ ```
164
+
165
+ <details>
166
+ <summary>Options</summary>
167
+
168
+ - `--task, -t ID` — Task ID when path points to dataset root
169
+ - `--agent TYPE` — `both`, `nop`, or `oracle` (default: `both`)
170
+ - `--jobs-dir PATH` — Directory to store Harbor job artifacts (default: `.state/harbor-jobs`)
171
+ - `--env, -e TYPE` — Environment type: `docker`, `daytona`, `e2b`, `modal`, `runloop`, `gke` (default: `docker`)
172
+ - `--timeout-multiplier N` — Multiply default timeouts
173
+ - `--max-parallel N` — Max parallel validations (default: 8)
174
+ - `--show-passed` — Show passed tasks in batch mode
175
+ - `--output, -o PATH` — Write results to file as they complete (batch mode only)
176
+ - `--docker-prune-batch N` — Run docker cleanup after every N tasks (default: 5, 0 to disable)
177
+ - `-v, --verbose` / `-q, --quiet`
178
+
179
+ </details>
180
+
181
+ ### Analyze Task Quality
182
+
183
+ Run agent trials to verify a task is well-specified and solvable:
184
+
185
+ ```bash
186
+ swegen analyze tasks/<task_id>
187
+ swegen analyze tasks/<task_id> -k 5 -a claude-code
188
+ ```
189
+
190
+ <details>
191
+ <summary>Analysis Pipeline</summary>
192
+
193
+ 1. Static quality check (Harbor's `tasks check`)
194
+ 2. Baseline validation (nop should fail, oracle should pass)
195
+ 3. Run N agent trials (default: 3 with Claude Code)
196
+ 4. AI-powered trial classification (identifies TASK vs AGENT problems)
197
+ 5. Task verdict synthesis with actionable recommendations
198
+
199
+ **Classification categories:**
200
+ - `GOOD_SUCCESS` — Agent solved it correctly
201
+ - `BAD_SUCCESS` — Agent cheated or tests too permissive
202
+ - `GOOD_FAILURE` — Agent failed due to its own limitations (expected for hard tasks)
203
+ - `BAD_FAILURE` — Agent failed due to task issues (underspecified, brittle tests, etc.)
204
+ - `HARNESS_ERROR` — Infrastructure problem
205
+
206
+ </details>
207
+
208
+ <details>
209
+ <summary>Options</summary>
210
+
211
+ - `-a, --agent TYPE` — Agent to run trials (default: `claude-code`)
212
+ - `-m, --model MODEL` — Model for agent trials (default: `anthropic/claude-sonnet-4-5`)
213
+ - `-k, --n-trials N` — Number of trials (default: 3)
214
+ - `-n, --n-concurrent N` — Number of concurrent trials (default: 3, 1=sequential)
215
+ - `--jobs-dir PATH` — Directory to store job artifacts (default: `.state/analyze-jobs`)
216
+ - `--analysis-model MODEL` — Model for Claude Code classification (default: `claude-sonnet-4-5`)
217
+ - `--env, -e TYPE` — Environment type: `docker`, `daytona`, `e2b`, `modal`, `runloop`, `gke` (default: `docker`)
218
+ - `--skip-quality-check` — Skip static quality check
219
+ - `--skip-baseline` — Skip baseline validation (nop/oracle)
220
+ - `--skip-classify` — Skip AI-powered classification
221
+ - `--save-to-dir` — Write trajectory-analysis.{md,json} to each trial directory (for CI integration)
222
+ - `--classification-timeout N` — Timeout per trial classification in seconds (default: 300)
223
+ - `--verdict-timeout N` — Timeout for verdict synthesis in seconds (default: 180)
224
+ - `--timeout-multiplier N` — Multiply default timeouts
225
+ - `-v, --verbose`
226
+
227
+ </details>
228
+
229
+ ## Task Requirements
230
+
231
+ <details>
232
+ <summary>Valid PR criteria</summary>
233
+
234
+ **Languages:** Any (Python, JavaScript, TypeScript, Go, Rust, Ruby, Java, etc.)
235
+
236
+ **Valid PRs must:**
237
+ - Be merged to primary branch with accessible fork
238
+ - Include test changes and corresponding fix
239
+ - Have a linked issue for high-quality instructions (bypass with `--no-require-issue`)
240
+ - Modify 3-10 source files (configurable with `--min-source-files` and `--max-source-files`, bypass with `--no-require-minimum-difficulty`)
241
+ - Pass LLM substantiality evaluation (bypass with `--no-require-minimum-difficulty`)
242
+ - Fail tests on reversed baseline, pass after applying fix
243
+ - Exclude documentation-only, formatting-only, or version-bump-only changes
244
+
245
+ </details>
246
+
247
+ ## How It Works
248
+
249
+ <details>
250
+ <summary>Pipeline details</summary>
251
+
252
+ The pipeline uses a **language-agnostic approach**:
253
+
254
+ 1. **Fetch & Analyze** — Get PR metadata via GitHub API, clone repo, identify test files
255
+ 2. **Evaluate** — LLM evaluates PR substantiality and generates task instructions
256
+ 3. **Generate Skeleton** — Create Dockerfile and test.sh with TODOs for Claude Code
257
+ 4. **Claude Code Completion** — CC analyzes repo, detects language/runtime/build system, fills in skeleton
258
+ 5. **Validation** — Run NOP (reward=0) and Oracle (reward=1) agents
259
+ 6. **Iteration** — CC iterates until both agents pass
260
+
261
+ **Key Details:**
262
+ - Dockerfile clones at HEAD, then applies `bug.patch` to revert to buggy BASE state
263
+ - Test files stored in `task/tests/` and copied at runtime (prevents agent tampering)
264
+ - `fix.patch` (solution) excludes tests/CI, contains all other PR changes
265
+ - Dependencies installed at build time; runtime doesn't require internet access
266
+ - Successful tasks are cached as references to speed up future tasks from the same repo
267
+ - PR evaluation uses LLM to check substantiality and generate instructions
268
+
269
+ </details>
270
+
271
+ ## Examples
272
+
273
+ ```bash
274
+ # Generate a Python task
275
+ swegen create --repo kludex/starlette --pr 2949
276
+
277
+ # a JavaScript task
278
+ swegen create --repo axios/axios --pr 7150
279
+
280
+ # Continuous farming
281
+ swegen farm colinhacks/zod
282
+
283
+ # Validate existing task
284
+ swegen validate examples/axios__axios-7150
285
+
286
+ # Analyze task quality with agent trials
287
+ swegen analyze examples/axios__axios-7150
288
+ ```
289
+
290
+ ## License
291
+
292
+ [Apache License 2.0](LICENSE)
@@ -0,0 +1,35 @@
1
+ swegen/__init__.py,sha256=Fq2I4iQyFo6vZEw5Q_Q64F4P52zW6eJ6PISc6bZQecw,201
2
+ swegen/cli.py,sha256=e9tgqEVNSX3kVOPx0Y7gP7E8LPsYePmFTfBOytzgqAE,15053
3
+ swegen/config.py,sha256=z2t-Qo_VxvbYX0hga3Wr0Trp_eLX21ioPsPaosdHCQs,5909
4
+ swegen/analyze/__init__.py,sha256=_GIqCXLxP6YC99yy7lmSsEft3h5WotAK-7CPod7A1cY,574
5
+ swegen/analyze/classifier.py,sha256=eEFCtlcVkhvyQbX8mgPrNgbym35xVn3mmiST0ZL4N7w,24906
6
+ swegen/analyze/classify_prompt.txt,sha256=CStUh5-Hrv5IueLAEIW4u147HOT6QRTBWavklxxKCGE,12942
7
+ swegen/analyze/models.py,sha256=VUnzzj8rok_4cG5z79jkBdfZWx9Jla6P5YHGpjB2Vio,8417
8
+ swegen/analyze/run.py,sha256=8_By1Qa2_VDHE6FAt01rzeNyLpkJb25QUwJnSZogbpE,23361
9
+ swegen/analyze/verdict_prompt.txt,sha256=1I-jReZXUIiyC2i0cwKmmSEeJzM4M1Z1NAg1kZt_c34,5781
10
+ swegen/create/__init__.py,sha256=MRicK0sQEXj_UgpDc26S5Sv4VGX0U0JyF7eHjKRZH5c,652
11
+ swegen/create/claude_code_runner.py,sha256=FiVMgNcu-D9xPEzgBda1u4u5saqmAtr7ur2rjJElUHg,34316
12
+ swegen/create/claude_code_utils.py,sha256=pKJ6Qv0Mnq9hRq8iR6lecufAuNpGCNADnOMwen4sG_Q,3740
13
+ swegen/create/create.py,sha256=wf3QooQ4mn_qQCYzmryEqG8z8ZJScbwLX7LuHHQtFYE,26311
14
+ swegen/create/diff_utils.py,sha256=eugCgBwqt3PnjSs9DFs41DvQ7D2iktfe71zIkq5Yv8c,4722
15
+ swegen/create/orchestrator.py,sha256=H4jrBiRX3OBlamAa_lM3WozXedHoaGvixYVbSmfKRyc,15302
16
+ swegen/create/pr_fetcher.py,sha256=GuFxSyQ0m4i8tpObsw0B3cyR62Y5UWK7hkZ5KGw12T8,7703
17
+ swegen/create/repo_cache.py,sha256=siGEe4OotnT1EG9t66Zlu7NPmqs64daG3nKuecohzXI,6297
18
+ swegen/create/task_instruction.py,sha256=4FleYmdOeiaeoPUQwVA49YFDc__ApKsT9EiASYVE2l4,15998
19
+ swegen/create/task_reference.py,sha256=dwbkG9bigaRal50kBFyl742ZnsBXLVdvpxUFkK7qyiU,4007
20
+ swegen/create/task_skeleton.py,sha256=eMS1OFt8zrxyAdKo1kTOPndMS2qcLp6LCzfTa1INySo,9005
21
+ swegen/create/utils.py,sha256=4INLgksq15KLVCV8BHh0EvOuQJyY-eDzVZnwqZwHbzc,10622
22
+ swegen/farm/__init__.py,sha256=rQuM2PLAwknR0JD8mYl-vOsqYm4c6wypd_GIz1r2CUA,311
23
+ swegen/farm/farm_hand.py,sha256=r-Ud4D6IOoBuahqlKC4mTX9FWaDnkpuMJINIojz1gbc,11266
24
+ swegen/farm/fetcher.py,sha256=3vynVEcyxrCc2x2sv9rD19MFblXZStPUoNw9X1ehUdY,12402
25
+ swegen/farm/state.py,sha256=WvYe50IRxUshd8PIXZAUCPrr30BHrRvqviynSpXij5Y,9349
26
+ swegen/farm/stream_farm.py,sha256=LCfXACyEmsvQRH0SeypwGm61n-6evtlidSBI-uSKOgc,16760
27
+ swegen/tools/__init__.py,sha256=vnmVcRAf6W0afnhvPGTWO58Twj_8jdJvbmmnrbnAAFM,342
28
+ swegen/tools/harbor_runner.py,sha256=6HGJ-TUwB-DtRFAbeMSObf6W9bk2HMOfOo1pA_3gNsk,7222
29
+ swegen/tools/validate.py,sha256=lZwRr_lngtHYvTtEhicIxppJ3YsO6aO7InPLrv8UUAY,18104
30
+ swegen/tools/validate_utils.py,sha256=eRY_yUIJ0txz50SFXDoa3cMnxKiSC0pVKhZBUKCsS50,4549
31
+ swegen-0.1.0.dist-info/METADATA,sha256=0mjFtgsmT1uQsjPnqs5ONl6wgddib1r2A9NMWc0VxBg,11350
32
+ swegen-0.1.0.dist-info/WHEEL,sha256=WLgqFyCfm_KASv4WHyYy0P3pM_m7J5L9k2skdKLirC8,87
33
+ swegen-0.1.0.dist-info/entry_points.txt,sha256=DuRHqr-KOvo6KLwdVlht21TfTLbD9_PcZWPFwSa4Z9s,71
34
+ swegen-0.1.0.dist-info/licenses/LICENSE,sha256=xx0jnfkXJvxRnG63LTGOxlggYnIysveWIZ6H3PNdCrQ,11357
35
+ swegen-0.1.0.dist-info/RECORD,,
@@ -0,0 +1,4 @@
1
+ Wheel-Version: 1.0
2
+ Generator: hatchling 1.28.0
3
+ Root-Is-Purelib: true
4
+ Tag: py3-none-any
@@ -0,0 +1,3 @@
1
+ [console_scripts]
2
+ harbor = harbor.cli.main:app
3
+ swegen = swegen.cli:app
@@ -0,0 +1,201 @@
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.