lara-haystack 1.0.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,3 @@
1
+ # SPDX-FileCopyrightText: 2026-present deepset GmbH <info@deepset.ai>
2
+ #
3
+ # SPDX-License-Identifier: Apache-2.0
@@ -0,0 +1,7 @@
1
+ # SPDX-FileCopyrightText: 2026-present deepset GmbH <info@deepset.ai>
2
+ #
3
+ # SPDX-License-Identifier: Apache-2.0
4
+
5
+ from .document_translator import LaraDocumentTranslator
6
+
7
+ __all__ = ["LaraDocumentTranslator"]
@@ -0,0 +1,340 @@
1
+ # SPDX-FileCopyrightText: 2026-present deepset GmbH <info@deepset.ai>
2
+ #
3
+ # SPDX-License-Identifier: Apache-2.0
4
+
5
+ from typing import Any, Literal
6
+
7
+ from haystack import Document, component, logging
8
+ from haystack.utils import Secret
9
+ from lara_sdk import Credentials, TextBlock, Translator
10
+
11
+ logger = logging.getLogger(__name__)
12
+
13
+
14
+ @component
15
+ class LaraDocumentTranslator:
16
+ """
17
+ Translates the text content of Haystack Documents using translated's Lara translation API.
18
+
19
+ Lara is an adaptive translation AI that combines the fluency and context handling
20
+ of LLMs with low hallucination and latency. It adapts to domains at inference time
21
+ using optional context, instructions, translation memories, and glossaries. You can find
22
+ more detailed information in the [Lara documentation](https://developers.laratranslate.com/docs/introduction).
23
+
24
+
25
+ ### Usage example
26
+ ```python
27
+ from haystack import Document
28
+ from haystack.utils import Secret
29
+ from haystack_integrations.components.lara import LaraDocumentTranslator
30
+
31
+ translator = LaraDocumentTranslator(
32
+ access_key_id=Secret.from_env_var("LARA_ACCESS_KEY_ID"),
33
+ access_key_secret=Secret.from_env_var("LARA_ACCESS_KEY_SECRET"),
34
+ source_lang="en-US",
35
+ target_lang="de-DE",
36
+ )
37
+
38
+ doc = Document(content="Hello, world!")
39
+ result = translator.run(documents=[doc])
40
+ print(result["documents"][0].content)
41
+ ```
42
+ """
43
+
44
+ def __init__(
45
+ self,
46
+ access_key_id: Secret = Secret.from_env_var("LARA_ACCESS_KEY_ID"),
47
+ access_key_secret: Secret = Secret.from_env_var("LARA_ACCESS_KEY_SECRET"),
48
+ source_lang: str | None = None,
49
+ target_lang: str | None = None,
50
+ context: str | None = None,
51
+ instructions: str | None = None,
52
+ style: Literal["faithful", "fluid", "creative"] = "faithful",
53
+ adapt_to: list[str] | None = None,
54
+ glossaries: list[str] | None = None,
55
+ reasoning: bool = False,
56
+ ):
57
+ """
58
+ Creats an instance of the LaraDocumentTranslator component.
59
+
60
+ :param access_key_id:
61
+ Lara API access key ID. Defaults to the `LARA_ACCESS_KEY_ID` environment variable.
62
+ :param access_key_secret:
63
+ Lara API access key secret. Defaults to the `LARA_ACCESS_KEY_SECRET` environment variable.
64
+ :param source_lang:
65
+ Language code of the source text. If `None`, Lara auto-detects the source language.
66
+ Use locale codes from the
67
+ [supported languages list](https://developers.laratranslate.com/docs/supported-languages).
68
+ :param target_lang:
69
+ Language code of the target text.
70
+ Use locale codes from the
71
+ [supported languages list](https://developers.laratranslate.com/docs/supported-languages).
72
+ :param context:
73
+ Optional external context: text that is not translated but is sent to Lara to
74
+ improve translation quality (e.g. surrounding sentences, prior messages).
75
+ You can find more detailed information in the
76
+ [Lara documentation](https://developers.laratranslate.com/docs/adapt-to-context).
77
+ :param instructions:
78
+ Optional natural-language instructions to guide translation and
79
+ specify domain-specific terminology (e.g. "Be formal", "Use a professional tone").
80
+ You can find more detailed information in the
81
+ [Lara documentation](https://developers.laratranslate.com/docs/adapt-to-instructions).
82
+ :param style:
83
+ One of `"faithful"`, `"fluid"`, or `"creative"`.
84
+ Default is `"faithful"`.
85
+ Style description:
86
+ - `"faithful"`: For accuracy and precision. Keeps original structure and meaning.
87
+ Ideal for manuals, legal documents.
88
+ - `"fluid"`: For readability and natural flow. Smooth, conversational. Good for general content.
89
+ - `"creative"`: For artistic and creative expression. Best for literature, marketing, or content
90
+ where impact and tone matter more than literal wording.
91
+ You can find more detailed information in the
92
+ [Lara documentation](https://support.laratranslate.com/en/translation-styles).
93
+ :param adapt_to:
94
+ Optional list of translation memory IDs. Lara adapts to the style and terminology of these memories
95
+ at inference time. Domain adaptation is available depending on your plan. You can find more
96
+ detailed information in the
97
+ [Lara documentation](https://developers.laratranslate.com/docs/adapt-to-translation-memories).
98
+ :param glossaries:
99
+ Optional list of glossary IDs. Lara applies these glossaries at inference time to enforce
100
+ consistent terminology (e.g. brand names, product terms, legal or technical phrases) across translations.
101
+ Glossary management and availability depends on your plan.
102
+ You can find more detailed information in the
103
+ [Lara documentation](https://developers.laratranslate.com/docs/manage-glossaries).
104
+ :param reasoning:
105
+ If `True`, uses the Lara Think model for higher-quality translation (multi-step linguistic analysis).
106
+ Increases latency and cost. Availability depends on your plan. You can find more detailed information in the
107
+ [Lara documentation](https://developers.laratranslate.com/docs/translate-text#reasoning-lara-think).
108
+ """
109
+
110
+ self.access_key_id = access_key_id
111
+ self.access_key_secret = access_key_secret
112
+ self.source_lang = source_lang
113
+ self.target_lang = target_lang
114
+ self.context = context
115
+ self.instructions = instructions
116
+ self.style = style
117
+ self.adapt_to = adapt_to
118
+ self.glossaries = glossaries
119
+ self.reasoning = reasoning
120
+ self._translator: Translator | None = None
121
+
122
+ def warm_up(self) -> None:
123
+ """
124
+ Warm up the Lara translator by initializing the client.
125
+ """
126
+ if self._translator is None:
127
+ credentials = Credentials(
128
+ access_key_id=self.access_key_id.resolve_value(),
129
+ access_key_secret=self.access_key_secret.resolve_value(),
130
+ )
131
+ self._translator = Translator(credentials=credentials)
132
+
133
+ @component.output_types(documents=list[Document])
134
+ def run(
135
+ self,
136
+ documents: list[Document],
137
+ source_lang: str | list[str | None] | None = None,
138
+ target_lang: str | list[str] | None = None,
139
+ context: str | list[str] | None = None,
140
+ instructions: str | list[str] | None = None,
141
+ style: str | list[str] | None = None,
142
+ adapt_to: list[str] | list[list[str]] | None = None,
143
+ glossaries: list[str] | list[list[str]] | None = None,
144
+ reasoning: bool | list[bool] | None = None,
145
+ ) -> dict[str, list[Document]]:
146
+ """
147
+ Translate the text content of each input Document using the Lara API.
148
+
149
+ Any of the translation parameters (source_lang, target_lang, context,
150
+ instructions, style, adapt_to, glossaries, reasoning) can be passed here
151
+ to override the defaults set when creating the component. They can be a single value
152
+ (applied to all documents) or a list of values with the same length as
153
+ `documents` for per-document settings.
154
+
155
+ :param documents:
156
+ List of Haystack Documents whose `content` is to be translated.
157
+ :param source_lang:
158
+ Source language code(s). Use locale codes from the
159
+ [supported languages list](https://developers.laratranslate.com/docs/supported-languages).
160
+ If `None`, Lara auto-detects the source language. Single value or list (one per document).
161
+ :param target_lang:
162
+ Target language code(s). Use locale codes from the
163
+ [supported languages list](https://developers.laratranslate.com/docs/supported-languages).
164
+ Single value or list (one per document).
165
+ :param context:
166
+ Optional external context: text that is not translated but is sent to Lara to
167
+ improve translation quality (e.g. surrounding sentences, prior messages).
168
+ You can find more detailed information in the
169
+ [Lara documentation](https://developers.laratranslate.com/docs/adapt-to-context).
170
+ :param instructions:
171
+ Optional natural-language instructions to guide translation and specify
172
+ domain-specific terminology (e.g. "Be formal", "Use a professional tone").
173
+ You can find more detailed information in the
174
+ [Lara documentation](https://developers.laratranslate.com/docs/adapt-to-instructions).
175
+ :param style:
176
+ One of `"faithful"`, `"fluid"`, or `"creative"`.
177
+ Style description:
178
+ - `"faithful"`: For accuracy and precision. Keeps original structure and meaning.
179
+ Ideal for manuals, legal documents.
180
+ - `"fluid"`: For readability and natural flow. Smooth, conversational. Good for general content.
181
+ - `"creative"`: For artistic and creative expression. Best for literature, marketing, or content
182
+ where impact and tone matter more than literal wording.
183
+ You can find more detailed information in the
184
+ [Lara documentation](https://support.laratranslate.com/en/translation-styles).
185
+ :param adapt_to:
186
+ Optional list of translation memory IDs. Lara adapts to the style and terminology
187
+ of these memories at inference time. Domain adaptation is available depending on your plan.
188
+ You can find more detailed information in the
189
+ [Lara documentation](https://developers.laratranslate.com/docs/adapt-to-translation-memories).
190
+ :param glossaries:
191
+ Optional list of glossary IDs. Lara applies these glossaries at inference time to enforce
192
+ consistent terminology (e.g. brand names, product terms, legal or technical phrases) across translations.
193
+ Glossary management and availability depends on your plan.
194
+ You can find more detailed information in the
195
+ [Lara documentation](https://developers.laratranslate.com/docs/manage-glossaries).
196
+ :param reasoning:
197
+ If `True`, uses the Lara Think model for higher-quality translation (multi-step linguistic analysis).
198
+ Increases latency and cost. Availability depends on your plan. You can find more detailed information in the
199
+ [Lara documentation](https://developers.laratranslate.com/docs/translate-text#reasoning-lara-think).
200
+ :return:
201
+ A dictionary with the following keys:
202
+ - `documents`: A list of translated documents.
203
+
204
+ :raises ValueError: If any list-valued parameter has length != `len(documents)`.
205
+ """
206
+ if not documents:
207
+ return {"documents": []}
208
+
209
+ if self._translator is None:
210
+ self.warm_up()
211
+
212
+ source_lang = source_lang or self.source_lang
213
+ target_lang = target_lang or self.target_lang
214
+ context = context or self.context
215
+ instructions = instructions or self.instructions
216
+ style = style or self.style
217
+ adapt_to = adapt_to or self.adapt_to
218
+ glossaries = glossaries or self.glossaries
219
+ reasoning = reasoning or self.reasoning
220
+
221
+ validated_params = self._validate_params(
222
+ len(documents),
223
+ source_lang,
224
+ target_lang,
225
+ context,
226
+ style,
227
+ instructions,
228
+ adapt_to,
229
+ glossaries,
230
+ reasoning,
231
+ )
232
+
233
+ translated_documents = []
234
+ for idx, cur_doc in enumerate(documents):
235
+ if not cur_doc.content:
236
+ logger.warning(f"Document {cur_doc.id} has no content, skipping translation.")
237
+ translation = cur_doc.content
238
+ else:
239
+ params = {key: value[idx] for key, value in validated_params.items()}
240
+ text_blocks = [TextBlock(text=cur_doc.content, translatable=True)]
241
+ if params["context"] is not None:
242
+ text_blocks.append(TextBlock(text=params["context"], translatable=False))
243
+
244
+ # Ignoring type because the lara client is only initialized after warm_up and None before
245
+ translation_response = self._translator.translate( # type: ignore[union-attr]
246
+ text=text_blocks,
247
+ source=params["source_lang"],
248
+ target=params["target_lang"],
249
+ instructions=params["instructions"],
250
+ style=params["style"],
251
+ adapt_to=params["adapt_to"],
252
+ glossaries=params["glossaries"],
253
+ reasoning=params["reasoning"],
254
+ )
255
+ translation = translation_response.translation[0].text
256
+
257
+ meta = {"original_document_id": cur_doc.id, **cur_doc.meta}
258
+ translated_doc = Document(content=translation, meta=meta)
259
+ translated_documents.append(translated_doc)
260
+
261
+ return {"documents": translated_documents}
262
+
263
+ @staticmethod
264
+ def _normalize_parameter(
265
+ name: str,
266
+ value: Any,
267
+ num_documents: int,
268
+ allow_list_of_lists: bool = False,
269
+ wrap_scalar: bool = False,
270
+ ) -> list[Any]:
271
+ """
272
+ Validate a single translation parameter and broadcast it to a per-document list.
273
+
274
+ :param name: Human-readable parameter name used in error messages.
275
+ :param value: The raw parameter value (scalar, list, or list-of-lists).
276
+ :param num_documents: Expected number of documents.
277
+ :param allow_list_of_lists: If True, treat a list whose first element is
278
+ itself a list as already per-document (used for adapt_to / glossaries).
279
+ :param wrap_scalar: If True and value is a non-None scalar, wrap it in a
280
+ single-element list before replicating (used for instructions).
281
+ :return: A list of length `num_documents`.
282
+ :raises ValueError: If a list-valued parameter has the wrong length.
283
+ """
284
+ if allow_list_of_lists:
285
+ is_per_doc = isinstance(value, list) and len(value) > 0 and isinstance(value[0], list)
286
+ if is_per_doc:
287
+ if len(value) != num_documents:
288
+ msg = f"If {name} is a list of lists, it must be the same length as the number of documents."
289
+ raise ValueError(msg)
290
+ return value
291
+ return [value] * num_documents
292
+
293
+ if isinstance(value, list):
294
+ if len(value) != num_documents:
295
+ msg = f"If {name} is a list, it must be the same length as the number of documents."
296
+ raise ValueError(msg)
297
+ return value
298
+
299
+ if wrap_scalar and value is not None:
300
+ value = [value]
301
+ return [value] * num_documents
302
+
303
+ def _validate_params(
304
+ self,
305
+ num_documents: int,
306
+ source_lang: str | list[str | None] | None,
307
+ target_lang: str | list[str] | None,
308
+ context: str | list[str] | None,
309
+ style: str | list[str] | None,
310
+ instructions: str | list[str] | None,
311
+ adapt_to: list[str] | list[list[str]] | None,
312
+ glossaries: list[str] | list[list[str]] | None,
313
+ reasoning: bool | list[bool] | None,
314
+ ) -> dict[str, list[Any]]:
315
+ """
316
+ Validates translation parameters and normalizes them to per-document lists.
317
+
318
+ :param num_documents: Number of documents in the current batch.
319
+ :param source_lang: Source language (scalar or list of length num_documents).
320
+ :param target_lang: Target language (scalar or list of length num_documents).
321
+ :param context: Context (scalar or list of length num_documents).
322
+ :param style: Style (scalar or list of length num_documents).
323
+ :param instructions: Instructions (scalar or list of length num_documents).
324
+ :param adapt_to: Adaptation memory IDs (list or list of lists, one per doc).
325
+ :param glossaries: Glossary IDs (list or list of lists, one per doc).
326
+ :param reasoning: Reasoning flag (scalar or list of length num_documents).
327
+ :return: Dictionary mapping each parameter name to a list of length
328
+ `num_documents`.
329
+ :raises ValueError: If any list-valued parameter has length != num_documents.
330
+ """
331
+ return {
332
+ "source_lang": self._normalize_parameter("source language", source_lang, num_documents),
333
+ "target_lang": self._normalize_parameter("target language", target_lang, num_documents),
334
+ "context": self._normalize_parameter("context", context, num_documents),
335
+ "style": self._normalize_parameter("style", style, num_documents),
336
+ "instructions": self._normalize_parameter("instructions", instructions, num_documents, wrap_scalar=True),
337
+ "reasoning": self._normalize_parameter("reasoning", reasoning, num_documents),
338
+ "adapt_to": self._normalize_parameter("adapt to", adapt_to, num_documents, allow_list_of_lists=True),
339
+ "glossaries": self._normalize_parameter("glossaries", glossaries, num_documents, allow_list_of_lists=True),
340
+ }
File without changes
@@ -0,0 +1,39 @@
1
+ Metadata-Version: 2.4
2
+ Name: lara-haystack
3
+ Version: 1.0.0
4
+ Summary: Haystack integration for Lara, translated's AI translator
5
+ Project-URL: Documentation, https://github.com/deepset-ai/haystack-core-integrations/tree/main/integrations/lara#readme
6
+ Project-URL: Issues, https://github.com/deepset-ai/haystack-core-integrations/tree/main/integrations/issues
7
+ Project-URL: Source, https://github.com/deepset-ai/haystack-core-integrations/tree/main/integrations/lara
8
+ Author-email: deepset GmbH <info@deepset.ai>
9
+ License-Expression: Apache-2.0
10
+ License-File: LICENSE.txt
11
+ Keywords: Haystack,Lara,Translation,Translator
12
+ Classifier: Development Status :: 4 - Beta
13
+ Classifier: License :: OSI Approved :: Apache Software License
14
+ Classifier: Programming Language :: Python
15
+ Classifier: Programming Language :: Python :: 3.10
16
+ Classifier: Programming Language :: Python :: 3.11
17
+ Classifier: Programming Language :: Python :: 3.12
18
+ Classifier: Programming Language :: Python :: 3.13
19
+ Classifier: Programming Language :: Python :: Implementation :: CPython
20
+ Requires-Python: >=3.10
21
+ Requires-Dist: haystack-ai>=2.24.1
22
+ Requires-Dist: lara-sdk
23
+ Description-Content-Type: text/markdown
24
+
25
+ # lara-haystack
26
+
27
+ [![PyPI - Version](https://img.shields.io/pypi/v/lara-haystack.svg)](https://pypi.org/project/lara-haystack)
28
+ [![PyPI - Python Version](https://img.shields.io/pypi/pyversions/lara-haystack.svg)](https://pypi.org/project/lara-haystack)
29
+
30
+ - [Integration page](https://haystack.deepset.ai/integrations/lara)
31
+ - [Changelog](https://github.com/deepset-ai/haystack-core-integrations/blob/main/integrations/lara/CHANGELOG.md)
32
+
33
+ ---
34
+
35
+ ## Contributing
36
+
37
+ Refer to the general [Contribution Guidelines](https://github.com/deepset-ai/haystack-core-integrations/blob/main/CONTRIBUTING.md).
38
+
39
+ To run integration tests locally, you need to export the `LARA_ACCESS_KEY_ID` and `LARA_ACCESS_KEY_SECRET` environment variables.
@@ -0,0 +1,8 @@
1
+ haystack_integrations/__init__.py,sha256=ySaDZGF3fcR-FwjgLGvulEeO2TKnCFK6iwxYwLbMXWE,110
2
+ haystack_integrations/components/translators/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
3
+ haystack_integrations/components/translators/lara/__init__.py,sha256=2C36UWXvymk5CELvL10ZbvKGdlUhg7AMRj-rIo-a0Xk,205
4
+ haystack_integrations/components/translators/lara/document_translator.py,sha256=vjd-jdMqGXmPvH2f4ddHHQDB7UoF4OajRjXQ-2bXoHY,17339
5
+ lara_haystack-1.0.0.dist-info/METADATA,sha256=SykyJ3An8l2ETSNWx-qWOQYbLbAGk2b_2PeFo-ncBHg,1875
6
+ lara_haystack-1.0.0.dist-info/WHEEL,sha256=QccIxa26bgl1E6uMy58deGWi-0aeIkkangHcxk2kWfw,87
7
+ lara_haystack-1.0.0.dist-info/licenses/LICENSE.txt,sha256=B05uMshqTA74s-0ltyHKI6yoPfJ3zYgQbvcXfDVGFf8,10280
8
+ lara_haystack-1.0.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,73 @@
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, and distribution as defined by Sections 1 through 9 of this document.
10
+
11
+ "Licensor" shall mean the copyright owner or entity authorized by the copyright owner that is granting the License.
12
+
13
+ "Legal Entity" shall mean the union of the acting entity and all other entities that control, are controlled by, or are under common control with that entity. For the purposes of this definition, "control" means (i) the power, direct or indirect, to cause the direction or management of such entity, whether by contract or otherwise, or (ii) ownership of fifty percent (50%) or more of the outstanding shares, or (iii) beneficial ownership of such entity.
14
+
15
+ "You" (or "Your") shall mean an individual or Legal Entity exercising permissions granted by this License.
16
+
17
+ "Source" form shall mean the preferred form for making modifications, including but not limited to software source code, documentation source, and configuration files.
18
+
19
+ "Object" form shall mean any form resulting from mechanical transformation or translation of a Source form, including but not limited to compiled object code, generated documentation, and conversions to other media types.
20
+
21
+ "Work" shall mean the work of authorship, whether in Source or Object form, made available under the License, as indicated by a copyright notice that is included in or attached to the work (an example is provided in the Appendix below).
22
+
23
+ "Derivative Works" shall mean any work, whether in Source or Object form, that is based on (or derived from) the Work and for which the editorial revisions, annotations, elaborations, or other modifications represent, as a whole, an original work of authorship. For the purposes of this License, Derivative Works shall not include works that remain separable from, or merely link (or bind by name) to the interfaces of, the Work and Derivative Works thereof.
24
+
25
+ "Contribution" shall mean any work of authorship, including the original version of the Work and any modifications or additions to that Work or Derivative Works thereof, that is intentionally submitted to Licensor for inclusion in the Work by the copyright owner or by an individual or Legal Entity authorized to submit on behalf of the copyright owner. For the purposes of this definition, "submitted" means any form of electronic, verbal, or written communication sent to the Licensor or its representatives, including but not limited to communication on electronic mailing lists, source code control systems, and issue tracking systems that are managed by, or on behalf of, the Licensor for the purpose of discussing and improving the Work, but excluding communication that is conspicuously marked or otherwise designated in writing by the copyright owner as "Not a Contribution."
26
+
27
+ "Contributor" shall mean Licensor and any individual or Legal Entity on behalf of whom a Contribution has been received by Licensor and subsequently incorporated within the Work.
28
+
29
+ 2. Grant of Copyright License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable copyright license to reproduce, prepare Derivative Works of, publicly display, publicly perform, sublicense, and distribute the Work and such Derivative Works in Source or Object form.
30
+
31
+ 3. Grant of Patent License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable (except as stated in this section) patent license to make, have made, use, offer to sell, sell, import, and otherwise transfer the Work, where such license applies only to those patent claims licensable by such Contributor that are necessarily infringed by their Contribution(s) alone or by combination of their Contribution(s) with the Work to which such Contribution(s) was submitted. If You institute patent litigation against any entity (including a cross-claim or counterclaim in a lawsuit) alleging that the Work or a Contribution incorporated within the Work constitutes direct or contributory patent infringement, then any patent licenses granted to You under this License for that Work shall terminate as of the date such litigation is filed.
32
+
33
+ 4. Redistribution. You may reproduce and distribute copies of the Work or Derivative Works thereof in any medium, with or without modifications, and in Source or Object form, provided that You meet the following conditions:
34
+
35
+ (a) You must give any other recipients of the Work or Derivative Works a copy of this License; and
36
+
37
+ (b) You must cause any modified files to carry prominent notices stating that You changed the files; and
38
+
39
+ (c) You must retain, in the Source form of any Derivative Works that You distribute, all copyright, patent, trademark, and attribution notices from the Source form of the Work, excluding those notices that do not pertain to any part of the Derivative Works; and
40
+
41
+ (d) If the Work includes a "NOTICE" text file as part of its distribution, then any Derivative Works that You distribute must include a readable copy of the attribution notices contained within such NOTICE file, excluding those notices that do not pertain to any part of the Derivative Works, in at least one of the following places: within a NOTICE text file distributed as part of the Derivative Works; within the Source form or documentation, if provided along with the Derivative Works; or, within a display generated by the Derivative Works, if and wherever such third-party notices normally appear. The contents of the NOTICE file are for informational purposes only and do not modify the License. You may add Your own attribution notices within Derivative Works that You distribute, alongside or as an addendum to the NOTICE text from the Work, provided that such additional attribution notices cannot be construed as modifying the License.
42
+
43
+ You may add Your own copyright statement to Your modifications and may provide additional or different license terms and conditions for use, reproduction, or distribution of Your modifications, or for any such Derivative Works as a whole, provided Your use, reproduction, and distribution of the Work otherwise complies with the conditions stated in this License.
44
+
45
+ 5. Submission of Contributions. Unless You explicitly state otherwise, any Contribution intentionally submitted for inclusion in the Work by You to the Licensor shall be under the terms and conditions of this License, without any additional terms or conditions. Notwithstanding the above, nothing herein shall supersede or modify the terms of any separate license agreement you may have executed with Licensor regarding such Contributions.
46
+
47
+ 6. Trademarks. This License does not grant permission to use the trade names, trademarks, service marks, or product names of the Licensor, except as required for reasonable and customary use in describing the origin of the Work and reproducing the content of the NOTICE file.
48
+
49
+ 7. Disclaimer of Warranty. Unless required by applicable law or agreed to in writing, Licensor provides the Work (and each Contributor provides its Contributions) on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied, including, without limitation, any warranties or conditions of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A PARTICULAR PURPOSE. You are solely responsible for determining the appropriateness of using or redistributing the Work and assume any risks associated with Your exercise of permissions under this License.
50
+
51
+ 8. Limitation of Liability. In no event and under no legal theory, whether in tort (including negligence), contract, or otherwise, unless required by applicable law (such as deliberate and grossly negligent acts) or agreed to in writing, shall any Contributor be liable to You for damages, including any direct, indirect, special, incidental, or consequential damages of any character arising as a result of this License or out of the use or inability to use the Work (including but not limited to damages for loss of goodwill, work stoppage, computer failure or malfunction, or any and all other commercial damages or losses), even if such Contributor has been advised of the possibility of such damages.
52
+
53
+ 9. Accepting Warranty or Additional Liability. While redistributing the Work or Derivative Works thereof, You may choose to offer, and charge a fee for, acceptance of support, warranty, indemnity, or other liability obligations and/or rights consistent with this License. However, in accepting such obligations, You may act only on Your own behalf and on Your sole responsibility, not on behalf of any other Contributor, and only if You agree to indemnify, defend, and hold each Contributor harmless for any liability incurred by, or claims asserted against, such Contributor by reason of your accepting any such warranty or additional liability.
54
+
55
+ END OF TERMS AND CONDITIONS
56
+
57
+ APPENDIX: How to apply the Apache License to your work.
58
+
59
+ To apply the Apache License to your work, attach the following boilerplate notice, with the fields enclosed by brackets "[]" replaced with your own identifying information. (Don't include the brackets!) The text should be enclosed in the appropriate comment syntax for the file format. We also recommend that a file or class name and description of purpose be included on the same "printed page" as the copyright notice for easier identification within third-party archives.
60
+
61
+ Copyright [yyyy] [name of copyright owner]
62
+
63
+ Licensed under the Apache License, Version 2.0 (the "License");
64
+ you may not use this file except in compliance with the License.
65
+ You may obtain a copy of the License at
66
+
67
+ http://www.apache.org/licenses/LICENSE-2.0
68
+
69
+ Unless required by applicable law or agreed to in writing, software
70
+ distributed under the License is distributed on an "AS IS" BASIS,
71
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
72
+ See the License for the specific language governing permissions and
73
+ limitations under the License.