codefinetuner 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,294 @@
1
+ Metadata-Version: 2.4
2
+ Name: codefinetuner
3
+ Version: 0.1.0
4
+ Summary: Add your description here
5
+ Project-URL: Homepage, https://github.com/cuolm/codefinetuner
6
+ Project-URL: Repository, https://github.com/cuolm/codefinetuner.git
7
+ Project-URL: Issues, https://github.com/cuolm/codefinetuner/issues
8
+ Author-email: cuolm <cuolm.approach717@passinbox.com>
9
+ License-Expression: Apache-2.0
10
+ License-File: LICENSE.txt
11
+ Classifier: Development Status :: 4 - Beta
12
+ Classifier: License :: OSI Approved :: Apache Software License
13
+ Classifier: Programming Language :: Python :: 3.13
14
+ Classifier: Typing :: Typed
15
+ Requires-Python: >=3.13
16
+ Requires-Dist: bitsandbytes==0.48.2; sys_platform == 'linux' or sys_platform == 'win32'
17
+ Requires-Dist: codebleu>=0.7.0
18
+ Requires-Dist: datasets>=4.3.0
19
+ Requires-Dist: evaluate>=0.4.6
20
+ Requires-Dist: gguf>=0.18.0
21
+ Requires-Dist: matplotlib>=3.10.7
22
+ Requires-Dist: nltk>=3.9.2
23
+ Requires-Dist: numpy>=2.3.4
24
+ Requires-Dist: omegaconf>=2.3.0
25
+ Requires-Dist: peft>=0.17.1
26
+ Requires-Dist: scikit-learn>=1.7.2
27
+ Requires-Dist: sentencepiece>=0.2.1
28
+ Requires-Dist: torch>=2.9.0
29
+ Requires-Dist: transformers>=4.57.1
30
+ Requires-Dist: tree-sitter-language-pack>=0.2.0
31
+ Requires-Dist: tree-sitter<0.23.0,>=0.22.0
32
+ Description-Content-Type: text/markdown
33
+
34
+ # CodeFinetuner
35
+ [![Build](https://github.com/cuolm/codefinetuner/actions/workflows/tests.yml/badge.svg)](https://github.com/cuolm/codefinetuner/actions)
36
+ [![PyPI](https://img.shields.io/pypi/v/codefinetuner.svg)](https://pypi.org/project/codefinetuner/)
37
+ [![License](https://img.shields.io/github/license/cuolm/codefinetuner.svg)](LICENSE.txt)
38
+ [![Coverage](https://img.shields.io/endpoint?url=https://gist.githubusercontent.com/cuolm/gist_id/raw/coverage.json)](https://github.com/cuolm/codefinetuner/actions)
39
+
40
+
41
+ Create your own local code autocomplete model, fine-tuned on your custom code repository, for use in editors like VS Code or Vim/Neovim.
42
+
43
+ Fine-tuning is achieved by training a Low-Rank Adapter ([LoRA](https://arxiv.org/abs/2106.09685)) to perform Fill-In-the-Middle ([FIM](https://arxiv.org/abs/2207.14255)) completion.
44
+
45
+ ## Table of Contents
46
+ - [Architecture](#architecture)
47
+ - [Project Structure](#project-structure)
48
+ - [How Training Examples Are Created](#how-training-examples-are-created)
49
+ - [Installation](#installation)
50
+ - [Quick Start](#quick-start)
51
+ - [Configuration](#configuration)
52
+ - [Usage](#usage)
53
+ - [Deployment](#deployment)
54
+ - [Docker](#docker)
55
+ - [Tree-sitter Setup](#tree-sitter-setup) <!-- Link to new docs -->
56
+ - [Tests](#tests)
57
+ - [Resources](#resources)
58
+ - [License](#license)
59
+
60
+
61
+ ## Architecture
62
+ ```text
63
+ Raw Code Files
64
+ |
65
+ v
66
+ [Preprocess] -- tree-sitter parsing -> FIM examples -> tokenized JSONL
67
+ |
68
+ v
69
+ [Finetune] -- LoRA adapter training -> merged model
70
+ |
71
+ v
72
+ [Evaluate] -- CodeBLEU, SentenceBLEU, exact match, line match, perplexity
73
+ |
74
+ v
75
+ [Convert] -- GGUF conversion -> quantized model for deployment
76
+ ```
77
+
78
+ ## Project Structure
79
+ ```text
80
+ .
81
+ ├── src/
82
+ │ └── codefinetuner/ # Core packages
83
+ │ ├── preprocess/
84
+ │ ├── finetune/
85
+ │ ├── evaluate/
86
+ │ └── convert/
87
+ ├── config/ # User configuration
88
+ │ └── codefinetuner_config.yaml
89
+ ├── data/ # Default data directory (Workspace root)
90
+ ├── outputs/ # Pipeline artifacts (Workspace root)
91
+ ├── scripts/ # Utility scripts
92
+ ├── tests/ # Unit tests
93
+ ├── third_party/ # External submodules (e.g., custom parsers)
94
+ └── docs/ # Documentation and assets
95
+ ```
96
+
97
+ ## How Training Examples Are Created
98
+ To generate high-quality FIM examples, high-level structural code blocks are extracted (e.g., functions, classes). From these blocks, logical sub-blocks (e.g., statements, expressions) are masked to serve as the "middle" section for the model to predict.
99
+
100
+ Here is an example illustrating how a single FIM example is created:
101
+ <table>
102
+ <tr>
103
+ <td align="center" valign="top">
104
+ <strong>Source Code File</strong><br>
105
+ <img src="docs/code_file.png" alt="code_file" width="250">
106
+ </td>
107
+ <td align="center" valign="top">
108
+ <strong>Code Block</strong><br>
109
+ <img src="docs/code_block.png" alt="code_block" width="250">
110
+ </td>
111
+ <td align="center" valign="top">
112
+ <strong>One Subblock</strong><br>
113
+ <img src="docs/code_subblock.png" alt="code_subblock" width="250">
114
+ </td>
115
+ </tr>
116
+ </table>
117
+
118
+ ```python
119
+ <|fim_prefix|>uint32_t count_bits(uint32_t value){\n uint32_t count = 0;\n while(value){\n
120
+ <|fim_suffix|> }\n return count;
121
+ <|fim_middle|>count = count + (value & 1);\n value = (value >> 1);
122
+ ```
123
+
124
+ Using this technique, rather than randomly splitting code into unrelated text chunks, helps the model learn the logical patterns and structure of your specific codebase.
125
+
126
+ ## Installation
127
+
128
+ ### From PyPI
129
+ ```bash
130
+ uv add codefinetuner
131
+ # or
132
+ pip install codefinetuner
133
+ ```
134
+ ### From Source (Development)
135
+ ```bash
136
+ git clone --recurse-submodules https://github.com/cuolm/codefinetuner
137
+ cd codefinetuner
138
+
139
+ # Using uv (Recommended)
140
+ uv sync
141
+
142
+ # Using pip
143
+ pip install -r requirements.txt
144
+ pip install -e .
145
+ ```
146
+
147
+ ---
148
+
149
+ ## Quick Start
150
+ Create a configuration file according to the [Configuration](#configuration) section.
151
+ ```python
152
+ import codefinetuner
153
+
154
+ # Run the complete pipeline
155
+ codefinetuner.run_pipeline("codefinetuner_config.yaml")
156
+ ```
157
+
158
+ ## Configuration
159
+
160
+ The pipeline uses a single-source-of-truth YAML configuration file. It utilizes YAML anchors (`&globals`) to share core parameters across all stages (`preprocess`, `finetune`, `evaluate`), ensuring consistency and reducing redundancy.
161
+
162
+ ### Configuration Structure
163
+
164
+ Create a codefinetuner_config.yaml using the template below. For a full list of all available parameters and their effects, see the [Configuration Reference Guide](/docs/config-file.md).
165
+
166
+ ```yaml
167
+ # globals contain all the mandatory parameters.
168
+ globals: &globals
169
+ workspace_path: null # null: defaults to current working directory (CWD)
170
+ model_name: "Qwen/Qwen2.5-Coder-1.5B"
171
+ fim_prefix_token: "<|fim_prefix|>"
172
+ fim_middle_token: "<|fim_middle|>"
173
+ fim_suffix_token: "<|fim_suffix|>"
174
+ fim_pad_token: "<|fim_pad|>"
175
+ eos_token: "<|endoftext|>"
176
+ label_pad_token_id: -100
177
+ data_language: "c"
178
+ data_extensions: [".c", ".h"]
179
+
180
+ preprocess:
181
+ <<: *globals # Inherits all global parameters
182
+ split_mode: "manual"
183
+ max_token_sequence_length: 1024
184
+ # ... (preprocess specific settings)
185
+
186
+ finetune:
187
+ <<: *globals
188
+ lora_r: 32
189
+ trainer_num_train_epochs: 1
190
+ # ... (finetune specific settings)
191
+
192
+ evaluate:
193
+ <<: *globals
194
+ benchmark_sample_size: 4
195
+ # ... (evaluate specific settings)
196
+
197
+ ```
198
+ > **Note:** For a complete, production-ready example, see [`config/codefinetuner_config.yaml`](/config/codefinetuner_config.yaml).
199
+
200
+ ### Data Preparation
201
+ Place source files in your `raw_data_path` (default: `workspace_path/data`).
202
+ * **Auto Split:** Place files directly in the directory.
203
+ * **Manual Split:** Create `train`, `eval`, and `test` subfolders inside `raw_data_path` and assign files according to your manual split preferences.
204
+
205
+ ## Usage
206
+
207
+ ### CLI Usage
208
+ Run the pipeline using the unified CLI:
209
+ ```bash
210
+ uv run codefinetuner --config="config/codefinetuner_config.yaml"
211
+ ```
212
+
213
+ **Pipeline Flags:**
214
+ * `--config`: Specify path to a different config file.
215
+ * `--skip-preprocess`, `--skip-finetune`, `--skip-evaluate`, `--skip-convert`: Skip specific stages.
216
+
217
+ ### Python Module Usage
218
+ ```python
219
+ import codefinetuner
220
+
221
+ # Full pipeline
222
+ codefinetuner.run_pipeline("path/to/codefinetuner_config.yaml")
223
+
224
+ # Skip stages
225
+ codefinetuner.run_pipeline(
226
+ "path/to/codefinetuner_config.yaml",
227
+ skip_preprocess=True,
228
+ skip_convert=True
229
+ )
230
+
231
+ # Individual stages
232
+ from codefinetuner import preprocess, finetune
233
+ preprocess.run("config.yaml")
234
+ ```
235
+
236
+ ## Deployment: Using the Model
237
+ The `convert` stage converts the model to GGUF format. The final GGUF file is located under `outputs/convert/results/lora_model.gguf`.
238
+ For a detailed guide on how to use the gguf model with the VS Code extension [llama.vscode](https://github.com/ggml-org/llama-vscode), check out the [inference-vscode](/docs/inference-vscode.md) guide.
239
+
240
+
241
+ ## Create And Run Docker Image
242
+
243
+ #### 1. Build the Docker Image
244
+ Build the image from the `Dockerfile`, tagging it as codefinetuner-image.
245
+ ```bash
246
+ docker build -t codefinetuner-image .
247
+ ```
248
+ #### 2. Prepare Data and Run the Container
249
+ To allow the container to access your data for fine-tuning, use a bind mount to link your host machine's `data` directory to the container.
250
+ - On your host machine (where you run Docker), create a folder named `data` if it doesn't already exist.
251
+ - Put all files you want to use for fine-tuning inside the `data` directory. For `manual` mode, include `train`, `eval`, and `test` subdirectories containing your manually splitted files.
252
+ - Start the container with the bind mount, and open a Bash shell depending on your host machine hardware:
253
+
254
+ #### NVIDIA GPU (Recommended)
255
+ Use this command to enable CUDA support for `torch` and `bitsandbytes`. Requires the [NVIDIA Container Toolkit](https://docs.nvidia.com/datacenter/cloud-native/container-toolkit/latest/install-guide.html) installed on the host machine.
256
+
257
+ ```bash
258
+ docker run --gpus all -it --rm \
259
+ -v $(pwd)/data:/app/data \
260
+ codefinetuner-image /bin/bash
261
+ ```
262
+ #### CPU Only
263
+
264
+ Use this command if no compatible GPU is available. Note that fine-tuning will be significantly slower.
265
+ ```bash
266
+ docker run -it --rm \
267
+ -v $(pwd)/data:/app/data \
268
+ codefinetuner-image /bin/bash
269
+ ```
270
+
271
+ ## Tree-sitter Customization
272
+ Tree-sitter parses code into structural blocks for generating FIM training examples. Customize for new languages or build missing parsers.
273
+
274
+ - [Add Language Definitions](docs/tree-sitter-customization.md#add-new-language-block-definitions) - Define `block_types`/`subblock_types` in JSON.
275
+ - [Build Custom Parser](docs/tree-sitter-customization.md#build-custom-parser) - Compile from source (e.g., Mojo).
276
+
277
+
278
+ ## Tests
279
+ ```bash
280
+ pytest
281
+ ```
282
+
283
+ ## Useful Resources
284
+ - [Qwen2.5-Coder Technical Report](https://arxiv.org/pdf/2409.12186)
285
+ - [Structure-Aware Fill-in-the-Middle Pretraining for Code](https://arxiv.org/pdf/2506.00204)
286
+ - [LORA: LOW-RANK ADAPTATION OF LARGE LANGUAGE MODELS](https://arxiv.org/pdf/2106.09685)
287
+ - [Efficient Training of Language Models to Fill in the Middle](https://arxiv.org/pdf/2207.14255)
288
+ - [From Output to Evaluation: Does Raw Instruction-Tuned Code LLMs Output Suffice for Fill-in-the-Middle Code Generation?](https://arxiv.org/pdf/2505.18789)
289
+ - [CodeBLEU: a Method for Automatic Evaluation of Code Synthesis](https://arxiv.org/pdf/2009.10297)
290
+ - [HF LLM Course](https://huggingface.co/learn/llm-course/chapter1/1)
291
+ - [llama.vscode](https://github.com/ggml-org/llama.vscode)
292
+
293
+ ## License
294
+ Licensed under the [Apache License 2.0](LICENSE.txt).
@@ -0,0 +1,32 @@
1
+ codefinetuner/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
2
+ codefinetuner/pipeline.py,sha256=TjQymL2Skjs5eY3jE58OLXzzWDfz4G17PwWkAX4Bek8,4632
3
+ codefinetuner/convert/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
4
+ codefinetuner/convert/config.py,sha256=HyXMPgP1qNvl0mFxowDl_NsTma9BXrRb6ifymQUmy2E,5083
5
+ codefinetuner/convert/convert_hf_to_gguf.py,sha256=weWar0y0Omjj6cLYX42i5VIPm5C0SzsKkyI0lKBf2rg,577201
6
+ codefinetuner/convert/convert_hf_to_gguf.version,sha256=QsG7ukni09uOW2RMD0kLOlCvEaKkRnPYnJ03IRLMrX8,6
7
+ codefinetuner/convert/run.py,sha256=23wWXy4tBroSxxynw_zE0A87jlLRH0XmlXPuCR8hW70,2402
8
+ codefinetuner/evaluate/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
9
+ codefinetuner/evaluate/analyze.py,sha256=FbjkvWyk-fo9CgyJB-aPiCKZVumaLwMkid23QuCIFDk,8869
10
+ codefinetuner/evaluate/benchmark.py,sha256=GIRb7bKdLUEM3Mbt3ckG3i6Rmub6VL8c_CXGzsMB5K0,3643
11
+ codefinetuner/evaluate/codebleu_shim.py,sha256=rAz8BSASII86XqaDHzGo3tw-ZwUQaJtr_FLfIOc1pl4,1291
12
+ codefinetuner/evaluate/config.py,sha256=WCWgbgdRMGpxELKX1g346O79RLV8zvDNSrzyCrHR64Y,8390
13
+ codefinetuner/evaluate/evaluate.py,sha256=RqSASa3ln7eGfDSesRhBGi1AnvLHJwkPJgaCciwvu2s,2344
14
+ codefinetuner/evaluate/generate.py,sha256=l37Btc1BvwhLSCIbz4fJ5t0rVhp6NACqph8Wheri-i4,6519
15
+ codefinetuner/evaluate/metrics.py,sha256=tf9D8Z4qb7rr_utocIe39iTnC41VAdWCUjqxlbSP4LA,6014
16
+ codefinetuner/evaluate/run.py,sha256=022ooFB2N9XVs6FGt8FEOETcvhAPYw8fev0_6l7tRRM,4361
17
+ codefinetuner/finetune/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
18
+ codefinetuner/finetune/config.py,sha256=nFlewaN_a0NcCdkHX3BQ1c_iPDV-eso__NOAvCAdT0Q,8695
19
+ codefinetuner/finetune/model.py,sha256=oB-wi4ncuBjIse6elbUDTdaveyI9z44-pJrvyNgSejQ,2288
20
+ codefinetuner/finetune/run.py,sha256=ECbgcw3FoUnhiGUyYYrNbOLtLcTouYooKwarMyLDptM,5010
21
+ codefinetuner/finetune/train.py,sha256=E8w0MqC7zVp-VuAD3MfU_eCa3nwvDjgS5LHXK7P7JQo,7388
22
+ codefinetuner/preprocess/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
23
+ codefinetuner/preprocess/config.py,sha256=74dLKkdgCIuwxU4xfob7OEFArPg7mszaszykSOiWgvU,7593
24
+ codefinetuner/preprocess/extract.py,sha256=Hk6nCA3fMKazjpNhS9sBU_T29QAu_uwjVCdNdd0oL48,7090
25
+ codefinetuner/preprocess/process.py,sha256=fIISkeOcMwLoVyXwYtbex1OBl7Y8uLWnTlpFpPxqZf0,7563
26
+ codefinetuner/preprocess/run.py,sha256=25p5_AA_UUzhnO_p0CRrZr2PkvBWSMUk5G3aqnoP2iw,4700
27
+ codefinetuner/preprocess/tree_sitter_definitions.json,sha256=lFbu9JvvXzXKls7t-Ub-_U3nM34-esjHOaRVwSvmZk4,4188
28
+ codefinetuner-0.1.0.dist-info/METADATA,sha256=4exWwBA6L7iJaEGARZ-o5X6fnq5mYRRJp93avoD7Keg,10903
29
+ codefinetuner-0.1.0.dist-info/WHEEL,sha256=QccIxa26bgl1E6uMy58deGWi-0aeIkkangHcxk2kWfw,87
30
+ codefinetuner-0.1.0.dist-info/entry_points.txt,sha256=ay-OqtpawGFvDK8CkNQYYQxqiG5xZPgRPthAjVZop6w,62
31
+ codefinetuner-0.1.0.dist-info/licenses/LICENSE.txt,sha256=xx0jnfkXJvxRnG63LTGOxlggYnIysveWIZ6H3PNdCrQ,11357
32
+ codefinetuner-0.1.0.dist-info/RECORD,,
@@ -0,0 +1,4 @@
1
+ Wheel-Version: 1.0
2
+ Generator: hatchling 1.29.0
3
+ Root-Is-Purelib: true
4
+ Tag: py3-none-any
@@ -0,0 +1,2 @@
1
+ [console_scripts]
2
+ codefinetuner = codefinetuner.pipeline: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.