sqlalchemy-cratedb 0.36.0__py2.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,99 @@
1
+ # -*- coding: utf-8; -*-
2
+ #
3
+ # Licensed to CRATE Technology GmbH ("Crate") under one or more contributor
4
+ # license agreements. See the NOTICE file distributed with this work for
5
+ # additional information regarding copyright ownership. Crate licenses
6
+ # this file to you under the Apache License, Version 2.0 (the "License");
7
+ # you may not use this file except in compliance with the License. You may
8
+ # obtain a copy of the License at
9
+ #
10
+ # http://www.apache.org/licenses/LICENSE-2.0
11
+ #
12
+ # Unless required by applicable law or agreed to in writing, software
13
+ # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
14
+ # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
15
+ # License for the specific language governing permissions and limitations
16
+ # under the License.
17
+ #
18
+ # However, if you have executed another commercial license agreement
19
+ # with Crate these terms will supersede the license and you may use the
20
+ # software solely pursuant to the terms of the relevant commercial agreement.
21
+
22
+ from sqlalchemy.sql.expression import ColumnElement, literal
23
+ from sqlalchemy.ext.compiler import compiles
24
+
25
+
26
+ class Match(ColumnElement):
27
+ inherit_cache = True
28
+
29
+ def __init__(self, column, term, match_type=None, options=None):
30
+ super(Match, self).__init__()
31
+ self.column = column
32
+ self.term = term
33
+ self.match_type = match_type
34
+ self.options = options
35
+
36
+ def compile_column(self, compiler):
37
+ if isinstance(self.column, dict):
38
+ column = ', '.join(
39
+ sorted(["{0} {1}".format(compiler.process(k), v)
40
+ for k, v in self.column.items()])
41
+ )
42
+ return "({0})".format(column)
43
+ else:
44
+ return "{0}".format(compiler.process(self.column))
45
+
46
+ def compile_term(self, compiler):
47
+ return compiler.process(literal(self.term))
48
+
49
+ def compile_using(self, compiler):
50
+ if self.match_type:
51
+ using = "using {0}".format(self.match_type)
52
+ with_clause = self.with_clause()
53
+ if with_clause:
54
+ using = ' '.join([using, with_clause])
55
+ return using
56
+ if self.options:
57
+ raise ValueError("missing match_type. " +
58
+ "It's not allowed to specify options " +
59
+ "without match_type")
60
+
61
+ def with_clause(self):
62
+ if self.options:
63
+ options = ', '.join(
64
+ sorted(["{0}={1}".format(k, v)
65
+ for k, v in self.options.items()])
66
+ )
67
+
68
+ return "with ({0})".format(options)
69
+
70
+
71
+ def match(column, term, match_type=None, options=None):
72
+ """Generates match predicate for fulltext search
73
+
74
+ :param column: A reference to a column or an index, or a subcolumn, or a
75
+ dictionary of subcolumns with boost values.
76
+
77
+ :param term: The term to match against. This string is analyzed and the
78
+ resulting tokens are compared to the index.
79
+
80
+ :param match_type (optional): The match type. Determine how the term is
81
+ applied and the score calculated.
82
+
83
+ :param options (optional): The match options. Specify match type behaviour.
84
+ (Not possible without a specified match type.) Match options must be
85
+ supplied as a dictionary.
86
+ """
87
+ return Match(column, term, match_type, options)
88
+
89
+
90
+ @compiles(Match)
91
+ def compile_match(match, compiler, **kwargs):
92
+ func = "match(%s, %s)" % (
93
+ match.compile_column(compiler),
94
+ match.compile_term(compiler)
95
+ )
96
+ using = match.compile_using(compiler)
97
+ if using:
98
+ func = ' '.join([func, using])
99
+ return func
@@ -0,0 +1,28 @@
1
+ # -*- coding: utf-8; -*-
2
+ #
3
+ # Licensed to CRATE Technology GmbH ("Crate") under one or more contributor
4
+ # license agreements. See the NOTICE file distributed with this work for
5
+ # additional information regarding copyright ownership. Crate licenses
6
+ # this file to you under the Apache License, Version 2.0 (the "License");
7
+ # you may not use this file except in compliance with the License. You may
8
+ # obtain a copy of the License at
9
+ #
10
+ # http://www.apache.org/licenses/LICENSE-2.0
11
+ #
12
+ # Unless required by applicable law or agreed to in writing, software
13
+ # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
14
+ # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
15
+ # License for the specific language governing permissions and limitations
16
+ # under the License.
17
+ #
18
+ # However, if you have executed another commercial license agreement
19
+ # with Crate these terms will supersede the license and you may use the
20
+ # software solely pursuant to the terms of the relevant commercial agreement.
21
+
22
+ import sqlalchemy as sa
23
+ from verlib2 import Version
24
+
25
+ SA_VERSION = Version(sa.__version__)
26
+
27
+ SA_1_4 = Version('1.4.0b1')
28
+ SA_2_0 = Version('2.0.0')
@@ -0,0 +1,62 @@
1
+ # -*- coding: utf-8; -*-
2
+ #
3
+ # Licensed to CRATE Technology GmbH ("Crate") under one or more contributor
4
+ # license agreements. See the NOTICE file distributed with this work for
5
+ # additional information regarding copyright ownership. Crate licenses
6
+ # this file to you under the Apache License, Version 2.0 (the "License");
7
+ # you may not use this file except in compliance with the License. You may
8
+ # obtain a copy of the License at
9
+ #
10
+ # http://www.apache.org/licenses/LICENSE-2.0
11
+ #
12
+ # Unless required by applicable law or agreed to in writing, software
13
+ # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
14
+ # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
15
+ # License for the specific language governing permissions and limitations
16
+ # under the License.
17
+ #
18
+ # However, if you have executed another commercial license agreement
19
+ # with Crate these terms will supersede the license and you may use the
20
+ # software solely pursuant to the terms of the relevant commercial agreement.
21
+ import logging
22
+
23
+
24
+ logger = logging.getLogger(__name__)
25
+
26
+
27
+ def insert_bulk(pd_table, conn, keys, data_iter):
28
+ """
29
+ Use CrateDB's "bulk operations" endpoint as a fast path for pandas' and Dask's `to_sql()` [1] method.
30
+
31
+ The idea is to break out of SQLAlchemy, compile the insert statement, and use the raw
32
+ DBAPI connection client, in order to invoke a request using `bulk_parameters` [2]::
33
+
34
+ cursor.execute(sql=sql, bulk_parameters=data)
35
+
36
+ The vanilla implementation, used by SQLAlchemy, is::
37
+
38
+ data = [dict(zip(keys, row)) for row in data_iter]
39
+ conn.execute(pd_table.table.insert(), data)
40
+
41
+ Batch chunking will happen outside of this function, for example [3] demonstrates
42
+ the relevant code in `pandas.io.sql`.
43
+
44
+ [1] https://pandas.pydata.org/docs/reference/api/pandas.DataFrame.to_sql.html
45
+ [2] https://crate.io/docs/crate/reference/en/latest/interfaces/http.html#bulk-operations
46
+ [3] https://github.com/pandas-dev/pandas/blob/v2.0.1/pandas/io/sql.py#L1011-L1027
47
+ """
48
+
49
+ # Compile SQL statement and materialize batch.
50
+ sql = str(pd_table.table.insert().compile(bind=conn))
51
+ data = list(data_iter)
52
+
53
+ # For debugging and tracing the batches running through this method.
54
+ if logger.level == logging.DEBUG:
55
+ logger.debug(f"Bulk SQL: {sql}")
56
+ logger.debug(f"Bulk records: {len(data)}")
57
+ # logger.debug(f"Bulk data: {data}")
58
+
59
+ # Invoke bulk insert operation.
60
+ cursor = conn._dbapi_connection.cursor()
61
+ cursor.execute(sql=sql, bulk_parameters=data)
62
+ cursor.close()
@@ -0,0 +1,3 @@
1
+ from .array import ObjectArray
2
+ from .geo import Geopoint, Geoshape
3
+ from .object import ObjectType
@@ -0,0 +1,144 @@
1
+ # -*- coding: utf-8; -*-
2
+ #
3
+ # Licensed to CRATE Technology GmbH ("Crate") under one or more contributor
4
+ # license agreements. See the NOTICE file distributed with this work for
5
+ # additional information regarding copyright ownership. Crate licenses
6
+ # this file to you under the Apache License, Version 2.0 (the "License");
7
+ # you may not use this file except in compliance with the License. You may
8
+ # obtain a copy of the License at
9
+ #
10
+ # http://www.apache.org/licenses/LICENSE-2.0
11
+ #
12
+ # Unless required by applicable law or agreed to in writing, software
13
+ # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
14
+ # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
15
+ # License for the specific language governing permissions and limitations
16
+ # under the License.
17
+ #
18
+ # However, if you have executed another commercial license agreement
19
+ # with Crate these terms will supersede the license and you may use the
20
+ # software solely pursuant to the terms of the relevant commercial agreement.
21
+
22
+ import sqlalchemy.types as sqltypes
23
+ from sqlalchemy.sql import operators, expression
24
+ from sqlalchemy.sql import default_comparator
25
+ from sqlalchemy.ext.mutable import Mutable
26
+
27
+
28
+ class MutableList(Mutable, list):
29
+
30
+ @classmethod
31
+ def coerce(cls, key, value):
32
+ """ Convert plain list to MutableList """
33
+ if not isinstance(value, MutableList):
34
+ if isinstance(value, list):
35
+ return MutableList(value)
36
+ elif value is None:
37
+ return value
38
+ else:
39
+ return MutableList([value])
40
+ else:
41
+ return value
42
+
43
+ def __init__(self, initval=None):
44
+ list.__init__(self, initval or [])
45
+
46
+ def __setitem__(self, key, value):
47
+ list.__setitem__(self, key, value)
48
+ self.changed()
49
+
50
+ def __eq__(self, other):
51
+ return list.__eq__(self, other)
52
+
53
+ def append(self, item):
54
+ list.append(self, item)
55
+ self.changed()
56
+
57
+ def insert(self, idx, item):
58
+ list.insert(self, idx, item)
59
+ self.changed()
60
+
61
+ def extend(self, iterable):
62
+ list.extend(self, iterable)
63
+ self.changed()
64
+
65
+ def pop(self, index=-1):
66
+ list.pop(self, index)
67
+ self.changed()
68
+
69
+ def remove(self, item):
70
+ list.remove(self, item)
71
+ self.changed()
72
+
73
+
74
+ class Any(expression.ColumnElement):
75
+ """Represent the clause ``left operator ANY (right)``. ``right`` must be
76
+ an array expression.
77
+
78
+ copied from postgresql dialect
79
+
80
+ .. seealso::
81
+
82
+ :class:`sqlalchemy.dialects.postgresql.ARRAY`
83
+
84
+ :meth:`sqlalchemy.dialects.postgresql.ARRAY.Comparator.any`
85
+ ARRAY-bound method
86
+
87
+ """
88
+ __visit_name__ = 'any'
89
+ inherit_cache = True
90
+
91
+ def __init__(self, left, right, operator=operators.eq):
92
+ self.type = sqltypes.Boolean()
93
+ self.left = expression.literal(left)
94
+ self.right = right
95
+ self.operator = operator
96
+
97
+
98
+ class _ObjectArray(sqltypes.UserDefinedType):
99
+ cache_ok = True
100
+
101
+ class Comparator(sqltypes.TypeEngine.Comparator):
102
+ def __getitem__(self, key):
103
+ return default_comparator._binary_operate(self.expr,
104
+ operators.getitem,
105
+ key)
106
+
107
+ def any(self, other, operator=operators.eq):
108
+ """Return ``other operator ANY (array)`` clause.
109
+
110
+ Argument places are switched, because ANY requires array
111
+ expression to be on the right hand-side.
112
+
113
+ E.g.::
114
+
115
+ from sqlalchemy.sql import operators
116
+
117
+ conn.execute(
118
+ select([table.c.data]).where(
119
+ table.c.data.any(7, operator=operators.lt)
120
+ )
121
+ )
122
+
123
+ :param other: expression to be compared
124
+ :param operator: an operator object from the
125
+ :mod:`sqlalchemy.sql.operators`
126
+ package, defaults to :func:`.operators.eq`.
127
+
128
+ .. seealso::
129
+
130
+ :class:`.postgresql.Any`
131
+
132
+ :meth:`.postgresql.ARRAY.Comparator.all`
133
+
134
+ """
135
+ return Any(other, self.expr, operator=operator)
136
+
137
+ type = MutableList
138
+ comparator_factory = Comparator
139
+
140
+ def get_col_spec(self, **kws):
141
+ return "ARRAY(OBJECT)"
142
+
143
+
144
+ ObjectArray = MutableList.as_mutable(_ObjectArray)
@@ -0,0 +1,48 @@
1
+ import geojson
2
+ from sqlalchemy import types as sqltypes
3
+ from sqlalchemy.sql import default_comparator, operators
4
+
5
+
6
+ class Geopoint(sqltypes.UserDefinedType):
7
+ cache_ok = True
8
+
9
+ class Comparator(sqltypes.TypeEngine.Comparator):
10
+
11
+ def __getitem__(self, key):
12
+ return default_comparator._binary_operate(self.expr,
13
+ operators.getitem,
14
+ key)
15
+
16
+ def get_col_spec(self):
17
+ return 'GEO_POINT'
18
+
19
+ def bind_processor(self, dialect):
20
+ def process(value):
21
+ if isinstance(value, geojson.Point):
22
+ return value.coordinates
23
+ return value
24
+ return process
25
+
26
+ def result_processor(self, dialect, coltype):
27
+ return tuple
28
+
29
+ comparator_factory = Comparator
30
+
31
+
32
+ class Geoshape(sqltypes.UserDefinedType):
33
+ cache_ok = True
34
+
35
+ class Comparator(sqltypes.TypeEngine.Comparator):
36
+
37
+ def __getitem__(self, key):
38
+ return default_comparator._binary_operate(self.expr,
39
+ operators.getitem,
40
+ key)
41
+
42
+ def get_col_spec(self):
43
+ return 'GEO_SHAPE'
44
+
45
+ def result_processor(self, dialect, coltype):
46
+ return geojson.GeoJSON.to_instance
47
+
48
+ comparator_factory = Comparator
@@ -0,0 +1,92 @@
1
+ import warnings
2
+
3
+ from sqlalchemy import types as sqltypes
4
+ from sqlalchemy.ext.mutable import Mutable
5
+
6
+
7
+ class MutableDict(Mutable, dict):
8
+
9
+ @classmethod
10
+ def coerce(cls, key, value):
11
+ "Convert plain dictionaries to MutableDict."
12
+
13
+ if not isinstance(value, MutableDict):
14
+ if isinstance(value, dict):
15
+ return MutableDict(value)
16
+
17
+ # this call will raise ValueError
18
+ return Mutable.coerce(key, value)
19
+ else:
20
+ return value
21
+
22
+ def __init__(self, initval=None, to_update=None, root_change_key=None):
23
+ initval = initval or {}
24
+ self._changed_keys = set()
25
+ self._deleted_keys = set()
26
+ self._overwrite_key = root_change_key
27
+ self.to_update = self if to_update is None else to_update
28
+ for k in initval:
29
+ initval[k] = self._convert_dict(initval[k],
30
+ overwrite_key=k if self._overwrite_key is None else self._overwrite_key
31
+ )
32
+ dict.__init__(self, initval)
33
+
34
+ def __setitem__(self, key, value):
35
+ value = self._convert_dict(value, key if self._overwrite_key is None else self._overwrite_key)
36
+ dict.__setitem__(self, key, value)
37
+ self.to_update.on_key_changed(
38
+ key if self._overwrite_key is None else self._overwrite_key
39
+ )
40
+
41
+ def __delitem__(self, key):
42
+ dict.__delitem__(self, key)
43
+ # add the key to the deleted keys if this is the root object
44
+ # otherwise update on root object
45
+ if self._overwrite_key is None:
46
+ self._deleted_keys.add(key)
47
+ self.changed()
48
+ else:
49
+ self.to_update.on_key_changed(self._overwrite_key)
50
+
51
+ def on_key_changed(self, key):
52
+ self._deleted_keys.discard(key)
53
+ self._changed_keys.add(key)
54
+ self.changed()
55
+
56
+ def _convert_dict(self, value, overwrite_key):
57
+ if isinstance(value, dict) and not isinstance(value, MutableDict):
58
+ return MutableDict(value, self.to_update, overwrite_key)
59
+ return value
60
+
61
+ def __eq__(self, other):
62
+ return dict.__eq__(self, other)
63
+
64
+
65
+ class ObjectTypeImpl(sqltypes.UserDefinedType, sqltypes.JSON):
66
+
67
+ __visit_name__ = "OBJECT"
68
+
69
+ cache_ok = False
70
+ none_as_null = False
71
+
72
+
73
+ # Designated name to refer to. `Object` is too ambiguous.
74
+ ObjectType = MutableDict.as_mutable(ObjectTypeImpl)
75
+
76
+ # Backward-compatibility aliases.
77
+ _deprecated_Craty = ObjectType
78
+ _deprecated_Object = ObjectType
79
+
80
+ # https://www.lesinskis.com/deprecating-module-scope-variables.html
81
+ deprecated_names = ["Craty", "Object"]
82
+
83
+
84
+ def __getattr__(name):
85
+ if name in deprecated_names:
86
+ warnings.warn(f"{name} is deprecated and will be removed in future releases. "
87
+ f"Please use ObjectType instead.", DeprecationWarning)
88
+ return globals()[f"_deprecated_{name}"]
89
+ raise AttributeError(f"module {__name__} has no attribute {name}")
90
+
91
+
92
+ __all__ = deprecated_names + ["ObjectType"]
@@ -0,0 +1,178 @@
1
+
2
+
3
+ Apache License
4
+ Version 2.0, January 2004
5
+ http://www.apache.org/licenses/
6
+
7
+ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
8
+
9
+ 1. Definitions.
10
+
11
+ "License" shall mean the terms and conditions for use, reproduction,
12
+ and distribution as defined by Sections 1 through 9 of this document.
13
+
14
+ "Licensor" shall mean the copyright owner or entity authorized by
15
+ the copyright owner that is granting the License.
16
+
17
+ "Legal Entity" shall mean the union of the acting entity and all
18
+ other entities that control, are controlled by, or are under common
19
+ control with that entity. For the purposes of this definition,
20
+ "control" means (i) the power, direct or indirect, to cause the
21
+ direction or management of such entity, whether by contract or
22
+ otherwise, or (ii) ownership of fifty percent (50%) or more of the
23
+ outstanding shares, or (iii) beneficial ownership of such entity.
24
+
25
+ "You" (or "Your") shall mean an individual or Legal Entity
26
+ exercising permissions granted by this License.
27
+
28
+ "Source" form shall mean the preferred form for making modifications,
29
+ including but not limited to software source code, documentation
30
+ source, and configuration files.
31
+
32
+ "Object" form shall mean any form resulting from mechanical
33
+ transformation or translation of a Source form, including but
34
+ not limited to compiled object code, generated documentation,
35
+ and conversions to other media types.
36
+
37
+ "Work" shall mean the work of authorship, whether in Source or
38
+ Object form, made available under the License, as indicated by a
39
+ copyright notice that is included in or attached to the work
40
+ (an example is provided in the Appendix below).
41
+
42
+ "Derivative Works" shall mean any work, whether in Source or Object
43
+ form, that is based on (or derived from) the Work and for which the
44
+ editorial revisions, annotations, elaborations, or other modifications
45
+ represent, as a whole, an original work of authorship. For the purposes
46
+ of this License, Derivative Works shall not include works that remain
47
+ separable from, or merely link (or bind by name) to the interfaces of,
48
+ the Work and Derivative Works thereof.
49
+
50
+ "Contribution" shall mean any work of authorship, including
51
+ the original version of the Work and any modifications or additions
52
+ to that Work or Derivative Works thereof, that is intentionally
53
+ submitted to Licensor for inclusion in the Work by the copyright owner
54
+ or by an individual or Legal Entity authorized to submit on behalf of
55
+ the copyright owner. For the purposes of this definition, "submitted"
56
+ means any form of electronic, verbal, or written communication sent
57
+ to the Licensor or its representatives, including but not limited to
58
+ communication on electronic mailing lists, source code control systems,
59
+ and issue tracking systems that are managed by, or on behalf of, the
60
+ Licensor for the purpose of discussing and improving the Work, but
61
+ excluding communication that is conspicuously marked or otherwise
62
+ designated in writing by the copyright owner as "Not a Contribution."
63
+
64
+ "Contributor" shall mean Licensor and any individual or Legal Entity
65
+ on behalf of whom a Contribution has been received by Licensor and
66
+ subsequently incorporated within the Work.
67
+
68
+ 2. Grant of Copyright License. Subject to the terms and conditions of
69
+ this License, each Contributor hereby grants to You a perpetual,
70
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
71
+ copyright license to reproduce, prepare Derivative Works of,
72
+ publicly display, publicly perform, sublicense, and distribute the
73
+ Work and such Derivative Works in Source or Object form.
74
+
75
+ 3. Grant of Patent License. Subject to the terms and conditions of
76
+ this License, each Contributor hereby grants to You a perpetual,
77
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
78
+ (except as stated in this section) patent license to make, have made,
79
+ use, offer to sell, sell, import, and otherwise transfer the Work,
80
+ where such license applies only to those patent claims licensable
81
+ by such Contributor that are necessarily infringed by their
82
+ Contribution(s) alone or by combination of their Contribution(s)
83
+ with the Work to which such Contribution(s) was submitted. If You
84
+ institute patent litigation against any entity (including a
85
+ cross-claim or counterclaim in a lawsuit) alleging that the Work
86
+ or a Contribution incorporated within the Work constitutes direct
87
+ or contributory patent infringement, then any patent licenses
88
+ granted to You under this License for that Work shall terminate
89
+ as of the date such litigation is filed.
90
+
91
+ 4. Redistribution. You may reproduce and distribute copies of the
92
+ Work or Derivative Works thereof in any medium, with or without
93
+ modifications, and in Source or Object form, provided that You
94
+ meet the following conditions:
95
+
96
+ (a) You must give any other recipients of the Work or
97
+ Derivative Works a copy of this License; and
98
+
99
+ (b) You must cause any modified files to carry prominent notices
100
+ stating that You changed the files; and
101
+
102
+ (c) You must retain, in the Source form of any Derivative Works
103
+ that You distribute, all copyright, patent, trademark, and
104
+ attribution notices from the Source form of the Work,
105
+ excluding those notices that do not pertain to any part of
106
+ the Derivative Works; and
107
+
108
+ (d) If the Work includes a "NOTICE" text file as part of its
109
+ distribution, then any Derivative Works that You distribute must
110
+ include a readable copy of the attribution notices contained
111
+ within such NOTICE file, excluding those notices that do not
112
+ pertain to any part of the Derivative Works, in at least one
113
+ of the following places: within a NOTICE text file distributed
114
+ as part of the Derivative Works; within the Source form or
115
+ documentation, if provided along with the Derivative Works; or,
116
+ within a display generated by the Derivative Works, if and
117
+ wherever such third-party notices normally appear. The contents
118
+ of the NOTICE file are for informational purposes only and
119
+ do not modify the License. You may add Your own attribution
120
+ notices within Derivative Works that You distribute, alongside
121
+ or as an addendum to the NOTICE text from the Work, provided
122
+ that such additional attribution notices cannot be construed
123
+ as modifying the License.
124
+
125
+ You may add Your own copyright statement to Your modifications and
126
+ may provide additional or different license terms and conditions
127
+ for use, reproduction, or distribution of Your modifications, or
128
+ for any such Derivative Works as a whole, provided Your use,
129
+ reproduction, and distribution of the Work otherwise complies with
130
+ the conditions stated in this License.
131
+
132
+ 5. Submission of Contributions. Unless You explicitly state otherwise,
133
+ any Contribution intentionally submitted for inclusion in the Work
134
+ by You to the Licensor shall be under the terms and conditions of
135
+ this License, without any additional terms or conditions.
136
+ Notwithstanding the above, nothing herein shall supersede or modify
137
+ the terms of any separate license agreement you may have executed
138
+ with Licensor regarding such Contributions.
139
+
140
+ 6. Trademarks. This License does not grant permission to use the trade
141
+ names, trademarks, service marks, or product names of the Licensor,
142
+ except as required for reasonable and customary use in describing the
143
+ origin of the Work and reproducing the content of the NOTICE file.
144
+
145
+ 7. Disclaimer of Warranty. Unless required by applicable law or
146
+ agreed to in writing, Licensor provides the Work (and each
147
+ Contributor provides its Contributions) on an "AS IS" BASIS,
148
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
149
+ implied, including, without limitation, any warranties or conditions
150
+ of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
151
+ PARTICULAR PURPOSE. You are solely responsible for determining the
152
+ appropriateness of using or redistributing the Work and assume any
153
+ risks associated with Your exercise of permissions under this License.
154
+
155
+ 8. Limitation of Liability. In no event and under no legal theory,
156
+ whether in tort (including negligence), contract, or otherwise,
157
+ unless required by applicable law (such as deliberate and grossly
158
+ negligent acts) or agreed to in writing, shall any Contributor be
159
+ liable to You for damages, including any direct, indirect, special,
160
+ incidental, or consequential damages of any character arising as a
161
+ result of this License or out of the use or inability to use the
162
+ Work (including but not limited to damages for loss of goodwill,
163
+ work stoppage, computer failure or malfunction, or any and all
164
+ other commercial damages or losses), even if such Contributor
165
+ has been advised of the possibility of such damages.
166
+
167
+ 9. Accepting Warranty or Additional Liability. While redistributing
168
+ the Work or Derivative Works thereof, You may choose to offer,
169
+ and charge a fee for, acceptance of support, warranty, indemnity,
170
+ or other liability obligations and/or rights consistent with this
171
+ License. However, in accepting such obligations, You may act only
172
+ on Your own behalf and on Your sole responsibility, not on behalf
173
+ of any other Contributor, and only if You agree to indemnify,
174
+ defend, and hold each Contributor harmless for any liability
175
+ incurred by, or claims asserted against, such Contributor by reason
176
+ of your accepting any such warranty or additional liability.
177
+
178
+ END OF TERMS AND CONDITIONS