spanchor 0.1.1__tar.gz

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.
Files changed (116) hide show
  1. spanchor-0.1.1/.github/workflows/ci.yml +68 -0
  2. spanchor-0.1.1/.github/workflows/release.yml +100 -0
  3. spanchor-0.1.1/.gitignore +67 -0
  4. spanchor-0.1.1/.pre-commit-config.yaml +26 -0
  5. spanchor-0.1.1/LICENSE +171 -0
  6. spanchor-0.1.1/PKG-INFO +322 -0
  7. spanchor-0.1.1/README.md +289 -0
  8. spanchor-0.1.1/assets/branding/README.md +33 -0
  9. spanchor-0.1.1/assets/branding/spanchor-logo.png +0 -0
  10. spanchor-0.1.1/docs/BRANDING.md +104 -0
  11. spanchor-0.1.1/docs/DESCRIPTION_OPTIONS.md +501 -0
  12. spanchor-0.1.1/docs/RELEASING.md +328 -0
  13. spanchor-0.1.1/examples/demo/README.md +138 -0
  14. spanchor-0.1.1/examples/demo/baseline.json +110 -0
  15. spanchor-0.1.1/examples/demo/candidate.json +110 -0
  16. spanchor-0.1.1/examples/demo/docs/anchor_concepts.txt +5 -0
  17. spanchor-0.1.1/examples/demo/docs/intro_to_rag.txt +5 -0
  18. spanchor-0.1.1/examples/demo/gold.jsonl +4 -0
  19. spanchor-0.1.1/examples/real_world_validation/README.md +312 -0
  20. spanchor-0.1.1/examples/real_world_validation/baseline.json +14 -0
  21. spanchor-0.1.1/examples/real_world_validation/baseline_results.jsonl +100 -0
  22. spanchor-0.1.1/examples/real_world_validation/candidate.json +14 -0
  23. spanchor-0.1.1/examples/real_world_validation/candidate_passing_results.jsonl +100 -0
  24. spanchor-0.1.1/examples/real_world_validation/candidate_results.jsonl +100 -0
  25. spanchor-0.1.1/examples/real_world_validation/check_metrics.py +48 -0
  26. spanchor-0.1.1/examples/real_world_validation/corpus/api_reference.txt +245 -0
  27. spanchor-0.1.1/examples/real_world_validation/corpus/getting_started.txt +55 -0
  28. spanchor-0.1.1/examples/real_world_validation/corpus/security_and_compliance.txt +84 -0
  29. spanchor-0.1.1/examples/real_world_validation/corpus/troubleshooting.txt +169 -0
  30. spanchor-0.1.1/examples/real_world_validation/create_gold_set.py +762 -0
  31. spanchor-0.1.1/examples/real_world_validation/gold.jsonl +100 -0
  32. spanchor-0.1.1/examples/real_world_validation/retriever.py +223 -0
  33. spanchor-0.1.1/examples/real_world_validation/run_passing_validation.py +154 -0
  34. spanchor-0.1.1/examples/real_world_validation/run_validation.py +263 -0
  35. spanchor-0.1.1/pyproject.toml +130 -0
  36. spanchor-0.1.1/src/spanchor/__init__.py +60 -0
  37. spanchor-0.1.1/src/spanchor/adapters/__init__.py +9 -0
  38. spanchor-0.1.1/src/spanchor/adapters/base.py +93 -0
  39. spanchor-0.1.1/src/spanchor/anchors/__init__.py +6 -0
  40. spanchor-0.1.1/src/spanchor/annotation/__init__.py +25 -0
  41. spanchor-0.1.1/src/spanchor/annotation/add.py +242 -0
  42. spanchor-0.1.1/src/spanchor/annotation/locate.py +350 -0
  43. spanchor-0.1.1/src/spanchor/canonical/__init__.py +9 -0
  44. spanchor-0.1.1/src/spanchor/canonical/normalize.py +54 -0
  45. spanchor-0.1.1/src/spanchor/cli.py +861 -0
  46. spanchor-0.1.1/src/spanchor/comparison/__init__.py +16 -0
  47. spanchor-0.1.1/src/spanchor/comparison/compare.py +189 -0
  48. spanchor-0.1.1/src/spanchor/comparison/policy.py +248 -0
  49. spanchor-0.1.1/src/spanchor/errors.py +395 -0
  50. spanchor-0.1.1/src/spanchor/evaluation/__init__.py +23 -0
  51. spanchor-0.1.1/src/spanchor/evaluation/aggregation.py +225 -0
  52. spanchor-0.1.1/src/spanchor/evaluation/engine.py +291 -0
  53. spanchor-0.1.1/src/spanchor/evaluation/hit.py +166 -0
  54. spanchor-0.1.1/src/spanchor/evaluation/intervals.py +138 -0
  55. spanchor-0.1.1/src/spanchor/evaluation/iou.py +72 -0
  56. spanchor-0.1.1/src/spanchor/evaluation/precision.py +64 -0
  57. spanchor-0.1.1/src/spanchor/evaluation/recall.py +68 -0
  58. spanchor-0.1.1/src/spanchor/mapping/__init__.py +9 -0
  59. spanchor-0.1.1/src/spanchor/mapping/mapper.py +301 -0
  60. spanchor-0.1.1/src/spanchor/models/__init__.py +13 -0
  61. spanchor-0.1.1/src/spanchor/models/anchor.py +112 -0
  62. spanchor-0.1.1/src/spanchor/models/document.py +60 -0
  63. spanchor-0.1.1/src/spanchor/models/query.py +30 -0
  64. spanchor-0.1.1/src/spanchor/models/retrieval.py +92 -0
  65. spanchor-0.1.1/src/spanchor/models/run.py +47 -0
  66. spanchor-0.1.1/src/spanchor/reporting/__init__.py +6 -0
  67. spanchor-0.1.1/src/spanchor/reporting/json_report.py +127 -0
  68. spanchor-0.1.1/src/spanchor/reporting/markdown.py +373 -0
  69. spanchor-0.1.1/src/spanchor/storage/__init__.py +10 -0
  70. spanchor-0.1.1/src/spanchor/storage/json_io.py +457 -0
  71. spanchor-0.1.1/src/spanchor/storage/jsonl.py +306 -0
  72. spanchor-0.1.1/src/spanchor/testing.py +111 -0
  73. spanchor-0.1.1/src/spanchor/validation.py +105 -0
  74. spanchor-0.1.1/tests/__init__.py +1 -0
  75. spanchor-0.1.1/tests/conftest.py +201 -0
  76. spanchor-0.1.1/tests/fixtures/__init__.py +1 -0
  77. spanchor-0.1.1/tests/integration/__init__.py +1 -0
  78. spanchor-0.1.1/tests/regression/__init__.py +1 -0
  79. spanchor-0.1.1/tests/unit/__init__.py +1 -0
  80. spanchor-0.1.1/tests/unit/test_add_anchor.py +274 -0
  81. spanchor-0.1.1/tests/unit/test_aggregation.py +233 -0
  82. spanchor-0.1.1/tests/unit/test_anchor.py +225 -0
  83. spanchor-0.1.1/tests/unit/test_cli.py +375 -0
  84. spanchor-0.1.1/tests/unit/test_cli_evaluate.py +306 -0
  85. spanchor-0.1.1/tests/unit/test_compare.py +512 -0
  86. spanchor-0.1.1/tests/unit/test_comparison_regression_gate.py +336 -0
  87. spanchor-0.1.1/tests/unit/test_document.py +161 -0
  88. spanchor-0.1.1/tests/unit/test_engine.py +612 -0
  89. spanchor-0.1.1/tests/unit/test_hit.py +425 -0
  90. spanchor-0.1.1/tests/unit/test_intervals.py +255 -0
  91. spanchor-0.1.1/tests/unit/test_iou.py +432 -0
  92. spanchor-0.1.1/tests/unit/test_json_io.py +873 -0
  93. spanchor-0.1.1/tests/unit/test_jsonl.py +426 -0
  94. spanchor-0.1.1/tests/unit/test_locate.py +226 -0
  95. spanchor-0.1.1/tests/unit/test_mapper.py +414 -0
  96. spanchor-0.1.1/tests/unit/test_normalize.py +136 -0
  97. spanchor-0.1.1/tests/unit/test_policy.py +393 -0
  98. spanchor-0.1.1/tests/unit/test_precision.py +199 -0
  99. spanchor-0.1.1/tests/unit/test_properties_anchor.py +303 -0
  100. spanchor-0.1.1/tests/unit/test_properties_canonical.py +180 -0
  101. spanchor-0.1.1/tests/unit/test_properties_document.py +63 -0
  102. spanchor-0.1.1/tests/unit/test_properties_intervals.py +288 -0
  103. spanchor-0.1.1/tests/unit/test_properties_mapper.py +384 -0
  104. spanchor-0.1.1/tests/unit/test_properties_metrics.py +313 -0
  105. spanchor-0.1.1/tests/unit/test_properties_query.py +140 -0
  106. spanchor-0.1.1/tests/unit/test_properties_recall_precision.py +366 -0
  107. spanchor-0.1.1/tests/unit/test_properties_retrieval.py +193 -0
  108. spanchor-0.1.1/tests/unit/test_properties_storage.py +108 -0
  109. spanchor-0.1.1/tests/unit/test_query.py +129 -0
  110. spanchor-0.1.1/tests/unit/test_recall.py +239 -0
  111. spanchor-0.1.1/tests/unit/test_reporting_json.py +669 -0
  112. spanchor-0.1.1/tests/unit/test_reporting_markdown.py +624 -0
  113. spanchor-0.1.1/tests/unit/test_retrieval.py +267 -0
  114. spanchor-0.1.1/tests/unit/test_testing.py +200 -0
  115. spanchor-0.1.1/tests/unit/test_validation.py +287 -0
  116. spanchor-0.1.1/uv.lock +1061 -0
@@ -0,0 +1,68 @@
1
+ name: CI
2
+
3
+ on:
4
+ push:
5
+ branches:
6
+ - master
7
+ pull_request:
8
+ branches:
9
+ - master
10
+ workflow_dispatch:
11
+
12
+ jobs:
13
+ test:
14
+ name: Test
15
+ runs-on: ubuntu-latest
16
+ strategy:
17
+ matrix:
18
+ python-version: ["3.11", "3.12", "3.13"]
19
+ steps:
20
+ - name: Checkout repository
21
+ uses: actions/checkout@v4
22
+
23
+ - name: Set up Python
24
+ uses: actions/setup-python@v4
25
+ with:
26
+ python-version: ${{ matrix.python-version }}
27
+
28
+ - name: Upgrade pip
29
+ run: python -m pip install --upgrade pip
30
+
31
+ - name: Install package and dev dependencies
32
+ run: pip install -e ".[dev]"
33
+
34
+ - name: Run pytest
35
+ run: pytest
36
+
37
+ - name: Verify CLI
38
+ run: spanchor --help
39
+
40
+ - name: Verify package import and version
41
+ run: python -c "import spanchor; print('SPANCHOR version:', spanchor.__version__)"
42
+
43
+ quality:
44
+ name: Code Quality
45
+ runs-on: ubuntu-latest
46
+ steps:
47
+ - name: Checkout repository
48
+ uses: actions/checkout@v4
49
+
50
+ - name: Set up Python
51
+ uses: actions/setup-python@v4
52
+ with:
53
+ python-version: "3.11"
54
+
55
+ - name: Upgrade pip
56
+ run: python -m pip install --upgrade pip
57
+
58
+ - name: Install dev dependencies
59
+ run: pip install -e ".[dev]"
60
+
61
+ - name: Run Ruff Format Check
62
+ run: ruff format src/spanchor tests --check
63
+
64
+ - name: Run Ruff Lint
65
+ run: ruff check src/spanchor --select E,W,F,I --ignore B008,E501
66
+
67
+ - name: Run mypy
68
+ run: mypy --strict src/spanchor
@@ -0,0 +1,100 @@
1
+ name: Release
2
+
3
+ on:
4
+ push:
5
+ tags:
6
+ - "v*"
7
+
8
+ permissions:
9
+ id-token: write
10
+ contents: read
11
+
12
+ jobs:
13
+ validate:
14
+ name: Validate Release
15
+ runs-on: ubuntu-latest
16
+ steps:
17
+ - name: Checkout repository
18
+ uses: actions/checkout@v4
19
+
20
+ - name: Set up Python
21
+ uses: actions/setup-python@v4
22
+ with:
23
+ python-version: "3.11"
24
+
25
+ - name: Upgrade pip
26
+ run: python -m pip install --upgrade pip
27
+
28
+ - name: Install dev dependencies
29
+ run: pip install -e ".[dev]"
30
+
31
+ - name: Verify tag matches version
32
+ run: |
33
+ TAG_VERSION="${GITHUB_REF#refs/tags/v}"
34
+ PACKAGE_VERSION=$(grep '^version' pyproject.toml | grep -o '"[^"]*"' | tr -d '"')
35
+ if [ "$TAG_VERSION" != "$PACKAGE_VERSION" ]; then
36
+ echo "Tag version ($TAG_VERSION) does not match package version ($PACKAGE_VERSION)"
37
+ exit 1
38
+ fi
39
+ echo "✓ Tag version matches package version: $TAG_VERSION"
40
+
41
+ - name: Run pytest
42
+ run: pytest
43
+
44
+ - name: Run Ruff Format Check
45
+ run: ruff format src/spanchor tests --check
46
+
47
+ - name: Run Ruff Lint
48
+ run: ruff check src/spanchor --select E,W,F,I --ignore B008,E501
49
+
50
+ - name: Run mypy
51
+ run: mypy --strict src/spanchor
52
+
53
+ build:
54
+ name: Build Package
55
+ needs: validate
56
+ runs-on: ubuntu-latest
57
+ steps:
58
+ - name: Checkout repository
59
+ uses: actions/checkout@v4
60
+
61
+ - name: Set up Python
62
+ uses: actions/setup-python@v4
63
+ with:
64
+ python-version: "3.11"
65
+
66
+ - name: Upgrade pip
67
+ run: python -m pip install --upgrade pip
68
+
69
+ - name: Install build tools
70
+ run: pip install build
71
+
72
+ - name: Build distributions
73
+ run: python -m build
74
+
75
+ - name: Verify distributions
76
+ run: |
77
+ pip install twine
78
+ twine check dist/*
79
+
80
+ - name: Upload distributions
81
+ uses: actions/upload-artifact@v4
82
+ with:
83
+ name: distributions
84
+ path: dist/
85
+
86
+ publish:
87
+ name: Publish to PyPI
88
+ needs: build
89
+ runs-on: ubuntu-latest
90
+ steps:
91
+ - name: Download distributions
92
+ uses: actions/download-artifact@v4
93
+ with:
94
+ name: distributions
95
+ path: dist/
96
+
97
+ - name: Publish to PyPI using Trusted Publishing
98
+ uses: pypa/gh-action-pypi-publish@release/v1
99
+ with:
100
+ packages-dir: dist/
@@ -0,0 +1,67 @@
1
+ # Python
2
+ __pycache__/
3
+ *.py[cod]
4
+ *$py.class
5
+ *.so
6
+ .Python
7
+ build/
8
+ develop-eggs/
9
+ dist/
10
+ downloads/
11
+ eggs/
12
+ .eggs/
13
+ lib/
14
+ lib64/
15
+ parts/
16
+ sdist/
17
+ var/
18
+ wheels/
19
+ share/python-wheels/
20
+ *.egg-info/
21
+ .installed.cfg
22
+ *.egg
23
+ MANIFEST
24
+
25
+ # Virtual environments
26
+ venv/
27
+ env/
28
+ ENV/
29
+ .venv
30
+
31
+ # IDEs
32
+ .vscode/
33
+ .idea/
34
+ *.swp
35
+ *.swo
36
+ *~
37
+
38
+ # Testing
39
+ .pytest_cache/
40
+ .coverage
41
+ .coverage.*
42
+ htmlcov/
43
+ .hypothesis/
44
+ *.cover
45
+ .tox/
46
+
47
+ # mypy
48
+ .mypy_cache/
49
+ .dmypy.json
50
+ dmypy.json
51
+
52
+ # ruff
53
+ .ruff_cache/
54
+
55
+ # Distribution
56
+ *.whl
57
+
58
+ # OS
59
+ .DS_Store
60
+ Thumbs.db
61
+
62
+ # Project specific
63
+ examples/demo/output/
64
+ benchmarks/results/
65
+
66
+ # Local archive (task reports, temporary documentation)
67
+ .archive_docs/
@@ -0,0 +1,26 @@
1
+ repos:
2
+ - repo: https://github.com/astral-sh/ruff-pre-commit
3
+ rev: v0.4.4
4
+ hooks:
5
+ - id: ruff
6
+ args: [--fix]
7
+ - id: ruff-format
8
+
9
+ - repo: https://github.com/pre-commit/mirrors-mypy
10
+ rev: v1.10.0
11
+ hooks:
12
+ - id: mypy
13
+ args: [--strict]
14
+ files: ^src/
15
+ additional_dependencies:
16
+ - typer>=0.9.0
17
+ - rich>=13.0.0
18
+
19
+ - repo: local
20
+ hooks:
21
+ - id: pytest-unit
22
+ name: pytest unit tests
23
+ entry: uv run pytest tests/unit -q --no-header --no-cov
24
+ language: system
25
+ pass_filenames: false
26
+ stages: [pre-push]
spanchor-0.1.1/LICENSE ADDED
@@ -0,0 +1,171 @@
1
+ Apache License
2
+ Version 2.0, January 2004
3
+
4
+ http://www.apache.org/licenses/
5
+
6
+ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
7
+
8
+ 1. Definitions.
9
+
10
+ "License" shall mean the terms and conditions for use, reproduction,
11
+ and distribution as defined in Sections 1 through 9 of this document.
12
+
13
+ "Licensor" shall mean the copyright owner or entity authorized by
14
+ the copyright owner that is granting the License.
15
+
16
+ "Legal Entity" shall mean the union of the acting entity and all
17
+ other entities that control, are controlled by, or are under common
18
+ control with that entity. For the purposes of this definition,
19
+ "control" means (i) the power, direct or indirect, to cause the
20
+ direction or management of such entity, whether by contract or
21
+ otherwise, or (ii) ownership of fifty percent (50%) or more of the
22
+ outstanding shares, or (iii) beneficial ownership of such entity.
23
+
24
+ "You" (or "Your") shall mean an individual or Legal Entity exercising
25
+ permissions granted by this License.
26
+
27
+ "Source" form shall mean the preferred form for making modifications,
28
+ including but not limited to software source code, documentation
29
+ source, and configuration files.
30
+
31
+ "Object" form shall mean any form resulting from mechanical
32
+ transformation or translation of a Source form, including but
33
+ not limited to compiled object code, generated documentation,
34
+ and conversions to other media types.
35
+
36
+ "Work" shall mean the work of authorship, whether in Source or Object
37
+ form, made available under the License, as indicated by a copyright
38
+ notice that is included in or attached to the work
39
+ (an example is provided in the Appendix below).
40
+
41
+ "Derivative Works" shall mean any work, whether in Source or Object
42
+ form, that is based on (or derived from) the Work and for which the
43
+ editorial revisions, annotations, elaborations, or other modifications
44
+ represent, as a whole, an original work of authorship. For the purposes
45
+ of this License, Derivative Works shall not include works that remain
46
+ separable from, or merely link (or bind by name) to the interfaces of,
47
+ the Work and Derivative Works thereof.
48
+
49
+ "Contribution" shall mean any work of authorship, including
50
+ the original Work and any Derivative Works thereof, and any
51
+ modifications thereto, submitted to Licensor for inclusion in
52
+ the Work by the copyright owner or by an individual or Legal
53
+ Entity authorized to submit on behalf of the copyright owner.
54
+ For the purposes of this definition, "submitted" means any form of
55
+ electronic, verbal, or written communication sent to the Licensor
56
+ or its representatives, including but not limited to communication
57
+ on electronic mailing lists, source code control systems, and
58
+ issue tracking systems that are managed by, or on behalf of, the
59
+ Licensor for the purpose of discussing and improving the Work, but
60
+ excluding communication that is conspicuously marked or otherwise
61
+ designated in writing by the copyright owner as "Not a Contribution."
62
+
63
+ "Contributor" shall mean Licensor and any Legal Entity on behalf of
64
+ whom a Contribution has been received by Licensor and subsequently
65
+ incorporated within the Work.
66
+
67
+ 2. Grant of Copyright License. Subject to the terms and conditions of
68
+ this License, each Contributor hereby grants to You a perpetual,
69
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
70
+ copyright license to reproduce, prepare Derivative Works of,
71
+ publicly display, publicly perform, sublicense, and distribute the
72
+ Work and such Derivative Works in Source or Object form.
73
+
74
+ 3. Grant of Patent License. Subject to the terms and conditions of
75
+ this License, each Contributor hereby grants to You a perpetual,
76
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
77
+ (except as stated in this section) patent license to make, have made,
78
+ use, offer to sell, sell, import, and otherwise transfer the Work,
79
+ where such license applies only to those patent claims licensable
80
+ by such Contributor that are necessarily infringed by their
81
+ Contribution(s) alone or by combination of their Contribution(s)
82
+ with the Work to which such Contribution(s) was submitted.
83
+
84
+ 4. Redistribution. You may reproduce and distribute copies of the
85
+ Work or Derivative Works thereof in any medium, with or without
86
+ modifications, and in Source or Object form, provided that You
87
+ meet the following conditions:
88
+
89
+ (a) You must give any other recipients of the Work or
90
+ Derivative Works a copy of this License; and
91
+
92
+ (b) You must cause any modified files to carry prominent notices
93
+ stating that You changed the files; and
94
+
95
+ (c) You must retain, in the Source form of any Derivative Works
96
+ that You distribute, all copyright, patent, trademark, and
97
+ attribution notices from the Source form of the Work,
98
+ excluding those notices that do not pertain to any part of
99
+ the Derivative Works; and
100
+
101
+ (d) If the Work includes a "NOTICE" text file, then any
102
+ Derivative Works that You distribute must include a readable
103
+ copy of the attribution notices contained
104
+ within such NOTICE file, excluding those notices that do not
105
+ pertain to any part of the Derivative Works, in at least one
106
+ of the following places: within a NOTICE text file distributed
107
+ as part of the Derivative Works; within the Source form or
108
+ documentation, if provided along with the Derivative Works; or,
109
+ within a display generated by the Derivative Works, if and
110
+ wherever such third-party notices normally appear. The contents
111
+ of the NOTICE file are for informational purposes only and
112
+ do not modify the License. You may add Your own attribution
113
+ notices within Derivative Works that You distribute, alongside
114
+ or as an addendum to the NOTICE from the Work, provided that
115
+ such additional attribution notices cannot be construed
116
+ as modifying the License.
117
+
118
+ You may add Your own copyright statement to Your modifications and
119
+ may provide additional or different license terms and conditions
120
+ for use, reproduction, or distribution of Your modifications, or
121
+ for any such Derivative Works as a whole, provided Your use,
122
+ reproduction, and distribution of the Work otherwise complies with
123
+ the conditions of this License.
124
+
125
+ 5. Submission of Contributions. Unless You explicitly state otherwise,
126
+ any Contribution intentionally submitted for inclusion in the Work
127
+ by You to the Licensor shall be under the terms and conditions of
128
+ this License, without any additional terms or conditions.
129
+ Notwithstanding the above, nothing herein shall supersede or modify
130
+ the terms of any separate license agreement you may have executed
131
+ with Licensor regarding such Contribution.
132
+
133
+ 6. Trademarks. This License does not grant permission to use the trade
134
+ names, trademarks, service marks, or product names of the Licensor,
135
+ except as required for reasonable and customary use in describing the
136
+ origin of the Work and reproducing the content of the NOTICE file.
137
+
138
+ 7. Disclaimer of Warranty. Unless required by applicable law or
139
+ agreed to in writing, Licensor provides the Work (and each
140
+ Contributor provides its Contributions) on an "AS IS" BASIS,
141
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
142
+ implied, including, without limitation, any warranties or conditions
143
+ of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
144
+ PARTICULAR PURPOSE. You are solely responsible for determining the
145
+ appropriateness of using or redistributing the Work and assume any
146
+ risks associated with Your exercise of permissions under this License.
147
+
148
+ 8. Limitation of Liability. In no event and under no legal theory,
149
+ whether in tort (including negligence), contract, or otherwise,
150
+ unless required by applicable law (such as deliberate and grossly
151
+ negligent acts) or agreed to in writing, shall any Contributor be
152
+ liable to You for damages, including any direct, indirect, special,
153
+ incidental, or consequential damages of any character arising as a
154
+ result of this License or out of the use or inability to use the
155
+ Work (including but not limited to damages for loss of goodwill,
156
+ work stoppage, computer failure or malfunction, or any and all
157
+ other commercial damages or losses), even if such Contributor
158
+ has been advised of the possibility of such damages.
159
+
160
+ 9. Accepting Warranty or Additional Liability. While redistributing
161
+ the Work or Derivative Works thereof, You may choose to offer,
162
+ and charge a fee for, acceptance of support, warranty, indemnity,
163
+ or other liability obligations and/or rights consistent with this
164
+ License. However, in accepting such obligations, You may act only
165
+ on Your own behalf and on Your sole responsibility, not on behalf
166
+ of any other Contributor, and only if You agree to indemnify,
167
+ defend, and hold each Contributor harmless for any liability
168
+ incurred by, or claims asserted against, such Contributor by reason
169
+ of your accepting any such warranty or additional liability.
170
+
171
+ END OF TERMS AND CONDITIONS