labtasker-webui 0.1.1__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,15 @@
1
+ <!doctype html>
2
+ <html lang="en">
3
+ <head>
4
+ <meta charset="UTF-8" />
5
+ <meta name="viewport" content="width=device-width,initial-scale=1.0" />
6
+ <link rel="icon" type="image/png" href="/labtasker-icon.png" />
7
+ <title>Labtasker</title>
8
+ <script type="module" crossorigin src="/assets/index-D2PfKj6B.js"></script>
9
+ <link rel="stylesheet" crossorigin href="/assets/index-CscGvBx9.css">
10
+ </head>
11
+ <body>
12
+ <div id="root"></div>
13
+ <div id="toast" aria-live="polite"></div>
14
+ </body>
15
+ </html>
@@ -0,0 +1,140 @@
1
+ from __future__ import annotations
2
+
3
+ from typing import Any
4
+ from urllib.parse import urljoin
5
+
6
+ import httpx
7
+
8
+ from .security import DestinationBlocked, validate_resolved_destination, validate_server_url
9
+ from .sessions import Connection
10
+
11
+ MAX_RESPONSE_BYTES = 16 * 1024 * 1024
12
+
13
+
14
+ class UpstreamError(Exception):
15
+ def __init__(self, status: int, code: str, message: str, details: Any = None) -> None:
16
+ self.status = status
17
+ self.code = code
18
+ self.message = message
19
+ self.details = details if details is not None else {}
20
+ super().__init__(message)
21
+
22
+
23
+ class Upstream:
24
+ def __init__(self, allowed_origins: tuple[str, ...], strict: bool) -> None:
25
+ self.allowed_origins = allowed_origins
26
+ self.strict = strict
27
+
28
+ async def request(
29
+ self,
30
+ connection: Connection,
31
+ method: str,
32
+ path: str,
33
+ *,
34
+ params: dict[str, Any] | None = None,
35
+ ) -> Any:
36
+ is_local = connection.socket_path is not None
37
+ base = (
38
+ "http://localhost"
39
+ if is_local
40
+ else validate_server_url(connection.server_url, self.allowed_origins, self.strict)
41
+ )
42
+ url = urljoin(base.rstrip("/") + "/", path.lstrip("/"))
43
+ headers = {"Accept": "application/json"}
44
+ if connection.token and not is_local:
45
+ headers["Authorization"] = f"Bearer {connection.token}"
46
+ for _ in range(6):
47
+ if not is_local:
48
+ validate_resolved_destination(url, self.allowed_origins, self.strict)
49
+ try:
50
+ async with httpx.AsyncClient(
51
+ timeout=15,
52
+ follow_redirects=False,
53
+ transport=httpx.AsyncHTTPTransport(uds=connection.socket_path)
54
+ if is_local
55
+ else None,
56
+ trust_env=not is_local,
57
+ ) as client:
58
+ response = await client.request(method, url, params=params, headers=headers)
59
+ except (httpx.RequestError, DestinationBlocked) as exc:
60
+ if is_local:
61
+ raise UpstreamError(
62
+ 502,
63
+ "local_unavailable",
64
+ "Cannot connect to the existing local instance for "
65
+ f"{connection.server_url.removeprefix('local:')}. "
66
+ "Make sure it is running, then retry. WebUI never starts it.",
67
+ ) from exc
68
+ raise UpstreamError(502, "upstream_unavailable", str(exc)) from exc
69
+ if response.is_redirect:
70
+ if is_local:
71
+ raise UpstreamError(
72
+ 502, "local_redirect", "Local instances must not redirect requests."
73
+ )
74
+ target = response.headers.get("location")
75
+ if not target:
76
+ raise UpstreamError(
77
+ 502, "malformed_upstream", "Upstream returned an empty redirect."
78
+ )
79
+ url = urljoin(url, target)
80
+ validate_server_url(url, self.allowed_origins, self.strict)
81
+ continue
82
+ if response.status_code >= 400:
83
+ try:
84
+ body = response.json().get("error", {})
85
+ except Exception:
86
+ body = {}
87
+ raise UpstreamError(
88
+ response.status_code,
89
+ body.get("code", "upstream_error"),
90
+ body.get("message", f"Labtasker Server returned HTTP {response.status_code}."),
91
+ body.get("details", {}),
92
+ )
93
+ if len(response.content) > MAX_RESPONSE_BYTES:
94
+ raise UpstreamError(
95
+ 502,
96
+ "upstream_response_too_large",
97
+ "Labtasker Server returned more than 16 MiB in one response.",
98
+ {"limit_bytes": MAX_RESPONSE_BYTES},
99
+ )
100
+ if response.status_code == 204:
101
+ return None
102
+ try:
103
+ return response.json()
104
+ except ValueError as exc:
105
+ raise UpstreamError(
106
+ 502, "malformed_upstream", "Labtasker Server returned invalid JSON."
107
+ ) from exc
108
+ raise UpstreamError(502, "redirect_limit", "Labtasker Server redirected too many times.")
109
+
110
+ async def verify(self, connection: Connection) -> dict[str, Any]:
111
+ health = await self.request(connection, "GET", "/health")
112
+ if (
113
+ not isinstance(health, dict)
114
+ or health.get("status") != "ok"
115
+ or str(health.get("api_version")) != "2"
116
+ ):
117
+ raise UpstreamError(
118
+ 409, "incompatible_api", "This WebUI requires Labtasker API version 2."
119
+ )
120
+ schema = await self.request(connection, "GET", "/openapi.json")
121
+ paths = schema.get("paths") if isinstance(schema, dict) else None
122
+ required = {
123
+ "/api/v2/queues": {"get"},
124
+ "/api/v2/queues/{queue}/tasks": {"get"},
125
+ "/api/v2/queues/{queue}/tasks/count": {"get"},
126
+ "/api/v2/queues/{queue}/tasks/{task_id}": {"get", "delete"},
127
+ "/api/v2/queues/{queue}/tasks/{task_id}/cancel": {"post"},
128
+ "/api/v2/queues/{queue}/tasks/{task_id}/requeue": {"post"},
129
+ }
130
+ compatible = isinstance(paths, dict) and all(
131
+ path in paths and methods.issubset(paths[path]) for path, methods in required.items()
132
+ )
133
+ if not compatible:
134
+ raise UpstreamError(
135
+ 409,
136
+ "incompatible_api",
137
+ "The Server OpenAPI contract is missing endpoints required by this WebUI.",
138
+ )
139
+ await self.request(connection, "GET", "/api/v2/queues")
140
+ return health
@@ -0,0 +1,177 @@
1
+ Metadata-Version: 2.5
2
+ Name: labtasker-webui
3
+ Version: 0.1.1
4
+ Summary: A focused web interface for Labtasker v2
5
+ Project-URL: Homepage, https://github.com/luocfprime/labtasker-webui
6
+ Project-URL: Repository, https://github.com/luocfprime/labtasker-webui
7
+ Project-URL: Issues, https://github.com/luocfprime/labtasker-webui/issues
8
+ License-Expression: Apache-2.0
9
+ License-File: LICENSE
10
+ Requires-Python: >=3.11
11
+ Requires-Dist: fastapi<1,>=0.115
12
+ Requires-Dist: httpx[socks]<1,>=0.27
13
+ Requires-Dist: labtasker-client<3,>=2.1
14
+ Requires-Dist: uvicorn<1,>=0.34
15
+ Provides-Extra: local
16
+ Requires-Dist: labtasker-client<3,>=2.1; extra == 'local'
17
+ Description-Content-Type: text/markdown
18
+
19
+ # Labtasker WebUI
20
+
21
+ Labtasker WebUI connects to an existing [Labtasker](https://github.com/luocfprime/labtasker)
22
+ v2 Server or local project.
23
+ It brings Queue progress, Task details, and structured results into one compact
24
+ workspace, with reusable views for different experiments.
25
+
26
+ [![Labtasker WebUI showing Queue progress, filters, and custom Task columns](https://raw.githubusercontent.com/luocfprime/labtasker-webui/main/assets/screenshot.png)](https://raw.githubusercontent.com/luocfprime/labtasker-webui/main/assets/screenshot.png)
27
+
28
+ The key features are:
29
+
30
+ - **Queue progress at a glance:** Track pending, running, succeeded, failed, and
31
+ cancelled Tasks. Status counts follow the same filters as the Task list.
32
+ - **Flexible result exploration:** Filter Task fields and nested values, or add
33
+ custom columns such as `args.test_num` and `result.succ_rate`. Resize, reorder,
34
+ and double-click columns to fit their contents.
35
+ - **Reusable data views:** Save filters, sorting, and column layouts for each
36
+ connection and Queue. Switch views without rebuilding the table each time.
37
+ - **Complete Task inspection:** Open a Task to inspect its arguments, metadata,
38
+ execution timeline, errors, and results. Cancel, requeue, or delete selected
39
+ Tasks through explicit controls.
40
+ - **Easy local use:** Launch from Python without Node.js. Remember connections
41
+ and UI preferences in the WebUI working directory's `.labtasker/` folder.
42
+
43
+ ## Installation
44
+
45
+ Labtasker WebUI requires Python 3.11 or newer. Run it with `uv`:
46
+
47
+ ```bash
48
+ uvx labtasker-webui
49
+ ```
50
+
51
+ Or install and run it with pip:
52
+
53
+ ```bash
54
+ python -m pip install labtasker-webui
55
+ labtasker-webui
56
+ ```
57
+
58
+ Open <http://127.0.0.1:8080> to connect. The Python package includes the built
59
+ frontend; Node.js is only needed for development and building the package.
60
+
61
+ ## Example
62
+
63
+ Choose a connection type on the connection page:
64
+
65
+ - **HTTP Server:** Enter a Server URL starting with `http://` or `https://`, plus
66
+ a Bearer token if the Server requires one.
67
+ - **Local project:** Enter the directory of an already-running Labtasker project.
68
+ `.` refers to the WebUI process's working directory. Local attachment uses the
69
+ project's Unix socket and requires POSIX and a loopback bind.
70
+
71
+ Open a Queue, then filter its Tasks:
72
+
73
+ ```python
74
+ status in ["pending", "running"]
75
+ ```
76
+
77
+ Add a custom column through **Columns**, using a JSON path:
78
+
79
+ ```text
80
+ args.test_num
81
+ result.succ_rate
82
+ ```
83
+
84
+ Missing values stay blank. Dropdowns and filter presets apply immediately;
85
+ text filters apply on Enter or when leaving the input group. **Apply** remains
86
+ available as a fallback.
87
+
88
+ Use **+ Create view** beside the breadcrumbs to save the current filters,
89
+ sorting, and columns. A dot marks changes to the selected view; **Save** updates
90
+ it. The actions menu provides **Save as…**, **Rename**, **Reset changes**, and
91
+ **Delete**. Deleting a view leaves Tasks and the current layout intact.
92
+
93
+ The list loads more Tasks as you scroll and preserves existing selections.
94
+ While reading older rows, background refresh does not reorder the list.
95
+ Returning to the top resumes live refresh; **Refresh** updates it explicitly.
96
+ Click a Task to open its details. Dates use local time, with full timestamps
97
+ available on hover.
98
+
99
+ ## Project profiles
100
+
101
+ On loopback binds, the WebUI remembers settings in its working directory:
102
+
103
+ | File | Contents |
104
+ | --- | --- |
105
+ | `.labtasker/webui-profile.json` | Connection, columns, views, filters, and UI preferences |
106
+ | `.labtasker/webui-token` | Bearer token, stored separately with owner-only permissions |
107
+
108
+ Both files use `0600` permissions. The token is plaintext in its protected local
109
+ file; it is never returned by the profile API or stored in browser storage.
110
+ The browser uses an opaque `HttpOnly`, `SameSite=Strict` session cookie.
111
+
112
+ Profiles are separate from Labtasker's `.labtasker/config.toml`. Named views and
113
+ column layouts are scoped to the connection and Queue. Disconnecting removes
114
+ the remembered connection while retaining UI preferences.
115
+
116
+ Use `--no-profile` to disable disk persistence. Browser-local settings remain
117
+ available; interactive connections then expire after 12 hours of inactivity or
118
+ a WebUI restart. Profiles are disabled for non-loopback binds.
119
+
120
+ ## Configuration
121
+
122
+ Connection addresses, project directories, and tokens are configured in the UI.
123
+ The CLI only controls how the WebUI itself runs:
124
+
125
+ | CLI | Environment | Default |
126
+ | --- | --- | --- |
127
+ | `--host` | `LABTASKER_WEBUI_HOST` | `127.0.0.1` |
128
+ | `--port` | `LABTASKER_WEBUI_PORT` | `8080` |
129
+ | `--no-profile` | — | Persistence enabled on loopback |
130
+
131
+ Non-loopback deployments require an explicit allowlist of upstream origins:
132
+
133
+ ```bash
134
+ LABTASKER_WEBUI_ALLOWED_SERVER_ORIGINS=https://tasks.example labtasker-webui --host 0.0.0.0
135
+ ```
136
+
137
+ Separate multiple origins with commas. The WebUI has no user or role system;
138
+ restrict network access and use authentication/TLS at a trusted reverse proxy
139
+ for shared deployments. The backend validates upstream origins and redirects,
140
+ uses HTTPX's environment proxy settings, and keeps credentials out of browser
141
+ responses.
142
+
143
+ ## Scope
144
+
145
+ Labtasker WebUI inspects existing workloads and supports cancellation, requeue,
146
+ and permanent deletion of explicitly selected Task IDs. Batch deletion reports
147
+ each result; it is not an atomic operation.
148
+
149
+ Use the Labtasker Client, CLI, or Workers to submit and execute Tasks. The WebUI
150
+ does not submit or edit Tasks, schedule work, allocate resources, or manage the
151
+ Labtasker process. Local mode only attaches to an existing instance and never
152
+ opens its database.
153
+
154
+ ## Documentation
155
+
156
+ - [Specification](https://github.com/luocfprime/labtasker-webui/blob/main/docs/reference/specification.md): product behavior and state ownership.
157
+ - [Contributing](https://github.com/luocfprime/labtasker-webui/blob/main/CONTRIBUTING.md): setup and development conventions.
158
+ - [Agent guide](https://github.com/luocfprime/labtasker-webui/blob/main/AGENTS.md): project boundaries and internal workflow entry points.
159
+ - [Labtasker documentation](https://luocfprime.github.io/labtasker/): Tasks,
160
+ Queues, Workers, and the upstream API.
161
+
162
+ ## Development
163
+
164
+ ```bash
165
+ npm ci --prefix frontend
166
+ npm --prefix frontend run build
167
+ uv sync --group dev --frozen
168
+ uv run labtasker-webui
169
+ ```
170
+
171
+ See [Contributing](https://github.com/luocfprime/labtasker-webui/blob/main/CONTRIBUTING.md) for the validation gate and development, QA,
172
+ and release SOPs. CI covers Python checks, frontend tests, three browser engines,
173
+ and installation of the built package without Node.js.
174
+
175
+ ## License
176
+
177
+ [Apache-2.0](https://github.com/luocfprime/labtasker-webui/blob/main/LICENSE), matching Labtasker.
@@ -0,0 +1,22 @@
1
+ labtasker_webui/__init__.py,sha256=hivn8IvZCD79ty5xV3C2F-8CVBr5xl82pBH7RECvkjc,46
2
+ labtasker_webui/__main__.py,sha256=bYt9eEaoRQWdejEHFD8REx9jxVEdZptECFsV7F49Ink,30
3
+ labtasker_webui/app.py,sha256=ma-3gwZwDuFv7mblonS-LM5hrpV0VesAAHoWK26sVXE,19037
4
+ labtasker_webui/cli.py,sha256=zXv5cZWMRDz2cCaEqbrFhILOF0x7xMpts5QBpb3qojI,1184
5
+ labtasker_webui/config.py,sha256=hGbTixgYVDJHaHuW7yXC2AVEbo2wCTcMm6AZ-Q4WrkQ,2856
6
+ labtasker_webui/local.py,sha256=OUoOwAN7uukrV3s-Ej-8DnIT-4PF_QUytS5TmWWBUQ4,779
7
+ labtasker_webui/operations.py,sha256=175zobkEfzP9RQyt8vde-fRAeNv6rImFEfmCoIkN9v8,6753
8
+ labtasker_webui/profile.py,sha256=6MbbdJseDQbEL-Epg9uxq-fYOyIv9MYUdGj3s5Wv5Zc,3473
9
+ labtasker_webui/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
10
+ labtasker_webui/schemas.py,sha256=3GUcRxUaqQvu0q0Qmk4RjFZ5ftINCvHXiFxbZoS1Ldw,1635
11
+ labtasker_webui/security.py,sha256=rywFIKnbZm_mRcDa0Hiw7acNC1fpX0W8bCLtt6RAv9M,2038
12
+ labtasker_webui/sessions.py,sha256=mBaSsBbsZ-aXfHaDUzB2pPV8VtwGiKbFSL8AX_REhxo,1677
13
+ labtasker_webui/upstream.py,sha256=WjKTnyrdlfZx_W-oMZd-ibb3PDb8Vz5GqyAHLih7xkw,5846
14
+ labtasker_webui/static/index.html,sha256=ePpTFfjtuSg-IqUZ3z6ht3c69UorxhWlH7kukOC1664,507
15
+ labtasker_webui/static/labtasker-icon.png,sha256=zJxlW7BLhcQvl7-IHwvkReCi_S5gp4_oh3AgjpmJVrQ,2583
16
+ labtasker_webui/static/assets/index-CscGvBx9.css,sha256=Zo6_2A1nDjnMRblwXj3bn81pyZnr3pBuqLUXeHzP_kM,25667
17
+ labtasker_webui/static/assets/index-D2PfKj6B.js,sha256=Wag1edxKzq_GZefaQ71JO6jkA1_aNyIPHuFEbvq1W0E,376323
18
+ labtasker_webui-0.1.1.dist-info/METADATA,sha256=SoNX5eY7vOu4A4Xne_K-HNDL3d1HIsC_bL6nE7e22IY,7281
19
+ labtasker_webui-0.1.1.dist-info/WHEEL,sha256=zOwg4jB6zX2kU910N-cMawjivD6tO8NEWvE12je1bVk,87
20
+ labtasker_webui-0.1.1.dist-info/entry_points.txt,sha256=DHuZaNGH9Pgo0lbbwl1U1rUUCb4t4i3B0ELNR32vE6A,61
21
+ labtasker_webui-0.1.1.dist-info/licenses/LICENSE,sha256=xx0jnfkXJvxRnG63LTGOxlggYnIysveWIZ6H3PNdCrQ,11357
22
+ labtasker_webui-0.1.1.dist-info/RECORD,,
@@ -0,0 +1,4 @@
1
+ Wheel-Version: 1.0
2
+ Generator: hatchling 1.32.0
3
+ Root-Is-Purelib: true
4
+ Tag: py3-none-any
@@ -0,0 +1,2 @@
1
+ [console_scripts]
2
+ labtasker-webui = labtasker_webui.cli:main
@@ -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.