QPromaQ commited on
Commit
ca0269e
·
verified ·
1 Parent(s): 72b844c

Reset repository and upload final project (part 14)

Browse files
This view is limited to 50 files because it contains too many changes.   See raw diff
Files changed (50) hide show
  1. .venv_haddock/lib/python3.12/site-packages/pandas-2.3.3.dist-info/._INSTALLER +0 -0
  2. .venv_haddock/lib/python3.12/site-packages/pandas-2.3.3.dist-info/._LICENSE +0 -0
  3. .venv_haddock/lib/python3.12/site-packages/pandas-2.3.3.dist-info/._METADATA +0 -0
  4. .venv_haddock/lib/python3.12/site-packages/pandas-2.3.3.dist-info/._RECORD +0 -0
  5. .venv_haddock/lib/python3.12/site-packages/pandas-2.3.3.dist-info/._WHEEL +0 -0
  6. .venv_haddock/lib/python3.12/site-packages/pandas-2.3.3.dist-info/._entry_points.txt +0 -0
  7. .venv_haddock/lib/python3.12/site-packages/pandas-2.3.3.dist-info/INSTALLER +1 -0
  8. .venv_haddock/lib/python3.12/site-packages/pandas-2.3.3.dist-info/LICENSE +1250 -0
  9. .venv_haddock/lib/python3.12/site-packages/pandas-2.3.3.dist-info/METADATA +1574 -0
  10. .venv_haddock/lib/python3.12/site-packages/pandas-2.3.3.dist-info/RECORD +0 -0
  11. .venv_haddock/lib/python3.12/site-packages/pandas-2.3.3.dist-info/WHEEL +6 -0
  12. .venv_haddock/lib/python3.12/site-packages/pandas-2.3.3.dist-info/entry_points.txt +3 -0
  13. .venv_haddock/lib/python3.12/site-packages/pandas/tests/io/parser/test_quoting.py +199 -0
  14. .venv_haddock/lib/python3.12/site-packages/pandas/tests/io/parser/test_read_fwf.py +1034 -0
  15. .venv_haddock/lib/python3.12/site-packages/pandas/tests/io/parser/test_skiprows.py +334 -0
  16. .venv_haddock/lib/python3.12/site-packages/pandas/tests/io/parser/test_textreader.py +342 -0
  17. .venv_haddock/lib/python3.12/site-packages/pandas/tests/io/parser/test_unsupported.py +226 -0
  18. .venv_haddock/lib/python3.12/site-packages/pandas/tests/io/parser/test_upcast.py +102 -0
  19. .venv_haddock/lib/python3.12/site-packages/pandas/tests/io/parser/usecols/.___init__.py +0 -0
  20. .venv_haddock/lib/python3.12/site-packages/pandas/tests/io/parser/usecols/.___pycache__ +0 -0
  21. .venv_haddock/lib/python3.12/site-packages/pandas/tests/io/parser/usecols/._test_parse_dates.py +0 -0
  22. .venv_haddock/lib/python3.12/site-packages/pandas/tests/io/parser/usecols/._test_strings.py +0 -0
  23. .venv_haddock/lib/python3.12/site-packages/pandas/tests/io/parser/usecols/._test_usecols_basic.py +0 -0
  24. .venv_haddock/lib/python3.12/site-packages/pandas/tests/io/parser/usecols/__init__.py +0 -0
  25. .venv_haddock/lib/python3.12/site-packages/pandas/tests/io/parser/usecols/test_parse_dates.py +194 -0
  26. .venv_haddock/lib/python3.12/site-packages/pandas/tests/io/parser/usecols/test_strings.py +96 -0
  27. .venv_haddock/lib/python3.12/site-packages/pandas/tests/io/parser/usecols/test_usecols_basic.py +563 -0
  28. .venv_haddock/lib/python3.12/site-packages/pandas/tests/io/pytables/.___init__.py +0 -0
  29. .venv_haddock/lib/python3.12/site-packages/pandas/tests/io/pytables/.___pycache__ +0 -0
  30. .venv_haddock/lib/python3.12/site-packages/pandas/tests/io/pytables/._common.py +0 -0
  31. .venv_haddock/lib/python3.12/site-packages/pandas/tests/io/pytables/._conftest.py +0 -0
  32. .venv_haddock/lib/python3.12/site-packages/pandas/tests/io/pytables/._test_append.py +0 -0
  33. .venv_haddock/lib/python3.12/site-packages/pandas/tests/io/pytables/._test_categorical.py +0 -0
  34. .venv_haddock/lib/python3.12/site-packages/pandas/tests/io/pytables/._test_compat.py +0 -0
  35. .venv_haddock/lib/python3.12/site-packages/pandas/tests/io/pytables/._test_complex.py +0 -0
  36. .venv_haddock/lib/python3.12/site-packages/pandas/tests/io/pytables/._test_errors.py +0 -0
  37. .venv_haddock/lib/python3.12/site-packages/pandas/tests/io/pytables/._test_file_handling.py +0 -0
  38. .venv_haddock/lib/python3.12/site-packages/pandas/tests/io/pytables/._test_keys.py +0 -0
  39. .venv_haddock/lib/python3.12/site-packages/pandas/tests/io/pytables/._test_put.py +0 -0
  40. .venv_haddock/lib/python3.12/site-packages/pandas/tests/io/pytables/._test_pytables_missing.py +0 -0
  41. .venv_haddock/lib/python3.12/site-packages/pandas/tests/io/pytables/._test_read.py +0 -0
  42. .venv_haddock/lib/python3.12/site-packages/pandas/tests/io/pytables/._test_retain_attributes.py +0 -0
  43. .venv_haddock/lib/python3.12/site-packages/pandas/tests/io/pytables/._test_round_trip.py +0 -0
  44. .venv_haddock/lib/python3.12/site-packages/pandas/tests/io/pytables/._test_select.py +0 -0
  45. .venv_haddock/lib/python3.12/site-packages/pandas/tests/io/pytables/._test_store.py +0 -0
  46. .venv_haddock/lib/python3.12/site-packages/pandas/tests/io/pytables/._test_subclass.py +0 -0
  47. .venv_haddock/lib/python3.12/site-packages/pandas/tests/io/pytables/._test_time_series.py +0 -0
  48. .venv_haddock/lib/python3.12/site-packages/pandas/tests/io/pytables/._test_timezones.py +0 -0
  49. .venv_haddock/lib/python3.12/site-packages/pandas/tests/io/pytables/__init__.py +0 -0
  50. .venv_haddock/lib/python3.12/site-packages/pandas/tests/io/pytables/common.py +50 -0
.venv_haddock/lib/python3.12/site-packages/pandas-2.3.3.dist-info/._INSTALLER ADDED
Binary file (4.1 kB). View file
 
.venv_haddock/lib/python3.12/site-packages/pandas-2.3.3.dist-info/._LICENSE ADDED
Binary file (4.1 kB). View file
 
.venv_haddock/lib/python3.12/site-packages/pandas-2.3.3.dist-info/._METADATA ADDED
Binary file (4.1 kB). View file
 
.venv_haddock/lib/python3.12/site-packages/pandas-2.3.3.dist-info/._RECORD ADDED
Binary file (4.1 kB). View file
 
.venv_haddock/lib/python3.12/site-packages/pandas-2.3.3.dist-info/._WHEEL ADDED
Binary file (4.1 kB). View file
 
.venv_haddock/lib/python3.12/site-packages/pandas-2.3.3.dist-info/._entry_points.txt ADDED
Binary file (4.1 kB). View file
 
.venv_haddock/lib/python3.12/site-packages/pandas-2.3.3.dist-info/INSTALLER ADDED
@@ -0,0 +1 @@
 
 
1
+ pip
.venv_haddock/lib/python3.12/site-packages/pandas-2.3.3.dist-info/LICENSE ADDED
@@ -0,0 +1,1250 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ BSD 3-Clause License
2
+
3
+ Copyright (c) 2008-2011, AQR Capital Management, LLC, Lambda Foundry, Inc. and PyData Development Team
4
+ All rights reserved.
5
+
6
+ Copyright (c) 2011-2023, Open source contributors.
7
+
8
+ Redistribution and use in source and binary forms, with or without
9
+ modification, are permitted provided that the following conditions are met:
10
+
11
+ * Redistributions of source code must retain the above copyright notice, this
12
+ list of conditions and the following disclaimer.
13
+
14
+ * Redistributions in binary form must reproduce the above copyright notice,
15
+ this list of conditions and the following disclaimer in the documentation
16
+ and/or other materials provided with the distribution.
17
+
18
+ * Neither the name of the copyright holder nor the names of its
19
+ contributors may be used to endorse or promote products derived from
20
+ this software without specific prior written permission.
21
+
22
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
23
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
24
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
25
+ DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
26
+ FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
27
+ DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
28
+ SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
29
+ CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
30
+ OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
31
+ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
32
+ Copyright (c) 2010-2019 Keith Goodman
33
+ Copyright (c) 2019 Bottleneck Developers
34
+ All rights reserved.
35
+
36
+ Redistribution and use in source and binary forms, with or without
37
+ modification, are permitted provided that the following conditions are met:
38
+
39
+ * Redistributions of source code must retain the above copyright notice,
40
+ this list of conditions and the following disclaimer.
41
+
42
+ * Redistributions in binary form must reproduce the above copyright
43
+ notice, this list of conditions and the following disclaimer in the
44
+ documentation and/or other materials provided with the distribution.
45
+
46
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
47
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
48
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
49
+ ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
50
+ LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
51
+ CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
52
+ SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
53
+ INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
54
+ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
55
+ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
56
+ POSSIBILITY OF SUCH DAMAGE.Copyright 2017- Paul Ganssle <paul@ganssle.io>
57
+ Copyright 2017- dateutil contributors (see AUTHORS file)
58
+
59
+ Licensed under the Apache License, Version 2.0 (the "License");
60
+ you may not use this file except in compliance with the License.
61
+ You may obtain a copy of the License at
62
+
63
+ http://www.apache.org/licenses/LICENSE-2.0
64
+
65
+ Unless required by applicable law or agreed to in writing, software
66
+ distributed under the License is distributed on an "AS IS" BASIS,
67
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
68
+ See the License for the specific language governing permissions and
69
+ limitations under the License.
70
+
71
+ The above license applies to all contributions after 2017-12-01, as well as
72
+ all contributions that have been re-licensed (see AUTHORS file for the list of
73
+ contributors who have re-licensed their code).
74
+ --------------------------------------------------------------------------------
75
+ dateutil - Extensions to the standard Python datetime module.
76
+
77
+ Copyright (c) 2003-2011 - Gustavo Niemeyer <gustavo@niemeyer.net>
78
+ Copyright (c) 2012-2014 - Tomi Pieviläinen <tomi.pievilainen@iki.fi>
79
+ Copyright (c) 2014-2016 - Yaron de Leeuw <me@jarondl.net>
80
+ Copyright (c) 2015- - Paul Ganssle <paul@ganssle.io>
81
+ Copyright (c) 2015- - dateutil contributors (see AUTHORS file)
82
+
83
+ All rights reserved.
84
+
85
+ Redistribution and use in source and binary forms, with or without
86
+ modification, are permitted provided that the following conditions are met:
87
+
88
+ * Redistributions of source code must retain the above copyright notice,
89
+ this list of conditions and the following disclaimer.
90
+ * Redistributions in binary form must reproduce the above copyright notice,
91
+ this list of conditions and the following disclaimer in the documentation
92
+ and/or other materials provided with the distribution.
93
+ * Neither the name of the copyright holder nor the names of its
94
+ contributors may be used to endorse or promote products derived from
95
+ this software without specific prior written permission.
96
+
97
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
98
+ "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
99
+ LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
100
+ A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
101
+ CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
102
+ EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
103
+ PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
104
+ PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
105
+ LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
106
+ NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
107
+ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
108
+
109
+ The above BSD License Applies to all code, even that also covered by Apache 2.0.# MIT License
110
+
111
+ Copyright (c) 2019 Hadley Wickham; RStudio; and Evan Miller
112
+
113
+ Permission is hereby granted, free of charge, to any person obtaining a copy
114
+ of this software and associated documentation files (the "Software"), to deal
115
+ in the Software without restriction, including without limitation the rights
116
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
117
+ copies of the Software, and to permit persons to whom the Software is
118
+ furnished to do so, subject to the following conditions:
119
+
120
+ The above copyright notice and this permission notice shall be included in all
121
+ copies or substantial portions of the Software.
122
+
123
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
124
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
125
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
126
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
127
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
128
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
129
+ SOFTWARE.
130
+ Based on http://opensource.org/licenses/MIT
131
+
132
+ This is a template. Complete and ship as file LICENSE the following 2
133
+ lines (only)
134
+
135
+ YEAR:
136
+ COPYRIGHT HOLDER:
137
+
138
+ and specify as
139
+
140
+ License: MIT + file LICENSE
141
+
142
+ Copyright (c) <YEAR>, <COPYRIGHT HOLDER>
143
+
144
+ Permission is hereby granted, free of charge, to any person obtaining
145
+ a copy of this software and associated documentation files (the
146
+ "Software"), to deal in the Software without restriction, including
147
+ without limitation the rights to use, copy, modify, merge, publish,
148
+ distribute, sublicense, and/or sell copies of the Software, and to
149
+ permit persons to whom the Software is furnished to do so, subject to
150
+ the following conditions:
151
+
152
+ The above copyright notice and this permission notice shall be
153
+ included in all copies or substantial portions of the Software.
154
+
155
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
156
+ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
157
+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
158
+ NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
159
+ LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
160
+ OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
161
+ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
162
+ The MIT License
163
+
164
+ Copyright (c) 2008- Attractive Chaos <attractor@live.co.uk>
165
+
166
+ Permission is hereby granted, free of charge, to any person obtaining
167
+ a copy of this software and associated documentation files (the
168
+ "Software"), to deal in the Software without restriction, including
169
+ without limitation the rights to use, copy, modify, merge, publish,
170
+ distribute, sublicense, and/or sell copies of the Software, and to
171
+ permit persons to whom the Software is furnished to do so, subject to
172
+ the following conditions:
173
+
174
+ The above copyright notice and this permission notice shall be
175
+ included in all copies or substantial portions of the Software.
176
+
177
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
178
+ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
179
+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
180
+ NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS
181
+ BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
182
+ ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
183
+ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
184
+ SOFTWARE.musl as a whole is licensed under the following standard MIT license:
185
+
186
+ ----------------------------------------------------------------------
187
+ Copyright © 2005-2020 Rich Felker, et al.
188
+
189
+ Permission is hereby granted, free of charge, to any person obtaining
190
+ a copy of this software and associated documentation files (the
191
+ "Software"), to deal in the Software without restriction, including
192
+ without limitation the rights to use, copy, modify, merge, publish,
193
+ distribute, sublicense, and/or sell copies of the Software, and to
194
+ permit persons to whom the Software is furnished to do so, subject to
195
+ the following conditions:
196
+
197
+ The above copyright notice and this permission notice shall be
198
+ included in all copies or substantial portions of the Software.
199
+
200
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
201
+ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
202
+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
203
+ IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
204
+ CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
205
+ TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
206
+ SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
207
+ ----------------------------------------------------------------------
208
+
209
+ Authors/contributors include:
210
+
211
+ A. Wilcox
212
+ Ada Worcester
213
+ Alex Dowad
214
+ Alex Suykov
215
+ Alexander Monakov
216
+ Andre McCurdy
217
+ Andrew Kelley
218
+ Anthony G. Basile
219
+ Aric Belsito
220
+ Arvid Picciani
221
+ Bartosz Brachaczek
222
+ Benjamin Peterson
223
+ Bobby Bingham
224
+ Boris Brezillon
225
+ Brent Cook
226
+ Chris Spiegel
227
+ Clément Vasseur
228
+ Daniel Micay
229
+ Daniel Sabogal
230
+ Daurnimator
231
+ David Carlier
232
+ David Edelsohn
233
+ Denys Vlasenko
234
+ Dmitry Ivanov
235
+ Dmitry V. Levin
236
+ Drew DeVault
237
+ Emil Renner Berthing
238
+ Fangrui Song
239
+ Felix Fietkau
240
+ Felix Janda
241
+ Gianluca Anzolin
242
+ Hauke Mehrtens
243
+ He X
244
+ Hiltjo Posthuma
245
+ Isaac Dunham
246
+ Jaydeep Patil
247
+ Jens Gustedt
248
+ Jeremy Huntwork
249
+ Jo-Philipp Wich
250
+ Joakim Sindholt
251
+ John Spencer
252
+ Julien Ramseier
253
+ Justin Cormack
254
+ Kaarle Ritvanen
255
+ Khem Raj
256
+ Kylie McClain
257
+ Leah Neukirchen
258
+ Luca Barbato
259
+ Luka Perkov
260
+ M Farkas-Dyck (Strake)
261
+ Mahesh Bodapati
262
+ Markus Wichmann
263
+ Masanori Ogino
264
+ Michael Clark
265
+ Michael Forney
266
+ Mikhail Kremnyov
267
+ Natanael Copa
268
+ Nicholas J. Kain
269
+ orc
270
+ Pascal Cuoq
271
+ Patrick Oppenlander
272
+ Petr Hosek
273
+ Petr Skocik
274
+ Pierre Carrier
275
+ Reini Urban
276
+ Rich Felker
277
+ Richard Pennington
278
+ Ryan Fairfax
279
+ Samuel Holland
280
+ Segev Finer
281
+ Shiz
282
+ sin
283
+ Solar Designer
284
+ Stefan Kristiansson
285
+ Stefan O'Rear
286
+ Szabolcs Nagy
287
+ Timo Teräs
288
+ Trutz Behn
289
+ Valentin Ochs
290
+ Will Dietz
291
+ William Haddon
292
+ William Pitcock
293
+
294
+ Portions of this software are derived from third-party works licensed
295
+ under terms compatible with the above MIT license:
296
+
297
+ The TRE regular expression implementation (src/regex/reg* and
298
+ src/regex/tre*) is Copyright © 2001-2008 Ville Laurikari and licensed
299
+ under a 2-clause BSD license (license text in the source files). The
300
+ included version has been heavily modified by Rich Felker in 2012, in
301
+ the interests of size, simplicity, and namespace cleanliness.
302
+
303
+ Much of the math library code (src/math/* and src/complex/*) is
304
+ Copyright © 1993,2004 Sun Microsystems or
305
+ Copyright © 2003-2011 David Schultz or
306
+ Copyright © 2003-2009 Steven G. Kargl or
307
+ Copyright © 2003-2009 Bruce D. Evans or
308
+ Copyright © 2008 Stephen L. Moshier or
309
+ Copyright © 2017-2018 Arm Limited
310
+ and labelled as such in comments in the individual source files. All
311
+ have been licensed under extremely permissive terms.
312
+
313
+ The ARM memcpy code (src/string/arm/memcpy.S) is Copyright © 2008
314
+ The Android Open Source Project and is licensed under a two-clause BSD
315
+ license. It was taken from Bionic libc, used on Android.
316
+
317
+ The AArch64 memcpy and memset code (src/string/aarch64/*) are
318
+ Copyright © 1999-2019, Arm Limited.
319
+
320
+ The implementation of DES for crypt (src/crypt/crypt_des.c) is
321
+ Copyright © 1994 David Burren. It is licensed under a BSD license.
322
+
323
+ The implementation of blowfish crypt (src/crypt/crypt_blowfish.c) was
324
+ originally written by Solar Designer and placed into the public
325
+ domain. The code also comes with a fallback permissive license for use
326
+ in jurisdictions that may not recognize the public domain.
327
+
328
+ The smoothsort implementation (src/stdlib/qsort.c) is Copyright © 2011
329
+ Valentin Ochs and is licensed under an MIT-style license.
330
+
331
+ The x86_64 port was written by Nicholas J. Kain and is licensed under
332
+ the standard MIT terms.
333
+
334
+ The mips and microblaze ports were originally written by Richard
335
+ Pennington for use in the ellcc project. The original code was adapted
336
+ by Rich Felker for build system and code conventions during upstream
337
+ integration. It is licensed under the standard MIT terms.
338
+
339
+ The mips64 port was contributed by Imagination Technologies and is
340
+ licensed under the standard MIT terms.
341
+
342
+ The powerpc port was also originally written by Richard Pennington,
343
+ and later supplemented and integrated by John Spencer. It is licensed
344
+ under the standard MIT terms.
345
+
346
+ All other files which have no copyright comments are original works
347
+ produced specifically for use as part of this library, written either
348
+ by Rich Felker, the main author of the library, or by one or more
349
+ contibutors listed above. Details on authorship of individual files
350
+ can be found in the git version control history of the project. The
351
+ omission of copyright and license comments in each file is in the
352
+ interest of source tree size.
353
+
354
+ In addition, permission is hereby granted for all public header files
355
+ (include/* and arch/*/bits/*) and crt files intended to be linked into
356
+ applications (crt/*, ldso/dlstart.c, and arch/*/crt_arch.h) to omit
357
+ the copyright notice and permission notice otherwise required by the
358
+ license, and to use these files without any requirement of
359
+ attribution. These files include substantial contributions from:
360
+
361
+ Bobby Bingham
362
+ John Spencer
363
+ Nicholas J. Kain
364
+ Rich Felker
365
+ Richard Pennington
366
+ Stefan Kristiansson
367
+ Szabolcs Nagy
368
+
369
+ all of whom have explicitly granted such permission.
370
+
371
+ This file previously contained text expressing a belief that most of
372
+ the files covered by the above exception were sufficiently trivial not
373
+ to be subject to copyright, resulting in confusion over whether it
374
+ negated the permissions granted in the license. In the spirit of
375
+ permissive licensing, and of not having licensing issues being an
376
+ obstacle to adoption, that text has been removed.Copyright (c) 2005-2023, NumPy Developers.
377
+ All rights reserved.
378
+
379
+ Redistribution and use in source and binary forms, with or without
380
+ modification, are permitted provided that the following conditions are
381
+ met:
382
+
383
+ * Redistributions of source code must retain the above copyright
384
+ notice, this list of conditions and the following disclaimer.
385
+
386
+ * Redistributions in binary form must reproduce the above
387
+ copyright notice, this list of conditions and the following
388
+ disclaimer in the documentation and/or other materials provided
389
+ with the distribution.
390
+
391
+ * Neither the name of the NumPy Developers nor the names of any
392
+ contributors may be used to endorse or promote products derived
393
+ from this software without specific prior written permission.
394
+
395
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
396
+ "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
397
+ LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
398
+ A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
399
+ OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
400
+ SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
401
+ LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
402
+ DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
403
+ THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
404
+ (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
405
+ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
406
+ Apache License
407
+ Version 2.0, January 2004
408
+ http://www.apache.org/licenses/
409
+
410
+ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
411
+
412
+ 1. Definitions.
413
+
414
+ "License" shall mean the terms and conditions for use, reproduction,
415
+ and distribution as defined by Sections 1 through 9 of this document.
416
+
417
+ "Licensor" shall mean the copyright owner or entity authorized by
418
+ the copyright owner that is granting the License.
419
+
420
+ "Legal Entity" shall mean the union of the acting entity and all
421
+ other entities that control, are controlled by, or are under common
422
+ control with that entity. For the purposes of this definition,
423
+ "control" means (i) the power, direct or indirect, to cause the
424
+ direction or management of such entity, whether by contract or
425
+ otherwise, or (ii) ownership of fifty percent (50%) or more of the
426
+ outstanding shares, or (iii) beneficial ownership of such entity.
427
+
428
+ "You" (or "Your") shall mean an individual or Legal Entity
429
+ exercising permissions granted by this License.
430
+
431
+ "Source" form shall mean the preferred form for making modifications,
432
+ including but not limited to software source code, documentation
433
+ source, and configuration files.
434
+
435
+ "Object" form shall mean any form resulting from mechanical
436
+ transformation or translation of a Source form, including but
437
+ not limited to compiled object code, generated documentation,
438
+ and conversions to other media types.
439
+
440
+ "Work" shall mean the work of authorship, whether in Source or
441
+ Object form, made available under the License, as indicated by a
442
+ copyright notice that is included in or attached to the work
443
+ (an example is provided in the Appendix below).
444
+
445
+ "Derivative Works" shall mean any work, whether in Source or Object
446
+ form, that is based on (or derived from) the Work and for which the
447
+ editorial revisions, annotations, elaborations, or other modifications
448
+ represent, as a whole, an original work of authorship. For the purposes
449
+ of this License, Derivative Works shall not include works that remain
450
+ separable from, or merely link (or bind by name) to the interfaces of,
451
+ the Work and Derivative Works thereof.
452
+
453
+ "Contribution" shall mean any work of authorship, including
454
+ the original version of the Work and any modifications or additions
455
+ to that Work or Derivative Works thereof, that is intentionally
456
+ submitted to Licensor for inclusion in the Work by the copyright owner
457
+ or by an individual or Legal Entity authorized to submit on behalf of
458
+ the copyright owner. For the purposes of this definition, "submitted"
459
+ means any form of electronic, verbal, or written communication sent
460
+ to the Licensor or its representatives, including but not limited to
461
+ communication on electronic mailing lists, source code control systems,
462
+ and issue tracking systems that are managed by, or on behalf of, the
463
+ Licensor for the purpose of discussing and improving the Work, but
464
+ excluding communication that is conspicuously marked or otherwise
465
+ designated in writing by the copyright owner as "Not a Contribution."
466
+
467
+ "Contributor" shall mean Licensor and any individual or Legal Entity
468
+ on behalf of whom a Contribution has been received by Licensor and
469
+ subsequently incorporated within the Work.
470
+
471
+ 2. Grant of Copyright License. Subject to the terms and conditions of
472
+ this License, each Contributor hereby grants to You a perpetual,
473
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
474
+ copyright license to reproduce, prepare Derivative Works of,
475
+ publicly display, publicly perform, sublicense, and distribute the
476
+ Work and such Derivative Works in Source or Object form.
477
+
478
+ 3. Grant of Patent License. Subject to the terms and conditions of
479
+ this License, each Contributor hereby grants to You a perpetual,
480
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
481
+ (except as stated in this section) patent license to make, have made,
482
+ use, offer to sell, sell, import, and otherwise transfer the Work,
483
+ where such license applies only to those patent claims licensable
484
+ by such Contributor that are necessarily infringed by their
485
+ Contribution(s) alone or by combination of their Contribution(s)
486
+ with the Work to which such Contribution(s) was submitted. If You
487
+ institute patent litigation against any entity (including a
488
+ cross-claim or counterclaim in a lawsuit) alleging that the Work
489
+ or a Contribution incorporated within the Work constitutes direct
490
+ or contributory patent infringement, then any patent licenses
491
+ granted to You under this License for that Work shall terminate
492
+ as of the date such litigation is filed.
493
+
494
+ 4. Redistribution. You may reproduce and distribute copies of the
495
+ Work or Derivative Works thereof in any medium, with or without
496
+ modifications, and in Source or Object form, provided that You
497
+ meet the following conditions:
498
+
499
+ (a) You must give any other recipients of the Work or
500
+ Derivative Works a copy of this License; and
501
+
502
+ (b) You must cause any modified files to carry prominent notices
503
+ stating that You changed the files; and
504
+
505
+ (c) You must retain, in the Source form of any Derivative Works
506
+ that You distribute, all copyright, patent, trademark, and
507
+ attribution notices from the Source form of the Work,
508
+ excluding those notices that do not pertain to any part of
509
+ the Derivative Works; and
510
+
511
+ (d) If the Work includes a "NOTICE" text file as part of its
512
+ distribution, then any Derivative Works that You distribute must
513
+ include a readable copy of the attribution notices contained
514
+ within such NOTICE file, excluding those notices that do not
515
+ pertain to any part of the Derivative Works, in at least one
516
+ of the following places: within a NOTICE text file distributed
517
+ as part of the Derivative Works; within the Source form or
518
+ documentation, if provided along with the Derivative Works; or,
519
+ within a display generated by the Derivative Works, if and
520
+ wherever such third-party notices normally appear. The contents
521
+ of the NOTICE file are for informational purposes only and
522
+ do not modify the License. You may add Your own attribution
523
+ notices within Derivative Works that You distribute, alongside
524
+ or as an addendum to the NOTICE text from the Work, provided
525
+ that such additional attribution notices cannot be construed
526
+ as modifying the License.
527
+
528
+ You may add Your own copyright statement to Your modifications and
529
+ may provide additional or different license terms and conditions
530
+ for use, reproduction, or distribution of Your modifications, or
531
+ for any such Derivative Works as a whole, provided Your use,
532
+ reproduction, and distribution of the Work otherwise complies with
533
+ the conditions stated in this License.
534
+
535
+ 5. Submission of Contributions. Unless You explicitly state otherwise,
536
+ any Contribution intentionally submitted for inclusion in the Work
537
+ by You to the Licensor shall be under the terms and conditions of
538
+ this License, without any additional terms or conditions.
539
+ Notwithstanding the above, nothing herein shall supersede or modify
540
+ the terms of any separate license agreement you may have executed
541
+ with Licensor regarding such Contributions.
542
+
543
+ 6. Trademarks. This License does not grant permission to use the trade
544
+ names, trademarks, service marks, or product names of the Licensor,
545
+ except as required for reasonable and customary use in describing the
546
+ origin of the Work and reproducing the content of the NOTICE file.
547
+
548
+ 7. Disclaimer of Warranty. Unless required by applicable law or
549
+ agreed to in writing, Licensor provides the Work (and each
550
+ Contributor provides its Contributions) on an "AS IS" BASIS,
551
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
552
+ implied, including, without limitation, any warranties or conditions
553
+ of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
554
+ PARTICULAR PURPOSE. You are solely responsible for determining the
555
+ appropriateness of using or redistributing the Work and assume any
556
+ risks associated with Your exercise of permissions under this License.
557
+
558
+ 8. Limitation of Liability. In no event and under no legal theory,
559
+ whether in tort (including negligence), contract, or otherwise,
560
+ unless required by applicable law (such as deliberate and grossly
561
+ negligent acts) or agreed to in writing, shall any Contributor be
562
+ liable to You for damages, including any direct, indirect, special,
563
+ incidental, or consequential damages of any character arising as a
564
+ result of this License or out of the use or inability to use the
565
+ Work (including but not limited to damages for loss of goodwill,
566
+ work stoppage, computer failure or malfunction, or any and all
567
+ other commercial damages or losses), even if such Contributor
568
+ has been advised of the possibility of such damages.
569
+
570
+ 9. Accepting Warranty or Additional Liability. While redistributing
571
+ the Work or Derivative Works thereof, You may choose to offer,
572
+ and charge a fee for, acceptance of support, warranty, indemnity,
573
+ or other liability obligations and/or rights consistent with this
574
+ License. However, in accepting such obligations, You may act only
575
+ on Your own behalf and on Your sole responsibility, not on behalf
576
+ of any other Contributor, and only if You agree to indemnify,
577
+ defend, and hold each Contributor harmless for any liability
578
+ incurred by, or claims asserted against, such Contributor by reason
579
+ of your accepting any such warranty or additional liability.
580
+
581
+ END OF TERMS AND CONDITIONS
582
+
583
+
584
+ Copyright (c) Donald Stufft and individual contributors.
585
+ All rights reserved.
586
+
587
+ Redistribution and use in source and binary forms, with or without
588
+ modification, are permitted provided that the following conditions are met:
589
+
590
+ 1. Redistributions of source code must retain the above copyright notice,
591
+ this list of conditions and the following disclaimer.
592
+
593
+ 2. Redistributions in binary form must reproduce the above copyright
594
+ notice, this list of conditions and the following disclaimer in the
595
+ documentation and/or other materials provided with the distribution.
596
+
597
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
598
+ ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
599
+ WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
600
+ DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
601
+ FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
602
+ DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
603
+ SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
604
+ CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
605
+ OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
606
+ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.A. HISTORY OF THE SOFTWARE
607
+ ==========================
608
+
609
+ Python was created in the early 1990s by Guido van Rossum at Stichting
610
+ Mathematisch Centrum (CWI, see https://www.cwi.nl) in the Netherlands
611
+ as a successor of a language called ABC. Guido remains Python's
612
+ principal author, although it includes many contributions from others.
613
+
614
+ In 1995, Guido continued his work on Python at the Corporation for
615
+ National Research Initiatives (CNRI, see https://www.cnri.reston.va.us)
616
+ in Reston, Virginia where he released several versions of the
617
+ software.
618
+
619
+ In May 2000, Guido and the Python core development team moved to
620
+ BeOpen.com to form the BeOpen PythonLabs team. In October of the same
621
+ year, the PythonLabs team moved to Digital Creations, which became
622
+ Zope Corporation. In 2001, the Python Software Foundation (PSF, see
623
+ https://www.python.org/psf/) was formed, a non-profit organization
624
+ created specifically to own Python-related Intellectual Property.
625
+ Zope Corporation was a sponsoring member of the PSF.
626
+
627
+ All Python releases are Open Source (see https://opensource.org for
628
+ the Open Source Definition). Historically, most, but not all, Python
629
+ releases have also been GPL-compatible; the table below summarizes
630
+ the various releases.
631
+
632
+ Release Derived Year Owner GPL-
633
+ from compatible? (1)
634
+
635
+ 0.9.0 thru 1.2 1991-1995 CWI yes
636
+ 1.3 thru 1.5.2 1.2 1995-1999 CNRI yes
637
+ 1.6 1.5.2 2000 CNRI no
638
+ 2.0 1.6 2000 BeOpen.com no
639
+ 1.6.1 1.6 2001 CNRI yes (2)
640
+ 2.1 2.0+1.6.1 2001 PSF no
641
+ 2.0.1 2.0+1.6.1 2001 PSF yes
642
+ 2.1.1 2.1+2.0.1 2001 PSF yes
643
+ 2.1.2 2.1.1 2002 PSF yes
644
+ 2.1.3 2.1.2 2002 PSF yes
645
+ 2.2 and above 2.1.1 2001-now PSF yes
646
+
647
+ Footnotes:
648
+
649
+ (1) GPL-compatible doesn't mean that we're distributing Python under
650
+ the GPL. All Python licenses, unlike the GPL, let you distribute
651
+ a modified version without making your changes open source. The
652
+ GPL-compatible licenses make it possible to combine Python with
653
+ other software that is released under the GPL; the others don't.
654
+
655
+ (2) According to Richard Stallman, 1.6.1 is not GPL-compatible,
656
+ because its license has a choice of law clause. According to
657
+ CNRI, however, Stallman's lawyer has told CNRI's lawyer that 1.6.1
658
+ is "not incompatible" with the GPL.
659
+
660
+ Thanks to the many outside volunteers who have worked under Guido's
661
+ direction to make these releases possible.
662
+
663
+
664
+ B. TERMS AND CONDITIONS FOR ACCESSING OR OTHERWISE USING PYTHON
665
+ ===============================================================
666
+
667
+ Python software and documentation are licensed under the
668
+ Python Software Foundation License Version 2.
669
+
670
+ Starting with Python 3.8.6, examples, recipes, and other code in
671
+ the documentation are dual licensed under the PSF License Version 2
672
+ and the Zero-Clause BSD license.
673
+
674
+ Some software incorporated into Python is under different licenses.
675
+ The licenses are listed with code falling under that license.
676
+
677
+
678
+ PYTHON SOFTWARE FOUNDATION LICENSE VERSION 2
679
+ --------------------------------------------
680
+
681
+ 1. This LICENSE AGREEMENT is between the Python Software Foundation
682
+ ("PSF"), and the Individual or Organization ("Licensee") accessing and
683
+ otherwise using this software ("Python") in source or binary form and
684
+ its associated documentation.
685
+
686
+ 2. Subject to the terms and conditions of this License Agreement, PSF hereby
687
+ grants Licensee a nonexclusive, royalty-free, world-wide license to reproduce,
688
+ analyze, test, perform and/or display publicly, prepare derivative works,
689
+ distribute, and otherwise use Python alone or in any derivative version,
690
+ provided, however, that PSF's License Agreement and PSF's notice of copyright,
691
+ i.e., "Copyright (c) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010,
692
+ 2011, 2012, 2013, 2014, 2015, 2016, 2017, 2018, 2019, 2020, 2021, 2022, 2023 Python Software Foundation;
693
+ All Rights Reserved" are retained in Python alone or in any derivative version
694
+ prepared by Licensee.
695
+
696
+ 3. In the event Licensee prepares a derivative work that is based on
697
+ or incorporates Python or any part thereof, and wants to make
698
+ the derivative work available to others as provided herein, then
699
+ Licensee hereby agrees to include in any such work a brief summary of
700
+ the changes made to Python.
701
+
702
+ 4. PSF is making Python available to Licensee on an "AS IS"
703
+ basis. PSF MAKES NO REPRESENTATIONS OR WARRANTIES, EXPRESS OR
704
+ IMPLIED. BY WAY OF EXAMPLE, BUT NOT LIMITATION, PSF MAKES NO AND
705
+ DISCLAIMS ANY REPRESENTATION OR WARRANTY OF MERCHANTABILITY OR FITNESS
706
+ FOR ANY PARTICULAR PURPOSE OR THAT THE USE OF PYTHON WILL NOT
707
+ INFRINGE ANY THIRD PARTY RIGHTS.
708
+
709
+ 5. PSF SHALL NOT BE LIABLE TO LICENSEE OR ANY OTHER USERS OF PYTHON
710
+ FOR ANY INCIDENTAL, SPECIAL, OR CONSEQUENTIAL DAMAGES OR LOSS AS
711
+ A RESULT OF MODIFYING, DISTRIBUTING, OR OTHERWISE USING PYTHON,
712
+ OR ANY DERIVATIVE THEREOF, EVEN IF ADVISED OF THE POSSIBILITY THEREOF.
713
+
714
+ 6. This License Agreement will automatically terminate upon a material
715
+ breach of its terms and conditions.
716
+
717
+ 7. Nothing in this License Agreement shall be deemed to create any
718
+ relationship of agency, partnership, or joint venture between PSF and
719
+ Licensee. This License Agreement does not grant permission to use PSF
720
+ trademarks or trade name in a trademark sense to endorse or promote
721
+ products or services of Licensee, or any third party.
722
+
723
+ 8. By copying, installing or otherwise using Python, Licensee
724
+ agrees to be bound by the terms and conditions of this License
725
+ Agreement.
726
+
727
+
728
+ BEOPEN.COM LICENSE AGREEMENT FOR PYTHON 2.0
729
+ -------------------------------------------
730
+
731
+ BEOPEN PYTHON OPEN SOURCE LICENSE AGREEMENT VERSION 1
732
+
733
+ 1. This LICENSE AGREEMENT is between BeOpen.com ("BeOpen"), having an
734
+ office at 160 Saratoga Avenue, Santa Clara, CA 95051, and the
735
+ Individual or Organization ("Licensee") accessing and otherwise using
736
+ this software in source or binary form and its associated
737
+ documentation ("the Software").
738
+
739
+ 2. Subject to the terms and conditions of this BeOpen Python License
740
+ Agreement, BeOpen hereby grants Licensee a non-exclusive,
741
+ royalty-free, world-wide license to reproduce, analyze, test, perform
742
+ and/or display publicly, prepare derivative works, distribute, and
743
+ otherwise use the Software alone or in any derivative version,
744
+ provided, however, that the BeOpen Python License is retained in the
745
+ Software, alone or in any derivative version prepared by Licensee.
746
+
747
+ 3. BeOpen is making the Software available to Licensee on an "AS IS"
748
+ basis. BEOPEN MAKES NO REPRESENTATIONS OR WARRANTIES, EXPRESS OR
749
+ IMPLIED. BY WAY OF EXAMPLE, BUT NOT LIMITATION, BEOPEN MAKES NO AND
750
+ DISCLAIMS ANY REPRESENTATION OR WARRANTY OF MERCHANTABILITY OR FITNESS
751
+ FOR ANY PARTICULAR PURPOSE OR THAT THE USE OF THE SOFTWARE WILL NOT
752
+ INFRINGE ANY THIRD PARTY RIGHTS.
753
+
754
+ 4. BEOPEN SHALL NOT BE LIABLE TO LICENSEE OR ANY OTHER USERS OF THE
755
+ SOFTWARE FOR ANY INCIDENTAL, SPECIAL, OR CONSEQUENTIAL DAMAGES OR LOSS
756
+ AS A RESULT OF USING, MODIFYING OR DISTRIBUTING THE SOFTWARE, OR ANY
757
+ DERIVATIVE THEREOF, EVEN IF ADVISED OF THE POSSIBILITY THEREOF.
758
+
759
+ 5. This License Agreement will automatically terminate upon a material
760
+ breach of its terms and conditions.
761
+
762
+ 6. This License Agreement shall be governed by and interpreted in all
763
+ respects by the law of the State of California, excluding conflict of
764
+ law provisions. Nothing in this License Agreement shall be deemed to
765
+ create any relationship of agency, partnership, or joint venture
766
+ between BeOpen and Licensee. This License Agreement does not grant
767
+ permission to use BeOpen trademarks or trade names in a trademark
768
+ sense to endorse or promote products or services of Licensee, or any
769
+ third party. As an exception, the "BeOpen Python" logos available at
770
+ http://www.pythonlabs.com/logos.html may be used according to the
771
+ permissions granted on that web page.
772
+
773
+ 7. By copying, installing or otherwise using the software, Licensee
774
+ agrees to be bound by the terms and conditions of this License
775
+ Agreement.
776
+
777
+
778
+ CNRI LICENSE AGREEMENT FOR PYTHON 1.6.1
779
+ ---------------------------------------
780
+
781
+ 1. This LICENSE AGREEMENT is between the Corporation for National
782
+ Research Initiatives, having an office at 1895 Preston White Drive,
783
+ Reston, VA 20191 ("CNRI"), and the Individual or Organization
784
+ ("Licensee") accessing and otherwise using Python 1.6.1 software in
785
+ source or binary form and its associated documentation.
786
+
787
+ 2. Subject to the terms and conditions of this License Agreement, CNRI
788
+ hereby grants Licensee a nonexclusive, royalty-free, world-wide
789
+ license to reproduce, analyze, test, perform and/or display publicly,
790
+ prepare derivative works, distribute, and otherwise use Python 1.6.1
791
+ alone or in any derivative version, provided, however, that CNRI's
792
+ License Agreement and CNRI's notice of copyright, i.e., "Copyright (c)
793
+ 1995-2001 Corporation for National Research Initiatives; All Rights
794
+ Reserved" are retained in Python 1.6.1 alone or in any derivative
795
+ version prepared by Licensee. Alternately, in lieu of CNRI's License
796
+ Agreement, Licensee may substitute the following text (omitting the
797
+ quotes): "Python 1.6.1 is made available subject to the terms and
798
+ conditions in CNRI's License Agreement. This Agreement together with
799
+ Python 1.6.1 may be located on the internet using the following
800
+ unique, persistent identifier (known as a handle): 1895.22/1013. This
801
+ Agreement may also be obtained from a proxy server on the internet
802
+ using the following URL: http://hdl.handle.net/1895.22/1013".
803
+
804
+ 3. In the event Licensee prepares a derivative work that is based on
805
+ or incorporates Python 1.6.1 or any part thereof, and wants to make
806
+ the derivative work available to others as provided herein, then
807
+ Licensee hereby agrees to include in any such work a brief summary of
808
+ the changes made to Python 1.6.1.
809
+
810
+ 4. CNRI is making Python 1.6.1 available to Licensee on an "AS IS"
811
+ basis. CNRI MAKES NO REPRESENTATIONS OR WARRANTIES, EXPRESS OR
812
+ IMPLIED. BY WAY OF EXAMPLE, BUT NOT LIMITATION, CNRI MAKES NO AND
813
+ DISCLAIMS ANY REPRESENTATION OR WARRANTY OF MERCHANTABILITY OR FITNESS
814
+ FOR ANY PARTICULAR PURPOSE OR THAT THE USE OF PYTHON 1.6.1 WILL NOT
815
+ INFRINGE ANY THIRD PARTY RIGHTS.
816
+
817
+ 5. CNRI SHALL NOT BE LIABLE TO LICENSEE OR ANY OTHER USERS OF PYTHON
818
+ 1.6.1 FOR ANY INCIDENTAL, SPECIAL, OR CONSEQUENTIAL DAMAGES OR LOSS AS
819
+ A RESULT OF MODIFYING, DISTRIBUTING, OR OTHERWISE USING PYTHON 1.6.1,
820
+ OR ANY DERIVATIVE THEREOF, EVEN IF ADVISED OF THE POSSIBILITY THEREOF.
821
+
822
+ 6. This License Agreement will automatically terminate upon a material
823
+ breach of its terms and conditions.
824
+
825
+ 7. This License Agreement shall be governed by the federal
826
+ intellectual property law of the United States, including without
827
+ limitation the federal copyright law, and, to the extent such
828
+ U.S. federal law does not apply, by the law of the Commonwealth of
829
+ Virginia, excluding Virginia's conflict of law provisions.
830
+ Notwithstanding the foregoing, with regard to derivative works based
831
+ on Python 1.6.1 that incorporate non-separable material that was
832
+ previously distributed under the GNU General Public License (GPL), the
833
+ law of the Commonwealth of Virginia shall govern this License
834
+ Agreement only as to issues arising under or with respect to
835
+ Paragraphs 4, 5, and 7 of this License Agreement. Nothing in this
836
+ License Agreement shall be deemed to create any relationship of
837
+ agency, partnership, or joint venture between CNRI and Licensee. This
838
+ License Agreement does not grant permission to use CNRI trademarks or
839
+ trade name in a trademark sense to endorse or promote products or
840
+ services of Licensee, or any third party.
841
+
842
+ 8. By clicking on the "ACCEPT" button where indicated, or by copying,
843
+ installing or otherwise using Python 1.6.1, Licensee agrees to be
844
+ bound by the terms and conditions of this License Agreement.
845
+
846
+ ACCEPT
847
+
848
+
849
+ CWI LICENSE AGREEMENT FOR PYTHON 0.9.0 THROUGH 1.2
850
+ --------------------------------------------------
851
+
852
+ Copyright (c) 1991 - 1995, Stichting Mathematisch Centrum Amsterdam,
853
+ The Netherlands. All rights reserved.
854
+
855
+ Permission to use, copy, modify, and distribute this software and its
856
+ documentation for any purpose and without fee is hereby granted,
857
+ provided that the above copyright notice appear in all copies and that
858
+ both that copyright notice and this permission notice appear in
859
+ supporting documentation, and that the name of Stichting Mathematisch
860
+ Centrum or CWI not be used in advertising or publicity pertaining to
861
+ distribution of the software without specific, written prior
862
+ permission.
863
+
864
+ STICHTING MATHEMATISCH CENTRUM DISCLAIMS ALL WARRANTIES WITH REGARD TO
865
+ THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND
866
+ FITNESS, IN NO EVENT SHALL STICHTING MATHEMATISCH CENTRUM BE LIABLE
867
+ FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
868
+ WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
869
+ ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT
870
+ OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
871
+
872
+ ZERO-CLAUSE BSD LICENSE FOR CODE IN THE PYTHON DOCUMENTATION
873
+ ----------------------------------------------------------------------
874
+
875
+ Permission to use, copy, modify, and/or distribute this software for any
876
+ purpose with or without fee is hereby granted.
877
+
878
+ THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
879
+ REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
880
+ AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
881
+ INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
882
+ LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
883
+ OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
884
+ PERFORMANCE OF THIS SOFTWARE.
885
+ Copyright (c) 2014, Al Sweigart
886
+ All rights reserved.
887
+
888
+ Redistribution and use in source and binary forms, with or without
889
+ modification, are permitted provided that the following conditions are met:
890
+
891
+ * Redistributions of source code must retain the above copyright notice, this
892
+ list of conditions and the following disclaimer.
893
+
894
+ * Redistributions in binary form must reproduce the above copyright notice,
895
+ this list of conditions and the following disclaimer in the documentation
896
+ and/or other materials provided with the distribution.
897
+
898
+ * Neither the name of the {organization} nor the names of its
899
+ contributors may be used to endorse or promote products derived from
900
+ this software without specific prior written permission.
901
+
902
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
903
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
904
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
905
+ DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
906
+ FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
907
+ DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
908
+ SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
909
+ CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
910
+ OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
911
+ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.Copyright (c) 2017 Anthony Sottile
912
+
913
+ Permission is hereby granted, free of charge, to any person obtaining a copy
914
+ of this software and associated documentation files (the "Software"), to deal
915
+ in the Software without restriction, including without limitation the rights
916
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
917
+ copies of the Software, and to permit persons to whom the Software is
918
+ furnished to do so, subject to the following conditions:
919
+
920
+ The above copyright notice and this permission notice shall be included in
921
+ all copies or substantial portions of the Software.
922
+
923
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
924
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
925
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
926
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
927
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
928
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
929
+ THE SOFTWARE.Copyright (c) 2015-2019 Jared Hobbs
930
+
931
+ Permission is hereby granted, free of charge, to any person obtaining a copy of
932
+ this software and associated documentation files (the "Software"), to deal in
933
+ the Software without restriction, including without limitation the rights to
934
+ use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies
935
+ of the Software, and to permit persons to whom the Software is furnished to do
936
+ so, subject to the following conditions:
937
+
938
+ The above copyright notice and this permission notice shall be included in all
939
+ copies or substantial portions of the Software.
940
+
941
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
942
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
943
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
944
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
945
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
946
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
947
+ SOFTWARE.Developed by ESN, an Electronic Arts Inc. studio.
948
+ Copyright (c) 2014, Electronic Arts Inc.
949
+ All rights reserved.
950
+
951
+ Redistribution and use in source and binary forms, with or without
952
+ modification, are permitted provided that the following conditions are met:
953
+ * Redistributions of source code must retain the above copyright
954
+ notice, this list of conditions and the following disclaimer.
955
+ * Redistributions in binary form must reproduce the above copyright
956
+ notice, this list of conditions and the following disclaimer in the
957
+ documentation and/or other materials provided with the distribution.
958
+ * Neither the name of ESN, Electronic Arts Inc. nor the
959
+ names of its contributors may be used to endorse or promote products
960
+ derived from this software without specific prior written permission.
961
+
962
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
963
+ ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
964
+ WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
965
+ DISCLAIMED. IN NO EVENT SHALL ELECTRONIC ARTS INC. BE LIABLE
966
+ FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
967
+ (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
968
+ LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
969
+ ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
970
+ (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
971
+ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
972
+
973
+ ----
974
+
975
+ Portions of code from MODP_ASCII - Ascii transformations (upper/lower, etc)
976
+ https://github.com/client9/stringencoders
977
+
978
+ Copyright 2005, 2006, 2007
979
+ Nick Galbreath -- nickg [at] modp [dot] com
980
+ All rights reserved.
981
+
982
+ Redistribution and use in source and binary forms, with or without
983
+ modification, are permitted provided that the following conditions are
984
+ met:
985
+
986
+ Redistributions of source code must retain the above copyright
987
+ notice, this list of conditions and the following disclaimer.
988
+
989
+ Redistributions in binary form must reproduce the above copyright
990
+ notice, this list of conditions and the following disclaimer in the
991
+ documentation and/or other materials provided with the distribution.
992
+
993
+ Neither the name of the modp.com nor the names of its
994
+ contributors may be used to endorse or promote products derived from
995
+ this software without specific prior written permission.
996
+
997
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
998
+ "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
999
+ LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
1000
+ A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
1001
+ OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
1002
+ SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
1003
+ LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
1004
+ DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
1005
+ THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
1006
+ (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
1007
+ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
1008
+
1009
+ This is the standard "new" BSD license:
1010
+ http://www.opensource.org/licenses/bsd-license.php
1011
+
1012
+ https://github.com/client9/stringencoders/blob/cfd5c1507325ae497ea9bacdacba12c0ffd79d30/COPYING
1013
+
1014
+ ----
1015
+
1016
+ Numeric decoder derived from from TCL library
1017
+ https://opensource.apple.com/source/tcl/tcl-14/tcl/license.terms
1018
+ * Copyright (c) 1988-1993 The Regents of the University of California.
1019
+ * Copyright (c) 1994 Sun Microsystems, Inc.
1020
+
1021
+ This software is copyrighted by the Regents of the University of
1022
+ California, Sun Microsystems, Inc., Scriptics Corporation, ActiveState
1023
+ Corporation and other parties. The following terms apply to all files
1024
+ associated with the software unless explicitly disclaimed in
1025
+ individual files.
1026
+
1027
+ The authors hereby grant permission to use, copy, modify, distribute,
1028
+ and license this software and its documentation for any purpose, provided
1029
+ that existing copyright notices are retained in all copies and that this
1030
+ notice is included verbatim in any distributions. No written agreement,
1031
+ license, or royalty fee is required for any of the authorized uses.
1032
+ Modifications to this software may be copyrighted by their authors
1033
+ and need not follow the licensing terms described here, provided that
1034
+ the new terms are clearly indicated on the first page of each file where
1035
+ they apply.
1036
+
1037
+ IN NO EVENT SHALL THE AUTHORS OR DISTRIBUTORS BE LIABLE TO ANY PARTY
1038
+ FOR DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES
1039
+ ARISING OUT OF THE USE OF THIS SOFTWARE, ITS DOCUMENTATION, OR ANY
1040
+ DERIVATIVES THEREOF, EVEN IF THE AUTHORS HAVE BEEN ADVISED OF THE
1041
+ POSSIBILITY OF SUCH DAMAGE.
1042
+
1043
+ THE AUTHORS AND DISTRIBUTORS SPECIFICALLY DISCLAIM ANY WARRANTIES,
1044
+ INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY,
1045
+ FITNESS FOR A PARTICULAR PURPOSE, AND NON-INFRINGEMENT. THIS SOFTWARE
1046
+ IS PROVIDED ON AN "AS IS" BASIS, AND THE AUTHORS AND DISTRIBUTORS HAVE
1047
+ NO OBLIGATION TO PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR
1048
+ MODIFICATIONS.
1049
+
1050
+ GOVERNMENT USE: If you are acquiring this software on behalf of the
1051
+ U.S. government, the Government shall have only "Restricted Rights"
1052
+ in the software and related documentation as defined in the Federal
1053
+ Acquisition Regulations (FARs) in Clause 52.227.19 (c) (2). If you
1054
+ are acquiring the software on behalf of the Department of Defense, the
1055
+ software shall be classified as "Commercial Computer Software" and the
1056
+ Government shall have only "Restricted Rights" as defined in Clause
1057
+ 252.227-7013 (c) (1) of DFARs. Notwithstanding the foregoing, the
1058
+ authors grant the U.S. Government and others acting in its behalf
1059
+ permission to use and distribute the software in accordance with the
1060
+ terms specified in this license.Apache License
1061
+ Version 2.0, January 2004
1062
+ http://www.apache.org/licenses/
1063
+
1064
+ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
1065
+
1066
+ 1. Definitions.
1067
+
1068
+ "License" shall mean the terms and conditions for use, reproduction, and
1069
+ distribution as defined by Sections 1 through 9 of this document.
1070
+
1071
+ "Licensor" shall mean the copyright owner or entity authorized by the copyright
1072
+ owner that is granting the License.
1073
+
1074
+ "Legal Entity" shall mean the union of the acting entity and all other entities
1075
+ that control, are controlled by, or are under common control with that entity.
1076
+ For the purposes of this definition, "control" means (i) the power, direct or
1077
+ indirect, to cause the direction or management of such entity, whether by
1078
+ contract or otherwise, or (ii) ownership of fifty percent (50%) or more of the
1079
+ outstanding shares, or (iii) beneficial ownership of such entity.
1080
+
1081
+ "You" (or "Your") shall mean an individual or Legal Entity exercising
1082
+ permissions granted by this License.
1083
+
1084
+ "Source" form shall mean the preferred form for making modifications, including
1085
+ but not limited to software source code, documentation source, and configuration
1086
+ files.
1087
+
1088
+ "Object" form shall mean any form resulting from mechanical transformation or
1089
+ translation of a Source form, including but not limited to compiled object code,
1090
+ generated documentation, and conversions to other media types.
1091
+
1092
+ "Work" shall mean the work of authorship, whether in Source or Object form, made
1093
+ available under the License, as indicated by a copyright notice that is included
1094
+ in or attached to the work (an example is provided in the Appendix below).
1095
+
1096
+ "Derivative Works" shall mean any work, whether in Source or Object form, that
1097
+ is based on (or derived from) the Work and for which the editorial revisions,
1098
+ annotations, elaborations, or other modifications represent, as a whole, an
1099
+ original work of authorship. For the purposes of this License, Derivative Works
1100
+ shall not include works that remain separable from, or merely link (or bind by
1101
+ name) to the interfaces of, the Work and Derivative Works thereof.
1102
+
1103
+ "Contribution" shall mean any work of authorship, including the original version
1104
+ of the Work and any modifications or additions to that Work or Derivative Works
1105
+ thereof, that is intentionally submitted to Licensor for inclusion in the Work
1106
+ by the copyright owner or by an individual or Legal Entity authorized to submit
1107
+ on behalf of the copyright owner. For the purposes of this definition,
1108
+ "submitted" means any form of electronic, verbal, or written communication sent
1109
+ to the Licensor or its representatives, including but not limited to
1110
+ communication on electronic mailing lists, source code control systems, and
1111
+ issue tracking systems that are managed by, or on behalf of, the Licensor for
1112
+ the purpose of discussing and improving the Work, but excluding communication
1113
+ that is conspicuously marked or otherwise designated in writing by the copyright
1114
+ owner as "Not a Contribution."
1115
+
1116
+ "Contributor" shall mean Licensor and any individual or Legal Entity on behalf
1117
+ of whom a Contribution has been received by Licensor and subsequently
1118
+ incorporated within the Work.
1119
+
1120
+ 2. Grant of Copyright License.
1121
+
1122
+ Subject to the terms and conditions of this License, each Contributor hereby
1123
+ grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free,
1124
+ irrevocable copyright license to reproduce, prepare Derivative Works of,
1125
+ publicly display, publicly perform, sublicense, and distribute the Work and such
1126
+ Derivative Works in Source or Object form.
1127
+
1128
+ 3. Grant of Patent License.
1129
+
1130
+ Subject to the terms and conditions of this License, each Contributor hereby
1131
+ grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free,
1132
+ irrevocable (except as stated in this section) patent license to make, have
1133
+ made, use, offer to sell, sell, import, and otherwise transfer the Work, where
1134
+ such license applies only to those patent claims licensable by such Contributor
1135
+ that are necessarily infringed by their Contribution(s) alone or by combination
1136
+ of their Contribution(s) with the Work to which such Contribution(s) was
1137
+ submitted. If You institute patent litigation against any entity (including a
1138
+ cross-claim or counterclaim in a lawsuit) alleging that the Work or a
1139
+ Contribution incorporated within the Work constitutes direct or contributory
1140
+ patent infringement, then any patent licenses granted to You under this License
1141
+ for that Work shall terminate as of the date such litigation is filed.
1142
+
1143
+ 4. Redistribution.
1144
+
1145
+ You may reproduce and distribute copies of the Work or Derivative Works thereof
1146
+ in any medium, with or without modifications, and in Source or Object form,
1147
+ provided that You meet the following conditions:
1148
+
1149
+ You must give any other recipients of the Work or Derivative Works a copy of
1150
+ this License; and
1151
+ You must cause any modified files to carry prominent notices stating that You
1152
+ changed the files; and
1153
+ You must retain, in the Source form of any Derivative Works that You distribute,
1154
+ all copyright, patent, trademark, and attribution notices from the Source form
1155
+ of the Work, excluding those notices that do not pertain to any part of the
1156
+ Derivative Works; and
1157
+ If the Work includes a "NOTICE" text file as part of its distribution, then any
1158
+ Derivative Works that You distribute must include a readable copy of the
1159
+ attribution notices contained within such NOTICE file, excluding those notices
1160
+ that do not pertain to any part of the Derivative Works, in at least one of the
1161
+ following places: within a NOTICE text file distributed as part of the
1162
+ Derivative Works; within the Source form or documentation, if provided along
1163
+ with the Derivative Works; or, within a display generated by the Derivative
1164
+ Works, if and wherever such third-party notices normally appear. The contents of
1165
+ the NOTICE file are for informational purposes only and do not modify the
1166
+ License. You may add Your own attribution notices within Derivative Works that
1167
+ You distribute, alongside or as an addendum to the NOTICE text from the Work,
1168
+ provided that such additional attribution notices cannot be construed as
1169
+ modifying the License.
1170
+ You may add Your own copyright statement to Your modifications and may provide
1171
+ additional or different license terms and conditions for use, reproduction, or
1172
+ distribution of Your modifications, or for any such Derivative Works as a whole,
1173
+ provided Your use, reproduction, and distribution of the Work otherwise complies
1174
+ with the conditions stated in this License.
1175
+
1176
+ 5. Submission of Contributions.
1177
+
1178
+ Unless You explicitly state otherwise, any Contribution intentionally submitted
1179
+ for inclusion in the Work by You to the Licensor shall be under the terms and
1180
+ conditions of this License, without any additional terms or conditions.
1181
+ Notwithstanding the above, nothing herein shall supersede or modify the terms of
1182
+ any separate license agreement you may have executed with Licensor regarding
1183
+ such Contributions.
1184
+
1185
+ 6. Trademarks.
1186
+
1187
+ This License does not grant permission to use the trade names, trademarks,
1188
+ service marks, or product names of the Licensor, except as required for
1189
+ reasonable and customary use in describing the origin of the Work and
1190
+ reproducing the content of the NOTICE file.
1191
+
1192
+ 7. Disclaimer of Warranty.
1193
+
1194
+ Unless required by applicable law or agreed to in writing, Licensor provides the
1195
+ Work (and each Contributor provides its Contributions) on an "AS IS" BASIS,
1196
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied,
1197
+ including, without limitation, any warranties or conditions of TITLE,
1198
+ NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A PARTICULAR PURPOSE. You are
1199
+ solely responsible for determining the appropriateness of using or
1200
+ redistributing the Work and assume any risks associated with Your exercise of
1201
+ permissions under this License.
1202
+
1203
+ 8. Limitation of Liability.
1204
+
1205
+ In no event and under no legal theory, whether in tort (including negligence),
1206
+ contract, or otherwise, unless required by applicable law (such as deliberate
1207
+ and grossly negligent acts) or agreed to in writing, shall any Contributor be
1208
+ liable to You for damages, including any direct, indirect, special, incidental,
1209
+ or consequential damages of any character arising as a result of this License or
1210
+ out of the use or inability to use the Work (including but not limited to
1211
+ damages for loss of goodwill, work stoppage, computer failure or malfunction, or
1212
+ any and all other commercial damages or losses), even if such Contributor has
1213
+ been advised of the possibility of such damages.
1214
+
1215
+ 9. Accepting Warranty or Additional Liability.
1216
+
1217
+ While redistributing the Work or Derivative Works thereof, You may choose to
1218
+ offer, and charge a fee for, acceptance of support, warranty, indemnity, or
1219
+ other liability obligations and/or rights consistent with this License. However,
1220
+ in accepting such obligations, You may act only on Your own behalf and on Your
1221
+ sole responsibility, not on behalf of any other Contributor, and only if You
1222
+ agree to indemnify, defend, and hold each Contributor harmless for any liability
1223
+ incurred by, or claims asserted against, such Contributor by reason of your
1224
+ accepting any such warranty or additional liability.
1225
+
1226
+ END OF TERMS AND CONDITIONS
1227
+
1228
+ APPENDIX: How to apply the Apache License to your work
1229
+
1230
+ To apply the Apache License to your work, attach the following boilerplate
1231
+ notice, with the fields enclosed by brackets "[]" replaced with your own
1232
+ identifying information. (Don't include the brackets!) The text should be
1233
+ enclosed in the appropriate comment syntax for the file format. We also
1234
+ recommend that a file or class name and description of purpose be included on
1235
+ the same "printed page" as the copyright notice for easier identification within
1236
+ third-party archives.
1237
+
1238
+ Copyright [yyyy] [name of copyright owner]
1239
+
1240
+ Licensed under the Apache License, Version 2.0 (the "License");
1241
+ you may not use this file except in compliance with the License.
1242
+ You may obtain a copy of the License at
1243
+
1244
+ http://www.apache.org/licenses/LICENSE-2.0
1245
+
1246
+ Unless required by applicable law or agreed to in writing, software
1247
+ distributed under the License is distributed on an "AS IS" BASIS,
1248
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1249
+ See the License for the specific language governing permissions and
1250
+ limitations under the License.
.venv_haddock/lib/python3.12/site-packages/pandas-2.3.3.dist-info/METADATA ADDED
@@ -0,0 +1,1574 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ Metadata-Version: 2.1
2
+ Name: pandas
3
+ Version: 2.3.3
4
+ Summary: Powerful data structures for data analysis, time series, and statistics
5
+ Author-Email: The Pandas Development Team <pandas-dev@python.org>
6
+ License: BSD 3-Clause License
7
+
8
+ Copyright (c) 2008-2011, AQR Capital Management, LLC, Lambda Foundry, Inc. and PyData Development Team
9
+ All rights reserved.
10
+
11
+ Copyright (c) 2011-2023, Open source contributors.
12
+
13
+ Redistribution and use in source and binary forms, with or without
14
+ modification, are permitted provided that the following conditions are met:
15
+
16
+ * Redistributions of source code must retain the above copyright notice, this
17
+ list of conditions and the following disclaimer.
18
+
19
+ * Redistributions in binary form must reproduce the above copyright notice,
20
+ this list of conditions and the following disclaimer in the documentation
21
+ and/or other materials provided with the distribution.
22
+
23
+ * Neither the name of the copyright holder nor the names of its
24
+ contributors may be used to endorse or promote products derived from
25
+ this software without specific prior written permission.
26
+
27
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
28
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
29
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
30
+ DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
31
+ FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
32
+ DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
33
+ SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
34
+ CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
35
+ OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
36
+ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
37
+ Copyright (c) 2010-2019 Keith Goodman
38
+ Copyright (c) 2019 Bottleneck Developers
39
+ All rights reserved.
40
+
41
+ Redistribution and use in source and binary forms, with or without
42
+ modification, are permitted provided that the following conditions are met:
43
+
44
+ * Redistributions of source code must retain the above copyright notice,
45
+ this list of conditions and the following disclaimer.
46
+
47
+ * Redistributions in binary form must reproduce the above copyright
48
+ notice, this list of conditions and the following disclaimer in the
49
+ documentation and/or other materials provided with the distribution.
50
+
51
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
52
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
53
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
54
+ ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
55
+ LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
56
+ CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
57
+ SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
58
+ INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
59
+ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
60
+ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
61
+ POSSIBILITY OF SUCH DAMAGE.Copyright 2017- Paul Ganssle <paul@ganssle.io>
62
+ Copyright 2017- dateutil contributors (see AUTHORS file)
63
+
64
+ Licensed under the Apache License, Version 2.0 (the "License");
65
+ you may not use this file except in compliance with the License.
66
+ You may obtain a copy of the License at
67
+
68
+ http://www.apache.org/licenses/LICENSE-2.0
69
+
70
+ Unless required by applicable law or agreed to in writing, software
71
+ distributed under the License is distributed on an "AS IS" BASIS,
72
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
73
+ See the License for the specific language governing permissions and
74
+ limitations under the License.
75
+
76
+ The above license applies to all contributions after 2017-12-01, as well as
77
+ all contributions that have been re-licensed (see AUTHORS file for the list of
78
+ contributors who have re-licensed their code).
79
+ --------------------------------------------------------------------------------
80
+ dateutil - Extensions to the standard Python datetime module.
81
+
82
+ Copyright (c) 2003-2011 - Gustavo Niemeyer <gustavo@niemeyer.net>
83
+ Copyright (c) 2012-2014 - Tomi Pieviläinen <tomi.pievilainen@iki.fi>
84
+ Copyright (c) 2014-2016 - Yaron de Leeuw <me@jarondl.net>
85
+ Copyright (c) 2015- - Paul Ganssle <paul@ganssle.io>
86
+ Copyright (c) 2015- - dateutil contributors (see AUTHORS file)
87
+
88
+ All rights reserved.
89
+
90
+ Redistribution and use in source and binary forms, with or without
91
+ modification, are permitted provided that the following conditions are met:
92
+
93
+ * Redistributions of source code must retain the above copyright notice,
94
+ this list of conditions and the following disclaimer.
95
+ * Redistributions in binary form must reproduce the above copyright notice,
96
+ this list of conditions and the following disclaimer in the documentation
97
+ and/or other materials provided with the distribution.
98
+ * Neither the name of the copyright holder nor the names of its
99
+ contributors may be used to endorse or promote products derived from
100
+ this software without specific prior written permission.
101
+
102
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
103
+ "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
104
+ LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
105
+ A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
106
+ CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
107
+ EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
108
+ PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
109
+ PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
110
+ LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
111
+ NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
112
+ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
113
+
114
+ The above BSD License Applies to all code, even that also covered by Apache 2.0.# MIT License
115
+
116
+ Copyright (c) 2019 Hadley Wickham; RStudio; and Evan Miller
117
+
118
+ Permission is hereby granted, free of charge, to any person obtaining a copy
119
+ of this software and associated documentation files (the "Software"), to deal
120
+ in the Software without restriction, including without limitation the rights
121
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
122
+ copies of the Software, and to permit persons to whom the Software is
123
+ furnished to do so, subject to the following conditions:
124
+
125
+ The above copyright notice and this permission notice shall be included in all
126
+ copies or substantial portions of the Software.
127
+
128
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
129
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
130
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
131
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
132
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
133
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
134
+ SOFTWARE.
135
+ Based on http://opensource.org/licenses/MIT
136
+
137
+ This is a template. Complete and ship as file LICENSE the following 2
138
+ lines (only)
139
+
140
+ YEAR:
141
+ COPYRIGHT HOLDER:
142
+
143
+ and specify as
144
+
145
+ License: MIT + file LICENSE
146
+
147
+ Copyright (c) <YEAR>, <COPYRIGHT HOLDER>
148
+
149
+ Permission is hereby granted, free of charge, to any person obtaining
150
+ a copy of this software and associated documentation files (the
151
+ "Software"), to deal in the Software without restriction, including
152
+ without limitation the rights to use, copy, modify, merge, publish,
153
+ distribute, sublicense, and/or sell copies of the Software, and to
154
+ permit persons to whom the Software is furnished to do so, subject to
155
+ the following conditions:
156
+
157
+ The above copyright notice and this permission notice shall be
158
+ included in all copies or substantial portions of the Software.
159
+
160
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
161
+ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
162
+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
163
+ NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
164
+ LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
165
+ OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
166
+ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
167
+ The MIT License
168
+
169
+ Copyright (c) 2008- Attractive Chaos <attractor@live.co.uk>
170
+
171
+ Permission is hereby granted, free of charge, to any person obtaining
172
+ a copy of this software and associated documentation files (the
173
+ "Software"), to deal in the Software without restriction, including
174
+ without limitation the rights to use, copy, modify, merge, publish,
175
+ distribute, sublicense, and/or sell copies of the Software, and to
176
+ permit persons to whom the Software is furnished to do so, subject to
177
+ the following conditions:
178
+
179
+ The above copyright notice and this permission notice shall be
180
+ included in all copies or substantial portions of the Software.
181
+
182
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
183
+ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
184
+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
185
+ NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS
186
+ BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
187
+ ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
188
+ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
189
+ SOFTWARE.musl as a whole is licensed under the following standard MIT license:
190
+
191
+ ----------------------------------------------------------------------
192
+ Copyright © 2005-2020 Rich Felker, et al.
193
+
194
+ Permission is hereby granted, free of charge, to any person obtaining
195
+ a copy of this software and associated documentation files (the
196
+ "Software"), to deal in the Software without restriction, including
197
+ without limitation the rights to use, copy, modify, merge, publish,
198
+ distribute, sublicense, and/or sell copies of the Software, and to
199
+ permit persons to whom the Software is furnished to do so, subject to
200
+ the following conditions:
201
+
202
+ The above copyright notice and this permission notice shall be
203
+ included in all copies or substantial portions of the Software.
204
+
205
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
206
+ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
207
+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
208
+ IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
209
+ CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
210
+ TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
211
+ SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
212
+ ----------------------------------------------------------------------
213
+
214
+ Authors/contributors include:
215
+
216
+ A. Wilcox
217
+ Ada Worcester
218
+ Alex Dowad
219
+ Alex Suykov
220
+ Alexander Monakov
221
+ Andre McCurdy
222
+ Andrew Kelley
223
+ Anthony G. Basile
224
+ Aric Belsito
225
+ Arvid Picciani
226
+ Bartosz Brachaczek
227
+ Benjamin Peterson
228
+ Bobby Bingham
229
+ Boris Brezillon
230
+ Brent Cook
231
+ Chris Spiegel
232
+ Clément Vasseur
233
+ Daniel Micay
234
+ Daniel Sabogal
235
+ Daurnimator
236
+ David Carlier
237
+ David Edelsohn
238
+ Denys Vlasenko
239
+ Dmitry Ivanov
240
+ Dmitry V. Levin
241
+ Drew DeVault
242
+ Emil Renner Berthing
243
+ Fangrui Song
244
+ Felix Fietkau
245
+ Felix Janda
246
+ Gianluca Anzolin
247
+ Hauke Mehrtens
248
+ He X
249
+ Hiltjo Posthuma
250
+ Isaac Dunham
251
+ Jaydeep Patil
252
+ Jens Gustedt
253
+ Jeremy Huntwork
254
+ Jo-Philipp Wich
255
+ Joakim Sindholt
256
+ John Spencer
257
+ Julien Ramseier
258
+ Justin Cormack
259
+ Kaarle Ritvanen
260
+ Khem Raj
261
+ Kylie McClain
262
+ Leah Neukirchen
263
+ Luca Barbato
264
+ Luka Perkov
265
+ M Farkas-Dyck (Strake)
266
+ Mahesh Bodapati
267
+ Markus Wichmann
268
+ Masanori Ogino
269
+ Michael Clark
270
+ Michael Forney
271
+ Mikhail Kremnyov
272
+ Natanael Copa
273
+ Nicholas J. Kain
274
+ orc
275
+ Pascal Cuoq
276
+ Patrick Oppenlander
277
+ Petr Hosek
278
+ Petr Skocik
279
+ Pierre Carrier
280
+ Reini Urban
281
+ Rich Felker
282
+ Richard Pennington
283
+ Ryan Fairfax
284
+ Samuel Holland
285
+ Segev Finer
286
+ Shiz
287
+ sin
288
+ Solar Designer
289
+ Stefan Kristiansson
290
+ Stefan O'Rear
291
+ Szabolcs Nagy
292
+ Timo Teräs
293
+ Trutz Behn
294
+ Valentin Ochs
295
+ Will Dietz
296
+ William Haddon
297
+ William Pitcock
298
+
299
+ Portions of this software are derived from third-party works licensed
300
+ under terms compatible with the above MIT license:
301
+
302
+ The TRE regular expression implementation (src/regex/reg* and
303
+ src/regex/tre*) is Copyright © 2001-2008 Ville Laurikari and licensed
304
+ under a 2-clause BSD license (license text in the source files). The
305
+ included version has been heavily modified by Rich Felker in 2012, in
306
+ the interests of size, simplicity, and namespace cleanliness.
307
+
308
+ Much of the math library code (src/math/* and src/complex/*) is
309
+ Copyright © 1993,2004 Sun Microsystems or
310
+ Copyright © 2003-2011 David Schultz or
311
+ Copyright © 2003-2009 Steven G. Kargl or
312
+ Copyright © 2003-2009 Bruce D. Evans or
313
+ Copyright © 2008 Stephen L. Moshier or
314
+ Copyright © 2017-2018 Arm Limited
315
+ and labelled as such in comments in the individual source files. All
316
+ have been licensed under extremely permissive terms.
317
+
318
+ The ARM memcpy code (src/string/arm/memcpy.S) is Copyright © 2008
319
+ The Android Open Source Project and is licensed under a two-clause BSD
320
+ license. It was taken from Bionic libc, used on Android.
321
+
322
+ The AArch64 memcpy and memset code (src/string/aarch64/*) are
323
+ Copyright © 1999-2019, Arm Limited.
324
+
325
+ The implementation of DES for crypt (src/crypt/crypt_des.c) is
326
+ Copyright © 1994 David Burren. It is licensed under a BSD license.
327
+
328
+ The implementation of blowfish crypt (src/crypt/crypt_blowfish.c) was
329
+ originally written by Solar Designer and placed into the public
330
+ domain. The code also comes with a fallback permissive license for use
331
+ in jurisdictions that may not recognize the public domain.
332
+
333
+ The smoothsort implementation (src/stdlib/qsort.c) is Copyright © 2011
334
+ Valentin Ochs and is licensed under an MIT-style license.
335
+
336
+ The x86_64 port was written by Nicholas J. Kain and is licensed under
337
+ the standard MIT terms.
338
+
339
+ The mips and microblaze ports were originally written by Richard
340
+ Pennington for use in the ellcc project. The original code was adapted
341
+ by Rich Felker for build system and code conventions during upstream
342
+ integration. It is licensed under the standard MIT terms.
343
+
344
+ The mips64 port was contributed by Imagination Technologies and is
345
+ licensed under the standard MIT terms.
346
+
347
+ The powerpc port was also originally written by Richard Pennington,
348
+ and later supplemented and integrated by John Spencer. It is licensed
349
+ under the standard MIT terms.
350
+
351
+ All other files which have no copyright comments are original works
352
+ produced specifically for use as part of this library, written either
353
+ by Rich Felker, the main author of the library, or by one or more
354
+ contibutors listed above. Details on authorship of individual files
355
+ can be found in the git version control history of the project. The
356
+ omission of copyright and license comments in each file is in the
357
+ interest of source tree size.
358
+
359
+ In addition, permission is hereby granted for all public header files
360
+ (include/* and arch/*/bits/*) and crt files intended to be linked into
361
+ applications (crt/*, ldso/dlstart.c, and arch/*/crt_arch.h) to omit
362
+ the copyright notice and permission notice otherwise required by the
363
+ license, and to use these files without any requirement of
364
+ attribution. These files include substantial contributions from:
365
+
366
+ Bobby Bingham
367
+ John Spencer
368
+ Nicholas J. Kain
369
+ Rich Felker
370
+ Richard Pennington
371
+ Stefan Kristiansson
372
+ Szabolcs Nagy
373
+
374
+ all of whom have explicitly granted such permission.
375
+
376
+ This file previously contained text expressing a belief that most of
377
+ the files covered by the above exception were sufficiently trivial not
378
+ to be subject to copyright, resulting in confusion over whether it
379
+ negated the permissions granted in the license. In the spirit of
380
+ permissive licensing, and of not having licensing issues being an
381
+ obstacle to adoption, that text has been removed.Copyright (c) 2005-2023, NumPy Developers.
382
+ All rights reserved.
383
+
384
+ Redistribution and use in source and binary forms, with or without
385
+ modification, are permitted provided that the following conditions are
386
+ met:
387
+
388
+ * Redistributions of source code must retain the above copyright
389
+ notice, this list of conditions and the following disclaimer.
390
+
391
+ * Redistributions in binary form must reproduce the above
392
+ copyright notice, this list of conditions and the following
393
+ disclaimer in the documentation and/or other materials provided
394
+ with the distribution.
395
+
396
+ * Neither the name of the NumPy Developers nor the names of any
397
+ contributors may be used to endorse or promote products derived
398
+ from this software without specific prior written permission.
399
+
400
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
401
+ "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
402
+ LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
403
+ A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
404
+ OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
405
+ SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
406
+ LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
407
+ DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
408
+ THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
409
+ (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
410
+ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
411
+ Apache License
412
+ Version 2.0, January 2004
413
+ http://www.apache.org/licenses/
414
+
415
+ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
416
+
417
+ 1. Definitions.
418
+
419
+ "License" shall mean the terms and conditions for use, reproduction,
420
+ and distribution as defined by Sections 1 through 9 of this document.
421
+
422
+ "Licensor" shall mean the copyright owner or entity authorized by
423
+ the copyright owner that is granting the License.
424
+
425
+ "Legal Entity" shall mean the union of the acting entity and all
426
+ other entities that control, are controlled by, or are under common
427
+ control with that entity. For the purposes of this definition,
428
+ "control" means (i) the power, direct or indirect, to cause the
429
+ direction or management of such entity, whether by contract or
430
+ otherwise, or (ii) ownership of fifty percent (50%) or more of the
431
+ outstanding shares, or (iii) beneficial ownership of such entity.
432
+
433
+ "You" (or "Your") shall mean an individual or Legal Entity
434
+ exercising permissions granted by this License.
435
+
436
+ "Source" form shall mean the preferred form for making modifications,
437
+ including but not limited to software source code, documentation
438
+ source, and configuration files.
439
+
440
+ "Object" form shall mean any form resulting from mechanical
441
+ transformation or translation of a Source form, including but
442
+ not limited to compiled object code, generated documentation,
443
+ and conversions to other media types.
444
+
445
+ "Work" shall mean the work of authorship, whether in Source or
446
+ Object form, made available under the License, as indicated by a
447
+ copyright notice that is included in or attached to the work
448
+ (an example is provided in the Appendix below).
449
+
450
+ "Derivative Works" shall mean any work, whether in Source or Object
451
+ form, that is based on (or derived from) the Work and for which the
452
+ editorial revisions, annotations, elaborations, or other modifications
453
+ represent, as a whole, an original work of authorship. For the purposes
454
+ of this License, Derivative Works shall not include works that remain
455
+ separable from, or merely link (or bind by name) to the interfaces of,
456
+ the Work and Derivative Works thereof.
457
+
458
+ "Contribution" shall mean any work of authorship, including
459
+ the original version of the Work and any modifications or additions
460
+ to that Work or Derivative Works thereof, that is intentionally
461
+ submitted to Licensor for inclusion in the Work by the copyright owner
462
+ or by an individual or Legal Entity authorized to submit on behalf of
463
+ the copyright owner. For the purposes of this definition, "submitted"
464
+ means any form of electronic, verbal, or written communication sent
465
+ to the Licensor or its representatives, including but not limited to
466
+ communication on electronic mailing lists, source code control systems,
467
+ and issue tracking systems that are managed by, or on behalf of, the
468
+ Licensor for the purpose of discussing and improving the Work, but
469
+ excluding communication that is conspicuously marked or otherwise
470
+ designated in writing by the copyright owner as "Not a Contribution."
471
+
472
+ "Contributor" shall mean Licensor and any individual or Legal Entity
473
+ on behalf of whom a Contribution has been received by Licensor and
474
+ subsequently incorporated within the Work.
475
+
476
+ 2. Grant of Copyright License. Subject to the terms and conditions of
477
+ this License, each Contributor hereby grants to You a perpetual,
478
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
479
+ copyright license to reproduce, prepare Derivative Works of,
480
+ publicly display, publicly perform, sublicense, and distribute the
481
+ Work and such Derivative Works in Source or Object form.
482
+
483
+ 3. Grant of Patent License. Subject to the terms and conditions of
484
+ this License, each Contributor hereby grants to You a perpetual,
485
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
486
+ (except as stated in this section) patent license to make, have made,
487
+ use, offer to sell, sell, import, and otherwise transfer the Work,
488
+ where such license applies only to those patent claims licensable
489
+ by such Contributor that are necessarily infringed by their
490
+ Contribution(s) alone or by combination of their Contribution(s)
491
+ with the Work to which such Contribution(s) was submitted. If You
492
+ institute patent litigation against any entity (including a
493
+ cross-claim or counterclaim in a lawsuit) alleging that the Work
494
+ or a Contribution incorporated within the Work constitutes direct
495
+ or contributory patent infringement, then any patent licenses
496
+ granted to You under this License for that Work shall terminate
497
+ as of the date such litigation is filed.
498
+
499
+ 4. Redistribution. You may reproduce and distribute copies of the
500
+ Work or Derivative Works thereof in any medium, with or without
501
+ modifications, and in Source or Object form, provided that You
502
+ meet the following conditions:
503
+
504
+ (a) You must give any other recipients of the Work or
505
+ Derivative Works a copy of this License; and
506
+
507
+ (b) You must cause any modified files to carry prominent notices
508
+ stating that You changed the files; and
509
+
510
+ (c) You must retain, in the Source form of any Derivative Works
511
+ that You distribute, all copyright, patent, trademark, and
512
+ attribution notices from the Source form of the Work,
513
+ excluding those notices that do not pertain to any part of
514
+ the Derivative Works; and
515
+
516
+ (d) If the Work includes a "NOTICE" text file as part of its
517
+ distribution, then any Derivative Works that You distribute must
518
+ include a readable copy of the attribution notices contained
519
+ within such NOTICE file, excluding those notices that do not
520
+ pertain to any part of the Derivative Works, in at least one
521
+ of the following places: within a NOTICE text file distributed
522
+ as part of the Derivative Works; within the Source form or
523
+ documentation, if provided along with the Derivative Works; or,
524
+ within a display generated by the Derivative Works, if and
525
+ wherever such third-party notices normally appear. The contents
526
+ of the NOTICE file are for informational purposes only and
527
+ do not modify the License. You may add Your own attribution
528
+ notices within Derivative Works that You distribute, alongside
529
+ or as an addendum to the NOTICE text from the Work, provided
530
+ that such additional attribution notices cannot be construed
531
+ as modifying the License.
532
+
533
+ You may add Your own copyright statement to Your modifications and
534
+ may provide additional or different license terms and conditions
535
+ for use, reproduction, or distribution of Your modifications, or
536
+ for any such Derivative Works as a whole, provided Your use,
537
+ reproduction, and distribution of the Work otherwise complies with
538
+ the conditions stated in this License.
539
+
540
+ 5. Submission of Contributions. Unless You explicitly state otherwise,
541
+ any Contribution intentionally submitted for inclusion in the Work
542
+ by You to the Licensor shall be under the terms and conditions of
543
+ this License, without any additional terms or conditions.
544
+ Notwithstanding the above, nothing herein shall supersede or modify
545
+ the terms of any separate license agreement you may have executed
546
+ with Licensor regarding such Contributions.
547
+
548
+ 6. Trademarks. This License does not grant permission to use the trade
549
+ names, trademarks, service marks, or product names of the Licensor,
550
+ except as required for reasonable and customary use in describing the
551
+ origin of the Work and reproducing the content of the NOTICE file.
552
+
553
+ 7. Disclaimer of Warranty. Unless required by applicable law or
554
+ agreed to in writing, Licensor provides the Work (and each
555
+ Contributor provides its Contributions) on an "AS IS" BASIS,
556
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
557
+ implied, including, without limitation, any warranties or conditions
558
+ of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
559
+ PARTICULAR PURPOSE. You are solely responsible for determining the
560
+ appropriateness of using or redistributing the Work and assume any
561
+ risks associated with Your exercise of permissions under this License.
562
+
563
+ 8. Limitation of Liability. In no event and under no legal theory,
564
+ whether in tort (including negligence), contract, or otherwise,
565
+ unless required by applicable law (such as deliberate and grossly
566
+ negligent acts) or agreed to in writing, shall any Contributor be
567
+ liable to You for damages, including any direct, indirect, special,
568
+ incidental, or consequential damages of any character arising as a
569
+ result of this License or out of the use or inability to use the
570
+ Work (including but not limited to damages for loss of goodwill,
571
+ work stoppage, computer failure or malfunction, or any and all
572
+ other commercial damages or losses), even if such Contributor
573
+ has been advised of the possibility of such damages.
574
+
575
+ 9. Accepting Warranty or Additional Liability. While redistributing
576
+ the Work or Derivative Works thereof, You may choose to offer,
577
+ and charge a fee for, acceptance of support, warranty, indemnity,
578
+ or other liability obligations and/or rights consistent with this
579
+ License. However, in accepting such obligations, You may act only
580
+ on Your own behalf and on Your sole responsibility, not on behalf
581
+ of any other Contributor, and only if You agree to indemnify,
582
+ defend, and hold each Contributor harmless for any liability
583
+ incurred by, or claims asserted against, such Contributor by reason
584
+ of your accepting any such warranty or additional liability.
585
+
586
+ END OF TERMS AND CONDITIONS
587
+
588
+
589
+ Copyright (c) Donald Stufft and individual contributors.
590
+ All rights reserved.
591
+
592
+ Redistribution and use in source and binary forms, with or without
593
+ modification, are permitted provided that the following conditions are met:
594
+
595
+ 1. Redistributions of source code must retain the above copyright notice,
596
+ this list of conditions and the following disclaimer.
597
+
598
+ 2. Redistributions in binary form must reproduce the above copyright
599
+ notice, this list of conditions and the following disclaimer in the
600
+ documentation and/or other materials provided with the distribution.
601
+
602
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
603
+ ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
604
+ WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
605
+ DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
606
+ FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
607
+ DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
608
+ SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
609
+ CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
610
+ OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
611
+ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.A. HISTORY OF THE SOFTWARE
612
+ ==========================
613
+
614
+ Python was created in the early 1990s by Guido van Rossum at Stichting
615
+ Mathematisch Centrum (CWI, see https://www.cwi.nl) in the Netherlands
616
+ as a successor of a language called ABC. Guido remains Python's
617
+ principal author, although it includes many contributions from others.
618
+
619
+ In 1995, Guido continued his work on Python at the Corporation for
620
+ National Research Initiatives (CNRI, see https://www.cnri.reston.va.us)
621
+ in Reston, Virginia where he released several versions of the
622
+ software.
623
+
624
+ In May 2000, Guido and the Python core development team moved to
625
+ BeOpen.com to form the BeOpen PythonLabs team. In October of the same
626
+ year, the PythonLabs team moved to Digital Creations, which became
627
+ Zope Corporation. In 2001, the Python Software Foundation (PSF, see
628
+ https://www.python.org/psf/) was formed, a non-profit organization
629
+ created specifically to own Python-related Intellectual Property.
630
+ Zope Corporation was a sponsoring member of the PSF.
631
+
632
+ All Python releases are Open Source (see https://opensource.org for
633
+ the Open Source Definition). Historically, most, but not all, Python
634
+ releases have also been GPL-compatible; the table below summarizes
635
+ the various releases.
636
+
637
+ Release Derived Year Owner GPL-
638
+ from compatible? (1)
639
+
640
+ 0.9.0 thru 1.2 1991-1995 CWI yes
641
+ 1.3 thru 1.5.2 1.2 1995-1999 CNRI yes
642
+ 1.6 1.5.2 2000 CNRI no
643
+ 2.0 1.6 2000 BeOpen.com no
644
+ 1.6.1 1.6 2001 CNRI yes (2)
645
+ 2.1 2.0+1.6.1 2001 PSF no
646
+ 2.0.1 2.0+1.6.1 2001 PSF yes
647
+ 2.1.1 2.1+2.0.1 2001 PSF yes
648
+ 2.1.2 2.1.1 2002 PSF yes
649
+ 2.1.3 2.1.2 2002 PSF yes
650
+ 2.2 and above 2.1.1 2001-now PSF yes
651
+
652
+ Footnotes:
653
+
654
+ (1) GPL-compatible doesn't mean that we're distributing Python under
655
+ the GPL. All Python licenses, unlike the GPL, let you distribute
656
+ a modified version without making your changes open source. The
657
+ GPL-compatible licenses make it possible to combine Python with
658
+ other software that is released under the GPL; the others don't.
659
+
660
+ (2) According to Richard Stallman, 1.6.1 is not GPL-compatible,
661
+ because its license has a choice of law clause. According to
662
+ CNRI, however, Stallman's lawyer has told CNRI's lawyer that 1.6.1
663
+ is "not incompatible" with the GPL.
664
+
665
+ Thanks to the many outside volunteers who have worked under Guido's
666
+ direction to make these releases possible.
667
+
668
+
669
+ B. TERMS AND CONDITIONS FOR ACCESSING OR OTHERWISE USING PYTHON
670
+ ===============================================================
671
+
672
+ Python software and documentation are licensed under the
673
+ Python Software Foundation License Version 2.
674
+
675
+ Starting with Python 3.8.6, examples, recipes, and other code in
676
+ the documentation are dual licensed under the PSF License Version 2
677
+ and the Zero-Clause BSD license.
678
+
679
+ Some software incorporated into Python is under different licenses.
680
+ The licenses are listed with code falling under that license.
681
+
682
+
683
+ PYTHON SOFTWARE FOUNDATION LICENSE VERSION 2
684
+ --------------------------------------------
685
+
686
+ 1. This LICENSE AGREEMENT is between the Python Software Foundation
687
+ ("PSF"), and the Individual or Organization ("Licensee") accessing and
688
+ otherwise using this software ("Python") in source or binary form and
689
+ its associated documentation.
690
+
691
+ 2. Subject to the terms and conditions of this License Agreement, PSF hereby
692
+ grants Licensee a nonexclusive, royalty-free, world-wide license to reproduce,
693
+ analyze, test, perform and/or display publicly, prepare derivative works,
694
+ distribute, and otherwise use Python alone or in any derivative version,
695
+ provided, however, that PSF's License Agreement and PSF's notice of copyright,
696
+ i.e., "Copyright (c) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010,
697
+ 2011, 2012, 2013, 2014, 2015, 2016, 2017, 2018, 2019, 2020, 2021, 2022, 2023 Python Software Foundation;
698
+ All Rights Reserved" are retained in Python alone or in any derivative version
699
+ prepared by Licensee.
700
+
701
+ 3. In the event Licensee prepares a derivative work that is based on
702
+ or incorporates Python or any part thereof, and wants to make
703
+ the derivative work available to others as provided herein, then
704
+ Licensee hereby agrees to include in any such work a brief summary of
705
+ the changes made to Python.
706
+
707
+ 4. PSF is making Python available to Licensee on an "AS IS"
708
+ basis. PSF MAKES NO REPRESENTATIONS OR WARRANTIES, EXPRESS OR
709
+ IMPLIED. BY WAY OF EXAMPLE, BUT NOT LIMITATION, PSF MAKES NO AND
710
+ DISCLAIMS ANY REPRESENTATION OR WARRANTY OF MERCHANTABILITY OR FITNESS
711
+ FOR ANY PARTICULAR PURPOSE OR THAT THE USE OF PYTHON WILL NOT
712
+ INFRINGE ANY THIRD PARTY RIGHTS.
713
+
714
+ 5. PSF SHALL NOT BE LIABLE TO LICENSEE OR ANY OTHER USERS OF PYTHON
715
+ FOR ANY INCIDENTAL, SPECIAL, OR CONSEQUENTIAL DAMAGES OR LOSS AS
716
+ A RESULT OF MODIFYING, DISTRIBUTING, OR OTHERWISE USING PYTHON,
717
+ OR ANY DERIVATIVE THEREOF, EVEN IF ADVISED OF THE POSSIBILITY THEREOF.
718
+
719
+ 6. This License Agreement will automatically terminate upon a material
720
+ breach of its terms and conditions.
721
+
722
+ 7. Nothing in this License Agreement shall be deemed to create any
723
+ relationship of agency, partnership, or joint venture between PSF and
724
+ Licensee. This License Agreement does not grant permission to use PSF
725
+ trademarks or trade name in a trademark sense to endorse or promote
726
+ products or services of Licensee, or any third party.
727
+
728
+ 8. By copying, installing or otherwise using Python, Licensee
729
+ agrees to be bound by the terms and conditions of this License
730
+ Agreement.
731
+
732
+
733
+ BEOPEN.COM LICENSE AGREEMENT FOR PYTHON 2.0
734
+ -------------------------------------------
735
+
736
+ BEOPEN PYTHON OPEN SOURCE LICENSE AGREEMENT VERSION 1
737
+
738
+ 1. This LICENSE AGREEMENT is between BeOpen.com ("BeOpen"), having an
739
+ office at 160 Saratoga Avenue, Santa Clara, CA 95051, and the
740
+ Individual or Organization ("Licensee") accessing and otherwise using
741
+ this software in source or binary form and its associated
742
+ documentation ("the Software").
743
+
744
+ 2. Subject to the terms and conditions of this BeOpen Python License
745
+ Agreement, BeOpen hereby grants Licensee a non-exclusive,
746
+ royalty-free, world-wide license to reproduce, analyze, test, perform
747
+ and/or display publicly, prepare derivative works, distribute, and
748
+ otherwise use the Software alone or in any derivative version,
749
+ provided, however, that the BeOpen Python License is retained in the
750
+ Software, alone or in any derivative version prepared by Licensee.
751
+
752
+ 3. BeOpen is making the Software available to Licensee on an "AS IS"
753
+ basis. BEOPEN MAKES NO REPRESENTATIONS OR WARRANTIES, EXPRESS OR
754
+ IMPLIED. BY WAY OF EXAMPLE, BUT NOT LIMITATION, BEOPEN MAKES NO AND
755
+ DISCLAIMS ANY REPRESENTATION OR WARRANTY OF MERCHANTABILITY OR FITNESS
756
+ FOR ANY PARTICULAR PURPOSE OR THAT THE USE OF THE SOFTWARE WILL NOT
757
+ INFRINGE ANY THIRD PARTY RIGHTS.
758
+
759
+ 4. BEOPEN SHALL NOT BE LIABLE TO LICENSEE OR ANY OTHER USERS OF THE
760
+ SOFTWARE FOR ANY INCIDENTAL, SPECIAL, OR CONSEQUENTIAL DAMAGES OR LOSS
761
+ AS A RESULT OF USING, MODIFYING OR DISTRIBUTING THE SOFTWARE, OR ANY
762
+ DERIVATIVE THEREOF, EVEN IF ADVISED OF THE POSSIBILITY THEREOF.
763
+
764
+ 5. This License Agreement will automatically terminate upon a material
765
+ breach of its terms and conditions.
766
+
767
+ 6. This License Agreement shall be governed by and interpreted in all
768
+ respects by the law of the State of California, excluding conflict of
769
+ law provisions. Nothing in this License Agreement shall be deemed to
770
+ create any relationship of agency, partnership, or joint venture
771
+ between BeOpen and Licensee. This License Agreement does not grant
772
+ permission to use BeOpen trademarks or trade names in a trademark
773
+ sense to endorse or promote products or services of Licensee, or any
774
+ third party. As an exception, the "BeOpen Python" logos available at
775
+ http://www.pythonlabs.com/logos.html may be used according to the
776
+ permissions granted on that web page.
777
+
778
+ 7. By copying, installing or otherwise using the software, Licensee
779
+ agrees to be bound by the terms and conditions of this License
780
+ Agreement.
781
+
782
+
783
+ CNRI LICENSE AGREEMENT FOR PYTHON 1.6.1
784
+ ---------------------------------------
785
+
786
+ 1. This LICENSE AGREEMENT is between the Corporation for National
787
+ Research Initiatives, having an office at 1895 Preston White Drive,
788
+ Reston, VA 20191 ("CNRI"), and the Individual or Organization
789
+ ("Licensee") accessing and otherwise using Python 1.6.1 software in
790
+ source or binary form and its associated documentation.
791
+
792
+ 2. Subject to the terms and conditions of this License Agreement, CNRI
793
+ hereby grants Licensee a nonexclusive, royalty-free, world-wide
794
+ license to reproduce, analyze, test, perform and/or display publicly,
795
+ prepare derivative works, distribute, and otherwise use Python 1.6.1
796
+ alone or in any derivative version, provided, however, that CNRI's
797
+ License Agreement and CNRI's notice of copyright, i.e., "Copyright (c)
798
+ 1995-2001 Corporation for National Research Initiatives; All Rights
799
+ Reserved" are retained in Python 1.6.1 alone or in any derivative
800
+ version prepared by Licensee. Alternately, in lieu of CNRI's License
801
+ Agreement, Licensee may substitute the following text (omitting the
802
+ quotes): "Python 1.6.1 is made available subject to the terms and
803
+ conditions in CNRI's License Agreement. This Agreement together with
804
+ Python 1.6.1 may be located on the internet using the following
805
+ unique, persistent identifier (known as a handle): 1895.22/1013. This
806
+ Agreement may also be obtained from a proxy server on the internet
807
+ using the following URL: http://hdl.handle.net/1895.22/1013".
808
+
809
+ 3. In the event Licensee prepares a derivative work that is based on
810
+ or incorporates Python 1.6.1 or any part thereof, and wants to make
811
+ the derivative work available to others as provided herein, then
812
+ Licensee hereby agrees to include in any such work a brief summary of
813
+ the changes made to Python 1.6.1.
814
+
815
+ 4. CNRI is making Python 1.6.1 available to Licensee on an "AS IS"
816
+ basis. CNRI MAKES NO REPRESENTATIONS OR WARRANTIES, EXPRESS OR
817
+ IMPLIED. BY WAY OF EXAMPLE, BUT NOT LIMITATION, CNRI MAKES NO AND
818
+ DISCLAIMS ANY REPRESENTATION OR WARRANTY OF MERCHANTABILITY OR FITNESS
819
+ FOR ANY PARTICULAR PURPOSE OR THAT THE USE OF PYTHON 1.6.1 WILL NOT
820
+ INFRINGE ANY THIRD PARTY RIGHTS.
821
+
822
+ 5. CNRI SHALL NOT BE LIABLE TO LICENSEE OR ANY OTHER USERS OF PYTHON
823
+ 1.6.1 FOR ANY INCIDENTAL, SPECIAL, OR CONSEQUENTIAL DAMAGES OR LOSS AS
824
+ A RESULT OF MODIFYING, DISTRIBUTING, OR OTHERWISE USING PYTHON 1.6.1,
825
+ OR ANY DERIVATIVE THEREOF, EVEN IF ADVISED OF THE POSSIBILITY THEREOF.
826
+
827
+ 6. This License Agreement will automatically terminate upon a material
828
+ breach of its terms and conditions.
829
+
830
+ 7. This License Agreement shall be governed by the federal
831
+ intellectual property law of the United States, including without
832
+ limitation the federal copyright law, and, to the extent such
833
+ U.S. federal law does not apply, by the law of the Commonwealth of
834
+ Virginia, excluding Virginia's conflict of law provisions.
835
+ Notwithstanding the foregoing, with regard to derivative works based
836
+ on Python 1.6.1 that incorporate non-separable material that was
837
+ previously distributed under the GNU General Public License (GPL), the
838
+ law of the Commonwealth of Virginia shall govern this License
839
+ Agreement only as to issues arising under or with respect to
840
+ Paragraphs 4, 5, and 7 of this License Agreement. Nothing in this
841
+ License Agreement shall be deemed to create any relationship of
842
+ agency, partnership, or joint venture between CNRI and Licensee. This
843
+ License Agreement does not grant permission to use CNRI trademarks or
844
+ trade name in a trademark sense to endorse or promote products or
845
+ services of Licensee, or any third party.
846
+
847
+ 8. By clicking on the "ACCEPT" button where indicated, or by copying,
848
+ installing or otherwise using Python 1.6.1, Licensee agrees to be
849
+ bound by the terms and conditions of this License Agreement.
850
+
851
+ ACCEPT
852
+
853
+
854
+ CWI LICENSE AGREEMENT FOR PYTHON 0.9.0 THROUGH 1.2
855
+ --------------------------------------------------
856
+
857
+ Copyright (c) 1991 - 1995, Stichting Mathematisch Centrum Amsterdam,
858
+ The Netherlands. All rights reserved.
859
+
860
+ Permission to use, copy, modify, and distribute this software and its
861
+ documentation for any purpose and without fee is hereby granted,
862
+ provided that the above copyright notice appear in all copies and that
863
+ both that copyright notice and this permission notice appear in
864
+ supporting documentation, and that the name of Stichting Mathematisch
865
+ Centrum or CWI not be used in advertising or publicity pertaining to
866
+ distribution of the software without specific, written prior
867
+ permission.
868
+
869
+ STICHTING MATHEMATISCH CENTRUM DISCLAIMS ALL WARRANTIES WITH REGARD TO
870
+ THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND
871
+ FITNESS, IN NO EVENT SHALL STICHTING MATHEMATISCH CENTRUM BE LIABLE
872
+ FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
873
+ WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
874
+ ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT
875
+ OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
876
+
877
+ ZERO-CLAUSE BSD LICENSE FOR CODE IN THE PYTHON DOCUMENTATION
878
+ ----------------------------------------------------------------------
879
+
880
+ Permission to use, copy, modify, and/or distribute this software for any
881
+ purpose with or without fee is hereby granted.
882
+
883
+ THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
884
+ REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
885
+ AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
886
+ INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
887
+ LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
888
+ OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
889
+ PERFORMANCE OF THIS SOFTWARE.
890
+ Copyright (c) 2014, Al Sweigart
891
+ All rights reserved.
892
+
893
+ Redistribution and use in source and binary forms, with or without
894
+ modification, are permitted provided that the following conditions are met:
895
+
896
+ * Redistributions of source code must retain the above copyright notice, this
897
+ list of conditions and the following disclaimer.
898
+
899
+ * Redistributions in binary form must reproduce the above copyright notice,
900
+ this list of conditions and the following disclaimer in the documentation
901
+ and/or other materials provided with the distribution.
902
+
903
+ * Neither the name of the {organization} nor the names of its
904
+ contributors may be used to endorse or promote products derived from
905
+ this software without specific prior written permission.
906
+
907
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
908
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
909
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
910
+ DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
911
+ FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
912
+ DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
913
+ SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
914
+ CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
915
+ OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
916
+ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.Copyright (c) 2017 Anthony Sottile
917
+
918
+ Permission is hereby granted, free of charge, to any person obtaining a copy
919
+ of this software and associated documentation files (the "Software"), to deal
920
+ in the Software without restriction, including without limitation the rights
921
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
922
+ copies of the Software, and to permit persons to whom the Software is
923
+ furnished to do so, subject to the following conditions:
924
+
925
+ The above copyright notice and this permission notice shall be included in
926
+ all copies or substantial portions of the Software.
927
+
928
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
929
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
930
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
931
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
932
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
933
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
934
+ THE SOFTWARE.Copyright (c) 2015-2019 Jared Hobbs
935
+
936
+ Permission is hereby granted, free of charge, to any person obtaining a copy of
937
+ this software and associated documentation files (the "Software"), to deal in
938
+ the Software without restriction, including without limitation the rights to
939
+ use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies
940
+ of the Software, and to permit persons to whom the Software is furnished to do
941
+ so, subject to the following conditions:
942
+
943
+ The above copyright notice and this permission notice shall be included in all
944
+ copies or substantial portions of the Software.
945
+
946
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
947
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
948
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
949
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
950
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
951
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
952
+ SOFTWARE.Developed by ESN, an Electronic Arts Inc. studio.
953
+ Copyright (c) 2014, Electronic Arts Inc.
954
+ All rights reserved.
955
+
956
+ Redistribution and use in source and binary forms, with or without
957
+ modification, are permitted provided that the following conditions are met:
958
+ * Redistributions of source code must retain the above copyright
959
+ notice, this list of conditions and the following disclaimer.
960
+ * Redistributions in binary form must reproduce the above copyright
961
+ notice, this list of conditions and the following disclaimer in the
962
+ documentation and/or other materials provided with the distribution.
963
+ * Neither the name of ESN, Electronic Arts Inc. nor the
964
+ names of its contributors may be used to endorse or promote products
965
+ derived from this software without specific prior written permission.
966
+
967
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
968
+ ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
969
+ WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
970
+ DISCLAIMED. IN NO EVENT SHALL ELECTRONIC ARTS INC. BE LIABLE
971
+ FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
972
+ (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
973
+ LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
974
+ ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
975
+ (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
976
+ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
977
+
978
+ ----
979
+
980
+ Portions of code from MODP_ASCII - Ascii transformations (upper/lower, etc)
981
+ https://github.com/client9/stringencoders
982
+
983
+ Copyright 2005, 2006, 2007
984
+ Nick Galbreath -- nickg [at] modp [dot] com
985
+ All rights reserved.
986
+
987
+ Redistribution and use in source and binary forms, with or without
988
+ modification, are permitted provided that the following conditions are
989
+ met:
990
+
991
+ Redistributions of source code must retain the above copyright
992
+ notice, this list of conditions and the following disclaimer.
993
+
994
+ Redistributions in binary form must reproduce the above copyright
995
+ notice, this list of conditions and the following disclaimer in the
996
+ documentation and/or other materials provided with the distribution.
997
+
998
+ Neither the name of the modp.com nor the names of its
999
+ contributors may be used to endorse or promote products derived from
1000
+ this software without specific prior written permission.
1001
+
1002
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
1003
+ "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
1004
+ LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
1005
+ A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
1006
+ OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
1007
+ SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
1008
+ LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
1009
+ DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
1010
+ THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
1011
+ (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
1012
+ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
1013
+
1014
+ This is the standard "new" BSD license:
1015
+ http://www.opensource.org/licenses/bsd-license.php
1016
+
1017
+ https://github.com/client9/stringencoders/blob/cfd5c1507325ae497ea9bacdacba12c0ffd79d30/COPYING
1018
+
1019
+ ----
1020
+
1021
+ Numeric decoder derived from from TCL library
1022
+ https://opensource.apple.com/source/tcl/tcl-14/tcl/license.terms
1023
+ * Copyright (c) 1988-1993 The Regents of the University of California.
1024
+ * Copyright (c) 1994 Sun Microsystems, Inc.
1025
+
1026
+ This software is copyrighted by the Regents of the University of
1027
+ California, Sun Microsystems, Inc., Scriptics Corporation, ActiveState
1028
+ Corporation and other parties. The following terms apply to all files
1029
+ associated with the software unless explicitly disclaimed in
1030
+ individual files.
1031
+
1032
+ The authors hereby grant permission to use, copy, modify, distribute,
1033
+ and license this software and its documentation for any purpose, provided
1034
+ that existing copyright notices are retained in all copies and that this
1035
+ notice is included verbatim in any distributions. No written agreement,
1036
+ license, or royalty fee is required for any of the authorized uses.
1037
+ Modifications to this software may be copyrighted by their authors
1038
+ and need not follow the licensing terms described here, provided that
1039
+ the new terms are clearly indicated on the first page of each file where
1040
+ they apply.
1041
+
1042
+ IN NO EVENT SHALL THE AUTHORS OR DISTRIBUTORS BE LIABLE TO ANY PARTY
1043
+ FOR DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES
1044
+ ARISING OUT OF THE USE OF THIS SOFTWARE, ITS DOCUMENTATION, OR ANY
1045
+ DERIVATIVES THEREOF, EVEN IF THE AUTHORS HAVE BEEN ADVISED OF THE
1046
+ POSSIBILITY OF SUCH DAMAGE.
1047
+
1048
+ THE AUTHORS AND DISTRIBUTORS SPECIFICALLY DISCLAIM ANY WARRANTIES,
1049
+ INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY,
1050
+ FITNESS FOR A PARTICULAR PURPOSE, AND NON-INFRINGEMENT. THIS SOFTWARE
1051
+ IS PROVIDED ON AN "AS IS" BASIS, AND THE AUTHORS AND DISTRIBUTORS HAVE
1052
+ NO OBLIGATION TO PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR
1053
+ MODIFICATIONS.
1054
+
1055
+ GOVERNMENT USE: If you are acquiring this software on behalf of the
1056
+ U.S. government, the Government shall have only "Restricted Rights"
1057
+ in the software and related documentation as defined in the Federal
1058
+ Acquisition Regulations (FARs) in Clause 52.227.19 (c) (2). If you
1059
+ are acquiring the software on behalf of the Department of Defense, the
1060
+ software shall be classified as "Commercial Computer Software" and the
1061
+ Government shall have only "Restricted Rights" as defined in Clause
1062
+ 252.227-7013 (c) (1) of DFARs. Notwithstanding the foregoing, the
1063
+ authors grant the U.S. Government and others acting in its behalf
1064
+ permission to use and distribute the software in accordance with the
1065
+ terms specified in this license.Apache License
1066
+ Version 2.0, January 2004
1067
+ http://www.apache.org/licenses/
1068
+
1069
+ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
1070
+
1071
+ 1. Definitions.
1072
+
1073
+ "License" shall mean the terms and conditions for use, reproduction, and
1074
+ distribution as defined by Sections 1 through 9 of this document.
1075
+
1076
+ "Licensor" shall mean the copyright owner or entity authorized by the copyright
1077
+ owner that is granting the License.
1078
+
1079
+ "Legal Entity" shall mean the union of the acting entity and all other entities
1080
+ that control, are controlled by, or are under common control with that entity.
1081
+ For the purposes of this definition, "control" means (i) the power, direct or
1082
+ indirect, to cause the direction or management of such entity, whether by
1083
+ contract or otherwise, or (ii) ownership of fifty percent (50%) or more of the
1084
+ outstanding shares, or (iii) beneficial ownership of such entity.
1085
+
1086
+ "You" (or "Your") shall mean an individual or Legal Entity exercising
1087
+ permissions granted by this License.
1088
+
1089
+ "Source" form shall mean the preferred form for making modifications, including
1090
+ but not limited to software source code, documentation source, and configuration
1091
+ files.
1092
+
1093
+ "Object" form shall mean any form resulting from mechanical transformation or
1094
+ translation of a Source form, including but not limited to compiled object code,
1095
+ generated documentation, and conversions to other media types.
1096
+
1097
+ "Work" shall mean the work of authorship, whether in Source or Object form, made
1098
+ available under the License, as indicated by a copyright notice that is included
1099
+ in or attached to the work (an example is provided in the Appendix below).
1100
+
1101
+ "Derivative Works" shall mean any work, whether in Source or Object form, that
1102
+ is based on (or derived from) the Work and for which the editorial revisions,
1103
+ annotations, elaborations, or other modifications represent, as a whole, an
1104
+ original work of authorship. For the purposes of this License, Derivative Works
1105
+ shall not include works that remain separable from, or merely link (or bind by
1106
+ name) to the interfaces of, the Work and Derivative Works thereof.
1107
+
1108
+ "Contribution" shall mean any work of authorship, including the original version
1109
+ of the Work and any modifications or additions to that Work or Derivative Works
1110
+ thereof, that is intentionally submitted to Licensor for inclusion in the Work
1111
+ by the copyright owner or by an individual or Legal Entity authorized to submit
1112
+ on behalf of the copyright owner. For the purposes of this definition,
1113
+ "submitted" means any form of electronic, verbal, or written communication sent
1114
+ to the Licensor or its representatives, including but not limited to
1115
+ communication on electronic mailing lists, source code control systems, and
1116
+ issue tracking systems that are managed by, or on behalf of, the Licensor for
1117
+ the purpose of discussing and improving the Work, but excluding communication
1118
+ that is conspicuously marked or otherwise designated in writing by the copyright
1119
+ owner as "Not a Contribution."
1120
+
1121
+ "Contributor" shall mean Licensor and any individual or Legal Entity on behalf
1122
+ of whom a Contribution has been received by Licensor and subsequently
1123
+ incorporated within the Work.
1124
+
1125
+ 2. Grant of Copyright License.
1126
+
1127
+ Subject to the terms and conditions of this License, each Contributor hereby
1128
+ grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free,
1129
+ irrevocable copyright license to reproduce, prepare Derivative Works of,
1130
+ publicly display, publicly perform, sublicense, and distribute the Work and such
1131
+ Derivative Works in Source or Object form.
1132
+
1133
+ 3. Grant of Patent License.
1134
+
1135
+ Subject to the terms and conditions of this License, each Contributor hereby
1136
+ grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free,
1137
+ irrevocable (except as stated in this section) patent license to make, have
1138
+ made, use, offer to sell, sell, import, and otherwise transfer the Work, where
1139
+ such license applies only to those patent claims licensable by such Contributor
1140
+ that are necessarily infringed by their Contribution(s) alone or by combination
1141
+ of their Contribution(s) with the Work to which such Contribution(s) was
1142
+ submitted. If You institute patent litigation against any entity (including a
1143
+ cross-claim or counterclaim in a lawsuit) alleging that the Work or a
1144
+ Contribution incorporated within the Work constitutes direct or contributory
1145
+ patent infringement, then any patent licenses granted to You under this License
1146
+ for that Work shall terminate as of the date such litigation is filed.
1147
+
1148
+ 4. Redistribution.
1149
+
1150
+ You may reproduce and distribute copies of the Work or Derivative Works thereof
1151
+ in any medium, with or without modifications, and in Source or Object form,
1152
+ provided that You meet the following conditions:
1153
+
1154
+ You must give any other recipients of the Work or Derivative Works a copy of
1155
+ this License; and
1156
+ You must cause any modified files to carry prominent notices stating that You
1157
+ changed the files; and
1158
+ You must retain, in the Source form of any Derivative Works that You distribute,
1159
+ all copyright, patent, trademark, and attribution notices from the Source form
1160
+ of the Work, excluding those notices that do not pertain to any part of the
1161
+ Derivative Works; and
1162
+ If the Work includes a "NOTICE" text file as part of its distribution, then any
1163
+ Derivative Works that You distribute must include a readable copy of the
1164
+ attribution notices contained within such NOTICE file, excluding those notices
1165
+ that do not pertain to any part of the Derivative Works, in at least one of the
1166
+ following places: within a NOTICE text file distributed as part of the
1167
+ Derivative Works; within the Source form or documentation, if provided along
1168
+ with the Derivative Works; or, within a display generated by the Derivative
1169
+ Works, if and wherever such third-party notices normally appear. The contents of
1170
+ the NOTICE file are for informational purposes only and do not modify the
1171
+ License. You may add Your own attribution notices within Derivative Works that
1172
+ You distribute, alongside or as an addendum to the NOTICE text from the Work,
1173
+ provided that such additional attribution notices cannot be construed as
1174
+ modifying the License.
1175
+ You may add Your own copyright statement to Your modifications and may provide
1176
+ additional or different license terms and conditions for use, reproduction, or
1177
+ distribution of Your modifications, or for any such Derivative Works as a whole,
1178
+ provided Your use, reproduction, and distribution of the Work otherwise complies
1179
+ with the conditions stated in this License.
1180
+
1181
+ 5. Submission of Contributions.
1182
+
1183
+ Unless You explicitly state otherwise, any Contribution intentionally submitted
1184
+ for inclusion in the Work by You to the Licensor shall be under the terms and
1185
+ conditions of this License, without any additional terms or conditions.
1186
+ Notwithstanding the above, nothing herein shall supersede or modify the terms of
1187
+ any separate license agreement you may have executed with Licensor regarding
1188
+ such Contributions.
1189
+
1190
+ 6. Trademarks.
1191
+
1192
+ This License does not grant permission to use the trade names, trademarks,
1193
+ service marks, or product names of the Licensor, except as required for
1194
+ reasonable and customary use in describing the origin of the Work and
1195
+ reproducing the content of the NOTICE file.
1196
+
1197
+ 7. Disclaimer of Warranty.
1198
+
1199
+ Unless required by applicable law or agreed to in writing, Licensor provides the
1200
+ Work (and each Contributor provides its Contributions) on an "AS IS" BASIS,
1201
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied,
1202
+ including, without limitation, any warranties or conditions of TITLE,
1203
+ NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A PARTICULAR PURPOSE. You are
1204
+ solely responsible for determining the appropriateness of using or
1205
+ redistributing the Work and assume any risks associated with Your exercise of
1206
+ permissions under this License.
1207
+
1208
+ 8. Limitation of Liability.
1209
+
1210
+ In no event and under no legal theory, whether in tort (including negligence),
1211
+ contract, or otherwise, unless required by applicable law (such as deliberate
1212
+ and grossly negligent acts) or agreed to in writing, shall any Contributor be
1213
+ liable to You for damages, including any direct, indirect, special, incidental,
1214
+ or consequential damages of any character arising as a result of this License or
1215
+ out of the use or inability to use the Work (including but not limited to
1216
+ damages for loss of goodwill, work stoppage, computer failure or malfunction, or
1217
+ any and all other commercial damages or losses), even if such Contributor has
1218
+ been advised of the possibility of such damages.
1219
+
1220
+ 9. Accepting Warranty or Additional Liability.
1221
+
1222
+ While redistributing the Work or Derivative Works thereof, You may choose to
1223
+ offer, and charge a fee for, acceptance of support, warranty, indemnity, or
1224
+ other liability obligations and/or rights consistent with this License. However,
1225
+ in accepting such obligations, You may act only on Your own behalf and on Your
1226
+ sole responsibility, not on behalf of any other Contributor, and only if You
1227
+ agree to indemnify, defend, and hold each Contributor harmless for any liability
1228
+ incurred by, or claims asserted against, such Contributor by reason of your
1229
+ accepting any such warranty or additional liability.
1230
+
1231
+ END OF TERMS AND CONDITIONS
1232
+
1233
+ APPENDIX: How to apply the Apache License to your work
1234
+
1235
+ To apply the Apache License to your work, attach the following boilerplate
1236
+ notice, with the fields enclosed by brackets "[]" replaced with your own
1237
+ identifying information. (Don't include the brackets!) The text should be
1238
+ enclosed in the appropriate comment syntax for the file format. We also
1239
+ recommend that a file or class name and description of purpose be included on
1240
+ the same "printed page" as the copyright notice for easier identification within
1241
+ third-party archives.
1242
+
1243
+ Copyright [yyyy] [name of copyright owner]
1244
+
1245
+ Licensed under the Apache License, Version 2.0 (the "License");
1246
+ you may not use this file except in compliance with the License.
1247
+ You may obtain a copy of the License at
1248
+
1249
+ http://www.apache.org/licenses/LICENSE-2.0
1250
+
1251
+ Unless required by applicable law or agreed to in writing, software
1252
+ distributed under the License is distributed on an "AS IS" BASIS,
1253
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1254
+ See the License for the specific language governing permissions and
1255
+ limitations under the License.
1256
+ Classifier: Development Status :: 5 - Production/Stable
1257
+ Classifier: Environment :: Console
1258
+ Classifier: Intended Audience :: Science/Research
1259
+ Classifier: License :: OSI Approved :: BSD License
1260
+ Classifier: Operating System :: OS Independent
1261
+ Classifier: Programming Language :: Cython
1262
+ Classifier: Programming Language :: Python
1263
+ Classifier: Programming Language :: Python :: 3
1264
+ Classifier: Programming Language :: Python :: 3 :: Only
1265
+ Classifier: Programming Language :: Python :: 3.9
1266
+ Classifier: Programming Language :: Python :: 3.10
1267
+ Classifier: Programming Language :: Python :: 3.11
1268
+ Classifier: Programming Language :: Python :: 3.12
1269
+ Classifier: Programming Language :: Python :: 3.13
1270
+ Classifier: Programming Language :: Python :: 3.14
1271
+ Classifier: Topic :: Scientific/Engineering
1272
+ Project-URL: homepage, https://pandas.pydata.org
1273
+ Project-URL: documentation, https://pandas.pydata.org/docs/
1274
+ Project-URL: repository, https://github.com/pandas-dev/pandas
1275
+ Requires-Python: >=3.9
1276
+ Requires-Dist: numpy>=1.22.4; python_version < "3.11"
1277
+ Requires-Dist: numpy>=1.23.2; python_version == "3.11"
1278
+ Requires-Dist: numpy>=1.26.0; python_version >= "3.12"
1279
+ Requires-Dist: python-dateutil>=2.8.2
1280
+ Requires-Dist: pytz>=2020.1
1281
+ Requires-Dist: tzdata>=2022.7
1282
+ Provides-Extra: test
1283
+ Requires-Dist: hypothesis>=6.46.1; extra == "test"
1284
+ Requires-Dist: pytest>=7.3.2; extra == "test"
1285
+ Requires-Dist: pytest-xdist>=2.2.0; extra == "test"
1286
+ Provides-Extra: pyarrow
1287
+ Requires-Dist: pyarrow>=10.0.1; extra == "pyarrow"
1288
+ Provides-Extra: performance
1289
+ Requires-Dist: bottleneck>=1.3.6; extra == "performance"
1290
+ Requires-Dist: numba>=0.56.4; extra == "performance"
1291
+ Requires-Dist: numexpr>=2.8.4; extra == "performance"
1292
+ Provides-Extra: computation
1293
+ Requires-Dist: scipy>=1.10.0; extra == "computation"
1294
+ Requires-Dist: xarray>=2022.12.0; extra == "computation"
1295
+ Provides-Extra: fss
1296
+ Requires-Dist: fsspec>=2022.11.0; extra == "fss"
1297
+ Provides-Extra: aws
1298
+ Requires-Dist: s3fs>=2022.11.0; extra == "aws"
1299
+ Provides-Extra: gcp
1300
+ Requires-Dist: gcsfs>=2022.11.0; extra == "gcp"
1301
+ Requires-Dist: pandas-gbq>=0.19.0; extra == "gcp"
1302
+ Provides-Extra: excel
1303
+ Requires-Dist: odfpy>=1.4.1; extra == "excel"
1304
+ Requires-Dist: openpyxl>=3.1.0; extra == "excel"
1305
+ Requires-Dist: python-calamine>=0.1.7; extra == "excel"
1306
+ Requires-Dist: pyxlsb>=1.0.10; extra == "excel"
1307
+ Requires-Dist: xlrd>=2.0.1; extra == "excel"
1308
+ Requires-Dist: xlsxwriter>=3.0.5; extra == "excel"
1309
+ Provides-Extra: parquet
1310
+ Requires-Dist: pyarrow>=10.0.1; extra == "parquet"
1311
+ Provides-Extra: feather
1312
+ Requires-Dist: pyarrow>=10.0.1; extra == "feather"
1313
+ Provides-Extra: hdf5
1314
+ Requires-Dist: tables>=3.8.0; extra == "hdf5"
1315
+ Provides-Extra: spss
1316
+ Requires-Dist: pyreadstat>=1.2.0; extra == "spss"
1317
+ Provides-Extra: postgresql
1318
+ Requires-Dist: SQLAlchemy>=2.0.0; extra == "postgresql"
1319
+ Requires-Dist: psycopg2>=2.9.6; extra == "postgresql"
1320
+ Requires-Dist: adbc-driver-postgresql>=0.8.0; extra == "postgresql"
1321
+ Provides-Extra: mysql
1322
+ Requires-Dist: SQLAlchemy>=2.0.0; extra == "mysql"
1323
+ Requires-Dist: pymysql>=1.0.2; extra == "mysql"
1324
+ Provides-Extra: sql-other
1325
+ Requires-Dist: SQLAlchemy>=2.0.0; extra == "sql-other"
1326
+ Requires-Dist: adbc-driver-postgresql>=0.8.0; extra == "sql-other"
1327
+ Requires-Dist: adbc-driver-sqlite>=0.8.0; extra == "sql-other"
1328
+ Provides-Extra: html
1329
+ Requires-Dist: beautifulsoup4>=4.11.2; extra == "html"
1330
+ Requires-Dist: html5lib>=1.1; extra == "html"
1331
+ Requires-Dist: lxml>=4.9.2; extra == "html"
1332
+ Provides-Extra: xml
1333
+ Requires-Dist: lxml>=4.9.2; extra == "xml"
1334
+ Provides-Extra: plot
1335
+ Requires-Dist: matplotlib>=3.6.3; extra == "plot"
1336
+ Provides-Extra: output-formatting
1337
+ Requires-Dist: jinja2>=3.1.2; extra == "output-formatting"
1338
+ Requires-Dist: tabulate>=0.9.0; extra == "output-formatting"
1339
+ Provides-Extra: clipboard
1340
+ Requires-Dist: PyQt5>=5.15.9; extra == "clipboard"
1341
+ Requires-Dist: qtpy>=2.3.0; extra == "clipboard"
1342
+ Provides-Extra: compression
1343
+ Requires-Dist: zstandard>=0.19.0; extra == "compression"
1344
+ Provides-Extra: consortium-standard
1345
+ Requires-Dist: dataframe-api-compat>=0.1.7; extra == "consortium-standard"
1346
+ Provides-Extra: all
1347
+ Requires-Dist: adbc-driver-postgresql>=0.8.0; extra == "all"
1348
+ Requires-Dist: adbc-driver-sqlite>=0.8.0; extra == "all"
1349
+ Requires-Dist: beautifulsoup4>=4.11.2; extra == "all"
1350
+ Requires-Dist: bottleneck>=1.3.6; extra == "all"
1351
+ Requires-Dist: dataframe-api-compat>=0.1.7; extra == "all"
1352
+ Requires-Dist: fastparquet>=2022.12.0; extra == "all"
1353
+ Requires-Dist: fsspec>=2022.11.0; extra == "all"
1354
+ Requires-Dist: gcsfs>=2022.11.0; extra == "all"
1355
+ Requires-Dist: html5lib>=1.1; extra == "all"
1356
+ Requires-Dist: hypothesis>=6.46.1; extra == "all"
1357
+ Requires-Dist: jinja2>=3.1.2; extra == "all"
1358
+ Requires-Dist: lxml>=4.9.2; extra == "all"
1359
+ Requires-Dist: matplotlib>=3.6.3; extra == "all"
1360
+ Requires-Dist: numba>=0.56.4; extra == "all"
1361
+ Requires-Dist: numexpr>=2.8.4; extra == "all"
1362
+ Requires-Dist: odfpy>=1.4.1; extra == "all"
1363
+ Requires-Dist: openpyxl>=3.1.0; extra == "all"
1364
+ Requires-Dist: pandas-gbq>=0.19.0; extra == "all"
1365
+ Requires-Dist: psycopg2>=2.9.6; extra == "all"
1366
+ Requires-Dist: pyarrow>=10.0.1; extra == "all"
1367
+ Requires-Dist: pymysql>=1.0.2; extra == "all"
1368
+ Requires-Dist: PyQt5>=5.15.9; extra == "all"
1369
+ Requires-Dist: pyreadstat>=1.2.0; extra == "all"
1370
+ Requires-Dist: pytest>=7.3.2; extra == "all"
1371
+ Requires-Dist: pytest-xdist>=2.2.0; extra == "all"
1372
+ Requires-Dist: python-calamine>=0.1.7; extra == "all"
1373
+ Requires-Dist: pyxlsb>=1.0.10; extra == "all"
1374
+ Requires-Dist: qtpy>=2.3.0; extra == "all"
1375
+ Requires-Dist: scipy>=1.10.0; extra == "all"
1376
+ Requires-Dist: s3fs>=2022.11.0; extra == "all"
1377
+ Requires-Dist: SQLAlchemy>=2.0.0; extra == "all"
1378
+ Requires-Dist: tables>=3.8.0; extra == "all"
1379
+ Requires-Dist: tabulate>=0.9.0; extra == "all"
1380
+ Requires-Dist: xarray>=2022.12.0; extra == "all"
1381
+ Requires-Dist: xlrd>=2.0.1; extra == "all"
1382
+ Requires-Dist: xlsxwriter>=3.0.5; extra == "all"
1383
+ Requires-Dist: zstandard>=0.19.0; extra == "all"
1384
+ Description-Content-Type: text/markdown
1385
+
1386
+ <div align="center">
1387
+ <img src="https://pandas.pydata.org/static/img/pandas.svg"><br>
1388
+ </div>
1389
+
1390
+ -----------------
1391
+
1392
+ # pandas: powerful Python data analysis toolkit
1393
+
1394
+ | | |
1395
+ | --- | --- |
1396
+ | Testing | [![CI - Test](https://github.com/pandas-dev/pandas/actions/workflows/unit-tests.yml/badge.svg)](https://github.com/pandas-dev/pandas/actions/workflows/unit-tests.yml) [![Coverage](https://codecov.io/github/pandas-dev/pandas/coverage.svg?branch=main)](https://codecov.io/gh/pandas-dev/pandas) |
1397
+ | Package | [![PyPI Latest Release](https://img.shields.io/pypi/v/pandas.svg)](https://pypi.org/project/pandas/) [![PyPI Downloads](https://img.shields.io/pypi/dm/pandas.svg?label=PyPI%20downloads)](https://pypi.org/project/pandas/) [![Conda Latest Release](https://anaconda.org/conda-forge/pandas/badges/version.svg)](https://anaconda.org/conda-forge/pandas) [![Conda Downloads](https://img.shields.io/conda/dn/conda-forge/pandas.svg?label=Conda%20downloads)](https://anaconda.org/conda-forge/pandas) |
1398
+ | Meta | [![Powered by NumFOCUS](https://img.shields.io/badge/powered%20by-NumFOCUS-orange.svg?style=flat&colorA=E1523D&colorB=007D8A)](https://numfocus.org) [![DOI](https://zenodo.org/badge/DOI/10.5281/zenodo.3509134.svg)](https://doi.org/10.5281/zenodo.3509134) [![License - BSD 3-Clause](https://img.shields.io/pypi/l/pandas.svg)](https://github.com/pandas-dev/pandas/blob/main/LICENSE) [![Slack](https://img.shields.io/badge/join_Slack-information-brightgreen.svg?logo=slack)](https://pandas.pydata.org/docs/dev/development/community.html?highlight=slack#community-slack) |
1399
+
1400
+
1401
+ ## What is it?
1402
+
1403
+ **pandas** is a Python package that provides fast, flexible, and expressive data
1404
+ structures designed to make working with "relational" or "labeled" data both
1405
+ easy and intuitive. It aims to be the fundamental high-level building block for
1406
+ doing practical, **real world** data analysis in Python. Additionally, it has
1407
+ the broader goal of becoming **the most powerful and flexible open source data
1408
+ analysis / manipulation tool available in any language**. It is already well on
1409
+ its way towards this goal.
1410
+
1411
+ ## Table of Contents
1412
+
1413
+ - [Main Features](#main-features)
1414
+ - [Where to get it](#where-to-get-it)
1415
+ - [Dependencies](#dependencies)
1416
+ - [Installation from sources](#installation-from-sources)
1417
+ - [License](#license)
1418
+ - [Documentation](#documentation)
1419
+ - [Background](#background)
1420
+ - [Getting Help](#getting-help)
1421
+ - [Discussion and Development](#discussion-and-development)
1422
+ - [Contributing to pandas](#contributing-to-pandas)
1423
+
1424
+ ## Main Features
1425
+ Here are just a few of the things that pandas does well:
1426
+
1427
+ - Easy handling of [**missing data**][missing-data] (represented as
1428
+ `NaN`, `NA`, or `NaT`) in floating point as well as non-floating point data
1429
+ - Size mutability: columns can be [**inserted and
1430
+ deleted**][insertion-deletion] from DataFrame and higher dimensional
1431
+ objects
1432
+ - Automatic and explicit [**data alignment**][alignment]: objects can
1433
+ be explicitly aligned to a set of labels, or the user can simply
1434
+ ignore the labels and let `Series`, `DataFrame`, etc. automatically
1435
+ align the data for you in computations
1436
+ - Powerful, flexible [**group by**][groupby] functionality to perform
1437
+ split-apply-combine operations on data sets, for both aggregating
1438
+ and transforming data
1439
+ - Make it [**easy to convert**][conversion] ragged,
1440
+ differently-indexed data in other Python and NumPy data structures
1441
+ into DataFrame objects
1442
+ - Intelligent label-based [**slicing**][slicing], [**fancy
1443
+ indexing**][fancy-indexing], and [**subsetting**][subsetting] of
1444
+ large data sets
1445
+ - Intuitive [**merging**][merging] and [**joining**][joining] data
1446
+ sets
1447
+ - Flexible [**reshaping**][reshape] and [**pivoting**][pivot-table] of
1448
+ data sets
1449
+ - [**Hierarchical**][mi] labeling of axes (possible to have multiple
1450
+ labels per tick)
1451
+ - Robust IO tools for loading data from [**flat files**][flat-files]
1452
+ (CSV and delimited), [**Excel files**][excel], [**databases**][db],
1453
+ and saving/loading data from the ultrafast [**HDF5 format**][hdfstore]
1454
+ - [**Time series**][timeseries]-specific functionality: date range
1455
+ generation and frequency conversion, moving window statistics,
1456
+ date shifting and lagging
1457
+
1458
+
1459
+ [missing-data]: https://pandas.pydata.org/pandas-docs/stable/user_guide/missing_data.html
1460
+ [insertion-deletion]: https://pandas.pydata.org/pandas-docs/stable/user_guide/dsintro.html#column-selection-addition-deletion
1461
+ [alignment]: https://pandas.pydata.org/pandas-docs/stable/user_guide/dsintro.html?highlight=alignment#intro-to-data-structures
1462
+ [groupby]: https://pandas.pydata.org/pandas-docs/stable/user_guide/groupby.html#group-by-split-apply-combine
1463
+ [conversion]: https://pandas.pydata.org/pandas-docs/stable/user_guide/dsintro.html#dataframe
1464
+ [slicing]: https://pandas.pydata.org/pandas-docs/stable/user_guide/indexing.html#slicing-ranges
1465
+ [fancy-indexing]: https://pandas.pydata.org/pandas-docs/stable/user_guide/advanced.html#advanced
1466
+ [subsetting]: https://pandas.pydata.org/pandas-docs/stable/user_guide/indexing.html#boolean-indexing
1467
+ [merging]: https://pandas.pydata.org/pandas-docs/stable/user_guide/merging.html#database-style-dataframe-or-named-series-joining-merging
1468
+ [joining]: https://pandas.pydata.org/pandas-docs/stable/user_guide/merging.html#joining-on-index
1469
+ [reshape]: https://pandas.pydata.org/pandas-docs/stable/user_guide/reshaping.html
1470
+ [pivot-table]: https://pandas.pydata.org/pandas-docs/stable/user_guide/reshaping.html
1471
+ [mi]: https://pandas.pydata.org/pandas-docs/stable/user_guide/indexing.html#hierarchical-indexing-multiindex
1472
+ [flat-files]: https://pandas.pydata.org/pandas-docs/stable/user_guide/io.html#csv-text-files
1473
+ [excel]: https://pandas.pydata.org/pandas-docs/stable/user_guide/io.html#excel-files
1474
+ [db]: https://pandas.pydata.org/pandas-docs/stable/user_guide/io.html#sql-queries
1475
+ [hdfstore]: https://pandas.pydata.org/pandas-docs/stable/user_guide/io.html#hdf5-pytables
1476
+ [timeseries]: https://pandas.pydata.org/pandas-docs/stable/user_guide/timeseries.html#time-series-date-functionality
1477
+
1478
+ ## Where to get it
1479
+ The source code is currently hosted on GitHub at:
1480
+ https://github.com/pandas-dev/pandas
1481
+
1482
+ Binary installers for the latest released version are available at the [Python
1483
+ Package Index (PyPI)](https://pypi.org/project/pandas) and on [Conda](https://docs.conda.io/en/latest/).
1484
+
1485
+ ```sh
1486
+ # conda
1487
+ conda install -c conda-forge pandas
1488
+ ```
1489
+
1490
+ ```sh
1491
+ # or PyPI
1492
+ pip install pandas
1493
+ ```
1494
+
1495
+ The list of changes to pandas between each release can be found
1496
+ [here](https://pandas.pydata.org/pandas-docs/stable/whatsnew/index.html). For full
1497
+ details, see the commit logs at https://github.com/pandas-dev/pandas.
1498
+
1499
+ ## Dependencies
1500
+ - [NumPy - Adds support for large, multi-dimensional arrays, matrices and high-level mathematical functions to operate on these arrays](https://www.numpy.org)
1501
+ - [python-dateutil - Provides powerful extensions to the standard datetime module](https://dateutil.readthedocs.io/en/stable/index.html)
1502
+ - [pytz - Brings the Olson tz database into Python which allows accurate and cross platform timezone calculations](https://github.com/stub42/pytz)
1503
+
1504
+ See the [full installation instructions](https://pandas.pydata.org/pandas-docs/stable/install.html#dependencies) for minimum supported versions of required, recommended and optional dependencies.
1505
+
1506
+ ## Installation from sources
1507
+ To install pandas from source you need [Cython](https://cython.org/) in addition to the normal
1508
+ dependencies above. Cython can be installed from PyPI:
1509
+
1510
+ ```sh
1511
+ pip install cython
1512
+ ```
1513
+
1514
+ In the `pandas` directory (same one where you found this file after
1515
+ cloning the git repo), execute:
1516
+
1517
+ ```sh
1518
+ pip install .
1519
+ ```
1520
+
1521
+ or for installing in [development mode](https://pip.pypa.io/en/latest/cli/pip_install/#install-editable):
1522
+
1523
+
1524
+ ```sh
1525
+ python -m pip install -ve . --no-build-isolation --config-settings=editable-verbose=true
1526
+ ```
1527
+
1528
+ See the full instructions for [installing from source](https://pandas.pydata.org/docs/dev/development/contributing_environment.html).
1529
+
1530
+ ## License
1531
+ [BSD 3](LICENSE)
1532
+
1533
+ ## Documentation
1534
+ The official documentation is hosted on [PyData.org](https://pandas.pydata.org/pandas-docs/stable/).
1535
+
1536
+ ## Background
1537
+ Work on ``pandas`` started at [AQR](https://www.aqr.com/) (a quantitative hedge fund) in 2008 and
1538
+ has been under active development since then.
1539
+
1540
+ ## Getting Help
1541
+
1542
+ For usage questions, the best place to go to is [StackOverflow](https://stackoverflow.com/questions/tagged/pandas).
1543
+ Further, general questions and discussions can also take place on the [pydata mailing list](https://groups.google.com/forum/?fromgroups#!forum/pydata).
1544
+
1545
+ ## Discussion and Development
1546
+ Most development discussions take place on GitHub in this repo, via the [GitHub issue tracker](https://github.com/pandas-dev/pandas/issues).
1547
+
1548
+ Further, the [pandas-dev mailing list](https://mail.python.org/mailman/listinfo/pandas-dev) can also be used for specialized discussions or design issues, and a [Slack channel](https://pandas.pydata.org/docs/dev/development/community.html?highlight=slack#community-slack) is available for quick development related questions.
1549
+
1550
+ There are also frequent [community meetings](https://pandas.pydata.org/docs/dev/development/community.html#community-meeting) for project maintainers open to the community as well as monthly [new contributor meetings](https://pandas.pydata.org/docs/dev/development/community.html#new-contributor-meeting) to help support new contributors.
1551
+
1552
+ Additional information on the communication channels can be found on the [contributor community](https://pandas.pydata.org/docs/development/community.html) page.
1553
+
1554
+ ## Contributing to pandas
1555
+
1556
+ [![Open Source Helpers](https://www.codetriage.com/pandas-dev/pandas/badges/users.svg)](https://www.codetriage.com/pandas-dev/pandas)
1557
+
1558
+ All contributions, bug reports, bug fixes, documentation improvements, enhancements, and ideas are welcome.
1559
+
1560
+ A detailed overview on how to contribute can be found in the **[contributing guide](https://pandas.pydata.org/docs/dev/development/contributing.html)**.
1561
+
1562
+ If you are simply looking to start working with the pandas codebase, navigate to the [GitHub "issues" tab](https://github.com/pandas-dev/pandas/issues) and start looking through interesting issues. There are a number of issues listed under [Docs](https://github.com/pandas-dev/pandas/issues?labels=Docs&sort=updated&state=open) and [good first issue](https://github.com/pandas-dev/pandas/issues?labels=good+first+issue&sort=updated&state=open) where you could start out.
1563
+
1564
+ You can also triage issues which may include reproducing bug reports, or asking for vital information such as version numbers or reproduction instructions. If you would like to start triaging issues, one easy way to get started is to [subscribe to pandas on CodeTriage](https://www.codetriage.com/pandas-dev/pandas).
1565
+
1566
+ Or maybe through using pandas you have an idea of your own or are looking for something in the documentation and thinking ‘this can be improved’...you can do something about it!
1567
+
1568
+ Feel free to ask questions on the [mailing list](https://groups.google.com/forum/?fromgroups#!forum/pydata) or on [Slack](https://pandas.pydata.org/docs/dev/development/community.html?highlight=slack#community-slack).
1569
+
1570
+ As contributors and maintainers to this project, you are expected to abide by pandas' code of conduct. More information can be found at: [Contributor Code of Conduct](https://github.com/pandas-dev/.github/blob/master/CODE_OF_CONDUCT.md)
1571
+
1572
+ <hr>
1573
+
1574
+ [Go to Top](#table-of-contents)
.venv_haddock/lib/python3.12/site-packages/pandas-2.3.3.dist-info/RECORD ADDED
The diff for this file is too large to render. See raw diff
 
.venv_haddock/lib/python3.12/site-packages/pandas-2.3.3.dist-info/WHEEL ADDED
@@ -0,0 +1,6 @@
 
 
 
 
 
 
 
1
+ Wheel-Version: 1.0
2
+ Generator: meson
3
+ Root-Is-Purelib: false
4
+ Tag: cp312-cp312-macosx_11_0_arm64
5
+ Generator: delocate 0.13.0
6
+
.venv_haddock/lib/python3.12/site-packages/pandas-2.3.3.dist-info/entry_points.txt ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ [pandas_plotting_backends]
2
+ matplotlib = pandas:plotting._matplotlib
3
+
.venv_haddock/lib/python3.12/site-packages/pandas/tests/io/parser/test_quoting.py ADDED
@@ -0,0 +1,199 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ """
2
+ Tests that quoting specifications are properly handled
3
+ during parsing for all of the parsers defined in parsers.py
4
+ """
5
+
6
+ import csv
7
+ from io import StringIO
8
+
9
+ import pytest
10
+
11
+ from pandas.compat import (
12
+ PY311,
13
+ PY314,
14
+ )
15
+ from pandas.errors import ParserError
16
+
17
+ from pandas import DataFrame
18
+ import pandas._testing as tm
19
+
20
+ pytestmark = pytest.mark.filterwarnings(
21
+ "ignore:Passing a BlockManager to DataFrame:DeprecationWarning"
22
+ )
23
+ xfail_pyarrow = pytest.mark.usefixtures("pyarrow_xfail")
24
+ skip_pyarrow = pytest.mark.usefixtures("pyarrow_skip")
25
+
26
+
27
+ if PY314:
28
+ # TODO: write a regex that works with all new possitibilities here
29
+ MSG1 = ""
30
+ MSG2 = r"[\s\S]*"
31
+ else:
32
+ MSG1 = "a(n)? 1-character string"
33
+ MSG2 = "string( or None)?"
34
+
35
+
36
+ @pytest.mark.parametrize(
37
+ "kwargs,msg",
38
+ [
39
+ ({"quotechar": "foo"}, f'"quotechar" must be {MSG1}'),
40
+ (
41
+ {"quotechar": None, "quoting": csv.QUOTE_MINIMAL},
42
+ "quotechar must be set if quoting enabled",
43
+ ),
44
+ ({"quotechar": 2}, f'"quotechar" must be {MSG2}, not int'),
45
+ ],
46
+ )
47
+ @skip_pyarrow # ParserError: CSV parse error: Empty CSV file or block
48
+ def test_bad_quote_char(all_parsers, kwargs, msg):
49
+ data = "1,2,3"
50
+ parser = all_parsers
51
+
52
+ with pytest.raises(TypeError, match=msg):
53
+ parser.read_csv(StringIO(data), **kwargs)
54
+
55
+
56
+ @pytest.mark.parametrize(
57
+ "quoting,msg",
58
+ [
59
+ ("foo", '"quoting" must be an integer|Argument'),
60
+ (10, 'bad "quoting" value'), # quoting must be in the range [0, 3]
61
+ ],
62
+ )
63
+ @xfail_pyarrow # ValueError: The 'quoting' option is not supported
64
+ def test_bad_quoting(all_parsers, quoting, msg):
65
+ data = "1,2,3"
66
+ parser = all_parsers
67
+
68
+ with pytest.raises(TypeError, match=msg):
69
+ parser.read_csv(StringIO(data), quoting=quoting)
70
+
71
+
72
+ def test_quote_char_basic(all_parsers):
73
+ parser = all_parsers
74
+ data = 'a,b,c\n1,2,"cat"'
75
+ expected = DataFrame([[1, 2, "cat"]], columns=["a", "b", "c"])
76
+
77
+ result = parser.read_csv(StringIO(data), quotechar='"')
78
+ tm.assert_frame_equal(result, expected)
79
+
80
+
81
+ @pytest.mark.parametrize("quote_char", ["~", "*", "%", "$", "@", "P"])
82
+ def test_quote_char_various(all_parsers, quote_char):
83
+ parser = all_parsers
84
+ expected = DataFrame([[1, 2, "cat"]], columns=["a", "b", "c"])
85
+
86
+ data = 'a,b,c\n1,2,"cat"'
87
+ new_data = data.replace('"', quote_char)
88
+
89
+ result = parser.read_csv(StringIO(new_data), quotechar=quote_char)
90
+ tm.assert_frame_equal(result, expected)
91
+
92
+
93
+ @xfail_pyarrow # ValueError: The 'quoting' option is not supported
94
+ @pytest.mark.parametrize("quoting", [csv.QUOTE_MINIMAL, csv.QUOTE_NONE])
95
+ @pytest.mark.parametrize("quote_char", ["", None])
96
+ def test_null_quote_char(all_parsers, quoting, quote_char):
97
+ kwargs = {"quotechar": quote_char, "quoting": quoting}
98
+ data = "a,b,c\n1,2,3"
99
+ parser = all_parsers
100
+
101
+ if quoting != csv.QUOTE_NONE:
102
+ # Sanity checking.
103
+ if not PY314:
104
+ msg = "1-character string"
105
+ else:
106
+ msg = "unicode character or None"
107
+ msg = (
108
+ f'"quotechar" must be a {msg}'
109
+ if PY311 and all_parsers.engine == "python" and quote_char == ""
110
+ else "quotechar must be set if quoting enabled"
111
+ )
112
+
113
+ with pytest.raises(TypeError, match=msg):
114
+ parser.read_csv(StringIO(data), **kwargs)
115
+ elif not (PY311 and all_parsers.engine == "python"):
116
+ # Python 3.11+ doesn't support null/blank quote chars in their csv parsers
117
+ expected = DataFrame([[1, 2, 3]], columns=["a", "b", "c"])
118
+ result = parser.read_csv(StringIO(data), **kwargs)
119
+ tm.assert_frame_equal(result, expected)
120
+
121
+
122
+ @pytest.mark.parametrize(
123
+ "kwargs,exp_data",
124
+ [
125
+ ({}, [[1, 2, "foo"]]), # Test default.
126
+ # QUOTE_MINIMAL only applies to CSV writing, so no effect on reading.
127
+ ({"quotechar": '"', "quoting": csv.QUOTE_MINIMAL}, [[1, 2, "foo"]]),
128
+ # QUOTE_MINIMAL only applies to CSV writing, so no effect on reading.
129
+ ({"quotechar": '"', "quoting": csv.QUOTE_ALL}, [[1, 2, "foo"]]),
130
+ # QUOTE_NONE tells the reader to do no special handling
131
+ # of quote characters and leave them alone.
132
+ ({"quotechar": '"', "quoting": csv.QUOTE_NONE}, [[1, 2, '"foo"']]),
133
+ # QUOTE_NONNUMERIC tells the reader to cast
134
+ # all non-quoted fields to float
135
+ ({"quotechar": '"', "quoting": csv.QUOTE_NONNUMERIC}, [[1.0, 2.0, "foo"]]),
136
+ ],
137
+ )
138
+ @xfail_pyarrow # ValueError: The 'quoting' option is not supported
139
+ def test_quoting_various(all_parsers, kwargs, exp_data):
140
+ data = '1,2,"foo"'
141
+ parser = all_parsers
142
+ columns = ["a", "b", "c"]
143
+
144
+ result = parser.read_csv(StringIO(data), names=columns, **kwargs)
145
+ expected = DataFrame(exp_data, columns=columns)
146
+ tm.assert_frame_equal(result, expected)
147
+
148
+
149
+ @pytest.mark.parametrize(
150
+ "doublequote,exp_data", [(True, [[3, '4 " 5']]), (False, [[3, '4 " 5"']])]
151
+ )
152
+ def test_double_quote(all_parsers, doublequote, exp_data, request):
153
+ parser = all_parsers
154
+ data = 'a,b\n3,"4 "" 5"'
155
+
156
+ if parser.engine == "pyarrow" and not doublequote:
157
+ mark = pytest.mark.xfail(reason="Mismatched result")
158
+ request.applymarker(mark)
159
+
160
+ result = parser.read_csv(StringIO(data), quotechar='"', doublequote=doublequote)
161
+ expected = DataFrame(exp_data, columns=["a", "b"])
162
+ tm.assert_frame_equal(result, expected)
163
+
164
+
165
+ @pytest.mark.parametrize("quotechar", ['"', "\u0001"])
166
+ def test_quotechar_unicode(all_parsers, quotechar):
167
+ # see gh-14477
168
+ data = "a\n1"
169
+ parser = all_parsers
170
+ expected = DataFrame({"a": [1]})
171
+
172
+ result = parser.read_csv(StringIO(data), quotechar=quotechar)
173
+ tm.assert_frame_equal(result, expected)
174
+
175
+
176
+ @pytest.mark.parametrize("balanced", [True, False])
177
+ def test_unbalanced_quoting(all_parsers, balanced, request):
178
+ # see gh-22789.
179
+ parser = all_parsers
180
+ data = 'a,b,c\n1,2,"3'
181
+
182
+ if parser.engine == "pyarrow" and not balanced:
183
+ mark = pytest.mark.xfail(reason="Mismatched result")
184
+ request.applymarker(mark)
185
+
186
+ if balanced:
187
+ # Re-balance the quoting and read in without errors.
188
+ expected = DataFrame([[1, 2, 3]], columns=["a", "b", "c"])
189
+ result = parser.read_csv(StringIO(data + '"'))
190
+ tm.assert_frame_equal(result, expected)
191
+ else:
192
+ msg = (
193
+ "EOF inside string starting at row 1"
194
+ if parser.engine == "c"
195
+ else "unexpected end of data"
196
+ )
197
+
198
+ with pytest.raises(ParserError, match=msg):
199
+ parser.read_csv(StringIO(data))
.venv_haddock/lib/python3.12/site-packages/pandas/tests/io/parser/test_read_fwf.py ADDED
@@ -0,0 +1,1034 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ """
2
+ Tests the 'read_fwf' function in parsers.py. This
3
+ test suite is independent of the others because the
4
+ engine is set to 'python-fwf' internally.
5
+ """
6
+
7
+ from datetime import datetime
8
+ from io import (
9
+ BytesIO,
10
+ StringIO,
11
+ )
12
+ from pathlib import Path
13
+
14
+ import numpy as np
15
+ import pytest
16
+
17
+ from pandas.errors import EmptyDataError
18
+
19
+ import pandas as pd
20
+ from pandas import (
21
+ DataFrame,
22
+ DatetimeIndex,
23
+ )
24
+ import pandas._testing as tm
25
+
26
+ from pandas.io.common import urlopen
27
+ from pandas.io.parsers import (
28
+ read_csv,
29
+ read_fwf,
30
+ )
31
+
32
+
33
+ def test_basic():
34
+ data = """\
35
+ A B C D
36
+ 201158 360.242940 149.910199 11950.7
37
+ 201159 444.953632 166.985655 11788.4
38
+ 201160 364.136849 183.628767 11806.2
39
+ 201161 413.836124 184.375703 11916.8
40
+ 201162 502.953953 173.237159 12468.3
41
+ """
42
+ result = read_fwf(StringIO(data))
43
+ expected = DataFrame(
44
+ [
45
+ [201158, 360.242940, 149.910199, 11950.7],
46
+ [201159, 444.953632, 166.985655, 11788.4],
47
+ [201160, 364.136849, 183.628767, 11806.2],
48
+ [201161, 413.836124, 184.375703, 11916.8],
49
+ [201162, 502.953953, 173.237159, 12468.3],
50
+ ],
51
+ columns=["A", "B", "C", "D"],
52
+ )
53
+ tm.assert_frame_equal(result, expected)
54
+
55
+
56
+ def test_colspecs():
57
+ data = """\
58
+ A B C D E
59
+ 201158 360.242940 149.910199 11950.7
60
+ 201159 444.953632 166.985655 11788.4
61
+ 201160 364.136849 183.628767 11806.2
62
+ 201161 413.836124 184.375703 11916.8
63
+ 201162 502.953953 173.237159 12468.3
64
+ """
65
+ colspecs = [(0, 4), (4, 8), (8, 20), (21, 33), (34, 43)]
66
+ result = read_fwf(StringIO(data), colspecs=colspecs)
67
+
68
+ expected = DataFrame(
69
+ [
70
+ [2011, 58, 360.242940, 149.910199, 11950.7],
71
+ [2011, 59, 444.953632, 166.985655, 11788.4],
72
+ [2011, 60, 364.136849, 183.628767, 11806.2],
73
+ [2011, 61, 413.836124, 184.375703, 11916.8],
74
+ [2011, 62, 502.953953, 173.237159, 12468.3],
75
+ ],
76
+ columns=["A", "B", "C", "D", "E"],
77
+ )
78
+ tm.assert_frame_equal(result, expected)
79
+
80
+
81
+ def test_widths():
82
+ data = """\
83
+ A B C D E
84
+ 2011 58 360.242940 149.910199 11950.7
85
+ 2011 59 444.953632 166.985655 11788.4
86
+ 2011 60 364.136849 183.628767 11806.2
87
+ 2011 61 413.836124 184.375703 11916.8
88
+ 2011 62 502.953953 173.237159 12468.3
89
+ """
90
+ result = read_fwf(StringIO(data), widths=[5, 5, 13, 13, 7])
91
+
92
+ expected = DataFrame(
93
+ [
94
+ [2011, 58, 360.242940, 149.910199, 11950.7],
95
+ [2011, 59, 444.953632, 166.985655, 11788.4],
96
+ [2011, 60, 364.136849, 183.628767, 11806.2],
97
+ [2011, 61, 413.836124, 184.375703, 11916.8],
98
+ [2011, 62, 502.953953, 173.237159, 12468.3],
99
+ ],
100
+ columns=["A", "B", "C", "D", "E"],
101
+ )
102
+ tm.assert_frame_equal(result, expected)
103
+
104
+
105
+ def test_non_space_filler():
106
+ # From Thomas Kluyver:
107
+ #
108
+ # Apparently, some non-space filler characters can be seen, this is
109
+ # supported by specifying the 'delimiter' character:
110
+ #
111
+ # http://publib.boulder.ibm.com/infocenter/dmndhelp/v6r1mx/index.jsp?topic=/com.ibm.wbit.612.help.config.doc/topics/rfixwidth.html
112
+ data = """\
113
+ A~~~~B~~~~C~~~~~~~~~~~~D~~~~~~~~~~~~E
114
+ 201158~~~~360.242940~~~149.910199~~~11950.7
115
+ 201159~~~~444.953632~~~166.985655~~~11788.4
116
+ 201160~~~~364.136849~~~183.628767~~~11806.2
117
+ 201161~~~~413.836124~~~184.375703~~~11916.8
118
+ 201162~~~~502.953953~~~173.237159~~~12468.3
119
+ """
120
+ colspecs = [(0, 4), (4, 8), (8, 20), (21, 33), (34, 43)]
121
+ result = read_fwf(StringIO(data), colspecs=colspecs, delimiter="~")
122
+
123
+ expected = DataFrame(
124
+ [
125
+ [2011, 58, 360.242940, 149.910199, 11950.7],
126
+ [2011, 59, 444.953632, 166.985655, 11788.4],
127
+ [2011, 60, 364.136849, 183.628767, 11806.2],
128
+ [2011, 61, 413.836124, 184.375703, 11916.8],
129
+ [2011, 62, 502.953953, 173.237159, 12468.3],
130
+ ],
131
+ columns=["A", "B", "C", "D", "E"],
132
+ )
133
+ tm.assert_frame_equal(result, expected)
134
+
135
+
136
+ def test_over_specified():
137
+ data = """\
138
+ A B C D E
139
+ 201158 360.242940 149.910199 11950.7
140
+ 201159 444.953632 166.985655 11788.4
141
+ 201160 364.136849 183.628767 11806.2
142
+ 201161 413.836124 184.375703 11916.8
143
+ 201162 502.953953 173.237159 12468.3
144
+ """
145
+ colspecs = [(0, 4), (4, 8), (8, 20), (21, 33), (34, 43)]
146
+
147
+ with pytest.raises(ValueError, match="must specify only one of"):
148
+ read_fwf(StringIO(data), colspecs=colspecs, widths=[6, 10, 10, 7])
149
+
150
+
151
+ def test_under_specified():
152
+ data = """\
153
+ A B C D E
154
+ 201158 360.242940 149.910199 11950.7
155
+ 201159 444.953632 166.985655 11788.4
156
+ 201160 364.136849 183.628767 11806.2
157
+ 201161 413.836124 184.375703 11916.8
158
+ 201162 502.953953 173.237159 12468.3
159
+ """
160
+ with pytest.raises(ValueError, match="Must specify either"):
161
+ read_fwf(StringIO(data), colspecs=None, widths=None)
162
+
163
+
164
+ def test_read_csv_compat():
165
+ csv_data = """\
166
+ A,B,C,D,E
167
+ 2011,58,360.242940,149.910199,11950.7
168
+ 2011,59,444.953632,166.985655,11788.4
169
+ 2011,60,364.136849,183.628767,11806.2
170
+ 2011,61,413.836124,184.375703,11916.8
171
+ 2011,62,502.953953,173.237159,12468.3
172
+ """
173
+ expected = read_csv(StringIO(csv_data), engine="python")
174
+
175
+ fwf_data = """\
176
+ A B C D E
177
+ 201158 360.242940 149.910199 11950.7
178
+ 201159 444.953632 166.985655 11788.4
179
+ 201160 364.136849 183.628767 11806.2
180
+ 201161 413.836124 184.375703 11916.8
181
+ 201162 502.953953 173.237159 12468.3
182
+ """
183
+ colspecs = [(0, 4), (4, 8), (8, 20), (21, 33), (34, 43)]
184
+ result = read_fwf(StringIO(fwf_data), colspecs=colspecs)
185
+ tm.assert_frame_equal(result, expected)
186
+
187
+
188
+ def test_bytes_io_input():
189
+ data = BytesIO("שלום\nשלום".encode()) # noqa: RUF001
190
+ result = read_fwf(data, widths=[2, 2], encoding="utf8")
191
+ expected = DataFrame([["של", "ום"]], columns=["של", "ום"])
192
+ tm.assert_frame_equal(result, expected)
193
+
194
+
195
+ def test_fwf_colspecs_is_list_or_tuple():
196
+ data = """index,A,B,C,D
197
+ foo,2,3,4,5
198
+ bar,7,8,9,10
199
+ baz,12,13,14,15
200
+ qux,12,13,14,15
201
+ foo2,12,13,14,15
202
+ bar2,12,13,14,15
203
+ """
204
+
205
+ msg = "column specifications must be a list or tuple.+"
206
+
207
+ with pytest.raises(TypeError, match=msg):
208
+ read_fwf(StringIO(data), colspecs={"a": 1}, delimiter=",")
209
+
210
+
211
+ def test_fwf_colspecs_is_list_or_tuple_of_two_element_tuples():
212
+ data = """index,A,B,C,D
213
+ foo,2,3,4,5
214
+ bar,7,8,9,10
215
+ baz,12,13,14,15
216
+ qux,12,13,14,15
217
+ foo2,12,13,14,15
218
+ bar2,12,13,14,15
219
+ """
220
+
221
+ msg = "Each column specification must be.+"
222
+
223
+ with pytest.raises(TypeError, match=msg):
224
+ read_fwf(StringIO(data), colspecs=[("a", 1)])
225
+
226
+
227
+ @pytest.mark.parametrize(
228
+ "colspecs,exp_data",
229
+ [
230
+ ([(0, 3), (3, None)], [[123, 456], [456, 789]]),
231
+ ([(None, 3), (3, 6)], [[123, 456], [456, 789]]),
232
+ ([(0, None), (3, None)], [[123456, 456], [456789, 789]]),
233
+ ([(None, None), (3, 6)], [[123456, 456], [456789, 789]]),
234
+ ],
235
+ )
236
+ def test_fwf_colspecs_none(colspecs, exp_data):
237
+ # see gh-7079
238
+ data = """\
239
+ 123456
240
+ 456789
241
+ """
242
+ expected = DataFrame(exp_data)
243
+
244
+ result = read_fwf(StringIO(data), colspecs=colspecs, header=None)
245
+ tm.assert_frame_equal(result, expected)
246
+
247
+
248
+ @pytest.mark.parametrize(
249
+ "infer_nrows,exp_data",
250
+ [
251
+ # infer_nrows --> colspec == [(2, 3), (5, 6)]
252
+ (1, [[1, 2], [3, 8]]),
253
+ # infer_nrows > number of rows
254
+ (10, [[1, 2], [123, 98]]),
255
+ ],
256
+ )
257
+ def test_fwf_colspecs_infer_nrows(infer_nrows, exp_data):
258
+ # see gh-15138
259
+ data = """\
260
+ 1 2
261
+ 123 98
262
+ """
263
+ expected = DataFrame(exp_data)
264
+
265
+ result = read_fwf(StringIO(data), infer_nrows=infer_nrows, header=None)
266
+ tm.assert_frame_equal(result, expected)
267
+
268
+
269
+ def test_fwf_regression():
270
+ # see gh-3594
271
+ #
272
+ # Turns out "T060" is parsable as a datetime slice!
273
+ tz_list = [1, 10, 20, 30, 60, 80, 100]
274
+ widths = [16] + [8] * len(tz_list)
275
+ names = ["SST"] + [f"T{z:03d}" for z in tz_list[1:]]
276
+
277
+ data = """ 2009164202000 9.5403 9.4105 8.6571 7.8372 6.0612 5.8843 5.5192
278
+ 2009164203000 9.5435 9.2010 8.6167 7.8176 6.0804 5.8728 5.4869
279
+ 2009164204000 9.5873 9.1326 8.4694 7.5889 6.0422 5.8526 5.4657
280
+ 2009164205000 9.5810 9.0896 8.4009 7.4652 6.0322 5.8189 5.4379
281
+ 2009164210000 9.6034 9.0897 8.3822 7.4905 6.0908 5.7904 5.4039
282
+ """
283
+
284
+ with tm.assert_produces_warning(FutureWarning, match="use 'date_format' instead"):
285
+ result = read_fwf(
286
+ StringIO(data),
287
+ index_col=0,
288
+ header=None,
289
+ names=names,
290
+ widths=widths,
291
+ parse_dates=True,
292
+ date_parser=lambda s: datetime.strptime(s, "%Y%j%H%M%S"),
293
+ )
294
+ expected = DataFrame(
295
+ [
296
+ [9.5403, 9.4105, 8.6571, 7.8372, 6.0612, 5.8843, 5.5192],
297
+ [9.5435, 9.2010, 8.6167, 7.8176, 6.0804, 5.8728, 5.4869],
298
+ [9.5873, 9.1326, 8.4694, 7.5889, 6.0422, 5.8526, 5.4657],
299
+ [9.5810, 9.0896, 8.4009, 7.4652, 6.0322, 5.8189, 5.4379],
300
+ [9.6034, 9.0897, 8.3822, 7.4905, 6.0908, 5.7904, 5.4039],
301
+ ],
302
+ index=DatetimeIndex(
303
+ [
304
+ "2009-06-13 20:20:00",
305
+ "2009-06-13 20:30:00",
306
+ "2009-06-13 20:40:00",
307
+ "2009-06-13 20:50:00",
308
+ "2009-06-13 21:00:00",
309
+ ]
310
+ ),
311
+ columns=["SST", "T010", "T020", "T030", "T060", "T080", "T100"],
312
+ )
313
+ tm.assert_frame_equal(result, expected)
314
+ result = read_fwf(
315
+ StringIO(data),
316
+ index_col=0,
317
+ header=None,
318
+ names=names,
319
+ widths=widths,
320
+ parse_dates=True,
321
+ date_format="%Y%j%H%M%S",
322
+ )
323
+ tm.assert_frame_equal(result, expected)
324
+
325
+
326
+ def test_fwf_for_uint8():
327
+ data = """1421302965.213420 PRI=3 PGN=0xef00 DST=0x17 SRC=0x28 04 154 00 00 00 00 00 127
328
+ 1421302964.226776 PRI=6 PGN=0xf002 SRC=0x47 243 00 00 255 247 00 00 71""" # noqa: E501
329
+ df = read_fwf(
330
+ StringIO(data),
331
+ colspecs=[(0, 17), (25, 26), (33, 37), (49, 51), (58, 62), (63, 1000)],
332
+ names=["time", "pri", "pgn", "dst", "src", "data"],
333
+ converters={
334
+ "pgn": lambda x: int(x, 16),
335
+ "src": lambda x: int(x, 16),
336
+ "dst": lambda x: int(x, 16),
337
+ "data": lambda x: len(x.split(" ")),
338
+ },
339
+ )
340
+
341
+ expected = DataFrame(
342
+ [
343
+ [1421302965.213420, 3, 61184, 23, 40, 8],
344
+ [1421302964.226776, 6, 61442, None, 71, 8],
345
+ ],
346
+ columns=["time", "pri", "pgn", "dst", "src", "data"],
347
+ )
348
+ expected["dst"] = expected["dst"].astype(object)
349
+ tm.assert_frame_equal(df, expected)
350
+
351
+
352
+ @pytest.mark.parametrize("comment", ["#", "~", "!"])
353
+ def test_fwf_comment(comment):
354
+ data = """\
355
+ 1 2. 4 #hello world
356
+ 5 NaN 10.0
357
+ """
358
+ data = data.replace("#", comment)
359
+
360
+ colspecs = [(0, 3), (4, 9), (9, 25)]
361
+ expected = DataFrame([[1, 2.0, 4], [5, np.nan, 10.0]])
362
+
363
+ result = read_fwf(StringIO(data), colspecs=colspecs, header=None, comment=comment)
364
+ tm.assert_almost_equal(result, expected)
365
+
366
+
367
+ def test_fwf_skip_blank_lines():
368
+ data = """
369
+
370
+ A B C D
371
+
372
+ 201158 360.242940 149.910199 11950.7
373
+ 201159 444.953632 166.985655 11788.4
374
+
375
+
376
+ 201162 502.953953 173.237159 12468.3
377
+
378
+ """
379
+ result = read_fwf(StringIO(data), skip_blank_lines=True)
380
+ expected = DataFrame(
381
+ [
382
+ [201158, 360.242940, 149.910199, 11950.7],
383
+ [201159, 444.953632, 166.985655, 11788.4],
384
+ [201162, 502.953953, 173.237159, 12468.3],
385
+ ],
386
+ columns=["A", "B", "C", "D"],
387
+ )
388
+ tm.assert_frame_equal(result, expected)
389
+
390
+ data = """\
391
+ A B C D
392
+ 201158 360.242940 149.910199 11950.7
393
+ 201159 444.953632 166.985655 11788.4
394
+
395
+
396
+ 201162 502.953953 173.237159 12468.3
397
+ """
398
+ result = read_fwf(StringIO(data), skip_blank_lines=False)
399
+ expected = DataFrame(
400
+ [
401
+ [201158, 360.242940, 149.910199, 11950.7],
402
+ [201159, 444.953632, 166.985655, 11788.4],
403
+ [np.nan, np.nan, np.nan, np.nan],
404
+ [np.nan, np.nan, np.nan, np.nan],
405
+ [201162, 502.953953, 173.237159, 12468.3],
406
+ ],
407
+ columns=["A", "B", "C", "D"],
408
+ )
409
+ tm.assert_frame_equal(result, expected)
410
+
411
+
412
+ @pytest.mark.parametrize("thousands", [",", "#", "~"])
413
+ def test_fwf_thousands(thousands):
414
+ data = """\
415
+ 1 2,334.0 5
416
+ 10 13 10.
417
+ """
418
+ data = data.replace(",", thousands)
419
+
420
+ colspecs = [(0, 3), (3, 11), (12, 16)]
421
+ expected = DataFrame([[1, 2334.0, 5], [10, 13, 10.0]])
422
+
423
+ result = read_fwf(
424
+ StringIO(data), header=None, colspecs=colspecs, thousands=thousands
425
+ )
426
+ tm.assert_almost_equal(result, expected)
427
+
428
+
429
+ @pytest.mark.parametrize("header", [True, False])
430
+ def test_bool_header_arg(header):
431
+ # see gh-6114
432
+ data = """\
433
+ MyColumn
434
+ a
435
+ b
436
+ a
437
+ b"""
438
+
439
+ msg = "Passing a bool to header is invalid"
440
+ with pytest.raises(TypeError, match=msg):
441
+ read_fwf(StringIO(data), header=header)
442
+
443
+
444
+ def test_full_file():
445
+ # File with all values.
446
+ test = """index A B C
447
+ 2000-01-03T00:00:00 0.980268513777 3 foo
448
+ 2000-01-04T00:00:00 1.04791624281 -4 bar
449
+ 2000-01-05T00:00:00 0.498580885705 73 baz
450
+ 2000-01-06T00:00:00 1.12020151869 1 foo
451
+ 2000-01-07T00:00:00 0.487094399463 0 bar
452
+ 2000-01-10T00:00:00 0.836648671666 2 baz
453
+ 2000-01-11T00:00:00 0.157160753327 34 foo"""
454
+ colspecs = ((0, 19), (21, 35), (38, 40), (42, 45))
455
+ expected = read_fwf(StringIO(test), colspecs=colspecs)
456
+
457
+ result = read_fwf(StringIO(test))
458
+ tm.assert_frame_equal(result, expected)
459
+
460
+
461
+ def test_full_file_with_missing():
462
+ # File with missing values.
463
+ test = """index A B C
464
+ 2000-01-03T00:00:00 0.980268513777 3 foo
465
+ 2000-01-04T00:00:00 1.04791624281 -4 bar
466
+ 0.498580885705 73 baz
467
+ 2000-01-06T00:00:00 1.12020151869 1 foo
468
+ 2000-01-07T00:00:00 0 bar
469
+ 2000-01-10T00:00:00 0.836648671666 2 baz
470
+ 34"""
471
+ colspecs = ((0, 19), (21, 35), (38, 40), (42, 45))
472
+ expected = read_fwf(StringIO(test), colspecs=colspecs)
473
+
474
+ result = read_fwf(StringIO(test))
475
+ tm.assert_frame_equal(result, expected)
476
+
477
+
478
+ def test_full_file_with_spaces():
479
+ # File with spaces in columns.
480
+ test = """
481
+ Account Name Balance CreditLimit AccountCreated
482
+ 101 Keanu Reeves 9315.45 10000.00 1/17/1998
483
+ 312 Gerard Butler 90.00 1000.00 8/6/2003
484
+ 868 Jennifer Love Hewitt 0 17000.00 5/25/1985
485
+ 761 Jada Pinkett-Smith 49654.87 100000.00 12/5/2006
486
+ 317 Bill Murray 789.65 5000.00 2/5/2007
487
+ """.strip(
488
+ "\r\n"
489
+ )
490
+ colspecs = ((0, 7), (8, 28), (30, 38), (42, 53), (56, 70))
491
+ expected = read_fwf(StringIO(test), colspecs=colspecs)
492
+
493
+ result = read_fwf(StringIO(test))
494
+ tm.assert_frame_equal(result, expected)
495
+
496
+
497
+ def test_full_file_with_spaces_and_missing():
498
+ # File with spaces and missing values in columns.
499
+ test = """
500
+ Account Name Balance CreditLimit AccountCreated
501
+ 101 10000.00 1/17/1998
502
+ 312 Gerard Butler 90.00 1000.00 8/6/2003
503
+ 868 5/25/1985
504
+ 761 Jada Pinkett-Smith 49654.87 100000.00 12/5/2006
505
+ 317 Bill Murray 789.65
506
+ """.strip(
507
+ "\r\n"
508
+ )
509
+ colspecs = ((0, 7), (8, 28), (30, 38), (42, 53), (56, 70))
510
+ expected = read_fwf(StringIO(test), colspecs=colspecs)
511
+
512
+ result = read_fwf(StringIO(test))
513
+ tm.assert_frame_equal(result, expected)
514
+
515
+
516
+ def test_messed_up_data():
517
+ # Completely messed up file.
518
+ test = """
519
+ Account Name Balance Credit Limit Account Created
520
+ 101 10000.00 1/17/1998
521
+ 312 Gerard Butler 90.00 1000.00
522
+
523
+ 761 Jada Pinkett-Smith 49654.87 100000.00 12/5/2006
524
+ 317 Bill Murray 789.65
525
+ """.strip(
526
+ "\r\n"
527
+ )
528
+ colspecs = ((2, 10), (15, 33), (37, 45), (49, 61), (64, 79))
529
+ expected = read_fwf(StringIO(test), colspecs=colspecs)
530
+
531
+ result = read_fwf(StringIO(test))
532
+ tm.assert_frame_equal(result, expected)
533
+
534
+
535
+ def test_multiple_delimiters():
536
+ test = r"""
537
+ col1~~~~~col2 col3++++++++++++++++++col4
538
+ ~~22.....11.0+++foo~~~~~~~~~~Keanu Reeves
539
+ 33+++122.33\\\bar.........Gerard Butler
540
+ ++44~~~~12.01 baz~~Jennifer Love Hewitt
541
+ ~~55 11+++foo++++Jada Pinkett-Smith
542
+ ..66++++++.03~~~bar Bill Murray
543
+ """.strip(
544
+ "\r\n"
545
+ )
546
+ delimiter = " +~.\\"
547
+ colspecs = ((0, 4), (7, 13), (15, 19), (21, 41))
548
+ expected = read_fwf(StringIO(test), colspecs=colspecs, delimiter=delimiter)
549
+
550
+ result = read_fwf(StringIO(test), delimiter=delimiter)
551
+ tm.assert_frame_equal(result, expected)
552
+
553
+
554
+ def test_variable_width_unicode():
555
+ data = """
556
+ שלום שלום
557
+ ום שלל
558
+ של ום
559
+ """.strip(
560
+ "\r\n"
561
+ )
562
+ encoding = "utf8"
563
+ kwargs = {"header": None, "encoding": encoding}
564
+
565
+ expected = read_fwf(
566
+ BytesIO(data.encode(encoding)), colspecs=[(0, 4), (5, 9)], **kwargs
567
+ )
568
+ result = read_fwf(BytesIO(data.encode(encoding)), **kwargs)
569
+ tm.assert_frame_equal(result, expected)
570
+
571
+
572
+ @pytest.mark.parametrize("dtype", [{}, {"a": "float64", "b": str, "c": "int32"}])
573
+ def test_dtype(dtype):
574
+ data = """ a b c
575
+ 1 2 3.2
576
+ 3 4 5.2
577
+ """
578
+ colspecs = [(0, 5), (5, 10), (10, None)]
579
+ result = read_fwf(StringIO(data), colspecs=colspecs, dtype=dtype)
580
+
581
+ expected = DataFrame(
582
+ {"a": [1, 3], "b": [2, 4], "c": [3.2, 5.2]}, columns=["a", "b", "c"]
583
+ )
584
+
585
+ for col, dt in dtype.items():
586
+ expected[col] = expected[col].astype(dt)
587
+
588
+ tm.assert_frame_equal(result, expected)
589
+
590
+
591
+ def test_skiprows_inference():
592
+ # see gh-11256
593
+ data = """
594
+ Text contained in the file header
595
+
596
+ DataCol1 DataCol2
597
+ 0.0 1.0
598
+ 101.6 956.1
599
+ """.strip()
600
+ skiprows = 2
601
+
602
+ depr_msg = "The 'delim_whitespace' keyword in pd.read_csv is deprecated"
603
+ with tm.assert_produces_warning(FutureWarning, match=depr_msg):
604
+ expected = read_csv(StringIO(data), skiprows=skiprows, delim_whitespace=True)
605
+
606
+ result = read_fwf(StringIO(data), skiprows=skiprows)
607
+ tm.assert_frame_equal(result, expected)
608
+
609
+
610
+ def test_skiprows_by_index_inference():
611
+ data = """
612
+ To be skipped
613
+ Not To Be Skipped
614
+ Once more to be skipped
615
+ 123 34 8 123
616
+ 456 78 9 456
617
+ """.strip()
618
+ skiprows = [0, 2]
619
+
620
+ depr_msg = "The 'delim_whitespace' keyword in pd.read_csv is deprecated"
621
+ with tm.assert_produces_warning(FutureWarning, match=depr_msg):
622
+ expected = read_csv(StringIO(data), skiprows=skiprows, delim_whitespace=True)
623
+
624
+ result = read_fwf(StringIO(data), skiprows=skiprows)
625
+ tm.assert_frame_equal(result, expected)
626
+
627
+
628
+ def test_skiprows_inference_empty():
629
+ data = """
630
+ AA BBB C
631
+ 12 345 6
632
+ 78 901 2
633
+ """.strip()
634
+
635
+ msg = "No rows from which to infer column width"
636
+ with pytest.raises(EmptyDataError, match=msg):
637
+ read_fwf(StringIO(data), skiprows=3)
638
+
639
+
640
+ def test_whitespace_preservation():
641
+ # see gh-16772
642
+ header = None
643
+ csv_data = """
644
+ a ,bbb
645
+ cc,dd """
646
+
647
+ fwf_data = """
648
+ a bbb
649
+ ccdd """
650
+ result = read_fwf(
651
+ StringIO(fwf_data), widths=[3, 3], header=header, skiprows=[0], delimiter="\n\t"
652
+ )
653
+ expected = read_csv(StringIO(csv_data), header=header)
654
+ tm.assert_frame_equal(result, expected)
655
+
656
+
657
+ def test_default_delimiter():
658
+ header = None
659
+ csv_data = """
660
+ a,bbb
661
+ cc,dd"""
662
+
663
+ fwf_data = """
664
+ a \tbbb
665
+ cc\tdd """
666
+ result = read_fwf(StringIO(fwf_data), widths=[3, 3], header=header, skiprows=[0])
667
+ expected = read_csv(StringIO(csv_data), header=header)
668
+ tm.assert_frame_equal(result, expected)
669
+
670
+
671
+ @pytest.mark.parametrize("infer", [True, False])
672
+ def test_fwf_compression(compression_only, infer, compression_to_extension):
673
+ data = """1111111111
674
+ 2222222222
675
+ 3333333333""".strip()
676
+
677
+ compression = compression_only
678
+ extension = compression_to_extension[compression]
679
+
680
+ kwargs = {"widths": [5, 5], "names": ["one", "two"]}
681
+ expected = read_fwf(StringIO(data), **kwargs)
682
+
683
+ data = bytes(data, encoding="utf-8")
684
+
685
+ with tm.ensure_clean(filename="tmp." + extension) as path:
686
+ tm.write_to_compressed(compression, path, data)
687
+
688
+ if infer is not None:
689
+ kwargs["compression"] = "infer" if infer else compression
690
+
691
+ result = read_fwf(path, **kwargs)
692
+ tm.assert_frame_equal(result, expected)
693
+
694
+
695
+ def test_binary_mode():
696
+ """
697
+ read_fwf supports opening files in binary mode.
698
+
699
+ GH 18035.
700
+ """
701
+ data = """aaa aaa aaa
702
+ bba bab b a"""
703
+ df_reference = DataFrame(
704
+ [["bba", "bab", "b a"]], columns=["aaa", "aaa.1", "aaa.2"], index=[0]
705
+ )
706
+ with tm.ensure_clean() as path:
707
+ Path(path).write_text(data, encoding="utf-8")
708
+ with open(path, "rb") as file:
709
+ df = read_fwf(file)
710
+ file.seek(0)
711
+ tm.assert_frame_equal(df, df_reference)
712
+
713
+
714
+ @pytest.mark.parametrize("memory_map", [True, False])
715
+ def test_encoding_mmap(memory_map):
716
+ """
717
+ encoding should be working, even when using a memory-mapped file.
718
+
719
+ GH 23254.
720
+ """
721
+ encoding = "iso8859_1"
722
+ with tm.ensure_clean() as path:
723
+ Path(path).write_bytes(" 1 A Ä 2\n".encode(encoding))
724
+ df = read_fwf(
725
+ path,
726
+ header=None,
727
+ widths=[2, 2, 2, 2],
728
+ encoding=encoding,
729
+ memory_map=memory_map,
730
+ )
731
+ df_reference = DataFrame([[1, "A", "Ä", 2]])
732
+ tm.assert_frame_equal(df, df_reference)
733
+
734
+
735
+ @pytest.mark.parametrize(
736
+ "colspecs, names, widths, index_col",
737
+ [
738
+ (
739
+ [(0, 6), (6, 12), (12, 18), (18, None)],
740
+ list("abcde"),
741
+ None,
742
+ None,
743
+ ),
744
+ (
745
+ None,
746
+ list("abcde"),
747
+ [6] * 4,
748
+ None,
749
+ ),
750
+ (
751
+ [(0, 6), (6, 12), (12, 18), (18, None)],
752
+ list("abcde"),
753
+ None,
754
+ True,
755
+ ),
756
+ (
757
+ None,
758
+ list("abcde"),
759
+ [6] * 4,
760
+ False,
761
+ ),
762
+ (
763
+ None,
764
+ list("abcde"),
765
+ [6] * 4,
766
+ True,
767
+ ),
768
+ (
769
+ [(0, 6), (6, 12), (12, 18), (18, None)],
770
+ list("abcde"),
771
+ None,
772
+ False,
773
+ ),
774
+ ],
775
+ )
776
+ def test_len_colspecs_len_names(colspecs, names, widths, index_col):
777
+ # GH#40830
778
+ data = """col1 col2 col3 col4
779
+ bab ba 2"""
780
+ msg = "Length of colspecs must match length of names"
781
+ with pytest.raises(ValueError, match=msg):
782
+ read_fwf(
783
+ StringIO(data),
784
+ colspecs=colspecs,
785
+ names=names,
786
+ widths=widths,
787
+ index_col=index_col,
788
+ )
789
+
790
+
791
+ @pytest.mark.parametrize(
792
+ "colspecs, names, widths, index_col, expected",
793
+ [
794
+ (
795
+ [(0, 6), (6, 12), (12, 18), (18, None)],
796
+ list("abc"),
797
+ None,
798
+ 0,
799
+ DataFrame(
800
+ index=["col1", "ba"],
801
+ columns=["a", "b", "c"],
802
+ data=[["col2", "col3", "col4"], ["b ba", "2", np.nan]],
803
+ ),
804
+ ),
805
+ (
806
+ [(0, 6), (6, 12), (12, 18), (18, None)],
807
+ list("ab"),
808
+ None,
809
+ [0, 1],
810
+ DataFrame(
811
+ index=[["col1", "ba"], ["col2", "b ba"]],
812
+ columns=["a", "b"],
813
+ data=[["col3", "col4"], ["2", np.nan]],
814
+ ),
815
+ ),
816
+ (
817
+ [(0, 6), (6, 12), (12, 18), (18, None)],
818
+ list("a"),
819
+ None,
820
+ [0, 1, 2],
821
+ DataFrame(
822
+ index=[["col1", "ba"], ["col2", "b ba"], ["col3", "2"]],
823
+ columns=["a"],
824
+ data=[["col4"], [np.nan]],
825
+ ),
826
+ ),
827
+ (
828
+ None,
829
+ list("abc"),
830
+ [6] * 4,
831
+ 0,
832
+ DataFrame(
833
+ index=["col1", "ba"],
834
+ columns=["a", "b", "c"],
835
+ data=[["col2", "col3", "col4"], ["b ba", "2", np.nan]],
836
+ ),
837
+ ),
838
+ (
839
+ None,
840
+ list("ab"),
841
+ [6] * 4,
842
+ [0, 1],
843
+ DataFrame(
844
+ index=[["col1", "ba"], ["col2", "b ba"]],
845
+ columns=["a", "b"],
846
+ data=[["col3", "col4"], ["2", np.nan]],
847
+ ),
848
+ ),
849
+ (
850
+ None,
851
+ list("a"),
852
+ [6] * 4,
853
+ [0, 1, 2],
854
+ DataFrame(
855
+ index=[["col1", "ba"], ["col2", "b ba"], ["col3", "2"]],
856
+ columns=["a"],
857
+ data=[["col4"], [np.nan]],
858
+ ),
859
+ ),
860
+ ],
861
+ )
862
+ def test_len_colspecs_len_names_with_index_col(
863
+ colspecs, names, widths, index_col, expected
864
+ ):
865
+ # GH#40830
866
+ data = """col1 col2 col3 col4
867
+ bab ba 2"""
868
+ result = read_fwf(
869
+ StringIO(data),
870
+ colspecs=colspecs,
871
+ names=names,
872
+ widths=widths,
873
+ index_col=index_col,
874
+ )
875
+ tm.assert_frame_equal(result, expected)
876
+
877
+
878
+ def test_colspecs_with_comment():
879
+ # GH 14135
880
+ result = read_fwf(
881
+ StringIO("#\nA1K\n"), colspecs=[(1, 2), (2, 3)], comment="#", header=None
882
+ )
883
+ expected = DataFrame([[1, "K"]], columns=[0, 1])
884
+ tm.assert_frame_equal(result, expected)
885
+
886
+
887
+ def test_skip_rows_and_n_rows():
888
+ # GH#44021
889
+ data = """a\tb
890
+ 1\t a
891
+ 2\t b
892
+ 3\t c
893
+ 4\t d
894
+ 5\t e
895
+ 6\t f
896
+ """
897
+ result = read_fwf(StringIO(data), nrows=4, skiprows=[2, 4])
898
+ expected = DataFrame({"a": [1, 3, 5, 6], "b": ["a", "c", "e", "f"]})
899
+ tm.assert_frame_equal(result, expected)
900
+
901
+
902
+ def test_skiprows_with_iterator():
903
+ # GH#10261, GH#56323
904
+ data = """0
905
+ 1
906
+ 2
907
+ 3
908
+ 4
909
+ 5
910
+ 6
911
+ 7
912
+ 8
913
+ 9
914
+ """
915
+ df_iter = read_fwf(
916
+ StringIO(data),
917
+ colspecs=[(0, 2)],
918
+ names=["a"],
919
+ iterator=True,
920
+ chunksize=2,
921
+ skiprows=[0, 1, 2, 6, 9],
922
+ )
923
+ expected_frames = [
924
+ DataFrame({"a": [3, 4]}),
925
+ DataFrame({"a": [5, 7]}, index=[2, 3]),
926
+ DataFrame({"a": [8]}, index=[4]),
927
+ ]
928
+ for i, result in enumerate(df_iter):
929
+ tm.assert_frame_equal(result, expected_frames[i])
930
+
931
+
932
+ def test_names_and_infer_colspecs():
933
+ # GH#45337
934
+ data = """X Y Z
935
+ 959.0 345 22.2
936
+ """
937
+ result = read_fwf(StringIO(data), skiprows=1, usecols=[0, 2], names=["a", "b"])
938
+ expected = DataFrame({"a": [959.0], "b": 22.2})
939
+ tm.assert_frame_equal(result, expected)
940
+
941
+
942
+ def test_widths_and_usecols():
943
+ # GH#46580
944
+ data = """0 1 n -0.4100.1
945
+ 0 2 p 0.2 90.1
946
+ 0 3 n -0.3140.4"""
947
+ result = read_fwf(
948
+ StringIO(data),
949
+ header=None,
950
+ usecols=(0, 1, 3),
951
+ widths=(3, 5, 1, 5, 5),
952
+ index_col=False,
953
+ names=("c0", "c1", "c3"),
954
+ )
955
+ expected = DataFrame(
956
+ {
957
+ "c0": 0,
958
+ "c1": [1, 2, 3],
959
+ "c3": [-0.4, 0.2, -0.3],
960
+ }
961
+ )
962
+ tm.assert_frame_equal(result, expected)
963
+
964
+
965
+ def test_dtype_backend(string_storage, dtype_backend):
966
+ # GH#50289
967
+ data = """a b c d e f g h i
968
+ 1 2.5 True a
969
+ 3 4.5 False b True 6 7.5 a"""
970
+ with pd.option_context("mode.string_storage", string_storage):
971
+ result = read_fwf(StringIO(data), dtype_backend=dtype_backend)
972
+
973
+ if dtype_backend == "pyarrow":
974
+ pa = pytest.importorskip("pyarrow")
975
+ string_dtype = pd.ArrowDtype(pa.string())
976
+ else:
977
+ string_dtype = pd.StringDtype(string_storage)
978
+
979
+ expected = DataFrame(
980
+ {
981
+ "a": pd.Series([1, 3], dtype="Int64"),
982
+ "b": pd.Series([2.5, 4.5], dtype="Float64"),
983
+ "c": pd.Series([True, False], dtype="boolean"),
984
+ "d": pd.Series(["a", "b"], dtype=string_dtype),
985
+ "e": pd.Series([pd.NA, True], dtype="boolean"),
986
+ "f": pd.Series([pd.NA, 6], dtype="Int64"),
987
+ "g": pd.Series([pd.NA, 7.5], dtype="Float64"),
988
+ "h": pd.Series([None, "a"], dtype=string_dtype),
989
+ "i": pd.Series([pd.NA, pd.NA], dtype="Int64"),
990
+ }
991
+ )
992
+ if dtype_backend == "pyarrow":
993
+ pa = pytest.importorskip("pyarrow")
994
+ from pandas.arrays import ArrowExtensionArray
995
+
996
+ expected = DataFrame(
997
+ {
998
+ col: ArrowExtensionArray(pa.array(expected[col], from_pandas=True))
999
+ for col in expected.columns
1000
+ }
1001
+ )
1002
+ expected["i"] = ArrowExtensionArray(pa.array([None, None]))
1003
+
1004
+ # the storage of the str columns' Index is also affected by the
1005
+ # string_storage setting -> ignore that for checking the result
1006
+ tm.assert_frame_equal(result, expected, check_column_type=False)
1007
+
1008
+
1009
+ def test_invalid_dtype_backend():
1010
+ msg = (
1011
+ "dtype_backend numpy is invalid, only 'numpy_nullable' and "
1012
+ "'pyarrow' are allowed."
1013
+ )
1014
+ with pytest.raises(ValueError, match=msg):
1015
+ read_fwf("test", dtype_backend="numpy")
1016
+
1017
+
1018
+ @pytest.mark.network
1019
+ @pytest.mark.single_cpu
1020
+ def test_url_urlopen(httpserver):
1021
+ data = """\
1022
+ A B C D
1023
+ 201158 360.242940 149.910199 11950.7
1024
+ 201159 444.953632 166.985655 11788.4
1025
+ 201160 364.136849 183.628767 11806.2
1026
+ 201161 413.836124 184.375703 11916.8
1027
+ 201162 502.953953 173.237159 12468.3
1028
+ """
1029
+ httpserver.serve_content(content=data)
1030
+ expected = pd.Index(list("ABCD"))
1031
+ with urlopen(httpserver.url) as f:
1032
+ result = read_fwf(f).columns
1033
+
1034
+ tm.assert_index_equal(result, expected)
.venv_haddock/lib/python3.12/site-packages/pandas/tests/io/parser/test_skiprows.py ADDED
@@ -0,0 +1,334 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ """
2
+ Tests that skipped rows are properly handled during
3
+ parsing for all of the parsers defined in parsers.py
4
+ """
5
+
6
+ from datetime import datetime
7
+ from io import StringIO
8
+
9
+ import numpy as np
10
+ import pytest
11
+
12
+ from pandas.errors import EmptyDataError
13
+
14
+ from pandas import (
15
+ DataFrame,
16
+ Index,
17
+ )
18
+ import pandas._testing as tm
19
+
20
+ xfail_pyarrow = pytest.mark.usefixtures("pyarrow_xfail")
21
+ pytestmark = pytest.mark.filterwarnings(
22
+ "ignore:Passing a BlockManager to DataFrame:DeprecationWarning"
23
+ )
24
+
25
+
26
+ @xfail_pyarrow # ValueError: skiprows argument must be an integer
27
+ @pytest.mark.parametrize("skiprows", [list(range(6)), 6])
28
+ def test_skip_rows_bug(all_parsers, skiprows):
29
+ # see gh-505
30
+ parser = all_parsers
31
+ text = """#foo,a,b,c
32
+ #foo,a,b,c
33
+ #foo,a,b,c
34
+ #foo,a,b,c
35
+ #foo,a,b,c
36
+ #foo,a,b,c
37
+ 1/1/2000,1.,2.,3.
38
+ 1/2/2000,4,5,6
39
+ 1/3/2000,7,8,9
40
+ """
41
+ result = parser.read_csv(
42
+ StringIO(text), skiprows=skiprows, header=None, index_col=0, parse_dates=True
43
+ )
44
+ index = Index(
45
+ [datetime(2000, 1, 1), datetime(2000, 1, 2), datetime(2000, 1, 3)], name=0
46
+ )
47
+
48
+ expected = DataFrame(
49
+ np.arange(1.0, 10.0).reshape((3, 3)), columns=[1, 2, 3], index=index
50
+ )
51
+ tm.assert_frame_equal(result, expected)
52
+
53
+
54
+ @xfail_pyarrow # ValueError: skiprows argument must be an integer
55
+ def test_deep_skip_rows(all_parsers):
56
+ # see gh-4382
57
+ parser = all_parsers
58
+ data = "a,b,c\n" + "\n".join(
59
+ [",".join([str(i), str(i + 1), str(i + 2)]) for i in range(10)]
60
+ )
61
+ condensed_data = "a,b,c\n" + "\n".join(
62
+ [",".join([str(i), str(i + 1), str(i + 2)]) for i in [0, 1, 2, 3, 4, 6, 8, 9]]
63
+ )
64
+
65
+ result = parser.read_csv(StringIO(data), skiprows=[6, 8])
66
+ condensed_result = parser.read_csv(StringIO(condensed_data))
67
+ tm.assert_frame_equal(result, condensed_result)
68
+
69
+
70
+ @xfail_pyarrow # AssertionError: DataFrame are different
71
+ def test_skip_rows_blank(all_parsers):
72
+ # see gh-9832
73
+ parser = all_parsers
74
+ text = """#foo,a,b,c
75
+ #foo,a,b,c
76
+
77
+ #foo,a,b,c
78
+ #foo,a,b,c
79
+
80
+ 1/1/2000,1.,2.,3.
81
+ 1/2/2000,4,5,6
82
+ 1/3/2000,7,8,9
83
+ """
84
+ data = parser.read_csv(
85
+ StringIO(text), skiprows=6, header=None, index_col=0, parse_dates=True
86
+ )
87
+ index = Index(
88
+ [datetime(2000, 1, 1), datetime(2000, 1, 2), datetime(2000, 1, 3)], name=0
89
+ )
90
+
91
+ expected = DataFrame(
92
+ np.arange(1.0, 10.0).reshape((3, 3)), columns=[1, 2, 3], index=index
93
+ )
94
+ tm.assert_frame_equal(data, expected)
95
+
96
+
97
+ @pytest.mark.parametrize(
98
+ "data,kwargs,expected",
99
+ [
100
+ (
101
+ """id,text,num_lines
102
+ 1,"line 11
103
+ line 12",2
104
+ 2,"line 21
105
+ line 22",2
106
+ 3,"line 31",1""",
107
+ {"skiprows": [1]},
108
+ DataFrame(
109
+ [[2, "line 21\nline 22", 2], [3, "line 31", 1]],
110
+ columns=["id", "text", "num_lines"],
111
+ ),
112
+ ),
113
+ (
114
+ "a,b,c\n~a\n b~,~e\n d~,~f\n f~\n1,2,~12\n 13\n 14~",
115
+ {"quotechar": "~", "skiprows": [2]},
116
+ DataFrame([["a\n b", "e\n d", "f\n f"]], columns=["a", "b", "c"]),
117
+ ),
118
+ (
119
+ (
120
+ "Text,url\n~example\n "
121
+ "sentence\n one~,url1\n~"
122
+ "example\n sentence\n two~,url2\n~"
123
+ "example\n sentence\n three~,url3"
124
+ ),
125
+ {"quotechar": "~", "skiprows": [1, 3]},
126
+ DataFrame([["example\n sentence\n two", "url2"]], columns=["Text", "url"]),
127
+ ),
128
+ ],
129
+ )
130
+ @xfail_pyarrow # ValueError: skiprows argument must be an integer
131
+ def test_skip_row_with_newline(all_parsers, data, kwargs, expected):
132
+ # see gh-12775 and gh-10911
133
+ parser = all_parsers
134
+ result = parser.read_csv(StringIO(data), **kwargs)
135
+ tm.assert_frame_equal(result, expected)
136
+
137
+
138
+ @xfail_pyarrow # ValueError: skiprows argument must be an integer
139
+ def test_skip_row_with_quote(all_parsers):
140
+ # see gh-12775 and gh-10911
141
+ parser = all_parsers
142
+ data = """id,text,num_lines
143
+ 1,"line '11' line 12",2
144
+ 2,"line '21' line 22",2
145
+ 3,"line '31' line 32",1"""
146
+
147
+ exp_data = [[2, "line '21' line 22", 2], [3, "line '31' line 32", 1]]
148
+ expected = DataFrame(exp_data, columns=["id", "text", "num_lines"])
149
+
150
+ result = parser.read_csv(StringIO(data), skiprows=[1])
151
+ tm.assert_frame_equal(result, expected)
152
+
153
+
154
+ @pytest.mark.parametrize(
155
+ "data,exp_data",
156
+ [
157
+ (
158
+ """id,text,num_lines
159
+ 1,"line \n'11' line 12",2
160
+ 2,"line \n'21' line 22",2
161
+ 3,"line \n'31' line 32",1""",
162
+ [[2, "line \n'21' line 22", 2], [3, "line \n'31' line 32", 1]],
163
+ ),
164
+ (
165
+ """id,text,num_lines
166
+ 1,"line '11\n' line 12",2
167
+ 2,"line '21\n' line 22",2
168
+ 3,"line '31\n' line 32",1""",
169
+ [[2, "line '21\n' line 22", 2], [3, "line '31\n' line 32", 1]],
170
+ ),
171
+ (
172
+ """id,text,num_lines
173
+ 1,"line '11\n' \r\tline 12",2
174
+ 2,"line '21\n' \r\tline 22",2
175
+ 3,"line '31\n' \r\tline 32",1""",
176
+ [[2, "line '21\n' \r\tline 22", 2], [3, "line '31\n' \r\tline 32", 1]],
177
+ ),
178
+ ],
179
+ )
180
+ @xfail_pyarrow # ValueError: skiprows argument must be an integer
181
+ def test_skip_row_with_newline_and_quote(all_parsers, data, exp_data):
182
+ # see gh-12775 and gh-10911
183
+ parser = all_parsers
184
+ result = parser.read_csv(StringIO(data), skiprows=[1])
185
+
186
+ expected = DataFrame(exp_data, columns=["id", "text", "num_lines"])
187
+ tm.assert_frame_equal(result, expected)
188
+
189
+
190
+ @xfail_pyarrow # ValueError: The 'delim_whitespace' option is not supported
191
+ @pytest.mark.parametrize(
192
+ "lineterminator", ["\n", "\r\n", "\r"] # "LF" # "CRLF" # "CR"
193
+ )
194
+ def test_skiprows_lineterminator(all_parsers, lineterminator, request):
195
+ # see gh-9079
196
+ parser = all_parsers
197
+ data = "\n".join(
198
+ [
199
+ "SMOSMANIA ThetaProbe-ML2X ",
200
+ "2007/01/01 01:00 0.2140 U M ",
201
+ "2007/01/01 02:00 0.2141 M O ",
202
+ "2007/01/01 04:00 0.2142 D M ",
203
+ ]
204
+ )
205
+ expected = DataFrame(
206
+ [
207
+ ["2007/01/01", "01:00", 0.2140, "U", "M"],
208
+ ["2007/01/01", "02:00", 0.2141, "M", "O"],
209
+ ["2007/01/01", "04:00", 0.2142, "D", "M"],
210
+ ],
211
+ columns=["date", "time", "var", "flag", "oflag"],
212
+ )
213
+
214
+ if parser.engine == "python" and lineterminator == "\r":
215
+ mark = pytest.mark.xfail(reason="'CR' not respect with the Python parser yet")
216
+ request.applymarker(mark)
217
+
218
+ data = data.replace("\n", lineterminator)
219
+
220
+ depr_msg = "The 'delim_whitespace' keyword in pd.read_csv is deprecated"
221
+ with tm.assert_produces_warning(
222
+ FutureWarning, match=depr_msg, check_stacklevel=False
223
+ ):
224
+ result = parser.read_csv(
225
+ StringIO(data),
226
+ skiprows=1,
227
+ delim_whitespace=True,
228
+ names=["date", "time", "var", "flag", "oflag"],
229
+ )
230
+ tm.assert_frame_equal(result, expected)
231
+
232
+
233
+ @xfail_pyarrow # AssertionError: DataFrame are different
234
+ def test_skiprows_infield_quote(all_parsers):
235
+ # see gh-14459
236
+ parser = all_parsers
237
+ data = 'a"\nb"\na\n1'
238
+ expected = DataFrame({"a": [1]})
239
+
240
+ result = parser.read_csv(StringIO(data), skiprows=2)
241
+ tm.assert_frame_equal(result, expected)
242
+
243
+
244
+ @xfail_pyarrow # ValueError: skiprows argument must be an integer
245
+ @pytest.mark.parametrize(
246
+ "kwargs,expected",
247
+ [
248
+ ({}, DataFrame({"1": [3, 5]})),
249
+ ({"header": 0, "names": ["foo"]}, DataFrame({"foo": [3, 5]})),
250
+ ],
251
+ )
252
+ def test_skip_rows_callable(all_parsers, kwargs, expected):
253
+ parser = all_parsers
254
+ data = "a\n1\n2\n3\n4\n5"
255
+
256
+ result = parser.read_csv(StringIO(data), skiprows=lambda x: x % 2 == 0, **kwargs)
257
+ tm.assert_frame_equal(result, expected)
258
+
259
+
260
+ @xfail_pyarrow # ValueError: skiprows argument must be an integer
261
+ def test_skip_rows_callable_not_in(all_parsers):
262
+ parser = all_parsers
263
+ data = "0,a\n1,b\n2,c\n3,d\n4,e"
264
+ expected = DataFrame([[1, "b"], [3, "d"]])
265
+
266
+ result = parser.read_csv(
267
+ StringIO(data), header=None, skiprows=lambda x: x not in [1, 3]
268
+ )
269
+ tm.assert_frame_equal(result, expected)
270
+
271
+
272
+ @xfail_pyarrow # ValueError: skiprows argument must be an integer
273
+ def test_skip_rows_skip_all(all_parsers):
274
+ parser = all_parsers
275
+ data = "a\n1\n2\n3\n4\n5"
276
+ msg = "No columns to parse from file"
277
+
278
+ with pytest.raises(EmptyDataError, match=msg):
279
+ parser.read_csv(StringIO(data), skiprows=lambda x: True)
280
+
281
+
282
+ @xfail_pyarrow # ValueError: skiprows argument must be an integer
283
+ def test_skip_rows_bad_callable(all_parsers):
284
+ msg = "by zero"
285
+ parser = all_parsers
286
+ data = "a\n1\n2\n3\n4\n5"
287
+
288
+ with pytest.raises(ZeroDivisionError, match=msg):
289
+ parser.read_csv(StringIO(data), skiprows=lambda x: 1 / 0)
290
+
291
+
292
+ @xfail_pyarrow # ValueError: skiprows argument must be an integer
293
+ def test_skip_rows_and_n_rows(all_parsers):
294
+ # GH#44021
295
+ data = """a,b
296
+ 1,a
297
+ 2,b
298
+ 3,c
299
+ 4,d
300
+ 5,e
301
+ 6,f
302
+ 7,g
303
+ 8,h
304
+ """
305
+ parser = all_parsers
306
+ result = parser.read_csv(StringIO(data), nrows=5, skiprows=[2, 4, 6])
307
+ expected = DataFrame({"a": [1, 3, 5, 7, 8], "b": ["a", "c", "e", "g", "h"]})
308
+ tm.assert_frame_equal(result, expected)
309
+
310
+
311
+ @xfail_pyarrow
312
+ def test_skip_rows_with_chunks(all_parsers):
313
+ # GH 55677
314
+ data = """col_a
315
+ 10
316
+ 20
317
+ 30
318
+ 40
319
+ 50
320
+ 60
321
+ 70
322
+ 80
323
+ 90
324
+ 100
325
+ """
326
+ parser = all_parsers
327
+ reader = parser.read_csv(
328
+ StringIO(data), engine=parser, skiprows=lambda x: x in [1, 4, 5], chunksize=4
329
+ )
330
+ df1 = next(reader)
331
+ df2 = next(reader)
332
+
333
+ tm.assert_frame_equal(df1, DataFrame({"col_a": [20, 30, 60, 70]}))
334
+ tm.assert_frame_equal(df2, DataFrame({"col_a": [80, 90, 100]}, index=[4, 5, 6]))
.venv_haddock/lib/python3.12/site-packages/pandas/tests/io/parser/test_textreader.py ADDED
@@ -0,0 +1,342 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ """
2
+ Tests the TextReader class in parsers.pyx, which
3
+ is integral to the C engine in parsers.py
4
+ """
5
+ from io import (
6
+ BytesIO,
7
+ StringIO,
8
+ )
9
+
10
+ import numpy as np
11
+ import pytest
12
+
13
+ import pandas._libs.parsers as parser
14
+ from pandas._libs.parsers import TextReader
15
+ from pandas.errors import ParserWarning
16
+
17
+ from pandas import DataFrame
18
+ import pandas._testing as tm
19
+
20
+ from pandas.io.parsers import (
21
+ TextFileReader,
22
+ read_csv,
23
+ )
24
+ from pandas.io.parsers.c_parser_wrapper import ensure_dtype_objs
25
+
26
+
27
+ class TestTextReader:
28
+ @pytest.fixture
29
+ def csv_path(self, datapath):
30
+ return datapath("io", "data", "csv", "test1.csv")
31
+
32
+ def test_file_handle(self, csv_path):
33
+ with open(csv_path, "rb") as f:
34
+ reader = TextReader(f)
35
+ reader.read()
36
+
37
+ def test_file_handle_mmap(self, csv_path):
38
+ # this was never using memory_map=True
39
+ with open(csv_path, "rb") as f:
40
+ reader = TextReader(f, header=None)
41
+ reader.read()
42
+
43
+ def test_StringIO(self, csv_path):
44
+ with open(csv_path, "rb") as f:
45
+ text = f.read()
46
+ src = BytesIO(text)
47
+ reader = TextReader(src, header=None)
48
+ reader.read()
49
+
50
+ def test_string_factorize(self):
51
+ # should this be optional?
52
+ data = "a\nb\na\nb\na"
53
+ reader = TextReader(StringIO(data), header=None)
54
+ result = reader.read()
55
+ assert len(set(map(id, result[0]))) == 2
56
+
57
+ def test_skipinitialspace(self):
58
+ data = "a, b\na, b\na, b\na, b"
59
+
60
+ reader = TextReader(StringIO(data), skipinitialspace=True, header=None)
61
+ result = reader.read()
62
+
63
+ tm.assert_numpy_array_equal(
64
+ result[0], np.array(["a", "a", "a", "a"], dtype=np.object_)
65
+ )
66
+ tm.assert_numpy_array_equal(
67
+ result[1], np.array(["b", "b", "b", "b"], dtype=np.object_)
68
+ )
69
+
70
+ def test_parse_booleans(self):
71
+ data = "True\nFalse\nTrue\nTrue"
72
+
73
+ reader = TextReader(StringIO(data), header=None)
74
+ result = reader.read()
75
+
76
+ assert result[0].dtype == np.bool_
77
+
78
+ def test_delimit_whitespace(self):
79
+ data = 'a b\na\t\t "b"\n"a"\t \t b'
80
+
81
+ reader = TextReader(StringIO(data), delim_whitespace=True, header=None)
82
+ result = reader.read()
83
+
84
+ tm.assert_numpy_array_equal(
85
+ result[0], np.array(["a", "a", "a"], dtype=np.object_)
86
+ )
87
+ tm.assert_numpy_array_equal(
88
+ result[1], np.array(["b", "b", "b"], dtype=np.object_)
89
+ )
90
+
91
+ def test_embedded_newline(self):
92
+ data = 'a\n"hello\nthere"\nthis'
93
+
94
+ reader = TextReader(StringIO(data), header=None)
95
+ result = reader.read()
96
+
97
+ expected = np.array(["a", "hello\nthere", "this"], dtype=np.object_)
98
+ tm.assert_numpy_array_equal(result[0], expected)
99
+
100
+ def test_euro_decimal(self):
101
+ data = "12345,67\n345,678"
102
+
103
+ reader = TextReader(StringIO(data), delimiter=":", decimal=",", header=None)
104
+ result = reader.read()
105
+
106
+ expected = np.array([12345.67, 345.678])
107
+ tm.assert_almost_equal(result[0], expected)
108
+
109
+ def test_integer_thousands(self):
110
+ data = "123,456\n12,500"
111
+
112
+ reader = TextReader(StringIO(data), delimiter=":", thousands=",", header=None)
113
+ result = reader.read()
114
+
115
+ expected = np.array([123456, 12500], dtype=np.int64)
116
+ tm.assert_almost_equal(result[0], expected)
117
+
118
+ def test_integer_thousands_alt(self):
119
+ data = "123.456\n12.500"
120
+
121
+ reader = TextFileReader(
122
+ StringIO(data), delimiter=":", thousands=".", header=None
123
+ )
124
+ result = reader.read()
125
+
126
+ expected = DataFrame([123456, 12500])
127
+ tm.assert_frame_equal(result, expected)
128
+
129
+ def test_skip_bad_lines(self):
130
+ # too many lines, see #2430 for why
131
+ data = "a:b:c\nd:e:f\ng:h:i\nj:k:l:m\nl:m:n\no:p:q:r"
132
+
133
+ reader = TextReader(StringIO(data), delimiter=":", header=None)
134
+ msg = r"Error tokenizing data\. C error: Expected 3 fields in line 4, saw 4"
135
+ with pytest.raises(parser.ParserError, match=msg):
136
+ reader.read()
137
+
138
+ reader = TextReader(
139
+ StringIO(data), delimiter=":", header=None, on_bad_lines=2 # Skip
140
+ )
141
+ result = reader.read()
142
+ expected = {
143
+ 0: np.array(["a", "d", "g", "l"], dtype=object),
144
+ 1: np.array(["b", "e", "h", "m"], dtype=object),
145
+ 2: np.array(["c", "f", "i", "n"], dtype=object),
146
+ }
147
+ assert_array_dicts_equal(result, expected)
148
+
149
+ with tm.assert_produces_warning(ParserWarning, match="Skipping line"):
150
+ reader = TextReader(
151
+ StringIO(data), delimiter=":", header=None, on_bad_lines=1 # Warn
152
+ )
153
+ reader.read()
154
+
155
+ def test_header_not_enough_lines(self):
156
+ data = "skip this\nskip this\na,b,c\n1,2,3\n4,5,6"
157
+
158
+ reader = TextReader(StringIO(data), delimiter=",", header=2)
159
+ header = reader.header
160
+ expected = [["a", "b", "c"]]
161
+ assert header == expected
162
+
163
+ recs = reader.read()
164
+ expected = {
165
+ 0: np.array([1, 4], dtype=np.int64),
166
+ 1: np.array([2, 5], dtype=np.int64),
167
+ 2: np.array([3, 6], dtype=np.int64),
168
+ }
169
+ assert_array_dicts_equal(recs, expected)
170
+
171
+ def test_escapechar(self):
172
+ data = '\\"hello world"\n\\"hello world"\n\\"hello world"'
173
+
174
+ reader = TextReader(StringIO(data), delimiter=",", header=None, escapechar="\\")
175
+ result = reader.read()
176
+ expected = {0: np.array(['"hello world"'] * 3, dtype=object)}
177
+ assert_array_dicts_equal(result, expected)
178
+
179
+ def test_eof_has_eol(self):
180
+ # handling of new line at EOF
181
+ pass
182
+
183
+ def test_na_substitution(self):
184
+ pass
185
+
186
+ def test_numpy_string_dtype(self):
187
+ data = """\
188
+ a,1
189
+ aa,2
190
+ aaa,3
191
+ aaaa,4
192
+ aaaaa,5"""
193
+
194
+ def _make_reader(**kwds):
195
+ if "dtype" in kwds:
196
+ kwds["dtype"] = ensure_dtype_objs(kwds["dtype"])
197
+ return TextReader(StringIO(data), delimiter=",", header=None, **kwds)
198
+
199
+ reader = _make_reader(dtype="S5,i4")
200
+ result = reader.read()
201
+
202
+ assert result[0].dtype == "S5"
203
+
204
+ ex_values = np.array(["a", "aa", "aaa", "aaaa", "aaaaa"], dtype="S5")
205
+ assert (result[0] == ex_values).all()
206
+ assert result[1].dtype == "i4"
207
+
208
+ reader = _make_reader(dtype="S4")
209
+ result = reader.read()
210
+ assert result[0].dtype == "S4"
211
+ ex_values = np.array(["a", "aa", "aaa", "aaaa", "aaaa"], dtype="S4")
212
+ assert (result[0] == ex_values).all()
213
+ assert result[1].dtype == "S4"
214
+
215
+ def test_pass_dtype(self):
216
+ data = """\
217
+ one,two
218
+ 1,a
219
+ 2,b
220
+ 3,c
221
+ 4,d"""
222
+
223
+ def _make_reader(**kwds):
224
+ if "dtype" in kwds:
225
+ kwds["dtype"] = ensure_dtype_objs(kwds["dtype"])
226
+ return TextReader(StringIO(data), delimiter=",", **kwds)
227
+
228
+ reader = _make_reader(dtype={"one": "u1", 1: "S1"})
229
+ result = reader.read()
230
+ assert result[0].dtype == "u1"
231
+ assert result[1].dtype == "S1"
232
+
233
+ reader = _make_reader(dtype={"one": np.uint8, 1: object})
234
+ result = reader.read()
235
+ assert result[0].dtype == "u1"
236
+ assert result[1].dtype == "O"
237
+
238
+ reader = _make_reader(dtype={"one": np.dtype("u1"), 1: np.dtype("O")})
239
+ result = reader.read()
240
+ assert result[0].dtype == "u1"
241
+ assert result[1].dtype == "O"
242
+
243
+ def test_usecols(self):
244
+ data = """\
245
+ a,b,c
246
+ 1,2,3
247
+ 4,5,6
248
+ 7,8,9
249
+ 10,11,12"""
250
+
251
+ def _make_reader(**kwds):
252
+ return TextReader(StringIO(data), delimiter=",", **kwds)
253
+
254
+ reader = _make_reader(usecols=(1, 2))
255
+ result = reader.read()
256
+
257
+ exp = _make_reader().read()
258
+ assert len(result) == 2
259
+ assert (result[1] == exp[1]).all()
260
+ assert (result[2] == exp[2]).all()
261
+
262
+ @pytest.mark.parametrize(
263
+ "text, kwargs",
264
+ [
265
+ ("a,b,c\r1,2,3\r4,5,6\r7,8,9\r10,11,12", {"delimiter": ","}),
266
+ (
267
+ "a b c\r1 2 3\r4 5 6\r7 8 9\r10 11 12",
268
+ {"delim_whitespace": True},
269
+ ),
270
+ ("a,b,c\r1,2,3\r4,5,6\r,88,9\r10,11,12", {"delimiter": ","}),
271
+ (
272
+ (
273
+ "A,B,C,D,E,F,G,H,I,J,K,L,M,N,O\r"
274
+ "AAAAA,BBBBB,0,0,0,0,0,0,0,0,0,0,0,0,0\r"
275
+ ",BBBBB,0,0,0,0,0,0,0,0,0,0,0,0,0"
276
+ ),
277
+ {"delimiter": ","},
278
+ ),
279
+ ("A B C\r 2 3\r4 5 6", {"delim_whitespace": True}),
280
+ ("A B C\r2 3\r4 5 6", {"delim_whitespace": True}),
281
+ ],
282
+ )
283
+ def test_cr_delimited(self, text, kwargs):
284
+ nice_text = text.replace("\r", "\r\n")
285
+ result = TextReader(StringIO(text), **kwargs).read()
286
+ expected = TextReader(StringIO(nice_text), **kwargs).read()
287
+ assert_array_dicts_equal(result, expected)
288
+
289
+ def test_empty_field_eof(self):
290
+ data = "a,b,c\n1,2,3\n4,,"
291
+
292
+ result = TextReader(StringIO(data), delimiter=",").read()
293
+
294
+ expected = {
295
+ 0: np.array([1, 4], dtype=np.int64),
296
+ 1: np.array(["2", ""], dtype=object),
297
+ 2: np.array(["3", ""], dtype=object),
298
+ }
299
+ assert_array_dicts_equal(result, expected)
300
+
301
+ @pytest.mark.parametrize("repeat", range(10))
302
+ def test_empty_field_eof_mem_access_bug(self, repeat):
303
+ # GH5664
304
+ a = DataFrame([["b"], [np.nan]], columns=["a"], index=["a", "c"])
305
+ b = DataFrame([[1, 1, 1, 0], [1, 1, 1, 0]], columns=list("abcd"), index=[1, 1])
306
+ c = DataFrame(
307
+ [
308
+ [1, 2, 3, 4],
309
+ [6, np.nan, np.nan, np.nan],
310
+ [8, 9, 10, 11],
311
+ [13, 14, np.nan, np.nan],
312
+ ],
313
+ columns=list("abcd"),
314
+ index=[0, 5, 7, 12],
315
+ )
316
+
317
+ df = read_csv(StringIO("a,b\nc\n"), skiprows=0, names=["a"], engine="c")
318
+ tm.assert_frame_equal(df, a)
319
+
320
+ df = read_csv(
321
+ StringIO("1,1,1,1,0\n" * 2 + "\n" * 2), names=list("abcd"), engine="c"
322
+ )
323
+ tm.assert_frame_equal(df, b)
324
+
325
+ df = read_csv(
326
+ StringIO("0,1,2,3,4\n5,6\n7,8,9,10,11\n12,13,14"),
327
+ names=list("abcd"),
328
+ engine="c",
329
+ )
330
+ tm.assert_frame_equal(df, c)
331
+
332
+ def test_empty_csv_input(self):
333
+ # GH14867
334
+ with read_csv(
335
+ StringIO(), chunksize=20, header=None, names=["a", "b", "c"]
336
+ ) as df:
337
+ assert isinstance(df, TextFileReader)
338
+
339
+
340
+ def assert_array_dicts_equal(left, right):
341
+ for k, v in left.items():
342
+ tm.assert_numpy_array_equal(np.asarray(v), np.asarray(right[k]))
.venv_haddock/lib/python3.12/site-packages/pandas/tests/io/parser/test_unsupported.py ADDED
@@ -0,0 +1,226 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ """
2
+ Tests that features that are currently unsupported in
3
+ either the Python or C parser are actually enforced
4
+ and are clearly communicated to the user.
5
+
6
+ Ultimately, the goal is to remove test cases from this
7
+ test suite as new feature support is added to the parsers.
8
+ """
9
+ from io import StringIO
10
+ import os
11
+ from pathlib import Path
12
+
13
+ import pytest
14
+
15
+ from pandas.errors import ParserError
16
+
17
+ import pandas._testing as tm
18
+
19
+ from pandas.io.parsers import read_csv
20
+ import pandas.io.parsers.readers as parsers
21
+
22
+ pytestmark = pytest.mark.filterwarnings(
23
+ "ignore:Passing a BlockManager to DataFrame:DeprecationWarning"
24
+ )
25
+
26
+
27
+ @pytest.fixture(params=["python", "python-fwf"], ids=lambda val: val)
28
+ def python_engine(request):
29
+ return request.param
30
+
31
+
32
+ class TestUnsupportedFeatures:
33
+ def test_mangle_dupe_cols_false(self):
34
+ # see gh-12935
35
+ data = "a b c\n1 2 3"
36
+
37
+ for engine in ("c", "python"):
38
+ with pytest.raises(TypeError, match="unexpected keyword"):
39
+ read_csv(StringIO(data), engine=engine, mangle_dupe_cols=True)
40
+
41
+ def test_c_engine(self):
42
+ # see gh-6607
43
+ data = "a b c\n1 2 3"
44
+ msg = "does not support"
45
+
46
+ depr_msg = "The 'delim_whitespace' keyword in pd.read_csv is deprecated"
47
+
48
+ # specify C engine with unsupported options (raise)
49
+ with pytest.raises(ValueError, match=msg):
50
+ with tm.assert_produces_warning(FutureWarning, match=depr_msg):
51
+ read_csv(StringIO(data), engine="c", sep=None, delim_whitespace=False)
52
+ with pytest.raises(ValueError, match=msg):
53
+ read_csv(StringIO(data), engine="c", sep=r"\s")
54
+ with pytest.raises(ValueError, match=msg):
55
+ read_csv(StringIO(data), engine="c", sep="\t", quotechar=chr(128))
56
+ with pytest.raises(ValueError, match=msg):
57
+ read_csv(StringIO(data), engine="c", skipfooter=1)
58
+
59
+ # specify C-unsupported options without python-unsupported options
60
+ with tm.assert_produces_warning((parsers.ParserWarning, FutureWarning)):
61
+ read_csv(StringIO(data), sep=None, delim_whitespace=False)
62
+ with tm.assert_produces_warning(parsers.ParserWarning):
63
+ read_csv(StringIO(data), sep=r"\s")
64
+ with tm.assert_produces_warning(parsers.ParserWarning):
65
+ read_csv(StringIO(data), sep="\t", quotechar=chr(128))
66
+ with tm.assert_produces_warning(parsers.ParserWarning):
67
+ read_csv(StringIO(data), skipfooter=1)
68
+
69
+ text = """ A B C D E
70
+ one two three four
71
+ a b 10.0032 5 -0.5109 -2.3358 -0.4645 0.05076 0.3640
72
+ a q 20 4 0.4473 1.4152 0.2834 1.00661 0.1744
73
+ x q 30 3 -0.6662 -0.5243 -0.3580 0.89145 2.5838"""
74
+ msg = "Error tokenizing data"
75
+
76
+ with pytest.raises(ParserError, match=msg):
77
+ read_csv(StringIO(text), sep="\\s+")
78
+ with pytest.raises(ParserError, match=msg):
79
+ read_csv(StringIO(text), engine="c", sep="\\s+")
80
+
81
+ msg = "Only length-1 thousands markers supported"
82
+ data = """A|B|C
83
+ 1|2,334|5
84
+ 10|13|10.
85
+ """
86
+ with pytest.raises(ValueError, match=msg):
87
+ read_csv(StringIO(data), thousands=",,")
88
+ with pytest.raises(ValueError, match=msg):
89
+ read_csv(StringIO(data), thousands="")
90
+
91
+ msg = "Only length-1 line terminators supported"
92
+ data = "a,b,c~~1,2,3~~4,5,6"
93
+ with pytest.raises(ValueError, match=msg):
94
+ read_csv(StringIO(data), lineterminator="~~")
95
+
96
+ def test_python_engine(self, python_engine):
97
+ from pandas.io.parsers.readers import _python_unsupported as py_unsupported
98
+
99
+ data = """1,2,3,,
100
+ 1,2,3,4,
101
+ 1,2,3,4,5
102
+ 1,2,,,
103
+ 1,2,3,4,"""
104
+
105
+ for default in py_unsupported:
106
+ msg = (
107
+ f"The {repr(default)} option is not "
108
+ f"supported with the {repr(python_engine)} engine"
109
+ )
110
+
111
+ kwargs = {default: object()}
112
+ with pytest.raises(ValueError, match=msg):
113
+ read_csv(StringIO(data), engine=python_engine, **kwargs)
114
+
115
+ def test_python_engine_file_no_iter(self, python_engine):
116
+ # see gh-16530
117
+ class NoNextBuffer:
118
+ def __init__(self, csv_data) -> None:
119
+ self.data = csv_data
120
+
121
+ def __next__(self):
122
+ return self.data.__next__()
123
+
124
+ def read(self):
125
+ return self.data
126
+
127
+ def readline(self):
128
+ return self.data
129
+
130
+ data = "a\n1"
131
+ msg = "'NoNextBuffer' object is not iterable|argument 1 must be an iterator"
132
+
133
+ with pytest.raises(TypeError, match=msg):
134
+ read_csv(NoNextBuffer(data), engine=python_engine)
135
+
136
+ def test_pyarrow_engine(self):
137
+ from pandas.io.parsers.readers import _pyarrow_unsupported as pa_unsupported
138
+
139
+ data = """1,2,3,,
140
+ 1,2,3,4,
141
+ 1,2,3,4,5
142
+ 1,2,,,
143
+ 1,2,3,4,"""
144
+
145
+ for default in pa_unsupported:
146
+ msg = (
147
+ f"The {repr(default)} option is not "
148
+ f"supported with the 'pyarrow' engine"
149
+ )
150
+ kwargs = {default: object()}
151
+ default_needs_bool = {"warn_bad_lines", "error_bad_lines"}
152
+ if default == "dialect":
153
+ kwargs[default] = "excel" # test a random dialect
154
+ elif default in default_needs_bool:
155
+ kwargs[default] = True
156
+ elif default == "on_bad_lines":
157
+ kwargs[default] = "warn"
158
+
159
+ warn = None
160
+ depr_msg = None
161
+ if "delim_whitespace" in kwargs:
162
+ depr_msg = "The 'delim_whitespace' keyword in pd.read_csv is deprecated"
163
+ warn = FutureWarning
164
+ if "verbose" in kwargs:
165
+ depr_msg = "The 'verbose' keyword in pd.read_csv is deprecated"
166
+ warn = FutureWarning
167
+
168
+ with pytest.raises(ValueError, match=msg):
169
+ with tm.assert_produces_warning(warn, match=depr_msg):
170
+ read_csv(StringIO(data), engine="pyarrow", **kwargs)
171
+
172
+ def test_on_bad_lines_callable_python_or_pyarrow(self, all_parsers):
173
+ # GH 5686
174
+ # GH 54643
175
+ sio = StringIO("a,b\n1,2")
176
+ bad_lines_func = lambda x: x
177
+ parser = all_parsers
178
+ if all_parsers.engine not in ["python", "pyarrow"]:
179
+ msg = (
180
+ "on_bad_line can only be a callable "
181
+ "function if engine='python' or 'pyarrow'"
182
+ )
183
+ with pytest.raises(ValueError, match=msg):
184
+ parser.read_csv(sio, on_bad_lines=bad_lines_func)
185
+ else:
186
+ parser.read_csv(sio, on_bad_lines=bad_lines_func)
187
+
188
+
189
+ def test_close_file_handle_on_invalid_usecols(all_parsers):
190
+ # GH 45384
191
+ parser = all_parsers
192
+
193
+ error = ValueError
194
+ if parser.engine == "pyarrow":
195
+ # Raises pyarrow.lib.ArrowKeyError
196
+ pytest.skip(reason="https://github.com/apache/arrow/issues/38676")
197
+
198
+ with tm.ensure_clean("test.csv") as fname:
199
+ Path(fname).write_text("col1,col2\na,b\n1,2", encoding="utf-8")
200
+ with tm.assert_produces_warning(False):
201
+ with pytest.raises(error, match="col3"):
202
+ parser.read_csv(fname, usecols=["col1", "col2", "col3"])
203
+ # unlink fails on windows if file handles still point to it
204
+ os.unlink(fname)
205
+
206
+
207
+ def test_invalid_file_inputs(request, all_parsers):
208
+ # GH#45957
209
+ parser = all_parsers
210
+ if parser.engine == "python":
211
+ request.applymarker(
212
+ pytest.mark.xfail(reason=f"{parser.engine} engine supports lists.")
213
+ )
214
+
215
+ with pytest.raises(ValueError, match="Invalid"):
216
+ parser.read_csv([])
217
+
218
+
219
+ def test_invalid_dtype_backend(all_parsers):
220
+ parser = all_parsers
221
+ msg = (
222
+ "dtype_backend numpy is invalid, only 'numpy_nullable' and "
223
+ "'pyarrow' are allowed."
224
+ )
225
+ with pytest.raises(ValueError, match=msg):
226
+ parser.read_csv("test", dtype_backend="numpy")
.venv_haddock/lib/python3.12/site-packages/pandas/tests/io/parser/test_upcast.py ADDED
@@ -0,0 +1,102 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import numpy as np
2
+ import pytest
3
+
4
+ from pandas._libs.parsers import (
5
+ _maybe_upcast,
6
+ na_values,
7
+ )
8
+
9
+ import pandas as pd
10
+ from pandas import NA
11
+ import pandas._testing as tm
12
+ from pandas.core.arrays import (
13
+ ArrowStringArray,
14
+ BooleanArray,
15
+ FloatingArray,
16
+ IntegerArray,
17
+ StringArray,
18
+ )
19
+
20
+
21
+ def test_maybe_upcast(any_real_numpy_dtype):
22
+ # GH#36712
23
+
24
+ dtype = np.dtype(any_real_numpy_dtype)
25
+ na_value = na_values[dtype]
26
+ arr = np.array([1, 2, na_value], dtype=dtype)
27
+ result = _maybe_upcast(arr, use_dtype_backend=True)
28
+
29
+ expected_mask = np.array([False, False, True])
30
+ if issubclass(dtype.type, np.integer):
31
+ expected = IntegerArray(arr, mask=expected_mask)
32
+ else:
33
+ expected = FloatingArray(arr, mask=expected_mask)
34
+
35
+ tm.assert_extension_array_equal(result, expected)
36
+
37
+
38
+ def test_maybe_upcast_no_na(any_real_numpy_dtype):
39
+ # GH#36712
40
+ arr = np.array([1, 2, 3], dtype=any_real_numpy_dtype)
41
+ result = _maybe_upcast(arr, use_dtype_backend=True)
42
+
43
+ expected_mask = np.array([False, False, False])
44
+ if issubclass(np.dtype(any_real_numpy_dtype).type, np.integer):
45
+ expected = IntegerArray(arr, mask=expected_mask)
46
+ else:
47
+ expected = FloatingArray(arr, mask=expected_mask)
48
+
49
+ tm.assert_extension_array_equal(result, expected)
50
+
51
+
52
+ def test_maybe_upcaste_bool():
53
+ # GH#36712
54
+ dtype = np.bool_
55
+ na_value = na_values[dtype]
56
+ arr = np.array([True, False, na_value], dtype="uint8").view(dtype)
57
+ result = _maybe_upcast(arr, use_dtype_backend=True)
58
+
59
+ expected_mask = np.array([False, False, True])
60
+ expected = BooleanArray(arr, mask=expected_mask)
61
+ tm.assert_extension_array_equal(result, expected)
62
+
63
+
64
+ def test_maybe_upcaste_bool_no_nan():
65
+ # GH#36712
66
+ dtype = np.bool_
67
+ arr = np.array([True, False, False], dtype="uint8").view(dtype)
68
+ result = _maybe_upcast(arr, use_dtype_backend=True)
69
+
70
+ expected_mask = np.array([False, False, False])
71
+ expected = BooleanArray(arr, mask=expected_mask)
72
+ tm.assert_extension_array_equal(result, expected)
73
+
74
+
75
+ def test_maybe_upcaste_all_nan():
76
+ # GH#36712
77
+ dtype = np.int64
78
+ na_value = na_values[dtype]
79
+ arr = np.array([na_value, na_value], dtype=dtype)
80
+ result = _maybe_upcast(arr, use_dtype_backend=True)
81
+
82
+ expected_mask = np.array([True, True])
83
+ expected = IntegerArray(arr, mask=expected_mask)
84
+ tm.assert_extension_array_equal(result, expected)
85
+
86
+
87
+ @pytest.mark.parametrize("val", [na_values[np.object_], "c"])
88
+ def test_maybe_upcast_object(val, string_storage):
89
+ # GH#36712
90
+ pa = pytest.importorskip("pyarrow")
91
+
92
+ with pd.option_context("mode.string_storage", string_storage):
93
+ arr = np.array(["a", "b", val], dtype=np.object_)
94
+ result = _maybe_upcast(arr, use_dtype_backend=True)
95
+
96
+ if string_storage == "python":
97
+ exp_val = "c" if val == "c" else NA
98
+ expected = StringArray(np.array(["a", "b", exp_val], dtype=np.object_))
99
+ else:
100
+ exp_val = "c" if val == "c" else None
101
+ expected = ArrowStringArray(pa.array(["a", "b", exp_val]))
102
+ tm.assert_extension_array_equal(result, expected)
.venv_haddock/lib/python3.12/site-packages/pandas/tests/io/parser/usecols/.___init__.py ADDED
Binary file (4.1 kB). View file
 
.venv_haddock/lib/python3.12/site-packages/pandas/tests/io/parser/usecols/.___pycache__ ADDED
Binary file (4.1 kB). View file
 
.venv_haddock/lib/python3.12/site-packages/pandas/tests/io/parser/usecols/._test_parse_dates.py ADDED
Binary file (4.1 kB). View file
 
.venv_haddock/lib/python3.12/site-packages/pandas/tests/io/parser/usecols/._test_strings.py ADDED
Binary file (4.1 kB). View file
 
.venv_haddock/lib/python3.12/site-packages/pandas/tests/io/parser/usecols/._test_usecols_basic.py ADDED
Binary file (4.1 kB). View file
 
.venv_haddock/lib/python3.12/site-packages/pandas/tests/io/parser/usecols/__init__.py ADDED
File without changes
.venv_haddock/lib/python3.12/site-packages/pandas/tests/io/parser/usecols/test_parse_dates.py ADDED
@@ -0,0 +1,194 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ """
2
+ Tests the usecols functionality during parsing
3
+ for all of the parsers defined in parsers.py
4
+ """
5
+ from io import StringIO
6
+
7
+ import pytest
8
+
9
+ from pandas import (
10
+ DataFrame,
11
+ Index,
12
+ Timestamp,
13
+ )
14
+ import pandas._testing as tm
15
+
16
+ pytestmark = pytest.mark.filterwarnings(
17
+ "ignore:Passing a BlockManager to DataFrame:DeprecationWarning"
18
+ )
19
+ xfail_pyarrow = pytest.mark.usefixtures("pyarrow_xfail")
20
+ skip_pyarrow = pytest.mark.usefixtures("pyarrow_skip")
21
+
22
+ _msg_pyarrow_requires_names = (
23
+ "The pyarrow engine does not allow 'usecols' to be integer column "
24
+ "positions. Pass a list of string column names instead."
25
+ )
26
+
27
+
28
+ @pytest.mark.parametrize("usecols", [[0, 2, 3], [3, 0, 2]])
29
+ def test_usecols_with_parse_dates(all_parsers, usecols):
30
+ # see gh-9755
31
+ data = """a,b,c,d,e
32
+ 0,1,2014-01-01,09:00,4
33
+ 0,1,2014-01-02,10:00,4"""
34
+ parser = all_parsers
35
+ parse_dates = [[1, 2]]
36
+
37
+ depr_msg = (
38
+ "Support for nested sequences for 'parse_dates' in pd.read_csv is deprecated"
39
+ )
40
+
41
+ cols = {
42
+ "a": [0, 0],
43
+ "c_d": [Timestamp("2014-01-01 09:00:00"), Timestamp("2014-01-02 10:00:00")],
44
+ }
45
+ expected = DataFrame(cols, columns=["c_d", "a"])
46
+ if parser.engine == "pyarrow":
47
+ with pytest.raises(ValueError, match=_msg_pyarrow_requires_names):
48
+ with tm.assert_produces_warning(
49
+ FutureWarning, match=depr_msg, check_stacklevel=False
50
+ ):
51
+ parser.read_csv(
52
+ StringIO(data), usecols=usecols, parse_dates=parse_dates
53
+ )
54
+ return
55
+ with tm.assert_produces_warning(
56
+ FutureWarning, match=depr_msg, check_stacklevel=False
57
+ ):
58
+ result = parser.read_csv(
59
+ StringIO(data), usecols=usecols, parse_dates=parse_dates
60
+ )
61
+ tm.assert_frame_equal(result, expected)
62
+
63
+
64
+ @skip_pyarrow # pyarrow.lib.ArrowKeyError: Column 'fdate' in include_columns
65
+ def test_usecols_with_parse_dates2(all_parsers):
66
+ # see gh-13604
67
+ parser = all_parsers
68
+ data = """2008-02-07 09:40,1032.43
69
+ 2008-02-07 09:50,1042.54
70
+ 2008-02-07 10:00,1051.65"""
71
+
72
+ names = ["date", "values"]
73
+ usecols = names[:]
74
+ parse_dates = [0]
75
+
76
+ index = Index(
77
+ [
78
+ Timestamp("2008-02-07 09:40"),
79
+ Timestamp("2008-02-07 09:50"),
80
+ Timestamp("2008-02-07 10:00"),
81
+ ],
82
+ name="date",
83
+ )
84
+ cols = {"values": [1032.43, 1042.54, 1051.65]}
85
+ expected = DataFrame(cols, index=index)
86
+
87
+ result = parser.read_csv(
88
+ StringIO(data),
89
+ parse_dates=parse_dates,
90
+ index_col=0,
91
+ usecols=usecols,
92
+ header=None,
93
+ names=names,
94
+ )
95
+ tm.assert_frame_equal(result, expected)
96
+
97
+
98
+ def test_usecols_with_parse_dates3(all_parsers):
99
+ # see gh-14792
100
+ parser = all_parsers
101
+ data = """a,b,c,d,e,f,g,h,i,j
102
+ 2016/09/21,1,1,2,3,4,5,6,7,8"""
103
+
104
+ usecols = list("abcdefghij")
105
+ parse_dates = [0]
106
+
107
+ cols = {
108
+ "a": Timestamp("2016-09-21").as_unit("ns"),
109
+ "b": [1],
110
+ "c": [1],
111
+ "d": [2],
112
+ "e": [3],
113
+ "f": [4],
114
+ "g": [5],
115
+ "h": [6],
116
+ "i": [7],
117
+ "j": [8],
118
+ }
119
+ expected = DataFrame(cols, columns=usecols)
120
+
121
+ result = parser.read_csv(StringIO(data), usecols=usecols, parse_dates=parse_dates)
122
+ tm.assert_frame_equal(result, expected)
123
+
124
+
125
+ def test_usecols_with_parse_dates4(all_parsers):
126
+ data = "a,b,c,d,e,f,g,h,i,j\n2016/09/21,1,1,2,3,4,5,6,7,8"
127
+ usecols = list("abcdefghij")
128
+ parse_dates = [[0, 1]]
129
+ parser = all_parsers
130
+
131
+ cols = {
132
+ "a_b": "2016/09/21 1",
133
+ "c": [1],
134
+ "d": [2],
135
+ "e": [3],
136
+ "f": [4],
137
+ "g": [5],
138
+ "h": [6],
139
+ "i": [7],
140
+ "j": [8],
141
+ }
142
+ expected = DataFrame(cols, columns=["a_b"] + list("cdefghij"))
143
+
144
+ depr_msg = (
145
+ "Support for nested sequences for 'parse_dates' in pd.read_csv is deprecated"
146
+ )
147
+ with tm.assert_produces_warning(
148
+ (FutureWarning, DeprecationWarning), match=depr_msg, check_stacklevel=False
149
+ ):
150
+ result = parser.read_csv(
151
+ StringIO(data),
152
+ usecols=usecols,
153
+ parse_dates=parse_dates,
154
+ )
155
+ tm.assert_frame_equal(result, expected)
156
+
157
+
158
+ @pytest.mark.parametrize("usecols", [[0, 2, 3], [3, 0, 2]])
159
+ @pytest.mark.parametrize(
160
+ "names",
161
+ [
162
+ list("abcde"), # Names span all columns in original data.
163
+ list("acd"), # Names span only the selected columns.
164
+ ],
165
+ )
166
+ def test_usecols_with_parse_dates_and_names(all_parsers, usecols, names, request):
167
+ # see gh-9755
168
+ s = """0,1,2014-01-01,09:00,4
169
+ 0,1,2014-01-02,10:00,4"""
170
+ parse_dates = [[1, 2]]
171
+ parser = all_parsers
172
+
173
+ if parser.engine == "pyarrow" and not (len(names) == 3 and usecols[0] == 0):
174
+ mark = pytest.mark.xfail(
175
+ reason="Length mismatch in some cases, UserWarning in other"
176
+ )
177
+ request.applymarker(mark)
178
+
179
+ cols = {
180
+ "a": [0, 0],
181
+ "c_d": [Timestamp("2014-01-01 09:00:00"), Timestamp("2014-01-02 10:00:00")],
182
+ }
183
+ expected = DataFrame(cols, columns=["c_d", "a"])
184
+
185
+ depr_msg = (
186
+ "Support for nested sequences for 'parse_dates' in pd.read_csv is deprecated"
187
+ )
188
+ with tm.assert_produces_warning(
189
+ (FutureWarning, DeprecationWarning), match=depr_msg, check_stacklevel=False
190
+ ):
191
+ result = parser.read_csv(
192
+ StringIO(s), names=names, parse_dates=parse_dates, usecols=usecols
193
+ )
194
+ tm.assert_frame_equal(result, expected)
.venv_haddock/lib/python3.12/site-packages/pandas/tests/io/parser/usecols/test_strings.py ADDED
@@ -0,0 +1,96 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ """
2
+ Tests the usecols functionality during parsing
3
+ for all of the parsers defined in parsers.py
4
+ """
5
+ from io import StringIO
6
+
7
+ import pytest
8
+
9
+ from pandas import DataFrame
10
+ import pandas._testing as tm
11
+
12
+ pytestmark = pytest.mark.filterwarnings(
13
+ "ignore:Passing a BlockManager to DataFrame:DeprecationWarning"
14
+ )
15
+
16
+
17
+ def test_usecols_with_unicode_strings(all_parsers):
18
+ # see gh-13219
19
+ data = """AAA,BBB,CCC,DDD
20
+ 0.056674973,8,True,a
21
+ 2.613230982,2,False,b
22
+ 3.568935038,7,False,a"""
23
+ parser = all_parsers
24
+
25
+ exp_data = {
26
+ "AAA": {
27
+ 0: 0.056674972999999997,
28
+ 1: 2.6132309819999997,
29
+ 2: 3.5689350380000002,
30
+ },
31
+ "BBB": {0: 8, 1: 2, 2: 7},
32
+ }
33
+ expected = DataFrame(exp_data)
34
+
35
+ result = parser.read_csv(StringIO(data), usecols=["AAA", "BBB"])
36
+ tm.assert_frame_equal(result, expected)
37
+
38
+
39
+ def test_usecols_with_single_byte_unicode_strings(all_parsers):
40
+ # see gh-13219
41
+ data = """A,B,C,D
42
+ 0.056674973,8,True,a
43
+ 2.613230982,2,False,b
44
+ 3.568935038,7,False,a"""
45
+ parser = all_parsers
46
+
47
+ exp_data = {
48
+ "A": {
49
+ 0: 0.056674972999999997,
50
+ 1: 2.6132309819999997,
51
+ 2: 3.5689350380000002,
52
+ },
53
+ "B": {0: 8, 1: 2, 2: 7},
54
+ }
55
+ expected = DataFrame(exp_data)
56
+
57
+ result = parser.read_csv(StringIO(data), usecols=["A", "B"])
58
+ tm.assert_frame_equal(result, expected)
59
+
60
+
61
+ @pytest.mark.parametrize("usecols", [["AAA", b"BBB"], [b"AAA", "BBB"]])
62
+ def test_usecols_with_mixed_encoding_strings(all_parsers, usecols):
63
+ data = """AAA,BBB,CCC,DDD
64
+ 0.056674973,8,True,a
65
+ 2.613230982,2,False,b
66
+ 3.568935038,7,False,a"""
67
+ parser = all_parsers
68
+ _msg_validate_usecols_arg = (
69
+ "'usecols' must either be list-like "
70
+ "of all strings, all unicode, all "
71
+ "integers or a callable."
72
+ )
73
+ with pytest.raises(ValueError, match=_msg_validate_usecols_arg):
74
+ parser.read_csv(StringIO(data), usecols=usecols)
75
+
76
+
77
+ @pytest.mark.parametrize("usecols", [["あああ", "いい"], ["あああ", "いい"]])
78
+ def test_usecols_with_multi_byte_characters(all_parsers, usecols):
79
+ data = """あああ,いい,ううう,ええええ
80
+ 0.056674973,8,True,a
81
+ 2.613230982,2,False,b
82
+ 3.568935038,7,False,a"""
83
+ parser = all_parsers
84
+
85
+ exp_data = {
86
+ "あああ": {
87
+ 0: 0.056674972999999997,
88
+ 1: 2.6132309819999997,
89
+ 2: 3.5689350380000002,
90
+ },
91
+ "いい": {0: 8, 1: 2, 2: 7},
92
+ }
93
+ expected = DataFrame(exp_data)
94
+
95
+ result = parser.read_csv(StringIO(data), usecols=usecols)
96
+ tm.assert_frame_equal(result, expected)
.venv_haddock/lib/python3.12/site-packages/pandas/tests/io/parser/usecols/test_usecols_basic.py ADDED
@@ -0,0 +1,563 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ """
2
+ Tests the usecols functionality during parsing
3
+ for all of the parsers defined in parsers.py
4
+ """
5
+ from io import StringIO
6
+
7
+ import numpy as np
8
+ import pytest
9
+
10
+ from pandas.errors import ParserError
11
+
12
+ from pandas import (
13
+ DataFrame,
14
+ Index,
15
+ array,
16
+ )
17
+ import pandas._testing as tm
18
+
19
+ pytestmark = pytest.mark.filterwarnings(
20
+ "ignore:Passing a BlockManager to DataFrame:DeprecationWarning"
21
+ )
22
+
23
+ _msg_validate_usecols_arg = (
24
+ "'usecols' must either be list-like "
25
+ "of all strings, all unicode, all "
26
+ "integers or a callable."
27
+ )
28
+ _msg_validate_usecols_names = (
29
+ "Usecols do not match columns, columns expected but not found: {0}"
30
+ )
31
+ _msg_pyarrow_requires_names = (
32
+ "The pyarrow engine does not allow 'usecols' to be integer column "
33
+ "positions. Pass a list of string column names instead."
34
+ )
35
+
36
+ xfail_pyarrow = pytest.mark.usefixtures("pyarrow_xfail")
37
+ skip_pyarrow = pytest.mark.usefixtures("pyarrow_skip")
38
+
39
+ pytestmark = pytest.mark.filterwarnings(
40
+ "ignore:Passing a BlockManager to DataFrame is deprecated:DeprecationWarning"
41
+ )
42
+
43
+
44
+ def test_raise_on_mixed_dtype_usecols(all_parsers):
45
+ # See gh-12678
46
+ data = """a,b,c
47
+ 1000,2000,3000
48
+ 4000,5000,6000
49
+ """
50
+ usecols = [0, "b", 2]
51
+ parser = all_parsers
52
+
53
+ with pytest.raises(ValueError, match=_msg_validate_usecols_arg):
54
+ parser.read_csv(StringIO(data), usecols=usecols)
55
+
56
+
57
+ @pytest.mark.parametrize("usecols", [(1, 2), ("b", "c")])
58
+ def test_usecols(all_parsers, usecols, request):
59
+ data = """\
60
+ a,b,c
61
+ 1,2,3
62
+ 4,5,6
63
+ 7,8,9
64
+ 10,11,12"""
65
+ parser = all_parsers
66
+ if parser.engine == "pyarrow" and isinstance(usecols[0], int):
67
+ with pytest.raises(ValueError, match=_msg_pyarrow_requires_names):
68
+ parser.read_csv(StringIO(data), usecols=usecols)
69
+ return
70
+
71
+ result = parser.read_csv(StringIO(data), usecols=usecols)
72
+
73
+ expected = DataFrame([[2, 3], [5, 6], [8, 9], [11, 12]], columns=["b", "c"])
74
+ tm.assert_frame_equal(result, expected)
75
+
76
+
77
+ def test_usecols_with_names(all_parsers):
78
+ data = """\
79
+ a,b,c
80
+ 1,2,3
81
+ 4,5,6
82
+ 7,8,9
83
+ 10,11,12"""
84
+ parser = all_parsers
85
+ names = ["foo", "bar"]
86
+
87
+ if parser.engine == "pyarrow":
88
+ with pytest.raises(ValueError, match=_msg_pyarrow_requires_names):
89
+ parser.read_csv(StringIO(data), names=names, usecols=[1, 2], header=0)
90
+ return
91
+
92
+ result = parser.read_csv(StringIO(data), names=names, usecols=[1, 2], header=0)
93
+
94
+ expected = DataFrame([[2, 3], [5, 6], [8, 9], [11, 12]], columns=names)
95
+ tm.assert_frame_equal(result, expected)
96
+
97
+
98
+ @pytest.mark.parametrize(
99
+ "names,usecols", [(["b", "c"], [1, 2]), (["a", "b", "c"], ["b", "c"])]
100
+ )
101
+ def test_usecols_relative_to_names(all_parsers, names, usecols):
102
+ data = """\
103
+ 1,2,3
104
+ 4,5,6
105
+ 7,8,9
106
+ 10,11,12"""
107
+ parser = all_parsers
108
+ if parser.engine == "pyarrow" and not isinstance(usecols[0], int):
109
+ # ArrowKeyError: Column 'fb' in include_columns does not exist
110
+ pytest.skip(reason="https://github.com/apache/arrow/issues/38676")
111
+
112
+ result = parser.read_csv(StringIO(data), names=names, header=None, usecols=usecols)
113
+
114
+ expected = DataFrame([[2, 3], [5, 6], [8, 9], [11, 12]], columns=["b", "c"])
115
+ tm.assert_frame_equal(result, expected)
116
+
117
+
118
+ def test_usecols_relative_to_names2(all_parsers):
119
+ # see gh-5766
120
+ data = """\
121
+ 1,2,3
122
+ 4,5,6
123
+ 7,8,9
124
+ 10,11,12"""
125
+ parser = all_parsers
126
+
127
+ result = parser.read_csv(
128
+ StringIO(data), names=["a", "b"], header=None, usecols=[0, 1]
129
+ )
130
+
131
+ expected = DataFrame([[1, 2], [4, 5], [7, 8], [10, 11]], columns=["a", "b"])
132
+ tm.assert_frame_equal(result, expected)
133
+
134
+
135
+ # regex mismatch: "Length mismatch: Expected axis has 1 elements"
136
+ @xfail_pyarrow
137
+ def test_usecols_name_length_conflict(all_parsers):
138
+ data = """\
139
+ 1,2,3
140
+ 4,5,6
141
+ 7,8,9
142
+ 10,11,12"""
143
+ parser = all_parsers
144
+ msg = "Number of passed names did not match number of header fields in the file"
145
+ with pytest.raises(ValueError, match=msg):
146
+ parser.read_csv(StringIO(data), names=["a", "b"], header=None, usecols=[1])
147
+
148
+
149
+ def test_usecols_single_string(all_parsers):
150
+ # see gh-20558
151
+ parser = all_parsers
152
+ data = """foo, bar, baz
153
+ 1000, 2000, 3000
154
+ 4000, 5000, 6000"""
155
+
156
+ with pytest.raises(ValueError, match=_msg_validate_usecols_arg):
157
+ parser.read_csv(StringIO(data), usecols="foo")
158
+
159
+
160
+ @skip_pyarrow # CSV parse error in one case, AttributeError in another
161
+ @pytest.mark.parametrize(
162
+ "data", ["a,b,c,d\n1,2,3,4\n5,6,7,8", "a,b,c,d\n1,2,3,4,\n5,6,7,8,"]
163
+ )
164
+ def test_usecols_index_col_false(all_parsers, data):
165
+ # see gh-9082
166
+ parser = all_parsers
167
+ usecols = ["a", "c", "d"]
168
+ expected = DataFrame({"a": [1, 5], "c": [3, 7], "d": [4, 8]})
169
+
170
+ result = parser.read_csv(StringIO(data), usecols=usecols, index_col=False)
171
+ tm.assert_frame_equal(result, expected)
172
+
173
+
174
+ @pytest.mark.parametrize("index_col", ["b", 0])
175
+ @pytest.mark.parametrize("usecols", [["b", "c"], [1, 2]])
176
+ def test_usecols_index_col_conflict(all_parsers, usecols, index_col, request):
177
+ # see gh-4201: test that index_col as integer reflects usecols
178
+ parser = all_parsers
179
+ data = "a,b,c,d\nA,a,1,one\nB,b,2,two"
180
+
181
+ if parser.engine == "pyarrow" and isinstance(usecols[0], int):
182
+ with pytest.raises(ValueError, match=_msg_pyarrow_requires_names):
183
+ parser.read_csv(StringIO(data), usecols=usecols, index_col=index_col)
184
+ return
185
+
186
+ expected = DataFrame({"c": [1, 2]}, index=Index(["a", "b"], name="b"))
187
+
188
+ result = parser.read_csv(StringIO(data), usecols=usecols, index_col=index_col)
189
+ tm.assert_frame_equal(result, expected)
190
+
191
+
192
+ def test_usecols_index_col_conflict2(all_parsers):
193
+ # see gh-4201: test that index_col as integer reflects usecols
194
+ parser = all_parsers
195
+ data = "a,b,c,d\nA,a,1,one\nB,b,2,two"
196
+
197
+ expected = DataFrame({"b": ["a", "b"], "c": [1, 2], "d": ("one", "two")})
198
+ expected = expected.set_index(["b", "c"])
199
+
200
+ result = parser.read_csv(
201
+ StringIO(data), usecols=["b", "c", "d"], index_col=["b", "c"]
202
+ )
203
+ tm.assert_frame_equal(result, expected)
204
+
205
+
206
+ @skip_pyarrow # CSV parse error: Expected 3 columns, got 4
207
+ def test_usecols_implicit_index_col(all_parsers):
208
+ # see gh-2654
209
+ parser = all_parsers
210
+ data = "a,b,c\n4,apple,bat,5.7\n8,orange,cow,10"
211
+
212
+ result = parser.read_csv(StringIO(data), usecols=["a", "b"])
213
+ expected = DataFrame({"a": ["apple", "orange"], "b": ["bat", "cow"]}, index=[4, 8])
214
+ tm.assert_frame_equal(result, expected)
215
+
216
+
217
+ def test_usecols_index_col_middle(all_parsers):
218
+ # GH#9098
219
+ parser = all_parsers
220
+ data = """a,b,c,d
221
+ 1,2,3,4
222
+ """
223
+ result = parser.read_csv(StringIO(data), usecols=["b", "c", "d"], index_col="c")
224
+ expected = DataFrame({"b": [2], "d": [4]}, index=Index([3], name="c"))
225
+ tm.assert_frame_equal(result, expected)
226
+
227
+
228
+ def test_usecols_index_col_end(all_parsers):
229
+ # GH#9098
230
+ parser = all_parsers
231
+ data = """a,b,c,d
232
+ 1,2,3,4
233
+ """
234
+ result = parser.read_csv(StringIO(data), usecols=["b", "c", "d"], index_col="d")
235
+ expected = DataFrame({"b": [2], "c": [3]}, index=Index([4], name="d"))
236
+ tm.assert_frame_equal(result, expected)
237
+
238
+
239
+ def test_usecols_regex_sep(all_parsers):
240
+ # see gh-2733
241
+ parser = all_parsers
242
+ data = "a b c\n4 apple bat 5.7\n8 orange cow 10"
243
+
244
+ if parser.engine == "pyarrow":
245
+ msg = "the 'pyarrow' engine does not support regex separators"
246
+ with pytest.raises(ValueError, match=msg):
247
+ parser.read_csv(StringIO(data), sep=r"\s+", usecols=("a", "b"))
248
+ return
249
+
250
+ result = parser.read_csv(StringIO(data), sep=r"\s+", usecols=("a", "b"))
251
+
252
+ expected = DataFrame({"a": ["apple", "orange"], "b": ["bat", "cow"]}, index=[4, 8])
253
+ tm.assert_frame_equal(result, expected)
254
+
255
+
256
+ def test_usecols_with_whitespace(all_parsers):
257
+ parser = all_parsers
258
+ data = "a b c\n4 apple bat 5.7\n8 orange cow 10"
259
+
260
+ depr_msg = "The 'delim_whitespace' keyword in pd.read_csv is deprecated"
261
+
262
+ if parser.engine == "pyarrow":
263
+ msg = "The 'delim_whitespace' option is not supported with the 'pyarrow' engine"
264
+ with pytest.raises(ValueError, match=msg):
265
+ with tm.assert_produces_warning(
266
+ FutureWarning, match=depr_msg, check_stacklevel=False
267
+ ):
268
+ parser.read_csv(
269
+ StringIO(data), delim_whitespace=True, usecols=("a", "b")
270
+ )
271
+ return
272
+
273
+ with tm.assert_produces_warning(
274
+ FutureWarning, match=depr_msg, check_stacklevel=False
275
+ ):
276
+ result = parser.read_csv(
277
+ StringIO(data), delim_whitespace=True, usecols=("a", "b")
278
+ )
279
+ expected = DataFrame({"a": ["apple", "orange"], "b": ["bat", "cow"]}, index=[4, 8])
280
+ tm.assert_frame_equal(result, expected)
281
+
282
+
283
+ @pytest.mark.parametrize(
284
+ "usecols,expected",
285
+ [
286
+ # Column selection by index.
287
+ ([0, 1], DataFrame(data=[[1000, 2000], [4000, 5000]], columns=["2", "0"])),
288
+ # Column selection by name.
289
+ (
290
+ ["0", "1"],
291
+ DataFrame(data=[[2000, 3000], [5000, 6000]], columns=["0", "1"]),
292
+ ),
293
+ ],
294
+ )
295
+ def test_usecols_with_integer_like_header(all_parsers, usecols, expected, request):
296
+ parser = all_parsers
297
+ data = """2,0,1
298
+ 1000,2000,3000
299
+ 4000,5000,6000"""
300
+
301
+ if parser.engine == "pyarrow" and isinstance(usecols[0], int):
302
+ with pytest.raises(ValueError, match=_msg_pyarrow_requires_names):
303
+ parser.read_csv(StringIO(data), usecols=usecols)
304
+ return
305
+
306
+ result = parser.read_csv(StringIO(data), usecols=usecols)
307
+ tm.assert_frame_equal(result, expected)
308
+
309
+
310
+ @xfail_pyarrow # mismatched shape
311
+ def test_empty_usecols(all_parsers):
312
+ data = "a,b,c\n1,2,3\n4,5,6"
313
+ expected = DataFrame(columns=Index([]))
314
+ parser = all_parsers
315
+
316
+ result = parser.read_csv(StringIO(data), usecols=set())
317
+ tm.assert_frame_equal(result, expected)
318
+
319
+
320
+ def test_np_array_usecols(all_parsers):
321
+ # see gh-12546
322
+ parser = all_parsers
323
+ data = "a,b,c\n1,2,3"
324
+ usecols = np.array(["a", "b"])
325
+
326
+ expected = DataFrame([[1, 2]], columns=usecols)
327
+ result = parser.read_csv(StringIO(data), usecols=usecols)
328
+ tm.assert_frame_equal(result, expected)
329
+
330
+
331
+ @pytest.mark.parametrize(
332
+ "usecols,expected",
333
+ [
334
+ (
335
+ lambda x: x.upper() in ["AAA", "BBB", "DDD"],
336
+ DataFrame(
337
+ {
338
+ "AaA": {
339
+ 0: 0.056674972999999997,
340
+ 1: 2.6132309819999997,
341
+ 2: 3.5689350380000002,
342
+ },
343
+ "bBb": {0: 8, 1: 2, 2: 7},
344
+ "ddd": {0: "a", 1: "b", 2: "a"},
345
+ }
346
+ ),
347
+ ),
348
+ (lambda x: False, DataFrame(columns=Index([]))),
349
+ ],
350
+ )
351
+ def test_callable_usecols(all_parsers, usecols, expected):
352
+ # see gh-14154
353
+ data = """AaA,bBb,CCC,ddd
354
+ 0.056674973,8,True,a
355
+ 2.613230982,2,False,b
356
+ 3.568935038,7,False,a"""
357
+ parser = all_parsers
358
+
359
+ if parser.engine == "pyarrow":
360
+ msg = "The pyarrow engine does not allow 'usecols' to be a callable"
361
+ with pytest.raises(ValueError, match=msg):
362
+ parser.read_csv(StringIO(data), usecols=usecols)
363
+ return
364
+
365
+ result = parser.read_csv(StringIO(data), usecols=usecols)
366
+ tm.assert_frame_equal(result, expected)
367
+
368
+
369
+ # ArrowKeyError: Column 'fa' in include_columns does not exist in CSV file
370
+ @skip_pyarrow
371
+ @pytest.mark.parametrize("usecols", [["a", "c"], lambda x: x in ["a", "c"]])
372
+ def test_incomplete_first_row(all_parsers, usecols):
373
+ # see gh-6710
374
+ data = "1,2\n1,2,3"
375
+ parser = all_parsers
376
+ names = ["a", "b", "c"]
377
+ expected = DataFrame({"a": [1, 1], "c": [np.nan, 3]})
378
+
379
+ result = parser.read_csv(StringIO(data), names=names, usecols=usecols)
380
+ tm.assert_frame_equal(result, expected)
381
+
382
+
383
+ @skip_pyarrow # CSV parse error: Expected 3 columns, got 4
384
+ @pytest.mark.parametrize(
385
+ "data,usecols,kwargs,expected",
386
+ [
387
+ # see gh-8985
388
+ (
389
+ "19,29,39\n" * 2 + "10,20,30,40",
390
+ [0, 1, 2],
391
+ {"header": None},
392
+ DataFrame([[19, 29, 39], [19, 29, 39], [10, 20, 30]]),
393
+ ),
394
+ # see gh-9549
395
+ (
396
+ ("A,B,C\n1,2,3\n3,4,5\n1,2,4,5,1,6\n1,2,3,,,1,\n1,2,3\n5,6,7"),
397
+ ["A", "B", "C"],
398
+ {},
399
+ DataFrame(
400
+ {
401
+ "A": [1, 3, 1, 1, 1, 5],
402
+ "B": [2, 4, 2, 2, 2, 6],
403
+ "C": [3, 5, 4, 3, 3, 7],
404
+ }
405
+ ),
406
+ ),
407
+ ],
408
+ )
409
+ def test_uneven_length_cols(all_parsers, data, usecols, kwargs, expected):
410
+ # see gh-8985
411
+ parser = all_parsers
412
+ result = parser.read_csv(StringIO(data), usecols=usecols, **kwargs)
413
+ tm.assert_frame_equal(result, expected)
414
+
415
+
416
+ @pytest.mark.parametrize(
417
+ "usecols,kwargs,expected,msg",
418
+ [
419
+ (
420
+ ["a", "b", "c", "d"],
421
+ {},
422
+ DataFrame({"a": [1, 5], "b": [2, 6], "c": [3, 7], "d": [4, 8]}),
423
+ None,
424
+ ),
425
+ (
426
+ ["a", "b", "c", "f"],
427
+ {},
428
+ None,
429
+ _msg_validate_usecols_names.format(r"\['f'\]"),
430
+ ),
431
+ (["a", "b", "f"], {}, None, _msg_validate_usecols_names.format(r"\['f'\]")),
432
+ (
433
+ ["a", "b", "f", "g"],
434
+ {},
435
+ None,
436
+ _msg_validate_usecols_names.format(r"\[('f', 'g'|'g', 'f')\]"),
437
+ ),
438
+ # see gh-14671
439
+ (
440
+ None,
441
+ {"header": 0, "names": ["A", "B", "C", "D"]},
442
+ DataFrame({"A": [1, 5], "B": [2, 6], "C": [3, 7], "D": [4, 8]}),
443
+ None,
444
+ ),
445
+ (
446
+ ["A", "B", "C", "f"],
447
+ {"header": 0, "names": ["A", "B", "C", "D"]},
448
+ None,
449
+ _msg_validate_usecols_names.format(r"\['f'\]"),
450
+ ),
451
+ (
452
+ ["A", "B", "f"],
453
+ {"names": ["A", "B", "C", "D"]},
454
+ None,
455
+ _msg_validate_usecols_names.format(r"\['f'\]"),
456
+ ),
457
+ ],
458
+ )
459
+ def test_raises_on_usecols_names_mismatch(
460
+ all_parsers, usecols, kwargs, expected, msg, request
461
+ ):
462
+ data = "a,b,c,d\n1,2,3,4\n5,6,7,8"
463
+ kwargs.update(usecols=usecols)
464
+ parser = all_parsers
465
+
466
+ if parser.engine == "pyarrow" and not (
467
+ usecols is not None and expected is not None
468
+ ):
469
+ # everything but the first case
470
+ # ArrowKeyError: Column 'f' in include_columns does not exist in CSV file
471
+ pytest.skip(reason="https://github.com/apache/arrow/issues/38676")
472
+
473
+ if expected is None:
474
+ with pytest.raises(ValueError, match=msg):
475
+ parser.read_csv(StringIO(data), **kwargs)
476
+ else:
477
+ result = parser.read_csv(StringIO(data), **kwargs)
478
+ tm.assert_frame_equal(result, expected)
479
+
480
+
481
+ @pytest.mark.parametrize("usecols", [["A", "C"], [0, 2]])
482
+ def test_usecols_subset_names_mismatch_orig_columns(all_parsers, usecols, request):
483
+ data = "a,b,c,d\n1,2,3,4\n5,6,7,8"
484
+ names = ["A", "B", "C", "D"]
485
+ parser = all_parsers
486
+
487
+ if parser.engine == "pyarrow":
488
+ if isinstance(usecols[0], int):
489
+ with pytest.raises(ValueError, match=_msg_pyarrow_requires_names):
490
+ parser.read_csv(StringIO(data), header=0, names=names, usecols=usecols)
491
+ return
492
+ # "pyarrow.lib.ArrowKeyError: Column 'A' in include_columns does not exist"
493
+ pytest.skip(reason="https://github.com/apache/arrow/issues/38676")
494
+
495
+ result = parser.read_csv(StringIO(data), header=0, names=names, usecols=usecols)
496
+ expected = DataFrame({"A": [1, 5], "C": [3, 7]})
497
+ tm.assert_frame_equal(result, expected)
498
+
499
+
500
+ @pytest.mark.parametrize("names", [None, ["a", "b"]])
501
+ def test_usecols_indices_out_of_bounds(all_parsers, names):
502
+ # GH#25623 & GH 41130; enforced in 2.0
503
+ parser = all_parsers
504
+ data = """
505
+ a,b
506
+ 1,2
507
+ """
508
+
509
+ err = ParserError
510
+ msg = "Defining usecols with out-of-bounds"
511
+ if parser.engine == "pyarrow":
512
+ err = ValueError
513
+ msg = _msg_pyarrow_requires_names
514
+
515
+ with pytest.raises(err, match=msg):
516
+ parser.read_csv(StringIO(data), usecols=[0, 2], names=names, header=0)
517
+
518
+
519
+ def test_usecols_additional_columns(all_parsers):
520
+ # GH#46997
521
+ parser = all_parsers
522
+ usecols = lambda header: header.strip() in ["a", "b", "c"]
523
+
524
+ if parser.engine == "pyarrow":
525
+ msg = "The pyarrow engine does not allow 'usecols' to be a callable"
526
+ with pytest.raises(ValueError, match=msg):
527
+ parser.read_csv(StringIO("a,b\nx,y,z"), index_col=False, usecols=usecols)
528
+ return
529
+ result = parser.read_csv(StringIO("a,b\nx,y,z"), index_col=False, usecols=usecols)
530
+ expected = DataFrame({"a": ["x"], "b": "y"})
531
+ tm.assert_frame_equal(result, expected)
532
+
533
+
534
+ def test_usecols_additional_columns_integer_columns(all_parsers):
535
+ # GH#46997
536
+ parser = all_parsers
537
+ usecols = lambda header: header.strip() in ["0", "1"]
538
+ if parser.engine == "pyarrow":
539
+ msg = "The pyarrow engine does not allow 'usecols' to be a callable"
540
+ with pytest.raises(ValueError, match=msg):
541
+ parser.read_csv(StringIO("0,1\nx,y,z"), index_col=False, usecols=usecols)
542
+ return
543
+ result = parser.read_csv(StringIO("0,1\nx,y,z"), index_col=False, usecols=usecols)
544
+ expected = DataFrame({"0": ["x"], "1": "y"})
545
+ tm.assert_frame_equal(result, expected)
546
+
547
+
548
+ def test_usecols_dtype(all_parsers):
549
+ parser = all_parsers
550
+ data = """
551
+ col1,col2,col3
552
+ a,1,x
553
+ b,2,y
554
+ """
555
+ result = parser.read_csv(
556
+ StringIO(data),
557
+ usecols=["col1", "col2"],
558
+ dtype={"col1": "string", "col2": "uint8", "col3": "string"},
559
+ )
560
+ expected = DataFrame(
561
+ {"col1": array(["a", "b"]), "col2": np.array([1, 2], dtype="uint8")}
562
+ )
563
+ tm.assert_frame_equal(result, expected)
.venv_haddock/lib/python3.12/site-packages/pandas/tests/io/pytables/.___init__.py ADDED
Binary file (4.1 kB). View file
 
.venv_haddock/lib/python3.12/site-packages/pandas/tests/io/pytables/.___pycache__ ADDED
Binary file (4.1 kB). View file
 
.venv_haddock/lib/python3.12/site-packages/pandas/tests/io/pytables/._common.py ADDED
Binary file (4.1 kB). View file
 
.venv_haddock/lib/python3.12/site-packages/pandas/tests/io/pytables/._conftest.py ADDED
Binary file (4.1 kB). View file
 
.venv_haddock/lib/python3.12/site-packages/pandas/tests/io/pytables/._test_append.py ADDED
Binary file (4.1 kB). View file
 
.venv_haddock/lib/python3.12/site-packages/pandas/tests/io/pytables/._test_categorical.py ADDED
Binary file (4.1 kB). View file
 
.venv_haddock/lib/python3.12/site-packages/pandas/tests/io/pytables/._test_compat.py ADDED
Binary file (4.1 kB). View file
 
.venv_haddock/lib/python3.12/site-packages/pandas/tests/io/pytables/._test_complex.py ADDED
Binary file (4.1 kB). View file
 
.venv_haddock/lib/python3.12/site-packages/pandas/tests/io/pytables/._test_errors.py ADDED
Binary file (4.1 kB). View file
 
.venv_haddock/lib/python3.12/site-packages/pandas/tests/io/pytables/._test_file_handling.py ADDED
Binary file (4.1 kB). View file
 
.venv_haddock/lib/python3.12/site-packages/pandas/tests/io/pytables/._test_keys.py ADDED
Binary file (4.1 kB). View file
 
.venv_haddock/lib/python3.12/site-packages/pandas/tests/io/pytables/._test_put.py ADDED
Binary file (4.1 kB). View file
 
.venv_haddock/lib/python3.12/site-packages/pandas/tests/io/pytables/._test_pytables_missing.py ADDED
Binary file (4.1 kB). View file
 
.venv_haddock/lib/python3.12/site-packages/pandas/tests/io/pytables/._test_read.py ADDED
Binary file (4.1 kB). View file
 
.venv_haddock/lib/python3.12/site-packages/pandas/tests/io/pytables/._test_retain_attributes.py ADDED
Binary file (4.1 kB). View file
 
.venv_haddock/lib/python3.12/site-packages/pandas/tests/io/pytables/._test_round_trip.py ADDED
Binary file (4.1 kB). View file
 
.venv_haddock/lib/python3.12/site-packages/pandas/tests/io/pytables/._test_select.py ADDED
Binary file (4.1 kB). View file
 
.venv_haddock/lib/python3.12/site-packages/pandas/tests/io/pytables/._test_store.py ADDED
Binary file (4.1 kB). View file
 
.venv_haddock/lib/python3.12/site-packages/pandas/tests/io/pytables/._test_subclass.py ADDED
Binary file (4.1 kB). View file
 
.venv_haddock/lib/python3.12/site-packages/pandas/tests/io/pytables/._test_time_series.py ADDED
Binary file (4.1 kB). View file
 
.venv_haddock/lib/python3.12/site-packages/pandas/tests/io/pytables/._test_timezones.py ADDED
Binary file (4.1 kB). View file
 
.venv_haddock/lib/python3.12/site-packages/pandas/tests/io/pytables/__init__.py ADDED
File without changes
.venv_haddock/lib/python3.12/site-packages/pandas/tests/io/pytables/common.py ADDED
@@ -0,0 +1,50 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ from collections.abc import Generator
2
+ from contextlib import contextmanager
3
+ import pathlib
4
+ import tempfile
5
+
6
+ import pytest
7
+
8
+ from pandas.io.pytables import HDFStore
9
+
10
+ tables = pytest.importorskip("tables")
11
+ # set these parameters so we don't have file sharing
12
+ tables.parameters.MAX_NUMEXPR_THREADS = 1
13
+ tables.parameters.MAX_BLOSC_THREADS = 1
14
+ tables.parameters.MAX_THREADS = 1
15
+
16
+
17
+ def safe_close(store):
18
+ try:
19
+ if store is not None:
20
+ store.close()
21
+ except OSError:
22
+ pass
23
+
24
+
25
+ # contextmanager to ensure the file cleanup
26
+ @contextmanager
27
+ def ensure_clean_store(
28
+ path, mode="a", complevel=None, complib=None, fletcher32=False
29
+ ) -> Generator[HDFStore, None, None]:
30
+ with tempfile.TemporaryDirectory() as tmpdirname:
31
+ tmp_path = pathlib.Path(tmpdirname, path)
32
+ with HDFStore(
33
+ tmp_path,
34
+ mode=mode,
35
+ complevel=complevel,
36
+ complib=complib,
37
+ fletcher32=fletcher32,
38
+ ) as store:
39
+ yield store
40
+
41
+
42
+ def _maybe_remove(store, key):
43
+ """
44
+ For tests using tables, try removing the table to be sure there is
45
+ no content from previous tests using the same table name.
46
+ """
47
+ try:
48
+ store.remove(key)
49
+ except (ValueError, KeyError):
50
+ pass