ctboost 0.1.0__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 (41) hide show
  1. ctboost-0.1.0/.github/workflows/cmake.yml +77 -0
  2. ctboost-0.1.0/.github/workflows/publish.yml +140 -0
  3. ctboost-0.1.0/.gitignore +60 -0
  4. ctboost-0.1.0/CMakeLists.txt +113 -0
  5. ctboost-0.1.0/LICENSE +201 -0
  6. ctboost-0.1.0/PKG-INFO +480 -0
  7. ctboost-0.1.0/README.md +250 -0
  8. ctboost-0.1.0/cmake-uninstall.log +0 -0
  9. ctboost-0.1.0/ctboost/__init__.py +27 -0
  10. ctboost-0.1.0/ctboost/_version.py +3 -0
  11. ctboost-0.1.0/ctboost/core.py +123 -0
  12. ctboost-0.1.0/ctboost/sklearn.py +238 -0
  13. ctboost-0.1.0/ctboost/training.py +149 -0
  14. ctboost-0.1.0/cuda/cuda_backend.cu +118 -0
  15. ctboost-0.1.0/cuda/hist_kernels.cu +30 -0
  16. ctboost-0.1.0/cuda/hist_kernels.cuh +14 -0
  17. ctboost-0.1.0/include/ctboost/booster.hpp +59 -0
  18. ctboost-0.1.0/include/ctboost/build_info.hpp +17 -0
  19. ctboost-0.1.0/include/ctboost/cuda_backend.hpp +23 -0
  20. ctboost-0.1.0/include/ctboost/data.hpp +31 -0
  21. ctboost-0.1.0/include/ctboost/histogram.hpp +37 -0
  22. ctboost-0.1.0/include/ctboost/objective.hpp +49 -0
  23. ctboost-0.1.0/include/ctboost/statistics.hpp +52 -0
  24. ctboost-0.1.0/include/ctboost/tree.hpp +65 -0
  25. ctboost-0.1.0/pyproject.toml +73 -0
  26. ctboost-0.1.0/src/bindings/module.cpp +212 -0
  27. ctboost-0.1.0/src/core/booster.cpp +442 -0
  28. ctboost-0.1.0/src/core/build_info.cpp +35 -0
  29. ctboost-0.1.0/src/core/cuda_backend_stub.cpp +38 -0
  30. ctboost-0.1.0/src/core/data.cpp +104 -0
  31. ctboost-0.1.0/src/core/histogram.cpp +171 -0
  32. ctboost-0.1.0/src/core/objective.cpp +164 -0
  33. ctboost-0.1.0/src/core/statistics.cpp +276 -0
  34. ctboost-0.1.0/src/core/tree.cpp +483 -0
  35. ctboost-0.1.0/tests/test_booster.py +38 -0
  36. ctboost-0.1.0/tests/test_build.py +40 -0
  37. ctboost-0.1.0/tests/test_data_and_loss.py +126 -0
  38. ctboost-0.1.0/tests/test_multiclass.py +78 -0
  39. ctboost-0.1.0/tests/test_sklearn.py +147 -0
  40. ctboost-0.1.0/tests/test_statistics.py +25 -0
  41. ctboost-0.1.0/vsdevcmd.trace.txt +1 -0
@@ -0,0 +1,77 @@
1
+ name: CMake
2
+
3
+ on:
4
+ push:
5
+ branches:
6
+ - master
7
+ pull_request:
8
+
9
+ env:
10
+ FORCE_JAVASCRIPT_ACTIONS_TO_NODE24: "true"
11
+
12
+ permissions:
13
+ contents: read
14
+
15
+ jobs:
16
+ cmake-build:
17
+ name: CMake Build (${{ matrix.os }})
18
+ runs-on: ${{ matrix.os }}
19
+ strategy:
20
+ fail-fast: false
21
+ matrix:
22
+ os:
23
+ - ubuntu-latest
24
+ - windows-latest
25
+ - macos-latest
26
+ steps:
27
+ - name: Checkout
28
+ uses: actions/checkout@v6
29
+
30
+ - name: Set up Python
31
+ uses: actions/setup-python@v6
32
+ with:
33
+ python-version: "3.12"
34
+
35
+ - name: Install build and test dependencies
36
+ shell: pwsh
37
+ run: |
38
+ python -m pip install --upgrade pip
39
+ python -m pip install "pybind11<3" numpy pandas scikit-learn pytest
40
+
41
+ - name: Export Python and pybind11 paths
42
+ shell: pwsh
43
+ run: |
44
+ @'
45
+ import os
46
+ import pathlib
47
+ import sys
48
+ import pybind11
49
+
50
+ def normalize(path: str) -> str:
51
+ return pathlib.Path(path).as_posix()
52
+
53
+ with open(os.environ["GITHUB_ENV"], "a", encoding="utf-8") as handle:
54
+ handle.write(f"PYBIND11_DIR={normalize(pybind11.get_cmake_dir())}\n")
55
+ handle.write(f"PYTHON_EXECUTABLE={normalize(sys.executable)}\n")
56
+ '@ | python -
57
+
58
+ - name: Configure CMake
59
+ shell: pwsh
60
+ run: >
61
+ cmake -S . -B build
62
+ -DCMAKE_BUILD_TYPE=Release
63
+ -DCTBOOST_ENABLE_CUDA=OFF
64
+ "-Dpybind11_DIR=$env:PYBIND11_DIR"
65
+ "-DPython_EXECUTABLE=$env:PYTHON_EXECUTABLE"
66
+
67
+ - name: Build
68
+ shell: pwsh
69
+ run: cmake --build build --config Release --parallel
70
+
71
+ - name: Install package
72
+ shell: pwsh
73
+ run: python -m pip install . --no-deps --config-settings=cmake.define.CTBOOST_ENABLE_CUDA=OFF
74
+
75
+ - name: Run tests
76
+ shell: pwsh
77
+ run: pytest tests -q
@@ -0,0 +1,140 @@
1
+ name: Publish
2
+
3
+ on:
4
+ push:
5
+ branches:
6
+ - master
7
+ tags:
8
+ - "v*"
9
+ release:
10
+ types:
11
+ - published
12
+
13
+ env:
14
+ FORCE_JAVASCRIPT_ACTIONS_TO_NODE24: "true"
15
+
16
+ permissions:
17
+ contents: read
18
+
19
+ jobs:
20
+ build_wheels:
21
+ name: Build wheels (${{ matrix.os }})
22
+ runs-on: ${{ matrix.os }}
23
+ strategy:
24
+ fail-fast: false
25
+ matrix:
26
+ os:
27
+ - ubuntu-latest
28
+ - windows-latest
29
+ - macos-latest
30
+ steps:
31
+ - name: Checkout
32
+ uses: actions/checkout@v6
33
+
34
+ - name: Set up Python
35
+ uses: actions/setup-python@v6
36
+ with:
37
+ python-version: "3.12"
38
+
39
+ - name: Install cibuildwheel
40
+ run: python -m pip install --upgrade pip cibuildwheel
41
+
42
+ - name: Build wheels
43
+ run: python -m cibuildwheel --output-dir wheelhouse
44
+
45
+ - name: Upload wheel artifacts
46
+ uses: actions/upload-artifact@v6
47
+ with:
48
+ name: wheelhouse-${{ matrix.os }}
49
+ path: wheelhouse/*.whl
50
+
51
+ build_sdist:
52
+ name: Build source distribution
53
+ runs-on: ubuntu-latest
54
+ steps:
55
+ - name: Checkout
56
+ uses: actions/checkout@v6
57
+
58
+ - name: Set up Python
59
+ uses: actions/setup-python@v6
60
+ with:
61
+ python-version: "3.12"
62
+
63
+ - name: Install build
64
+ run: python -m pip install --upgrade pip build
65
+
66
+ - name: Build sdist
67
+ run: python -m build --sdist
68
+
69
+ - name: Upload sdist artifact
70
+ uses: actions/upload-artifact@v6
71
+ with:
72
+ name: sdist
73
+ path: dist/*.tar.gz
74
+
75
+ build_gpu_linux_wheels:
76
+ name: Build GPU Linux wheel
77
+ runs-on: ubuntu-latest
78
+ env:
79
+ CIBW_BUILD: cp310-manylinux_x86_64
80
+ CIBW_ENVIRONMENT: "CMAKE_ARGS='-DCTBOOST_ENABLE_CUDA=ON'"
81
+ CIBW_BEFORE_ALL: "yum install -y wget && wget https://developer.download.nvidia.com/compute/cuda/repos/rhel7/x86_64/cuda-rhel7.repo -O /etc/yum.repos.d/cuda.repo && yum clean all && yum -y install cuda-compiler-12-0"
82
+ steps:
83
+ - name: Checkout
84
+ uses: actions/checkout@v6
85
+
86
+ - name: Set up Python
87
+ uses: actions/setup-python@v6
88
+ with:
89
+ python-version: "3.12"
90
+
91
+ - name: Install cibuildwheel
92
+ run: python -m pip install --upgrade pip cibuildwheel
93
+
94
+ - name: Build GPU Linux wheel
95
+ run: python -m cibuildwheel --output-dir wheelhouse
96
+
97
+ - name: Upload GPU Linux wheel artifact
98
+ uses: actions/upload-artifact@v6
99
+ with:
100
+ name: cibw-wheels-gpu-linux
101
+ path: wheelhouse/*.whl
102
+
103
+ publish_pypi:
104
+ name: Publish to PyPI
105
+ needs:
106
+ - build_wheels
107
+ - build_sdist
108
+ if: startsWith(github.ref, 'refs/tags/v')
109
+ runs-on: ubuntu-latest
110
+ permissions:
111
+ id-token: write
112
+ steps:
113
+ - name: Download Linux CPU wheel artifacts
114
+ uses: actions/download-artifact@v5
115
+ with:
116
+ name: wheelhouse-ubuntu-latest
117
+ path: dist
118
+
119
+ - name: Download Windows CPU wheel artifacts
120
+ uses: actions/download-artifact@v5
121
+ with:
122
+ name: wheelhouse-windows-latest
123
+ path: dist
124
+
125
+ - name: Download macOS CPU wheel artifacts
126
+ uses: actions/download-artifact@v5
127
+ with:
128
+ name: wheelhouse-macos-latest
129
+ path: dist
130
+
131
+ - name: Download sdist artifact
132
+ uses: actions/download-artifact@v5
133
+ with:
134
+ name: sdist
135
+ path: dist
136
+
137
+ - name: Publish to PyPI
138
+ uses: pypa/gh-action-pypi-publish@release/v1
139
+ with:
140
+ packages-dir: dist
@@ -0,0 +1,60 @@
1
+ # Prerequisites
2
+ *.d
3
+
4
+ # Compiled Object files
5
+ *.slo
6
+ *.lo
7
+ *.o
8
+ *.obj
9
+
10
+ # Precompiled Headers
11
+ *.gch
12
+ *.pch
13
+
14
+ # Linker files
15
+ *.ilk
16
+
17
+ # Debugger Files
18
+ *.pdb
19
+
20
+ # Compiled Dynamic libraries
21
+ *.so
22
+ *.dylib
23
+ *.dll
24
+
25
+ # Fortran module files
26
+ *.mod
27
+ *.smod
28
+
29
+ # Compiled Static libraries
30
+ *.lai
31
+ *.la
32
+ *.a
33
+ *.lib
34
+
35
+ # Executables
36
+ *.exe
37
+ *.out
38
+ *.app
39
+
40
+ # debug information files
41
+ *.dwo
42
+
43
+ # Python
44
+ __pycache__/
45
+ *.py[cod]
46
+ *.pyd
47
+ .pytest_cache/
48
+ .venv/
49
+ venv/
50
+
51
+ # Packaging
52
+ build/
53
+ dist/
54
+ *.egg-info/
55
+
56
+ # CMake / scikit-build
57
+ CMakeUserPresets.json
58
+ CMakeCache.txt
59
+ CMakeFiles/
60
+ _skbuild/
@@ -0,0 +1,113 @@
1
+ cmake_minimum_required(VERSION 3.24...4.3)
2
+
3
+ project(CTBoost VERSION 0.1.0 LANGUAGES CXX)
4
+
5
+ if(DEFINED SKBUILD_PROJECT_VERSION_FULL)
6
+ set(CTBOOST_PACKAGE_VERSION "${SKBUILD_PROJECT_VERSION_FULL}")
7
+ else()
8
+ set(CTBOOST_PACKAGE_VERSION "${PROJECT_VERSION}")
9
+ endif()
10
+
11
+ set(CMAKE_CXX_STANDARD 17)
12
+ set(CMAKE_CXX_STANDARD_REQUIRED ON)
13
+ set(CMAKE_CXX_EXTENSIONS OFF)
14
+ set(CMAKE_CUDA_RUNTIME_LIBRARY Shared)
15
+ set(CMAKE_POSITION_INDEPENDENT_CODE ON)
16
+ set(CMAKE_INTERPROCEDURAL_OPTIMIZATION OFF)
17
+
18
+ option(CTBOOST_ENABLE_CUDA "Build CUDA backends when a CUDA toolkit is available" ON)
19
+
20
+ include(CheckLanguage)
21
+
22
+ find_package(Python REQUIRED COMPONENTS Interpreter Development.Module)
23
+ find_package(pybind11 CONFIG REQUIRED)
24
+
25
+ set(CTBOOST_WITH_CUDA OFF)
26
+ if(CTBOOST_ENABLE_CUDA)
27
+ check_language(CUDA)
28
+ if(CMAKE_CUDA_COMPILER)
29
+ enable_language(CUDA)
30
+ find_package(CUDAToolkit QUIET)
31
+ if(CUDAToolkit_FOUND)
32
+ if(NOT DEFINED CMAKE_CUDA_ARCHITECTURES)
33
+ set(CMAKE_CUDA_ARCHITECTURES native CACHE STRING "CUDA architectures to build")
34
+ endif()
35
+ set(CTBOOST_WITH_CUDA ON)
36
+ message(STATUS "CTBoost: CUDA toolkit detected, enabling GPU backend")
37
+ else()
38
+ message(STATUS "CTBoost: CUDA compiler found but toolkit missing, building CPU-only")
39
+ endif()
40
+ else()
41
+ message(STATUS "CTBoost: CUDA compiler not found, building CPU-only")
42
+ endif()
43
+ else()
44
+ message(STATUS "CTBoost: CUDA support disabled explicitly, building CPU-only")
45
+ endif()
46
+
47
+ add_library(ctboost_core STATIC
48
+ src/core/booster.cpp
49
+ src/core/build_info.cpp
50
+ src/core/data.cpp
51
+ src/core/histogram.cpp
52
+ src/core/objective.cpp
53
+ src/core/statistics.cpp
54
+ src/core/tree.cpp
55
+ )
56
+
57
+ target_include_directories(ctboost_core
58
+ PUBLIC
59
+ ${PROJECT_SOURCE_DIR}/include
60
+ )
61
+
62
+ target_compile_features(ctboost_core PUBLIC cxx_std_17)
63
+ target_link_libraries(ctboost_core PUBLIC pybind11::headers Python::Module)
64
+ target_compile_definitions(ctboost_core
65
+ PUBLIC
66
+ CTBOOST_VERSION="${CTBOOST_PACKAGE_VERSION}"
67
+ )
68
+
69
+ if(CTBOOST_WITH_CUDA)
70
+ add_library(ctboost_cuda_backend STATIC
71
+ cuda/cuda_backend.cu
72
+ cuda/hist_kernels.cu
73
+ )
74
+
75
+ set_target_properties(ctboost_cuda_backend PROPERTIES
76
+ POSITION_INDEPENDENT_CODE ON
77
+ CUDA_SEPARABLE_COMPILATION ON
78
+ CUDA_RESOLVE_DEVICE_SYMBOLS ON
79
+ CUDA_STANDARD 17
80
+ CUDA_STANDARD_REQUIRED ON
81
+ )
82
+
83
+ target_include_directories(ctboost_cuda_backend
84
+ PUBLIC
85
+ ${PROJECT_SOURCE_DIR}/include
86
+ ${PROJECT_SOURCE_DIR}/cuda
87
+ )
88
+
89
+ target_compile_definitions(ctboost_core PUBLIC CTBOOST_WITH_CUDA=1)
90
+ target_link_libraries(ctboost_cuda_backend PUBLIC CUDA::cudart)
91
+ target_link_libraries(ctboost_core PUBLIC ctboost_cuda_backend)
92
+ else()
93
+ target_sources(ctboost_core PRIVATE src/core/cuda_backend_stub.cpp)
94
+ target_compile_definitions(ctboost_core PUBLIC CTBOOST_WITH_CUDA=0)
95
+ endif()
96
+
97
+ pybind11_add_module(_core MODULE
98
+ src/bindings/module.cpp
99
+ )
100
+
101
+ target_link_libraries(_core PRIVATE ctboost_core)
102
+ target_include_directories(_core PRIVATE ${PROJECT_SOURCE_DIR}/include)
103
+
104
+ if(CTBOOST_WITH_CUDA)
105
+ target_link_libraries(_core PRIVATE ctboost_cuda_backend)
106
+ set_target_properties(_core PROPERTIES CUDA_RESOLVE_DEVICE_SYMBOLS ON)
107
+ endif()
108
+
109
+ install(TARGETS _core
110
+ LIBRARY DESTINATION ctboost
111
+ RUNTIME DESTINATION ctboost
112
+ ARCHIVE DESTINATION ctboost
113
+ )
ctboost-0.1.0/LICENSE ADDED
@@ -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.